Versions
- Mapbox
10.6.0-rc.1
- Gradle
7.2.1
When I run an app mapbox tiles are black. My code:
@Composable
fun MapboxScreen() {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.background(MaterialTheme.colorScheme.background)
.fillMaxSize()
) {
AndroidView(
modifier = Modifier,
factory = { context ->
ResourceOptionsManager.getDefault(
context,
context.getString(R.string.mapbox_access_token)
)
MapView(context).apply {
getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS) {
cameraOptions {
zoom(19.0)
}
}
}
)
}
}
Also I tried tokens in another app (non-compose) and there map tiles are shown correctly.
Was trying code as it is shown in this post: Mapbox map is black using jetpack compose but it wasn't working...
Also tried older Mapbox v9.