Abstract interface for managing the map's style.
Implementations are provided by platform packages (mobile, web). Layer and source typed APIs are provided through the platform-specific style generators and will be unified in a future update.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addGeoJSONSourceFeatures(
String sourceId, String dataId, List< Feature< features) → Future<GeometryObject> >void> -
Adds features to a GeoJSON style source. The add operation is scheduled
and applied on a GeoJSON serialization queue; observe
onSourceDataLoadedto know when changes are visible. -
addPersistentStyleLayer(
String properties, LayerPosition? layerPosition) → Future< void> - Adds a persistent style layer. Persistent layers survive style reloads when the new style does not redefine the same layer id.
-
addStyleImage(
String imageId, double scale, MbxImage image, bool sdf, List< ImageStretches?> stretchX, List<ImageStretches?> stretchY, ImageContent? content) → Future<void> -
Adds an image to the style. Existing images with the same
imageIdare replaced. -
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.
-
addStyleImportFromURI(
String importId, String uri, {Map< String, Object> ? config, ImportPosition? importPosition}) → Future<void> - Adds a new import to the current style from a URI.
-
addStyleLayer(
String properties, LayerPosition? layerPosition) → Future< void> - Adds a new style layer from a JSON properties string.
-
addStyleModel(
String modelId, String modelUri) → Future< void> -
Adds a 3D model to the style for use as
model-idin a model layer. If a model with the same id already exists, it is replaced. -
addStyleSource(
String sourceId, String properties) → Future< void> - Adds a new style source from a JSON properties string.
-
getFeaturesets(
) → Future< List< FeaturesetDescriptor> > - Returns the featuresets defined by the currently loaded style.
-
getProjection(
) → Future< StyleProjection?> - Returns the style projection.
-
getStyleDefaultCamera(
) → Future< CameraOptions> - Returns the default camera position defined by the style.
-
getStyleImage(
String imageId) → Future< MbxImage?> -
Returns a previously-added style image, or null if none exists for
imageId. -
getStyleImportConfigProperties(
String importId) → Future< Map< String, StylePropertyValue> > - Returns all configuration properties for a style import as a map.
-
getStyleImportConfigProperty(
String importId, String config) → Future< StylePropertyValue> - Returns a single configuration property for a style import.
-
getStyleImports(
) → Future< List< StyleObjectInfo?> > - Returns all current style imports.
-
getStyleImportSchema(
String importId) → Future< Object> - Returns the schema of a style import.
-
getStyleJSON(
) → Future< String> - Returns the current style as a JSON string.
-
getStyleLayerProperties(
String layerId) → Future< String> - Returns all properties of a layer as a JSON string.
-
getStyleLayerProperty(
String layerId, String property) → Future< StylePropertyValue> - Returns the live value of a single layer property.
-
getStyleLayers(
) → Future< List< StyleObjectInfo?> > - Returns all style layers.
-
getStyleLightProperty(
String id, String property) → Future< StylePropertyValue> - Returns the live value of a single light property.
-
getStyleLights(
) → Future< List< StyleObjectInfo?> > - Returns the current style's lights.
-
getStyleSourceProperties(
String sourceId) → Future< String> -
Returns all properties of a source as a JSON string. This reflects
the source's declarative payload (the JSON passed to
addStyleSource); volatile runtime properties updated via setStyleSourceProperty or setStyleSourceProperties are not always included. For a single-property live read that does see volatile values, use getStyleSourceProperty. -
getStyleSourceProperty(
String sourceId, String property) → Future< StylePropertyValue> - Returns the live value of a single source property as a StylePropertyValue envelope (raw value + kind). Reflects volatile runtime state, unlike getStyleSourceProperties.
-
getStyleSources(
) → Future< List< StyleObjectInfo?> > - Returns all style sources.
-
getStyleTerrainProperty(
String property) → Future< StylePropertyValue> - Returns the live value of a single terrain property.
-
getStyleTransition(
) → Future< TransitionOptions> - Returns the current style transition options.
-
getStyleURI(
) → Future< String> - Returns the current style URI.
-
hasStyleImage(
String imageId) → Future< bool> - Returns whether an image with the given id exists.
-
invalidateStyleCustomGeometrySourceRegion(
String sourceId, CoordinateBounds bounds) → Future< void> - Invalidates a region in a custom geometry source so its tiles get re-fetched.
-
invalidateStyleCustomGeometrySourceTile(
String sourceId, CanonicalTileID tileId) → Future< void> - Invalidates a tile in a custom geometry source so it gets re-fetched.
-
isStyleLayerPersistent(
String layerId) → Future< bool> - Returns whether the layer with the given id is persistent.
-
isStyleLoaded(
) → Future< bool> - Returns whether the style is fully loaded.
-
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.
-
moveStyleImport(
String importId, ImportPosition? importPosition) → Future< void> - Moves an import to a new position.
-
moveStyleLayer(
String layerId, LayerPosition? layerPosition) → Future< void> - Moves a style layer to a new position.
-
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.
-
removeStyleImage(
String imageId) → Future< void> - Removes a style image.
-
removeStyleImport(
String importId) → Future< void> - Removes an import from the style.
-
removeStyleLayer(
String layerId) → Future< void> - Removes a style layer.
-
removeStyleModel(
String modelId) → Future< void> - Removes a 3D model from the style.
-
removeStyleSource(
String sourceId) → Future< void> - Removes a style source.
-
setLight(
FlatLight flatLight) → Future< void> - Sets a single flat light source. Use setLights for ambient + directional.
-
setLights(
AmbientLight ambientLight, DirectionalLight directionalLight) → Future< void> - Sets ambient + directional lights together. Disables any flat light.
-
setProjection(
StyleProjection projection) → Future< void> - Sets the style projection.
-
setStyleImportConfigProperties(
String importId, Map< String, Object> configs) → Future<void> - Sets all configuration properties for an import from a map.
-
setStyleImportConfigProperty(
String importId, String config, Object value) → Future< void> - Sets an import configuration property value.
-
setStyleJSON(
String json) → Future< void> - Loads a style from a JSON string.
-
setStyleLayerProperties(
String layerId, String properties) → Future< void> - Sets all properties of a layer from a JSON object string.
-
setStyleLayerProperty(
String layerId, String property, Object value) → Future< void> - Sets a layer property value from a JSON string.
-
setStyleLightProperty(
String id, String property, Object value) → Future< void> - Sets a value on a single light property.
-
setStyleSourceProperties(
String sourceId, String properties) → Future< void> - Sets all properties of a source from a JSON object string.
-
setStyleSourceProperty(
String sourceId, String property, Object value) → Future< void> - Sets a source property value from a JSON string.
-
setStyleTerrain(
String properties) → Future< void> - Sets the style terrain from a JSON string.
-
setStyleTerrainProperty(
String property, Object value) → Future< void> - Sets a value on a single terrain property.
-
setStyleTransition(
TransitionOptions transitionOptions) → Future< void> - Sets the style transition options.
-
setStyleURI(
String uri) → Future< void> - Loads a style from a URI.
-
styleLayerExists(
String layerId) → Future< bool> - Returns whether a layer with the given id exists.
-
styleSourceExists(
String sourceId) → Future< bool> - Returns whether a source with the given id exists.
-
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. Features are matched
by id; provide unique ids on every feature to avoid
map-loading-error. -
updateStyleImageSourceImage(
String sourceId, MbxImage image) → Future< void> - Replaces the image data of an existing image-type style source.
-
updateStyleImportWithJSON(
String importId, String json, {Map< String, Object> ? config}) → Future<void> - Updates an existing import from a JSON string.
-
updateStyleImportWithURI(
String importId, String uri, {Map< String, Object> ? config}) → Future<void> - Updates an existing import from a URI.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited