flutter_map library

flutter_map

A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.



Classes

AssetTileProvider
Fetch tiles from the app's shipped assets, where the tile URL is a path within the asset store
BaseOverlayImage
Base class for all overlay images.
Bounds<T extends num>
Rectangular bound delimited by orthogonal lines passing through two points.
CameraConstraint
Describes a boundary for a MapCamera, that cannot be exceeded by movement
CameraFit
Describes a position for a MapCamera
CircleLayer
A layer that displays a list of CircleMarker on the map
CircleMarker
Immutable marker options for CircleMarker. Circle markers are a more simple and performant way to draw markers as the regular Marker
CirclePainter
The CustomPainter used to draw CircleMarker for the CircleLayer.
ContainCamera
Constrains the edges of the camera to within bounds
ContainCameraCenter
Constrains the center coordinate of the camera to within bounds
Crs
An abstract representation of a Coordinate Reference System.
CrsSimple
Custom CRS for non geographical maps
CursorKeyboardRotationOptions
Options to configure cursor/keyboard rotation
Epsg3857
EPSG:3857, The most common CRS used for rendering maps.
Epsg4326
EPSG:4326, A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
FadeInTileDisplay
A TileDisplay that should get faded in.
FadeRAWA
Prebuilt animation provider for a RichAttributionWidget
FileTileProvider
Fetch tiles from the local filesystem (not asset store), where the tile URL is a path within the filesystem.
FitBounds
The CameraFit should fit inside a given LatLngBounds.
FitCoordinates
Use this CameraFit if the MapCamera should fit a list of LatLng coordinates.
FitInsideBounds
A CameraFit that should get be within given LatLngBounds.
FlutterMap
An interactive geographical map
InstantaneousTileDisplay
Display the tile instantaneous.
InteractionOptions
All interactive options for FlutterMap
InteractiveFlag
Use InteractiveFlag to disable / enable certain events Use InteractiveFlag.all to enable all events, use InteractiveFlag.none to disable all events
LatLngBounds
Data structure representing rectangular bounding box constrained by its northwest and southeast corners
LatLngTween
A Tween object for LatLng. Used for AnimationController to handle animated changes of the MapCamera.
LayerHitResult<R extends Object>
Result emmitted by hit notifiers (see LayerHitNotifier) when a hit is detected on a feature within the respective layer
LogoSourceAttribution
An image attribution permanently displayed adjacent to the open/close icon of a RichAttributionWidget
MapCamera
Describes the view of a map. This includes the size/zoom/position/crs as well as the minimum/maximum zoom. This class is mostly immutable but has some fields that get calculated lazily, changes to the map view may occur via the MapController or user interactions which will result in a new MapCamera value.
MapController
Controller to programmatically interact with FlutterMap, such as controlling it and accessing some of its properties.
MapControllerImpl
Implements MapController whilst exposing methods for internal use which should not be visible to the user (e.g. for setting the current camera). This controller is for internal use. All updates to the state should be done by calling methods of this class to ensure consistency.
MapEvent
Base event class which is emitted by MapController instance, the event is usually related to performed gesture on the map itself or it can be an event related to map configuration
MapEventDoubleTapZoom
Event which is fired when map is double tapped
MapEventDoubleTapZoomEnd
Event which is fired when animation for double tap gesture ends
MapEventDoubleTapZoomStart
Event which is fired when animation for double tap gesture is started
MapEventFlingAnimation
Event which is fired when animation started by fling gesture is in progress
MapEventFlingAnimationEnd
Event which is fired when animation started by fling gesture finished
MapEventFlingAnimationNotStarted
Emits when InteractiveFlags contains fling and there wasn't enough velocity to start fling animation
MapEventFlingAnimationStart
Event which is fired when fling gesture is detected
MapEventLongPress
Event which is fired when map is long-pressed
MapEventMove
Event which is fired when map is being moved.
MapEventMoveEnd
Event which is fired when dragging is finished
MapEventMoveStart
Event which is fired when dragging is started
MapEventNonRotatedSizeChange
Event that fires when the map widget changes size, e.g. when the app window gets changed in size.
MapEventRotate
Event which is fired when map is being rotated
MapEventRotateEnd
Event which is fired when rotate gesture has ended
MapEventRotateStart
Event which is fired when rotate gesture was started
MapEventScrollWheelZoom
Event which is fired when scroll wheel is used to zoom
MapEventSecondaryTap
Event which is fired when map is secondary tapped
MapEventTap
Event which is fired when map is tapped
MapEventWithMove
Base event class which is emitted by MapController instance and includes information about camera movement which are not partial (e.g start rotate, rotate, end rotate).
MapOptions
All options for the FlutterMap widget.
Marker
A container for a child widget located at a geographic coordinate point
MarkerLayer
A Marker layer for FlutterMap.
MobileLayerTransformer
Transforms a child widget tree into a layer that can move and rotate based on the MapCamera
MultiFingerGesture
Use MultiFingerGesture to disable / enable certain gestures Use MultiFingerGesture.all to enable all gestures, use MultiFingerGesture.none to disable all gestures
NetworkTileProvider
TileProvider to fetch tiles from the network
OverlayImage
Unrotated overlay image that spans between a given bounding box.
OverlayImageLayer
OverlayImageLayer is used to display one or multiple images on the map.
Polygon<R extends Object>
Polygon class, to be used for the PolygonLayer.
PolygonLayer<R extends Object>
A polygon layer for FlutterMap.
Polyline<R extends Object>
Polyline (aka. LineString) class, to be used for the PolylineLayer.
PolylineLayer<R extends Object>
A Polyline (aka. LineString) layer for FlutterMap.
PolylinePattern
Determines whether a Polyline should be solid, dotted, or dashed, and the exact characteristics of each
PositionedTapController
PositionedTapDetector2
Proj4Crs
Custom CRS
Projection
The abstract base Projection class, used for coordinate reference systems like Epsg3857. Inherit from this class if you want to create or implement your own CRS.
RenderTranslucentPointer
A render object that is invisible to its parent during hit testing.
RichAttributionWidget
A prebuilt dynamic attribution layer that supports both logos and text through SourceAttributions
RichAttributionWidgetAnimation
Animation provider interface for a RichAttributionWidget
RotatedOverlayImage
Spans an image across three corner points.
Scalebar
The Scalebar widget is a map layer for FlutterMap.
ScalebarPainter
This painter is used in the Scalebar widget and ensures that all ScalebarPainters have a function to tell the widget what Size it should have.
ScaleRAWA
Prebuilt animation provider for a RichAttributionWidget
SimpleAttributionWidget
A simple, classic style, attribution layer
SourceAttribution
Base class for attributions that render themselves as widgets in a RichAttributionWidget
SphericalMercator
Spherical mercator projection
TapPosition
TextSourceAttribution
A simple text attribution displayed in the popup box of a RichAttributionWidget
TileCoordinates
Tile coordinates identify the position of the tile position for slippy map tiles. The z coordinate represents the zoom level where the zoom level of 0 fits the complete world while bigger z values are using accordingly to the zoom level of the MapCamera.
TileDisplay
Defines how the tile should get displayed on the map.
TileImage
The tile image class
TileLayer
Describes the needed properties to create a tile-based layer. A tile is an image bound to a specific geographical position.
TileProvider
The base tile provider, extended by other classes with more specialised purposes and/or requirements
TileUpdateEvent
Describes whether loading and/or pruning should occur and allows overriding the load center/zoom.
TileUpdateTransformers
Contains a set of built-in TileUpdateTransformers
TranslucentPointer
A widget that is invisible for its parent during hit testing, but still allows its subtree to receive pointer events
UnconstrainedCamera
Does not apply any constraint to a MapCamera
WMSTileLayerOptions
Options for the []

