Anchor

@Immutable
sealed interface Anchor(source)

Declares where the layers should be anchored, i.e. positioned in the list of layers in the map style.

This allows for layers declared in Compose to be inserted at any location of the layers defined in the base style JSON rather than exclusively on top of these.

Note: This mechanism can only be used to anchor layers at layerIds from the base map style referred to in the baseStyle parameter of the MapLibreMap composable. Anchoring layers defined in the composition to other layers defined in the composition is not possible.

See Anchor.Companion for Composable functions to use in the layers composition.

Inheritors

Types

Link copied to clipboard
data class Above(val layerId: String) : Anchor

Layer(s) are anchored above the layer (i.e. in front of it) with the given layerId from the base map style. See Anchor.Companion.Above to use this in the layers composition.

Link copied to clipboard
data class Below(val layerId: String) : Anchor

Layer(s) are anchored below the layer (i.e. behind it) with the given layerId from the base map style. See Anchor.Companion.Below to use this in the layers composition.

Link copied to clipboard
data object Bottom : Anchor

Layer(s) are anchored at the bottom, i.e. in behind of all other layers. See Anchor.Companion.Bottom to use this in the layers composition.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Replace(val layerId: String) : Anchor

Layer(s) replace the layer (i.e. are shown instead of it) with the given layerId from the base map style. See Anchor.Companion.Replace to use this in the layers composition.

Link copied to clipboard
data object Top : Anchor

Layer(s) are anchored at the top, i.e. in front of all other layers. See Anchor.Companion.Top to use this in the layers composition.