GenericStyle

fun GenericStyle(style: String, styleImportsContent: @Composable StyleImportsScope.() -> Unit? = null, slotsContent: SlotsContent = remember { SlotsContent() }, layerPositionedContent: LayerPositionedContent = remember { LayerPositionedContent() }, styleState: StyleState = rememberStyleState())

Generic Style that you can insert MapboxMapComposable functions in any slot you defined as a plain string, or set any map import configs given as plain string and Value pairs.

Please note it's your own responsibility to make sure the slots you provided exists in the style, and the import configs are valid within the style, otherwise it will result in unexpected behaviour.

Always prefer strongly typed MapboxStyleComposable over the GenericStyle.

Parameters

style

The Style JSON or Style Uri to be set to the map.

styleImportsContent

The style imports to be added to the current style, note layers and annotations shouldn't be added to this block.

slotsContent

The slots and their MapboxMapComposable that would be inserted to the corresponding slots in the style. You can use slotsContent to create it.

layerPositionedContent

The MapboxMapComposable content to be placed at specific layer position in the style. You can use layerPositionedContent to create it.

styleState

The state holder for the Style.


fun GenericStyle(style: String, styleImportsContent: @Composable StyleImportsScope.() -> Unit? = null, slotsContent: SlotsContent = remember { SlotsContent() }, layerPositionedContent: LayerPositionedContent = remember { LayerPositionedContent() }, styleImportsConfig: StyleImportsConfig = remember { StyleImportsConfig() }, projection: Projection = Projection.INITIAL, atmosphereState: AtmosphereState = remember { AtmosphereState() }, terrainState: TerrainState = TerrainState.INITIAL, lightsState: LightsState = LightsState.INITIAL, styleTransition: TransitionOptions = remember { transition { } })

Deprecated

Use overloaded GenericStyle function with StyleState

Generic Style that you can insert MapboxMapComposable functions in any slot you defined as a plain string, or set any map import configs given as plain string and Value pairs.

Please note it's your own responsibility to make sure the slots you provided exists in the style, and the import configs are valid within the style, otherwise it will result in unexpected behaviour.

Always prefer strongly typed MapboxStyleComposable over the GenericStyle.

Parameters

style

The Style JSON or Style Uri to be set to the map.

styleImportsContent

The style imports to be added to the current style, note layers and annotations shouldn't be added to this block.

slotsContent

The slots and their MapboxMapComposable that would be inserted to the corresponding slots in the style. You can use slotsContent to create it.

layerPositionedContent

The MapboxMapComposable content to be placed at specific layer position in the style. You can use layerPositionedContent to create it.

styleImportsConfig

The style import configurations for all the style imports in the style. You can use styleImportsConfig to create it.

projection

The projection to be set to the map. Defaults to Projection.DEFAULT meaning that projection value is taken from the style definition.

atmosphereState

The atmosphere to be set to the map. By default, no changes to the current atmosphere.

terrainState

The terrain to be set to the map. Defaults to initial state meaning no custom terrain is added, default value is taken from style definition.

lightsState

The lights to be set to the map. By default, no changes to the current lights defined in style.

styleTransition

Transition options applied when loading the style.