StatefulMapController class

The map controller


StatefulMapController({@required MapController mapController, TileLayerType tileLayerType = TileLayerType.normal, TileLayerOptions customTileLayer, bool verbose = false})
Provide a Flutter map MapController


center → LatLng
The map center value
changeFeed Stream<StatefulMapControllerStateChange>
A stream with changes occuring on the map
customTileLayer ↔ TileLayerOptions
A custom tile layer options
read / write
hashCode int
The hash code for this object.
lines List<Polyline>
The lines present on the map
mapController → MapController
The Flutter Map MapController
mapOptions ↔ MapOptions
The Flutter Map MapOptions
read / write
markers List<Marker>
The markers present on the map
namedLines Map<String, Polyline>
The named lines present on the map
namedMarkers Map<String, Marker>
The markers present on the map and their names
namedPolygons Map<String, Polygon>
The named polygons present on the map
onReady Future<void>
On ready callback: this is fired when the contoller is ready
polygons List<Polygon>
The polygons present on the map
rotate double
Rotate the map
runtimeType Type
A representation of the runtime type of the object.
statefulMarkers Map<String, StatefulMarker>
The stateful markers present on the map
tileLayer → TileLayerOptions
The current map tile layer
tileLayerType TileLayerType
The initial tile layer
read / write
verbose bool
Verbosity level
zoom double
The map zoom value


addLine({String name, List<LatLng> points, double width = 3.0, Color color =, bool isDotted = false}) Future<void>
Add a line on the map
addLineFromGeoPoints({String name, List<GeoPoint> geoPoints, double width = 3.0, Color color =, bool isDotted = false}) Future<void>
Add a line on the map
addMarker({Marker marker, String name}) Future<void>
Add a marker on the map
addMarkers({Map<String, Marker> markers}) Future<void>
Add multiple markers to the map
addPolygon({String name, List<LatLng> points, Color color = Colors.lightBlue, double borderWidth = 0.0, Color borderColor = const Color(0xFFFFFF00)}) Future<void>
Add a polygon on the map
addStatefulMarker({String name, StatefulMarker statefulMarker}) → void
addStatefulMarkers(Map<String, StatefulMarker> statefulMarkers) → void
centerOnPoint(LatLng point) Future<void>
Center the map on a LatLng
fitLine(String name) Future<void>
Fit bounds and zoom the map to center on a line
fitMarker(String name) Future<void>
Fit bounds for one marker on map
fitMarkers() Future<void>
Fit bounds for all markers on map
fromGeoJson(String data, {bool verbose = false, Icon markerIcon = const Icon(Icons.location_on), bool noIsolate = false}) Future<void>
Display some geojson data on the map
mutateMarker({String name, String property, dynamic value}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
notify(String name, dynamic value, Function from, MapControllerChangeType type) → void
Notify to the changefeed
onPositionChanged(MapPosition pos, bool gesture) → void
The callback used to handle gestures and keep the state in sync
removeLine(String name) Future<void>
Remove a line from the map
removeMarker({String name}) Future<void>
Remove a marker from the map
removeMarkers({List<String> names}) Future<void>
Remove multiple makers from the map
removePolygon(String name) Future<void>
Remove a polygon from the map
switchTileLayer(TileLayerType layer) → void
Switch to a tile layer
toGeoJson() String
Convert the map assets to a geojson string
toGeoJsonFeatures() → GeoJsonFeatureCollection
Export all the map assets to a GeoJsonFeatureCollection
toString() String
A string representation of this object.
zoomIn() Future<void>
Zoom in one level
zoomOut() Future<void>
Zoom out one level
zoomTo(double value) Future<void>
Zoom to level


operator ==(Object other) bool
The equality operator.