maplibre library

Classes

Aligned
An aligned point within a geospatial box or tile.
BackgroundStyleLayer
A simple background layer.
Bounded
A positionable object with position data (directly or within child objects) and methods to resolve bounding boxes.
Box
A base class for axis-aligned bounding boxes with min & max coordinates.
CircleLayer Layers
A Point layer.
CircleStyleLayer
A layer that contains circles.
ContentDecoder
An interface to decode content from a text or binary format.
ContentEncoder<Content extends Object>
An interface to encode Content into a text or binary format.
CoordRefSys
Metadata about a coordinate reference system (CRS) identified and specified by id.
CoordRefSysResolver
An abstract class for resolving coordinate reference system information.
Datum
A geodetic datum with a reference ellipsoid and datum transformation parameters.
DefaultFormat
The "default" text format for coordinate and geometry objects.
DistancedPosition<T extends Position>
An object containing position that is within distance from something.
Dms
A default implementation for DmsFormat abstract base class, that defines methods for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing values.
DmsFormat
A base class for formatters with methods for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing values.
DownloadProgress
This model class is used to stream the download progress in OfflineManager.downloadRegion.
Ellipsoid
A reference ellipsoid with ellipsoidal parameters (a, b and f).
Ellipsoidal
The base class for calculations related to the Earth surface modeled by ellipsoidal reference frames with geographic position (latitude, longitude) as an origin.
EllipsoidalVincenty
Distances & bearings between points, and destination points given start points & initial bearings, calculated on an ellipsoidal earth model using ‘direct and inverse solutions of geodesics on the ellipsoid’ devised by Thaddeus Vincenty.
Feature<T extends Geometry>
A feature is a geospatial entity with id, properties and geometry.
FeatureBuilder<T extends FeatureObject, E extends Geometry>
A builder to create geospatial feature objects of T from FeatureContent.
FeatureCollection<E extends Feature<Geometry>>
A feature collection contains an array of Feature items.
FeatureObject
A common base interface for geospatial feature objects (Feature and FeatureCollection).
FillExtrusionStyleLayer
A layer that contains fill extrusions.
FillStyleLayer
A layer that contains polygons.
GeoBox
A geographic bounding box with west, south, east and north values.
Geocentric
The base class for calculations related to the Earth surface modeled by ellipsoidal reference frames with geocentric cartesian position (X, Y, Z) as an origin.
GeodeticArcSegment
A geodetic (geographic) arc segment between the origin position and the destination position along a geodesic.
GeoExtent
A geospatial extent with spatial and optional temporal parts.
Geographic
A geographic position with longitude, latitude and optional elevation and m.
GeographicBearing
A direction (bearing) in degrees clockwise from north at a specific geographic position (origin).
GeoJSON
The GeoJSON text format for coordinate, geometry and feature objects.
GeoJsonConf
Optional configuration parameters for formatting (and parsing) GeoJSON.
GeoJSONL
The newline-delimited GeoJSON (or "GeoJSON Text Sequences") text format for feature objects.
GeoJsonSource
A GeoJSON source. Data must be provided via a "data" property, whose value can be a URL or inline GeoJSON. When using in a browser, the GeoJSON data must be on the same domain as the map or served with CORS headers.
Geometry
A base interface for geometry classes.
GeometryBuilder<T extends Geometry, E extends Geometry>
A builder to create geometry objects of T from GeometryContent.
GeometryCollection<E extends Geometry>
A geometry collection with geometries.
GeoTileMatrixSet
A tile matrix set with conversions between tiles and geographic positions.
GlobalGeodeticQuad
"Global Geodetic Quad" tile matrix set ("World CRS84 Quad" for WGS 84).
HeatmapStyleLayer
A layer that contains heatmaps.
HillshadeStyleLayer
A layer that contains hillshades.
HistoricalEllipsoids
Some historical geodetic ellipsoids defined as static constants.
ImageSource
An image source. The url value contains the image location. The coordinates array contains Positions for the image corners listed in clockwise order: top left, top right, bottom right, bottom left.
Instant
An instant with a timestamp.
Interval
An interval between optional start and end instants.
Layer<G extends Feature<Geometry>>
This class is the base for all annotation layer classes.
LineString
A line string geometry with a chain of positions.
LineStyleLayer
A layer that contains lines.
LngLatBounds
LatLng bounds class.
LngLatQuad
A class that defines 4 corners.
MapCamera
The current camera position on the map.
MapCompass UI
A compass for flutter_map that shows the map rotation and allows to reset the rotation back to 0.
MapControlButtons UI
Display a zoom-in and zoom-out button to the MapLibreMap by using it in MapLibreMap.children.
MapController
The MapController can be used to control, update and manipulate a rendered MapLibreMap.
MapEvent
Base class for all the events emitted by the MapLibreMap.
MapEventCameraIdle
Emitted when the map camera enters an idle state.
MapEventClick
Emitted when the user clicks on the map.
MapEventDoubleClick
Emitted when the user clicks twice in a short amount of time on the map.
MapEventIdle
Emitted when the map enters an idle state.
MapEventLongClick
Emitted when the user clicks on the map and holds button down at the same location for some time.
MapEventMapCreated
Emitted when the native map view has been created.
MapEventMoveCamera
Emitted when the map camera changes.
MapEventSecondaryClick
Emitted when the user clicks with the secondary button on the map. This would be classically the right mouse button.
MapEventStartMoveCamera
Emitted when the map camera changes.
MapEventStyleLoaded
Emitted when the map style has been loaded.
MapEventUserInput
Emitted when the user interacts with the map in any way. Use this class if you don't care about the type of gesture.
MapGestures
Configure gestures that are enabled on the map.
MapLibreMap
The MapLibreMap widget that can be inserted into the flutter widget tree.
MapLibreMapState
The State of the MapLibreMap widget.
MapOptions
The MapOptions class is used to set default values for the MapLibreMap widget.
MapScalebar UI
Display a scalebar to the MapLibreMap by using it in MapLibreMap.children.
Marker Layers
Model class for a widget marker, can be used in a WidgetLayer.
MarkerLayer Layers
A Point layer.
Mgrs
Military Grid Reference System (MGRS/NATO) grid references, with methods to parse references, and to convert between MGRS references and UTM coordinates.
MgrsGridSquare
The 100km grid square (or the 100,000-meter square identifier) as a part of the grid zone in MGRS/NATO grid references.
MgrsGridZone
A grid zone as a polygon of 6° × 8° in MGRS/NATO grid references.
MultiLineString
A multi line string with an array of line strings (each with a chain of positions).
MultiPoint
A multi point geometry with an array of points (each with a position).
MultiPolygon
A multi polygon with an array of polygons (each with an array of rings).
OfflineManager
Use the offline manager to download map regions for offline usage.
OfflineRegion
Model class that represents a map region for offline usage.
PermissionManager
The Permission Manager provides functionality to check if location permissions are granted and can request permissions.
Point
A point geometry with a position.
Polygon
A polygon geometry with one exterior and 0 to N interior rings.
PolygonLayer Layers
A Polygon layer.
PolylineLayer Layers
A LineString layer.
Position
A base class for geospatial positions.
Positionable
A positionable object contains data structures for (geospatial) position data, directly or within child objects.
PositionScheme
A position scheme encapsulates position and bounding box factories for certain type of position data.
PositionSeries
A fixed-length (and random-access) view to a series of positions.
ProjBox
A bounding box with minX, minY, maxX and maxY coordinates.
Projected
A projected position with x, y, and optional z and m coordinates.
QueriedLayer
Return used for MapController.queryLayers.
RasterDemCustomEncoding
Decodes tiles using the redFactor, blueFactor, greenFactor, baseShift parameters.
RasterDemEncoding
The encoding used by this source. Mapbox Terrain RGB is used by default.
RasterDemMapboxEncoding
Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info.
RasterDemSource
A raster DEM source. Only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.
RasterDemTerrariumEncoding
Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info.
RasterSource
A raster tile source.
RasterStyleLayer
A layer that contains markers.
RenderedFeature
Data class representing a vector feature that was rendered on the map.
Scalable
A scalable object at the zoom level (a positive number).
Scalable2i
Scalable x, y coordinates at the zoom level.
ScaledConverter
A coordinate converter between geospatial positions and scaled coordinates.
SimpleGeometry
A base interface for "simple" geometry classes.
SimpleGeometryContent
An interface to write simple geometry data to format encoders and object builders.
Source
The base Source class that can't be used directly.
SourceAttribution UI
Display a zoom-in and zoom-out button to the MapLibreMap by using it in MapLibreMap.children.
SpatialExtent<T extends Box>
An extent with 1 to N bounding boxes in defined coordinate reference system.
SphericalGreatCircle
Latitude/longitude points on a spherical model earth, and methods for calculating distances, bearings, destinations, etc on (orthodromic) great-circle paths.
SphericalGreatCircleLineString
Calculations for line strings (as an iterable of geographic positions) on a spherical model earth (great-circle paths).
SphericalRhumbLine
Latitude/longitude points on a spherical model earth, and methods for calculating distances, bearings, destinations, etc on (loxodromic) rhumb lines.
StyleController
The StyleController can be used to manipulate the style of a MapLibreMap. It can be accessed via MapController.style.
StyleLayer
The base Layer class that can't be used directly.
StyleLayerWithSource
A StyleLayer that pulls its data from a Source. Basically every layer except BackgroundStyleLayer.
SymbolStyleLayer
A layer that contains markers.
Temporal
A base class for temporal objects like instants and intervals.
TemporalExtent
An extent with 1 to N intervals in defined temporal coordinate reference system.
TemporalRefSys
Metadata about a temporal coordinate reference system (TRS) identified and specified by id.
TemporalRefSysResolver
An abstract class for resolving temporal coordinate reference system information.
TextReaderFormat<Content extends Object>
An interface to access text format decoders (readers) for Content.
TextWriterFormat<Content extends Object>
An interface to access text format encoders (writers) for Content.
TileMatrixSet
A tiling scheme represented as a set of tile matrices (grids).
Utm
UTM coordinates, with functions to parse them and convert them to geographic points.
UtmMeta<T extends Object>
Metadata (convergence and scale) as a result from UTM calculations related to position.
UtmZone
The UTM zone represented by the lonZone number and hemisphere.
ValuePositionable
A positionable object that has (geospatial) coordinate values directly available.
VectorSource
A vector tile source. Tiles must be in Mapbox Vector Tile format. All geometric coordinates in vector tiles must be between -1 * extent and (extent * 2) - 1 inclusive. All layers that use a vector source must specify a source-layer value.
VideoSource
A video source. The urls value is an array. For each URL in the array, a video element source will be created. To support the video across browsers, supply URLs in multiple formats.
WebMercatorQuad
"Web Mercator Quad" tile matrix set.
WGS84
Projections for the WGS 84 geographic coordinate system.
WidgetLayer Layers
Use the WidgetLayer to display Widgets on the MapLibreMap by using it in MapLibreMap.children.
WKB
The Well-known binary (WKB) format, see geometry for the standard WKB and geometryExtended for the Extended WKB (EWKB).
WKT
The WKT text format for coordinate and geometry objects.
WktLikeFormat
The WKT (like) text format for coordinate and geometry objects.

