StyleInterface

Defines the style interface that can be used to interact with the map's style.

interface StyleInterface : StyleManagerInterface

Functions

addImage
Link copied to clipboard

Adds an image to be used in the style. This API can also be used for updating an image. If the image \a id was already added, it gets replaced by the new image.

The image can be used in icon-image, fill-pattern, and line-pattern.

layout-symbol-icon-image

paint-line-line-pattern

paint-fill-fill-pattern

abstract fun addImage(imageId: String, bitmap: Bitmap): Expected<String, None>
addPersistentStyleCustomLayer
Link copied to clipboard
abstract override fun addPersistentStyleCustomLayer(@NonNull() p0: String, @NonNull() p1: CustomLayerHost, @Nullable() p2: LayerPosition?): Expected<String, None>
addPersistentStyleLayer
Link copied to clipboard
abstract override fun addPersistentStyleLayer(@NonNull() p0: Value, @Nullable() p1: LayerPosition?): Expected<String, None>
addStyleCustomGeometrySource
Link copied to clipboard
abstract override fun addStyleCustomGeometrySource(@NonNull() p0: String, @NonNull() p1: CustomGeometrySourceOptions): Expected<String, None>
addStyleCustomLayer
Link copied to clipboard
abstract override fun addStyleCustomLayer(@NonNull() p0: String, @NonNull() p1: CustomLayerHost, @Nullable() p2: LayerPosition?): Expected<String, None>
addStyleImage
Link copied to clipboard
abstract override fun addStyleImage(@NonNull() p0: String, p1: Float, @NonNull() p2: Image, p3: Boolean, @NonNull() p4: MutableList<ImageStretches>, @NonNull() p5: MutableList<ImageStretches>, @Nullable() p6: ImageContent?): Expected<String, None>
addStyleLayer
Link copied to clipboard
abstract override fun addStyleLayer(@NonNull() p0: Value, @Nullable() p1: LayerPosition?): Expected<String, None>
addStyleSource
Link copied to clipboard
abstract override fun addStyleSource(@NonNull() p0: String, @NonNull() p1: Value): Expected<String, None>
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getStyleDefaultCamera
Link copied to clipboard
abstract override fun getStyleDefaultCamera(): CameraOptions
getStyleImage
Link copied to clipboard
abstract override fun getStyleImage(@NonNull() p0: String): Image?
getStyleJSON
Link copied to clipboard
abstract override fun getStyleJSON(): String
getStyleLayerProperties
Link copied to clipboard
abstract override fun getStyleLayerProperties(@NonNull() p0: String): Expected<String, Value>
getStyleLayerProperty
Link copied to clipboard
abstract override fun getStyleLayerProperty(@NonNull() p0: String, @NonNull() p1: String): StylePropertyValue
getStyleLayers
Link copied to clipboard
abstract override fun getStyleLayers(): MutableList<StyleObjectInfo>
getStyleLightProperty
Link copied to clipboard
abstract override fun getStyleLightProperty(@NonNull() p0: String): StylePropertyValue
getStyleSourceProperties
Link copied to clipboard
abstract override fun getStyleSourceProperties(@NonNull() p0: String): Expected<String, Value>
getStyleSourceProperty
Link copied to clipboard
abstract override fun getStyleSourceProperty(@NonNull() p0: String, @NonNull() p1: String): StylePropertyValue
getStyleSources
Link copied to clipboard
abstract override fun getStyleSources(): MutableList<StyleObjectInfo>
getStyleTerrainProperty
Link copied to clipboard
abstract override fun getStyleTerrainProperty(@NonNull() p0: String): StylePropertyValue
getStyleTransition
Link copied to clipboard
abstract override fun getStyleTransition(): TransitionOptions
getStyleURI
Link copied to clipboard
abstract override fun getStyleURI(): String
hashCode
Link copied to clipboard
open override fun hashCode(): Int
abstract override fun invalidateStyleCustomGeometrySourceRegion(@NonNull() p0: String, @NonNull() p1: CoordinateBounds): Expected<String, None>
invalidateStyleCustomGeometrySourceTile
Link copied to clipboard
abstract override fun invalidateStyleCustomGeometrySourceTile(@NonNull() p0: String, @NonNull() p1: CanonicalTileID): Expected<String, None>
isStyleLayerPersistent
Link copied to clipboard
abstract override fun isStyleLayerPersistent(@NonNull() p0: String): Expected<String, Boolean>
isStyleLoaded
Link copied to clipboard
abstract override fun isStyleLoaded(): Boolean
removeStyleImage
Link copied to clipboard
abstract override fun removeStyleImage(@NonNull() p0: String): Expected<String, None>
removeStyleLayer
Link copied to clipboard
abstract override fun removeStyleLayer(@NonNull() p0: String): Expected<String, None>
removeStyleSource
Link copied to clipboard
abstract override fun removeStyleSource(@NonNull() p0: String): Expected<String, None>
setStyleCustomGeometrySourceTileData
Link copied to clipboard
abstract override fun setStyleCustomGeometrySourceTileData(@NonNull() p0: String, @NonNull() p1: CanonicalTileID, @NonNull() p2: MutableList<Feature>): Expected<String, None>
setStyleJSON
Link copied to clipboard
abstract override fun setStyleJSON(@NonNull() p0: String)
setStyleLayerProperties
Link copied to clipboard
abstract override fun setStyleLayerProperties(@NonNull() p0: String, @NonNull() p1: Value): Expected<String, None>
setStyleLayerProperty
Link copied to clipboard
abstract override fun setStyleLayerProperty(@NonNull() p0: String, @NonNull() p1: String, @NonNull() p2: Value): Expected<String, None>
setStyleLight
Link copied to clipboard
abstract override fun setStyleLight(@NonNull() p0: Value): Expected<String, None>
setStyleLightProperty
Link copied to clipboard
abstract override fun setStyleLightProperty(@NonNull() p0: String, @NonNull() p1: Value): Expected<String, None>
setStyleSourceProperties
Link copied to clipboard
abstract override fun setStyleSourceProperties(@NonNull() p0: String, @NonNull() p1: Value): Expected<String, None>
setStyleSourceProperty
Link copied to clipboard
abstract override fun setStyleSourceProperty(@NonNull() p0: String, @NonNull() p1: String, @NonNull() p2: Value): Expected<String, None>
setStyleTerrain
Link copied to clipboard
abstract override fun setStyleTerrain(@NonNull() p0: Value): Expected<String, None>
setStyleTerrainProperty
Link copied to clipboard
abstract override fun setStyleTerrainProperty(@NonNull() p0: String, @NonNull() p1: Value): Expected<String, None>
setStyleTransition
Link copied to clipboard
abstract override fun setStyleTransition(@NonNull() p0: TransitionOptions)
setStyleURI
Link copied to clipboard
abstract override fun setStyleURI(@NonNull() p0: String)
styleLayerExists
Link copied to clipboard
abstract override fun styleLayerExists(@NonNull() p0: String): Boolean
styleSourceExists
Link copied to clipboard
abstract override fun styleSourceExists(@NonNull() p0: String): Boolean
subscribe
Link copied to clipboard
abstract override fun subscribe(@NonNull() p0: Observer, @NonNull() p1: MutableList<String>)
toString
Link copied to clipboard
open override fun toString(): String
unsubscribe
Link copied to clipboard
abstract override fun unsubscribe(@NonNull() p0: Observer)
abstract override fun unsubscribe(@NonNull() p0: Observer, @NonNull() p1: MutableList<String>)
updateStyleImageSourceImage
Link copied to clipboard
abstract override fun updateStyleImageSourceImage(@NonNull() p0: String, @NonNull() p1: Image): Expected<String, None>

