Create Mapbox Map with Jetpack Compose code example
Example: Create Mapbox Map with Jetpack Compose
AndroidView(
modifier = modifier,
factory = { context ->
Mapbox.getInstance(
context,
public_api_key
)
MapView(context).apply {
getMapAsync { mapboxMap ->
mapboxMap.setStyle(Style.MAPBOX_STREETS)
val position = CameraPosition.Builder()
.zoom(19.0)
.build()
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(position), 1)
}
}
}
)