Enums

AndroidPlatformViewMode
The different ways a MapLibre map can be displayed on Android.
AngleUnit
An enumeration of angle units.
AngularVelocityUnit
An enumeration of angular velocity units.
AreaUnit
An enumeration of area units.
AxisOrder
The axis order of coordinate values in position and point representations.
BearingRenderMode
The mode how render the location on the map. Used in MapController.enableLocation.
BearingTrackMode
The mode how the bearing should get tracked on the map. Used in MapController.trackLocation.
CameraChangeReason
The reason the camera is changing.
CanvasOrigin
The position of the origin in a canvas or a grid.
CardinalPrecision
The precision for cardinal directions (compass point).
CoordRefSysType
An enumeration of common coordinate reference system (CRS) types.
Coords
An enum for coordinate types (by spatial dimension and whether is measured).
Dimensionality
An enum for dimensionality or topological dimension in the context of geospatial applications.
DmsType
An enum for common representation of geographic positions by coordinates (using degrees, minutes and seconds as components).
Geom
An enum for geometry types.
GeoRepresentation
An enum for spatial representations that can be used to code logic when need to choose some options based on a representation.
Hemisphere
An enum representing the hemispheres of the Earth.
IconAnchor
Part of the icon placed closest to the anchor.
LengthUnit
An enumeration of length (distance) units.
MapProjection
The map projections.
ScaleBarUnit
The unit system to use for the MapScalebar.
SpeedUnit
An enumeration of speed units.
TileScheme
Influences the y direction of the tile coordinates.
TimeUnit
An enumeration of time units (representing values of time duration or intervals).
WkbFlavor
The flavor (or a variation) of the Well-known binary (WKB) specification.

