MapboxMap

fun MapboxMap(modifier: Modifier = Modifier, mapEvents: MapEvents? = null, composeMapInitOptions: ComposeMapInitOptions = ComposeMapInitOptions(LocalDensity.current.density), gesturesSettings: GesturesSettings = GesturesSettings { }, locationComponentSettings: LocationComponentSettings = DefaultSettingsProvider.defaultLocationComponentSettings( LocalDensity.current.density ), compass: @Composable MapCompassScope.() -> Unit = { Compass() }, scaleBar: @Composable MapScaleBarScope.() -> Unit = { ScaleBar() }, logo: @Composable MapLogoScope.() -> Unit = { Logo() }, attribution: @Composable MapAttributionScope.() -> Unit = { Attribution() }, mapViewportState: MapViewportState = rememberMapViewportState(), onMapClickListener: OnMapClickListener = DefaultSettingsProvider.defaultOnClickListener, onMapLongClickListener: OnMapLongClickListener = DefaultSettingsProvider.defaultOnLongClickListener, style: @Composable () -> Unit = { MapboxStandardStyle() }, content: @Composable MapboxMapScope.() -> Unit? = null)

Entry point for adding a Mapbox Map instance to the Jetpack Compose UI.

Parameters

modifier

Modifier to be applied to the Mapbox map.

composeMapInitOptions

Defines the initialisation configurations for a MapboxMap. It should only be set once and not mutated after the initialisation. Mutating the ComposeMapInitOptions will result in internal MapView recreation and impact performance.

gesturesSettings

Gesture configuration allows to control the user touch interaction.

locationComponentSettings

Settings for showing a location puck on the map.

compass

The Mapbox Compass ornament of the map, consider using MapCompassScope.Compass.

scaleBar

The Mapbox ScaleBar ornament of the map, consider using MapScaleBarScope.ScaleBar.

logo

The Mapbox Logo ornament of the map, consider using MapLogoScope.Logo.

attribution

The Mapbox Attribution ornament of the map, consider using MapAttributionScope.Attribution.

mapViewportState

A state object that can be hoisted to control and observe the map's camera state. A MapViewportState may only be used by a single MapboxMap composable at a time as it reflects instance state for a single view of a map.

onMapClickListener

Callback to be invoked when the user clicks on the map view.

onMapLongClickListener

Callback to be invoked when the user long clicks on the map view.

style

The Style of the map.

content

The content of the map.