Piotr Prus
06/30/2021, 11:15 AMliteMode
and SnapshotReadyCallback. With this code(code in thread), I am getting crash with error: Bitmap size needs to be more than 0. How can I set the initial size of the googleMap?Piotr Prus
06/30/2021, 11:17 AMBoxWithConstraints(
modifier = Modifier
.fillMaxWidth()
.height(200.dp)
) {
val zoomLevel = 11f
val options = GoogleMapOptions().apply {
camera(CameraPosition.fromLatLngZoom(location.toGoogleLatLng(), zoomLevel))
liteMode(true)
}
val map = rememberMapViewWithLifecycle(options)
coroutineScope.launch {
val googleMap = map.awaitMap()
googleMap.addMarker { position(location.toGoogleLatLng()) }
googleMap.snapshot {
snapshot = it
}
}
}
Piotr Prus
06/30/2021, 11:19 AMvar snapshot by remember {
mutableStateOf(Bitmap.createBitmap(300, 200, Bitmap.Config.ARGB_8888))
}
and the ImageView:
Image(bitmap = snapshot.asImageBitmap(), contentDescription = "Map snapshot")