Enums

AttributionAlignment
Position to anchor RichAttributionWidget to relative to the FlutterMap
CursorRotationBehaviour
The behaviour of the cursor/keyboard rotation function in terms of the angle that the map is rotated to
EvictErrorTileStrategy
Strategies on how to handle tile errors
MapEventSource
Event sources which are used to identify different types of MapEvent events
PatternFit
Determines how a non-solid PolylinePattern should be fit to a Polyline when their lengths are not equal or multiples
PolygonLabelPlacement
Defines the algorithm used to calculate the position of the Polygon label.
RetinaMode
Retina mode improves the resolution of map tiles, particularly on high density displays
ScalebarLength
The relative length of the scalebar.

Extensions

OffsetToPointExtension on Offset
Extension methods for Offset
PointExtension on Point<T>
Extension methods for the math.Point class

Functions

coordinateDebugTileBuilder(BuildContext context, Widget tileWidget, TileImage tile) Widget
Shows coordinates over Tiles
darkModeTileBuilder(BuildContext context, Widget tileWidget, TileImage tile) Widget
Applies inversion color matrix on Tiles which may simulate Dark mode. darkModeTilesContainerBuilder is better at performance because it applies color matrix on the container instead of on every Tile
darkModeTilesContainerBuilder(BuildContext context, Widget tilesContainer) Widget
Applies inversion color matrix on Tiles container which may simulate Dark mode.
loadingTimeDebugTileBuilder(BuildContext context, Widget tileWidget, TileImage tile) Widget
Shows the Tile loading time in ms

Typedefs

ErrorTileCallBack = void Function(TileImage tile, Object error, StackTrace? stackTrace)
Callback definition for the TileLayer.errorTileCallback option.
IsKeyCursorRotationTrigger = bool Function(LogicalKeyboardKey key)
See CursorKeyboardRotationOptions.isKeyTrigger
LayerHitNotifier<R extends Object> = ValueNotifier<LayerHitResult<R>?>
A ValueNotifier that notifies:
LongPressCallback = void Function(TapPosition tapPosition, LatLng point)
Callback to notify when the map emits long-press gesture
MapEventCallback = void Function(MapEvent)
Callback to notify when the map emits a MapEvent.
PointerCancelCallback = void Function(PointerCancelEvent event, LatLng point)
Callback to notify when the map registers a pointer cancel event.
PointerDownCallback = void Function(PointerDownEvent event, LatLng point)
Callback to notify when the map registers a pointer down event.
PointerHoverCallback = void Function(PointerHoverEvent event, LatLng point)
Callback to notify when the map registers a pointer hover event.
PointerUpCallback = void Function(PointerUpEvent event, LatLng point)
Callback to notify when the map registers a pointer up event.
PositionCallback = void Function(MapCamera camera, bool hasGesture)
Callback that gets called when the viewport of the map changes.
TapCallback = void Function(TapPosition tapPosition, LatLng point)
Callback to notify when the map registers a confirmed short tap gesture.
TapPositionCallback = void Function(TapPosition position)
TileBuilder = Widget Function(BuildContext context, Widget tileWidget, TileImage tile)
Builder function that returns a TileBuilder instance.
TileUpdateTransformer = StreamTransformer<TileUpdateEvent, TileUpdateEvent>
Restricts and limits TileUpdateEvents (which are emitted 'by' MapEvents), which cause the tiles of the TileLayer to update (see below).