Package com.mapbox.maps.extension.style.layers

Types

Layer
Link copied to clipboard

Base class for the different Layer types

abstract class Layer : StyleContract.StyleLayerExtension

Functions

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?)
getLayer
Link copied to clipboard

Extension function to get a Layer provided by the Style Extension by layer id.

fun StyleManagerInterface.getLayer(layerId: String): Layer?
getLayerAs
Link copied to clipboard

Tries to cast the Layer to T.

inline fun <T : Layer> StyleManagerInterface.getLayerAs(layerId: String): T?
isPersistent
Link copied to clipboard

Get the persistent property as Boolean.

If true, the layer will be persisted across style changes.

fun Layer.isPersistent(): Boolean?