StyleManagerInterface

interface StyleManagerInterface : ObservableInterface

Interface for managing style of the `map`.

Functions

addPersistentStyleCustomLayer
Link copied to clipboard
abstract fun addPersistentStyleCustomLayer(layerId: String, layerHost: CustomLayerHost, layerPosition: LayerPosition): Expected<String, None>
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addPersistentStyleLayer
Link copied to clipboard
abstract fun addPersistentStyleLayer(properties: Value, layerPosition: LayerPosition): Expected<String, None>
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleCustomGeometrySource
Link copied to clipboard
abstract fun addStyleCustomGeometrySource(sourceId: String, options: CustomGeometrySourceOptions): Expected<String, None>
Adds a custom geometry to be used in the style.
addStyleCustomLayer
Link copied to clipboard
abstract fun addStyleCustomLayer(layerId: String, layerHost: CustomLayerHost, layerPosition: LayerPosition): Expected<String, None>
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleImage
Link copied to clipboard
abstract fun addStyleImage(imageId: String, scale: Float, image: Image, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Expected<String, None>
Adds an image to be used in the style.
addStyleLayer
Link copied to clipboard
abstract fun addStyleLayer(properties: Value, layerPosition: LayerPosition): Expected<String, None>
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleSource
Link copied to clipboard
abstract fun addStyleSource(sourceId: String, properties: Value): Expected<String, None>
Adds a new [style source](https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources).
getStyleDefaultCamera
Link copied to clipboard
abstract fun getStyleDefaultCamera(): CameraOptions
Returns the map style's default camera, if any, or a default camera otherwise.
getStyleImage
Link copied to clipboard
abstract fun getStyleImage(imageId: String): Image
Get an `image` from the style.
getStyleJSON
Link copied to clipboard
abstract fun getStyleJSON(): String
Get the JSON serialization string of the current style in use.
getStyleLayerProperties
Link copied to clipboard
abstract fun getStyleLayerProperties(layerId: String): Expected<String, Value>
Gets style layer properties.
getStyleLayerProperty
Link copied to clipboard
abstract fun getStyleLayerProperty(layerId: String, property: String): StylePropertyValue
Gets the value of style layer property.
getStyleLayers
Link copied to clipboard
abstract fun getStyleLayers(): List<StyleObjectInfo>
Returns the existing style layers.
getStyleLightProperty
Link copied to clipboard
abstract fun getStyleLightProperty(property: String): StylePropertyValue
Gets the value of a style light property.
getStyleProjectionProperty
Link copied to clipboard
abstract fun getStyleProjectionProperty(property: String): StylePropertyValue
Gets the value of a style projection property.
getStyleSourceProperties
Link copied to clipboard
abstract fun getStyleSourceProperties(sourceId: String): Expected<String, Value>
Gets style source properties.
getStyleSourceProperty
Link copied to clipboard
abstract fun getStyleSourceProperty(sourceId: String, property: String): StylePropertyValue
Gets the value of style source property.
getStyleSources
Link copied to clipboard
abstract fun getStyleSources(): List<StyleObjectInfo>
Returns the existing style sources.
getStyleTerrainProperty
Link copied to clipboard
abstract fun getStyleTerrainProperty(property: String): StylePropertyValue
Gets the value of a style terrain property.
getStyleTransition
Link copied to clipboard
abstract fun getStyleTransition(): TransitionOptions
Returns the map style's transition options.
getStyleURI
Link copied to clipboard
abstract fun getStyleURI(): String
Get the URI of the current style in use.
hasStyleImage
Link copied to clipboard
abstract fun hasStyleImage(imageId: String): Boolean
Checks whether an image exists.
abstract fun invalidateStyleCustomGeometrySourceRegion(sourceId: String, bounds: CoordinateBounds): Expected<String, None>
Invalidate region for provided custom geometry source.
invalidateStyleCustomGeometrySourceTile
Link copied to clipboard
abstract fun invalidateStyleCustomGeometrySourceTile(sourceId: String, tileId: CanonicalTileID): Expected<String, None>
Invalidate tile for provided custom geometry source.
isStyleLayerPersistent
Link copied to clipboard
abstract fun isStyleLayerPersistent(layerId: String): Expected<String, Boolean>
Checks if a style layer is persistent.
isStyleLoaded
Link copied to clipboard
abstract fun isStyleLoaded(): Boolean
Check if the style is completely loaded.
moveStyleLayer
Link copied to clipboard
abstract fun moveStyleLayer(layerId: String, layerPosition: LayerPosition): Expected<String, None>
Moves an existing style layer
removeStyleImage
Link copied to clipboard
abstract fun removeStyleImage(imageId: String): Expected<String, None>
Removes an image from the style.
removeStyleLayer
Link copied to clipboard
abstract fun removeStyleLayer(layerId: String): Expected<String, None>
Removes an existing style layer.
removeStyleSource
Link copied to clipboard
abstract fun removeStyleSource(sourceId: String): Expected<String, None>
Removes an existing style source.
setStyleCustomGeometrySourceTileData
Link copied to clipboard
abstract fun setStyleCustomGeometrySourceTileData(sourceId: String, tileId: CanonicalTileID, featureCollection: List<Feature>): Expected<String, None>
Set tile data of a custom geometry.
setStyleJSON
Link copied to clipboard
abstract fun setStyleJSON(json: String)
Load the style from a provided JSON string.
setStyleLayerProperties
Link copied to clipboard
abstract fun setStyleLayerProperties(layerId: String, properties: Value): Expected<String, None>
Sets style layer properties.
setStyleLayerProperty
Link copied to clipboard
abstract fun setStyleLayerProperty(layerId: String, property: String, value: Value): Expected<String, None>
Sets a value to a style layer property.
setStyleLight
Link copied to clipboard
abstract fun setStyleLight(properties: Value): Expected<String, None>
Sets the style global [light](https://docs.mapbox.com/mapbox-gl-js/style-spec/#light) properties.
setStyleLightProperty
Link copied to clipboard
abstract fun setStyleLightProperty(property: String, value: Value): Expected<String, None>
Sets a value to the the style light property.
setStyleProjection
Link copied to clipboard
abstract fun setStyleProjection(properties: Value): Expected<String, None>
Sets the map's [projection](https://docs.mapbox.com/mapbox-gl-js/style-spec/projection/).
setStyleProjectionProperty
Link copied to clipboard
abstract fun setStyleProjectionProperty(property: String, value: Value): Expected<String, None>
Sets a value to the the style projection property.
setStyleSourceProperties
Link copied to clipboard
abstract fun setStyleSourceProperties(sourceId: String, properties: Value): Expected<String, None>
Sets style source properties.
setStyleSourceProperty
Link copied to clipboard
abstract fun setStyleSourceProperty(sourceId: String, property: String, value: Value): Expected<String, None>
Sets a value to a style source property.
setStyleTerrain
Link copied to clipboard
abstract fun setStyleTerrain(properties: Value): Expected<String, None>
Sets the style global [terrain](https://docs.mapbox.com/mapbox-gl-js/style-spec/#terrain) properties.
setStyleTerrainProperty
Link copied to clipboard
abstract fun setStyleTerrainProperty(property: String, value: Value): Expected<String, None>
Sets a value to the the style terrain property.
setStyleTransition
Link copied to clipboard
abstract fun setStyleTransition(transitionOptions: TransitionOptions)
Overrides the map style's transition options with user-provided options.
setStyleURI
Link copied to clipboard
abstract fun setStyleURI(uri: String)
Load style from provided URI.
styleLayerExists
Link copied to clipboard
abstract fun styleLayerExists(layerId: String): Boolean
Checks whether a given style layer exists.
styleSourceExists
Link copied to clipboard
abstract fun styleSourceExists(sourceId: String): Boolean
Checks whether a given style source exists.
subscribe
Link copied to clipboard
abstract fun subscribe(observer: Observer, events: List<String>)
Subscribes an `observer` to a provided array of event types.
unsubscribe
Link copied to clipboard
abstract fun unsubscribe(observer: Observer)
Unsubscribes an `observer` from all events.
abstract fun unsubscribe(observer: Observer, events: List<String>)
Unsubscribes an `observer` from a provided array of event types.
updateStyleImageSourceImage
Link copied to clipboard
abstract fun updateStyleImageSourceImage(sourceId: String, image: Image): Expected<String, None>
Updates the image of an [image style source](https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources-image).

Inheritors

StyleInterface
Link copied to clipboard
CameraManagerInterface
Link copied to clipboard
StyleManager
Link copied to clipboard

Extensions

getLayer
Link copied to clipboard
fun StyleManagerInterface.getLayer(layerId: String): Layer?
Extension function to get a Layer provided by the Style Extension by layer id.
getLayerAs
Link copied to clipboard
inline fun <T : Layer> StyleManagerInterface.getLayerAs(layerId: String): T?
Tries to cast the Layer to T.
getSource
Link copied to clipboard
fun StyleManagerInterface.getSource(sourceId: String): Source?
Extension function to get a Source provided by the Style Extension by source id.
getSourceAs
Link copied to clipboard
inline fun <T : Source> StyleManagerInterface.getSourceAs(sourceId: String): T?
Tries to cast the Source to T.