MapboxMap class

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

Inheritance

Constructors

MapboxMap({required _MapboxMapsPlatform mapboxMapsPlatform, OnMapTapListener? onMapTapListener, OnMapLongTapListener? onMapLongTapListener, OnMapScrollListener? onMapScrollListener})

Properties

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

Methods

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.
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.
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.
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.
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.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
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.
setFeatureState(String sourceId, String? sourceLayerId, String featureId, String state) Future<void>
Updates the state object of a feature within a style source.
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.
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.
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