Style Manager
Interface for managing style of the `map`.
Functions
Link copied to clipboard
open fun addPersistentStyleCustomLayer(@NonNull layerId: String, @NonNull layerHost: CustomLayerHost, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
Link copied to clipboard
open fun addPersistentStyleLayer(@NonNull properties: Value, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
Link copied to clipboard
open fun addStyleCustomGeometrySource(@NonNull sourceId: String, @NonNull options: CustomGeometrySourceOptions): Expected<String, None>
Adds a custom geometry to be used in the style.
Link copied to clipboard
open fun addStyleCustomLayer(@NonNull layerId: String, @NonNull layerHost: CustomLayerHost, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
Link copied to clipboard
open fun addStyleCustomRasterSource(@NonNull sourceId: String, @NonNull options: CustomRasterSourceOptions): Expected<String, None>
Note!
Link copied to clipboard
open fun addStyleImage(@NonNull imageId: String, scale: Float, @NonNull image: Image, sdf: Boolean, @NonNull stretchX: List<ImageStretches>, @NonNull stretchY: List<ImageStretches>, @Nullable content: ImageContent): Expected<String, None>
Adds an image to be used in the style.
Link copied to clipboard
open fun addStyleLayer(@NonNull properties: Value, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
Link copied to clipboard
Gets the value of a style atmosphere property.
Link copied to clipboard
Returns the map style's default camera, if any, or a default camera otherwise.
Link copied to clipboard
Get an `image` from the style.
Link copied to clipboard
open fun getStyleImportConfigProperties(@NonNull importId: String): Expected<String, HashMap<String, StylePropertyValue>>
Gets style import config.
Link copied to clipboard
open fun getStyleImportConfigProperty(@NonNull importId: String, @NonNull config: String): Expected<String, StylePropertyValue>
Gets the value of style import config.
Link copied to clipboard
Returns the existing style imports.
Link copied to clipboard
Get the JSON serialization string of the current style in use.
Link copied to clipboard
open fun getStyleLayerProperty(@NonNull layerId: String, @NonNull property: String): StylePropertyValue
Gets the value of style layer property.
Link copied to clipboard
open fun getStyleLayerPropertyDefaultValue(@NonNull layerType: String, @NonNull property: String): StylePropertyValue
Gets the default value of style layer property
Link copied to clipboard
Returns the existing style layers.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Gets the value of a style projection property.
Link copied to clipboard
open fun getStyleSourceProperty(@NonNull sourceId: String, @NonNull property: String): StylePropertyValue
Gets the value of style source property.
Link copied to clipboard
open fun getStyleSourcePropertyDefaultValue(@NonNull sourceType: String, @NonNull property: String): StylePropertyValue
Gets the default value of style source property.
Link copied to clipboard
Returns the existing style sources.
Link copied to clipboard
Gets the value of a style terrain property.
Link copied to clipboard
Returns the map style's transition options.
Link copied to clipboard
Get the URI of the current style in use.
Link copied to clipboard
Checks whether an image exists.
Link copied to clipboard
Checks whether a model exists.
Link copied to clipboard
open fun invalidateStyleCustomGeometrySourceRegion(@NonNull sourceId: String, @NonNull bounds: CoordinateBounds): Expected<String, None>
Invalidate region for provided custom geometry source.
Link copied to clipboard
open fun invalidateStyleCustomGeometrySourceTile(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID): Expected<String, None>
Invalidate tile for provided custom geometry source.
Link copied to clipboard
open fun invalidateStyleCustomRasterSourceRegion(@NonNull sourceId: String, @NonNull bounds: CoordinateBounds): Expected<String, None>
Note!
Link copied to clipboard
open fun invalidateStyleCustomRasterSourceTile(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID): Expected<String, None>
Note!
Link copied to clipboard
Check if the style is completely loaded.
Link copied to clipboard
open fun moveStyleLayer(@NonNull layerId: String, @Nullable layerPosition: LayerPosition): Expected<String, None>
Moves an existing style layer
Link copied to clipboard
Removes an image from the style.
Link copied to clipboard
Removes an existing style import.
Link copied to clipboard
Removes an existing style layer.
Link copied to clipboard
Removes a model from the style.
Link copied to clipboard
Removes an existing style source.
Link copied to clipboard
Sets the style global [atmosphere](https://docs.mapbox.com/mapbox-gl-js/style-spec/#fog) properties.
Link copied to clipboard
open fun setStyleCustomGeometrySourceTileData(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID, @NonNull featureCollection: List<Feature>): Expected<String, None>
Set tile data of a custom geometry.
Link copied to clipboard
open fun setStyleCustomRasterSourceTileData(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID, @Nullable image: Image): Expected<String, None>
Note!
Link copied to clipboard
open fun setStyleGeoJSONSourceData(@NonNull sourceId: String, @NonNull dataId: String, @NonNull data: GeoJSONSourceData): Expected<String, None>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Load the style from a provided JSON string.
Link copied to clipboard
Link copied to clipboard
Sets the map's [projection](https://docs.mapbox.com/mapbox-gl-js/style-spec/projection/).
Link copied to clipboard
Link copied to clipboard
Sets the style global [terrain](https://docs.mapbox.com/mapbox-gl-js/style-spec/#terrain) properties.
Link copied to clipboard
Overrides the map style's transition options with user-provided options.
Link copied to clipboard
Load style from provided URI.
Link copied to clipboard
Checks whether a given style layer exists.
Link copied to clipboard
Checks whether a given style source exists.
Link copied to clipboard
Subscribes to `CameraChanged` event.
Subscribes to `MapIdle` event.
Subscribes to `MapLoaded` event.
Subscribes to `MapLoadingError` event.
Subscribes to `PerfStatsCollected` event.
Subscribes to `RenderFrameFinished` event.
Subscribes to `RenderFrameStarted` event.
Subscribes to `ResourceRequest` event.
Subscribes to `SourceAdded` event.
Subscribes to `SourceDataLoaded` event.
Subscribes to `SourceRemoved` event.
Subscribes to `StyleDataLoaded` event.
Subscribes to `StyleImageMissing` event.
Subscribes to `StyleImageRemoveUnused` event.
Subscribes to `StyleLoaded` event.
Subscribes to an experimental `GenericEvent` event.