Snapshotter class base
Captures styled map snapshots without a live MapWidget.
Style APIs are available directly on this class, which extends
StyleManager (e.g. snapshotter.setStyleURI(...)).
- Inheritance
-
- Object
- StyleManager
- Snapshotter
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onMapLoadErrorListener → OnMapLoadErrorListener?
-
Event listener invoked when a map load error occurs.
no setter
- onStyleDataLoadedListener → OnStyleDataLoadedListener?
-
Event listener invoked when style data has been loaded.
no setter
- onStyleImageMissingListener → OnStyleImageMissingListener?
-
Event listener invoked when the style has a missing image.
no setter
- onStyleLoadedListener → OnStyleLoadedListener?
-
Event listener invoked when the style has been fully loaded.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → StyleManager
-
Style manager for the snapshotter — set the style URI/JSON and mutate
runtime style properties (import configs, layers, sources).
no setter
Methods
-
addGeoJSONSourceFeatures(
String sourceId, String dataId, List< Feature< features) → Future<GeometryObject> >void> -
Adds features to a GeoJSON style source.
inherited
-
addLayer(
Layer layer, [LayerPosition? position]) → Future< void> -
Adds a Layer to the current style. Serializes the layer to JSON and
forwards to StylePlatformInterface.addStyleLayer.
inherited
-
addPersistentLayer(
Layer layer, [LayerPosition? position]) → Future< void> -
Adds a persistent Layer to the current style. Persistent layers
survive style reloads when the new style does not redefine the layer id.
inherited
-
addPersistentStyleLayer(
String properties, LayerPosition? layerPosition) → Future< void> -
Adds a persistent style layer from a JSON properties string. Persistent
layers survive style reloads when the new style does not redefine the
same layer id. Prefer the typed addPersistentLayer helpers for facade
layer classes.
inherited
-
addSource(
Source source) → Future< void> -
Adds a Source to the current style. Sources with multi-phase add
requirements (e.g.
GeoJsonSourcewith initial data) overrideSource.addToStyleto handle their specifics.inherited -
addStyleImage(
String imageId, double scale, MbxImage image, {bool sdf = false, List< ImageStretches?> stretchX = const <ImageStretches?>[], List<ImageStretches?> stretchY = const <ImageStretches?>[], ImageContent? content}) → Future<void> -
Adds an image to the style. Existing images with the same
imageIdare replaced.stretchXandstretchYdefault to empty lists;contentandsdfto null/false — mirroring the most common usage.inherited -
addStyleImportFromJSON(
String importId, String json, {Map< String, Object> ? config, ImportPosition? importPosition}) → Future<void> -
Adds a new import to the current style from a JSON string.
inherited
-
addStyleImportFromURI(
String importId, String uri, {Map< String, Object> ? config, ImportPosition? importPosition}) → Future<void> -
Adds a new import to the current style from a URI.
inherited
-
addStyleLayer(
String properties, LayerPosition? layerPosition) → Future< void> -
Adds a new style layer from a JSON properties string. Prefer the typed
addLayer /
addLayerAthelpers when constructing layers from facade classes; this raw-JSON form is for callers driving layers from style spec strings directly.inherited -
addStyleModel(
String modelId, String modelUri) → Future< void> -
Adds a 3D model to the style for use as
model-idin a model layer.inherited -
addStyleSource(
String sourceId, String properties) → Future< void> -
Adds a new style source from a JSON properties string. Prefer the typed
addSource helper when constructing sources from facade classes; this
raw-JSON form is for callers driving sources from style spec strings.
inherited
-
camera(
{required List< Point> coordinates, MbxEdgeInsets? padding, double? bearing, double? pitch}) → Future<CameraOptions> - Returns camera options that fit the given list of coordinates.
-
cancel(
) → Future< void> - Cancels any pending snapshot request.
-
clearData(
) → Future< void> - Clears temporary map data from the snapshotter's data path.
-
coordinateBounds(
CameraOptions camera) → Future< CoordinateBounds> - Returns the coordinate bounds corresponding to the given camera options.
-
dispose(
) → Future< void> - Releases resources held by this snapshotter instance.
-
getCameraState(
) → Future< CameraState> - Returns the current snapshotter camera state.
-
getFeaturesets(
) → Future< List< FeaturesetDescriptor> > -
Returns the featuresets defined by the currently loaded style.
inherited
-
getLayer(
String layerId) → Future< Layer?> -
Returns a decoded Layer by id, or null when
layerIdis unknown or its type is not handled.inherited -
getProjection(
) → Future< StyleProjection?> -
Returns the style projection.
inherited
-
getSize(
) → Future< Size?> - Returns the current snapshot image size.
-
getSource(
String sourceId) → Future< Source?> -
Returns a Source by id, or null when
sourceIdis unknown or its type is not handled. The returned source is bound to this style so subsequent property getters work.inherited -
getStyleDefaultCamera(
) → Future< CameraOptions> -
Returns the default camera position defined by the style.
inherited
-
getStyleImage(
String imageId) → Future< MbxImage?> -
Returns a previously-added style image, or null when
imageIdis unknown.inherited -
getStyleImportConfigProperties(
String importId) → Future< Map< String, StylePropertyValue> > -
Returns all configuration properties for a style import as a map.
inherited
-
getStyleImportConfigProperty(
String importId, String config) → Future< StylePropertyValue> -
Returns a single configuration property for a style import.
inherited
-
getStyleImports(
) → Future< List< StyleObjectInfo?> > -
Returns all current style imports.
inherited
-
getStyleImportSchema(
String importId) → Future< Object> -
Returns the schema of a style import.
inherited
-
getStyleJSON(
) → Future< String> -
Returns the current style as a JSON string.
inherited
-
getStyleLayerProperties(
String layerId) → Future< String> -
Returns all properties of a layer as a JSON string.
inherited
-
getStyleLayerProperty(
String layerId, String property) → Future< StylePropertyValue> -
Returns the live value of a single layer property.
inherited
-
getStyleLayers(
) → Future< List< StyleObjectInfo?> > -
Returns all style layers.
inherited
-
getStyleLightProperty(
String id, String property) → Future< StylePropertyValue> -
Returns the live value of a single light property.
inherited
-
getStyleLights(
) → Future< List< StyleObjectInfo?> > -
Returns the current style's lights.
inherited
-
getStyleSourceProperties(
String sourceId) → Future< String> -
Returns all properties of a source as a JSON string.
inherited
-
getStyleSourceProperty(
String sourceId, String property) → Future< StylePropertyValue> -
Returns the live value of a single source property as a
StylePropertyValue envelope.
inherited
-
getStyleSources(
) → Future< List< StyleObjectInfo?> > -
Returns all style sources.
inherited
-
getStyleTerrainProperty(
String property) → Future< StylePropertyValue> -
Returns the live value of a single terrain property.
inherited
-
getStyleTransition(
) → Future< TransitionOptions> -
Returns the current style transition options.
inherited
-
getStyleURI(
) → Future< String> -
Returns the current style URI.
inherited
-
hasStyleImage(
String imageId) → Future< bool> -
Returns whether an image with the given id exists.
inherited
-
invalidateStyleCustomGeometrySourceRegion(
String sourceId, CoordinateBounds bounds) → Future< void> -
Invalidates a region in a custom geometry source so its tiles get re-fetched.
inherited
-
invalidateStyleCustomGeometrySourceTile(
String sourceId, CanonicalTileID tileId) → Future< void> -
Invalidates a tile in a custom geometry source so it gets re-fetched.
inherited
-
isStyleLayerPersistent(
String layerId) → Future< bool> -
Returns whether the layer with the given id is persistent.
inherited
-
isStyleLoaded(
) → Future< bool> -
Returns whether the style is fully loaded.
inherited
-
localizeLabels(
String locale, List< String> ? layerIds) → Future<void> -
Localizes label text in the style for the given locale, optionally
scoped to a subset of layers.
inherited
-
moveStyleImport(
String importId, ImportPosition? importPosition) → Future< void> -
Moves an import to a new position.
inherited
-
moveStyleLayer(
String layerId, LayerPosition? layerPosition) → Future< void> -
Moves a style layer to a new position.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeGeoJSONSourceFeatures(
String sourceId, String dataId, List< String> featureIds) → Future<void> -
Removes features from a GeoJSON style source by id.
inherited
-
removeStyleImage(
String imageId) → Future< void> -
Removes a style image.
inherited
-
removeStyleImport(
String importId) → Future< void> -
Removes an import from the style.
inherited
-
removeStyleLayer(
String layerId) → Future< void> -
Removes a style layer.
inherited
-
removeStyleModel(
String modelId) → Future< void> -
Removes a 3D model from the style.
inherited
-
removeStyleSource(
String sourceId) → Future< void> -
Removes a style source.
inherited
-
setCamera(
CameraOptions cameraOptions) → Future< void> - Sets the camera to the given options.
-
setLight(
FlatLight flatLight) → Future< void> -
Sets a single flat light source. Use setLights for ambient + directional.
inherited
-
setLights(
AmbientLight ambientLight, DirectionalLight directionalLight) → Future< void> -
Sets ambient + directional lights together. Disables any flat light.
inherited
-
setProjection(
StyleProjection projection) → Future< void> -
Sets the style projection.
inherited
-
setSize(
Size size) → Future< void> - Sets the snapshot image size.
-
setStyleImportConfigProperties(
String importId, Map< String, Object> configs) → Future<void> -
Sets all configuration properties for an import from a map.
inherited
-
setStyleImportConfigProperty(
String importId, String config, Object value) → Future< void> -
Sets an import configuration property value.
inherited
-
setStyleJSON(
String json) → Future< void> -
Loads a style from a JSON string.
inherited
-
setStyleLayerProperties(
String layerId, String properties) → Future< void> -
Sets all properties of a layer from a JSON object string.
inherited
-
setStyleLayerProperty(
String layerId, String property, Object value) → Future< void> -
Sets a layer property value from a JSON string.
inherited
-
setStyleLightProperty(
String id, String property, Object value) → Future< void> -
Sets a value on a single light property.
inherited
-
setStyleSourceProperties(
String sourceId, String properties) → Future< void> -
Sets all properties of a source from a JSON object string.
inherited
-
setStyleSourceProperty(
String sourceId, String property, Object value) → Future< void> -
Sets a source property value from a JSON string.
inherited
-
setStyleTerrain(
String properties) → Future< void> -
Sets the style terrain from a JSON string.
inherited
-
setStyleTerrainProperty(
String property, Object value) → Future< void> -
Sets a value on a single terrain property.
inherited
-
setStyleTransition(
TransitionOptions transitionOptions) → Future< void> -
Sets the style transition options.
inherited
-
setStyleURI(
String uri) → Future< void> -
Loads a style from a URI.
inherited
-
start(
) → Future< Uint8List?> - Captures a snapshot. If a pending request exists it is cancelled first.
-
styleLayerExists(
String layerId) → Future< bool> -
Returns whether a layer with the given id exists.
inherited
-
styleSourceExists(
String sourceId) → Future< bool> -
Returns whether a source with the given id exists.
inherited
-
tileCover(
TileCoverOptions options) → Future< List< CanonicalTileID?> > - Returns tile identifiers covering the current snapshotter camera.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateGeoJSONSourceFeatures(
String sourceId, String dataId, List< Feature< features) → Future<GeometryObject> >void> -
Updates existing features in a GeoJSON style source.
inherited
-
updateLayer(
Layer layer) → Future< void> -
Updates an existing layer. Serializes the layer to JSON and forwards
to StylePlatformInterface.setStyleLayerProperties.
inherited
-
updateSource(
Source source) → Future< void> -
Updates an existing source. Serializes the source to JSON and forwards
to StylePlatformInterface.setStyleSourceProperties.
inherited
-
updateStyleImageSourceImage(
String sourceId, MbxImage image) → Future< void> -
Replaces the image data of an existing image-type style source.
inherited
-
updateStyleImportWithJSON(
String importId, String json, {Map< String, Object> ? config}) → Future<void> -
Updates an existing import from a JSON string.
inherited
-
updateStyleImportWithURI(
String importId, String uri, {Map< String, Object> ? config}) → Future<void> -
Updates an existing import from a URI.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
{required MapSnapshotOptions options, OnStyleLoadedListener? onStyleLoadedListener, OnMapLoadErrorListener? onMapLoadErrorListener, OnStyleDataLoadedListener? onStyleDataLoadedListener, OnStyleImageMissingListener? onStyleImageMissingListener}) → Future< Snapshotter> -
Creates a new Snapshotter configured with the given
options.