Answers for "Create Mapbox Map with Jetpack Compose"

0

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)
                }
            }
        }
    )
Posted by: Guest on May-10-2021

Code answers related to "Create Mapbox Map with Jetpack Compose"

Browse Popular Code Answers by Language