Mixins

BinaryFormat<Content extends Object>
A mixin to access binary format encoders and decoders for Content
CoordinateContent
An interface to write coordinate data to format encoders and object builders.
FeatureContent
An interface to write geospatial feature objects to format encoders and object builders.
GeometryContent
An interface to write geometry data to format encoders and object builders.
Projection
A mixin defining an interface for (geospatial) projections.
ProjectionAdapter
A projection adapter bundles forward and inverse projections.
TextFormat<Content extends Object>
A mixin to access text format encoders and decoders for Content.

Extensions

BoxArrayExtension on Iterable<Box?>
A helper extension on Iterable<Box?>.
CartesianArealExtension on Iterable<PositionSeries>
An extension of cartesian functions for areal geometries represented by an iterable of position series objects each representing a linear ring in a polygon geometry).
ColorExtension on Color
Extension methods on Color.
CoordinateArrayExtension on List<double>
A helper extension on List<double> to handle coordinate values.
DoubleAngleExtension on double
An extension on double with basic degrees and radians utility methods.
EllipsoidalExtension on Geographic
An extension of the Geographic class providing calculations related to the Earth surface modeled by ellipsoidal reference frames (or datums).
EllipsoidalVincentyExtension on Geographic
An extension for easier access to EllipsoidalVincenty.
GeographicDoubleAngleExtension on double
An extension on double with basic degrees and radians utility methods ( (for geographic coordinate reference systems).
PositionArrayExtension on Iterable<Position>
A helper extension on Iterable<Position>.
SphericalGreatCircleExtension on Geographic
An extension for easier access to SphericalGreatCircle.
SphericalGreatCircleIterableExtension on Iterable<Geographic>
An extension for easier access to SphericalGreatCircleLineString for iterables of geographic positions.
SphericalGreatCirclePositionSeriesExtension on PositionSeries
An extension for easier access to SphericalGreatCircleLineString for series of positions.
SphericalRhumbLineExtension on Geographic
An extension for easier access to SphericalRhumbLine.
UnitConversionExtension on num
An extension on double with conversion methods for angle, angular velocity, area, length, speed and time units.

Constants

circumferenceOfEarth → const double
circumference of the Earth
defaultEpsilon → const double
The default epsilon value 1.0e-9 used as a tolerance in equals2D, equals3D and similar methods in this package.
degree2Radian → const double
pre compiled factor to convert a coordinate in radian to degrees.
doublePrecisionEpsilon → const double
The maximum relative precision of double numbers (IEEE 754).
earthCircumferenceWgs84 → const double
The earth circumference in meters (from earth equatorial radius by WGS 84).
earthRadiusWgs84 → const double
The earth equatorial radius in meters as specified by WGS 84.
htmlColorNames → const Map<String, String>
A list of all color names that are listed by the World Wide Web Consortium (W3C) as valid color names for HTML and CSS.
maxLatitude → const double
The maximum value for the geographic latitude.
maxLatitudeUTM → const double
The maximum value for the geographic latitude inside the Universal Transverse Mercator (UTM) projection coverage.
maxLatitudeWebMercator → const double
The maximum value for the geographic latitude inside the Web Mercator projection coverage.
maxLongitude → const double
The maximum value for the geographic longitude.
minLatitude → const double
The minimum value for the geographic latitude.
minLatitudeUTM → const double
The minimum value for the geographic latitude inside the Universal Transverse Mercator (UTM) projection coverage.
minLatitudeWebMercator → const double
The minimum value for the geographic latitude inside the Web Mercator projection coverage.
minLongitude → const double
The minimum value for the geographic longitude.
screenPPIbyOGC → const double
OGC defines a screen pixel of 0.28 mm that approximates to 90.7 ppi.

Typedefs

AddGeometry<T extends Geometry> = void Function(T geometry, {String? name})
A function to add geometry to some collection with an optional name.
CreateBox<T extends Box> = T Function({double? maxM, required double maxX, required double maxY, double? maxZ, double? minM, required double minX, required double minY, double? minZ})
Creates a new bounding box from minX, minY, maxX and maxY values.
CreatePosition<T extends Position> = T Function({double? m, required double x, required double y, double? z})
Creates a new position of T from x and y, and optional z and m.
ExpandPosition = Iterable<T> Function<T extends Position>(Position source, {required CreatePosition<T> to})
A function to expand the source position to an iterable of zero or more positions of T using to as a factory.
MapCreatedCallback = void Function(MapController controller)
Callback that fires once the native MapLibre map has been created for a MapLibreMap widget. It provides the MapController to the user.
MapEventCallback = void Function(MapEvent event)
Callback that fires every time a MapEvent gets emitted by the map.
StyleLoadedCallback = void Function(StyleController style)
Callback that fires once the map style has successfully loaded. It provides the StyleController to the user.
TransformPosition = T Function<T extends Position>(Position source, {required CreatePosition<T> to})
A function to transform the source position to a position of T using to as a factory.
WriteFeatures = void Function(FeatureContent output)
A function to write geospatial feature objects to output.
WriteGeometries = void Function(GeometryContent output)
A function to write geometry data to output.
WriteSimpleGeometries = void Function(SimpleGeometryContent output)
A function to write simple geometry data to output.