Properties

pixelRatio
Link copied to clipboard

The pixel ratio of the current display for the map to be rendered on, this value is initialised and can be overwritten at the Map's initialisation period.

abstract val pixelRatio: Float

Inheritors

Style
Link copied to clipboard

Extensions

addImage
Link copied to clipboard

Extension function to add an image provided by the Style Extension to the Style.

fun StyleInterface.addImage(image: StyleContract.StyleImageExtension)
addLayer
Link copied to clipboard

Extension function to add a Layer provided by the Style Extension to the Style.

fun StyleInterface.addLayer(layer: StyleContract.StyleLayerExtension)
addLayerAbove
Link copied to clipboard

Extension function to add a Layer provided by the Style Extension to the Style.

fun StyleInterface.addLayerAbove(layer: StyleContract.StyleLayerExtension, above: String?)
addLayerAt
Link copied to clipboard

Extension function to add a Layer provided by the Style Extension to the Style.

fun StyleInterface.addLayerAt(layer: StyleContract.StyleLayerExtension, index: Int?)
addLayerBelow
Link copied to clipboard

Extension function to add a Layer provided by the Style Extension to the Style.

fun StyleInterface.addLayerBelow(layer: StyleContract.StyleLayerExtension, below: String?)
addPersistentLayer
Link copied to clipboard

Add layer to the style persistently.

Note: This is an experimental API and is a subject to change.

Whenever a new style is being parsed and currently used style has persistent layers, an engine will try to do following:

  • keep the persistent layer at its relative position

  • keep the source used by a persistent layer

  • keep images added through addStyleImage method

In cases when a new style has the same layer, source or image resource, style's resources would be used instead and MapLoadingError event will be emitted.

fun StyleInterface.addPersistentLayer(layer: Layer, position: LayerPosition?)
addSource
Link copied to clipboard

Extension function to add a Source provided by the Style Extension to the Style.

fun StyleInterface.addSource(source: StyleContract.StyleSourceExtension)
getLight
Link copied to clipboard

Extension function to get the light provided by the Style Extension.

fun StyleInterface.getLight(): Light
getTerrain
Link copied to clipboard

Extension function to get the terrain provided by the Style Extension.

fun StyleInterface.getTerrain(sourceId: String): Terrain
localizeLabels
Link copied to clipboard

Extension function to localize style labels

fun StyleInterface.localizeLabels(locale: Locale, layerIds: List<String>?)
setLight
Link copied to clipboard

Extension function to add a Light provided by the Style Extension to the Style.

fun StyleInterface.setLight(light: StyleContract.StyleLightExtension)
setTerrain
Link copied to clipboard

Extension function to set the Terrain provided by the Style Extension to the Style.

fun StyleInterface.setTerrain(terrain: StyleContract.StyleTerrainExtension)