MapboxMap class

Controller for a single MapboxMap instance running on the host platform.

Inheritance

Properties

annotations AnnotationManager
The interface to create and set annotations.
latefinal
attribution AttributionSettingsInterface
The interface to access the attribution settings.
latefinal
compass CompassSettingsInterface
The interface to access the compass settings.
latefinal
gestures GesturesSettingsInterface
The interface to access the gesture settings.
latefinal
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
location LocationSettings
The interface to set the location puck.
latefinal
The interface to set the logo settings.
latefinal
onMapLongTapListener OnMapLongTapListener?
getter/setter pair
onMapScrollListener OnMapScrollListener?
getter/setter pair
onMapTapListener OnMapTapListener?
getter/setter pair
projection Projection
The map projection of the style.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleBar ScaleBarSettingsInterface
The interface to access the compass settings.
latefinal
style StyleManager
The currently loaded Style]object.
latefinal

Methods

addInteraction<T extends TypedFeaturesetFeature<FeaturesetDescriptor>>(TypedInteraction<T> interaction, {String? interactionID}) → void
Add an interaction to the map An identifier can be provided, which you can use to remove the interaction with .removeInteraction(interactionID)
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
cameraForCoordinateBounds(CoordinateBounds bounds, MbxEdgeInsets padding, double? bearing, double? pitch, double? maxZoom, ScreenCoordinate? offset) Future<CameraOptions>
Convenience method that returns the camera options object for given parameters.
cameraForCoordinates(List<Point> coordinates, MbxEdgeInsets padding, double? bearing, double? pitch) Future<CameraOptions>
Convenience method that returns the camera options object for given parameters.
cameraForCoordinatesCameraOptions(List<Point> coordinates, CameraOptions camera, ScreenBox box) Future<CameraOptions>
Convenience method that adjusts the provided camera options object for given parameters.
cameraForCoordinatesPadding(List<Point> coordinates, CameraOptions camera, MbxEdgeInsets? coordinatesPadding, double? maxZoom, ScreenCoordinate? offset) Future<CameraOptions>
Convenience method that returns the camera options object for given parameters.
cameraForGeometry(Map<String?, Object?> geometry, MbxEdgeInsets padding, double? bearing, double? pitch) Future<CameraOptions>
Convenience method that returns the camera options object for given parameters.
cancelCameraAnimation() Future<void>
Cancel the ongoing camera animation if there is one.
clearData() Future<void>
Clears temporary map data.
coordinateBoundsForCamera(CameraOptions camera) Future<CoordinateBounds>
Returns the coordinate bounds for a given camera.
coordinateBoundsForCameraUnwrapped(CameraOptions camera) Future<CoordinateBounds>
Returns the coordinate bounds for a given camera.
coordinateBoundsZoomForCamera(CameraOptions camera) Future<CoordinateBoundsZoom>
Returns the coordinate bounds and the zoom for a given camera.
coordinateBoundsZoomForCameraUnwrapped(CameraOptions camera) Future<CoordinateBoundsZoom>
Returns the unwrapped coordinate bounds and zoom for a given camera.
coordinateForPixel(ScreenCoordinate pixel) Future<Point>
Calculates a geographical coordinate (i.e., longitude-latitude pair) that corresponds to a screen coordinate.
coordinatesForPixels(List<ScreenCoordinate?> pixels) Future<List<Point?>>
Calculates geographical coordinates (i.e., longitude-latitude pairs) that correspond to screen coordinates.
dispatch(String gesture, ScreenCoordinate screenCoordinate) Future<void>
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
easeTo(CameraOptions cameraOptions, MapAnimationOptions? mapAnimationOptions) Future<void>
Ease the map camera to a given camera options and animation options
flyTo(CameraOptions cameraOptions, MapAnimationOptions? mapAnimationOptions) Future<void>
Fly the map camera to a given camera options.
getBounds() Future<CameraBounds>
Returns the camera bounds of the map.
getCameraState() Future<CameraState>
Returns the current camera state.
getDebug() Future<List<MapDebugOptions?>>
Returns the map debug options.
getDebugOptions() Future<List<MapWidgetDebugOptions>>
Debug options for the widget associated with the map.
getElevation(Point coordinate) Future<double?>
Gets elevation for the given coordinate. Note: Elevation is only available for the visible region on the screen and with terrain enabled.
getFeatureState(String sourceId, String? sourceLayerId, String featureId) Future<String>
Gets the state map of a feature within a style source.
getFeatureStateForFeaturesetDescriptor(FeaturesetDescriptor featureset, FeaturesetFeatureId featureId) Future<Map<String, Object?>>
Get the state map of a feature within a style source.
getFeatureStateForFeaturesetFeature(FeaturesetFeature feature) Future<Map<String, Object?>>
Get the state map of a feature within a style source.
getGeoJsonClusterChildren(String sourceIdentifier, Map<String?, Object?> cluster) Future<FeatureExtensionValue>
Returns the children (original points or clusters) of a cluster (on the next zoom level) given its id (cluster_id value from feature properties) from a GeoJsonSource.
getGeoJsonClusterExpansionZoom(String sourceIdentifier, Map<String?, Object?> cluster) Future<FeatureExtensionValue>
Returns the zoom on which the cluster expands into several children (useful for "click to zoom" feature) given the cluster's cluster_id (cluster_id value from feature properties) from a GeoJsonSource.
getGeoJsonClusterLeaves(String sourceIdentifier, Map<String?, Object?> cluster, int? limit, int? offset) Future<FeatureExtensionValue>
Returns all the leaves (original points) of a cluster (given its cluster_id) from a GeoJsonSource, with pagination support: limit is the number of leaves to return (set to Infinity for all points), and offset is the amount of points to skip (for pagination).
getMapOptions() Future<MapOptions>
Returns the map options.
getPrefetchZoomDelta() Future<int>
Returns the map's prefetch zoom delta.
getSize() Future<Size>
Gets the size of the map. Note : not supported for iOS.
isGestureInProgress() Future<bool>
Returns true if a gesture is currently in progress.
isUserAnimationInProgress() Future<bool>
Returns true if user animation is currently in progress.
loadStyleJson(String styleJson) Future<void>
Loads a style from a JSON string, calling a completion closure when the style is fully loaded or there has been an error during load.
loadStyleURI(String styleURI) Future<void>
Will load a new map style asynchronous from the specified URI.
moveBy(ScreenCoordinate screenCoordinate, MapAnimationOptions? mapAnimationOptions) Future<void>
Move the map by a given screen coordinate with optional animation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pitchBy(double pitch, MapAnimationOptions? mapAnimationOptions) Future<void>
Pitch the map by with optional animation.
pixelForCoordinate(Point coordinate) Future<ScreenCoordinate>
Calculates a screen coordinate that corresponds to a geographical coordinate (i.e., longitude-latitude pair).
pixelsForCoordinates(List<Point> coordinates) Future<List<ScreenCoordinate?>>
Calculates screen coordinates that correspond to geographical coordinates (i.e., longitude-latitude pairs).
queryRenderedFeatures(RenderedQueryGeometry geometry, RenderedQueryOptions options) Future<List<QueriedRenderedFeature?>>
Queries the map for rendered features.
queryRenderedFeaturesForFeatureset({required FeaturesetDescriptor featureset, RenderedQueryGeometry? geometry, String? filter}) Future<List<FeaturesetFeature>>
Queries the map for rendered features with one typed featureset.
querySourceFeatures(String sourceId, SourceQueryOptions options) Future<List<QueriedSourceFeature?>>
Queries the map for source features.
reduceMemoryUse() Future<void>
Reduces memory use. Useful to call when the application gets paused or sent to background.
removeFeatureState(String sourceId, String? sourceLayerId, String featureId, String? stateKey) Future<void>
Removes entries from a feature state object.
removeFeatureStateForFeaturesetDescriptor({required FeaturesetDescriptor featureset, required FeaturesetFeatureId featureId, String? stateKey}) Future<void>
Removes entries from a feature state object of a feature in the specified featureset. Remove a specified property or all property from a feature's state object, depending on the value of stateKey.
removeFeatureStateForFeaturesetFeature({required FeaturesetFeature feature, String? stateKey}) Future<void>
Removes entries from a specified Feature. Remove a specified property or all property from a feature's state object, depending on the value of stateKey.
removeInteraction(String interactionID) → void
Remove an interaction from the map with the given interactionID that was passed with .addInteraction(interaction, interactionID)
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resetFeatureStatesForFeatureset(FeaturesetDescriptor featureset) Future<void>
Reset all the feature states within a featureset.
rotateBy(ScreenCoordinate first, ScreenCoordinate second, MapAnimationOptions? mapAnimationOptions) Future<void>
Rotate the map by with optional animation.
scaleBy(double amount, ScreenCoordinate? screenCoordinate, MapAnimationOptions? mapAnimationOptions) Future<void>
Scale the map by with optional animation.
setBounds(CameraBoundsOptions options) Future<void>
Sets the camera bounds options of the map. The map will retain its current values for any details not passed via the camera bounds options arguments. When camera bounds options are set, the camera center is constrained by these bounds, as well as the minimum zoom level of the camera, to prevent out of bounds areas to be visible. Note that tilting or rotating the map, or setting stricter minimum and maximum zoom within options may still cause some out of bounds areas to become visible.
setCamera(CameraOptions cameraOptions) Future<void>
Changes the map view by any combination of center, zoom, bearing, and pitch, without an animated transition. The map will retain its current values for any details not passed via the camera options argument. It is not guaranteed that the provided camera options will be set, the map may apply constraints resulting in a different camera state.
setConstrainMode(ConstrainMode mode) Future<void>
Sets the map constrain mode.
setDebug(List<MapDebugOptions?> debugOptions, bool value) Future<void>
Sets the map debug options and enables debug mode based on the passed value.
setDebugOptions(List<MapWidgetDebugOptions> debugOptions) Future<void>
Set debug options for the widget associated with the map.
setFeatureState(String sourceId, String? sourceLayerId, String featureId, String state) Future<void>
Updates the state object of a feature within a style source.
setFeatureStateForFeaturesetDescriptor(FeaturesetDescriptor featureset, FeaturesetFeatureId featureId, FeatureState state) Future<void>
Update the state map of a feature within a featureset. Update entries in the state map of a given feature within a style source. Only entries listed in the state map will be updated. An entry in the feature state map that is not listed in state will retain its previous value.
setFeatureStateForFeaturesetFeature(FeaturesetFeature feature, FeatureState state) Future<void>
Update the state map of an individual feature.
setGestureInProgress(bool inProgress) Future<void>
Tells the map rendering engine that there is currently a gesture in progress. This affects how the map renders labels, as it will use different texture filters if a gesture is ongoing.
setNorthOrientation(NorthOrientation orientation) Future<void>
Sets the north orientation mode.
setOnMapLongTapListener(OnMapLongTapListener? onMapLongTapListener) → void
setOnMapMoveListener(OnMapScrollListener? onMapScrollListener) → void
setOnMapTapListener(OnMapTapListener? onMapTapListener) → void
setPrefetchZoomDelta(int delta) Future<void>
When loading a map, if prefetch zoom delta is set to any number greater than 0, the map will first request a tile at zoom level lower than zoom - delta, with requested zoom level a multiple of delta, in an attempt to display a full map at lower resolution as quick as possible.
setSnapshotLegacyMode(bool enable) Future<void>
Set whether legacy mode should be used for snapshot.
setStyleGlyphURL(String glyphURL) Future<void>
The URL that points to the glyphs used by the style for rendering text labels on the map.
setTileCacheBudget(TileCacheBudgetInMegabytes? tileCacheBudgetInMegabytes, TileCacheBudgetInTiles? tileCacheBudgetInTiles) Future<void>
The memory budget hint to be used by the map. The budget can be given in tile units or in megabytes. A Map will do the best effort to keep memory allocations for a non essential resources within the budget.
setUserAnimationInProgress(bool inProgress) Future<void>
Tells the map rendering engine that the animation is currently performed by the user (e.g. with a setCamera calls series). It adjusts the engine for the animation use case. In particular, it brings more stability to symbol placement and rendering.
setViewportMode(ViewportMode mode) Future<void>
Sets the viewport mode.
snapshot() Future<Uint8List>
Returns a snapshot of the map. The snapshot is taken from the current state of the map.
styleGlyphURL() Future<String>
The URL that points to the glyphs used by the style for rendering text labels on the map.
toString() String
A string representation of this object.
inherited
triggerRepaint() Future<void>
Triggers a repaint of the map.

Operators

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