@Composable
fun OsmdroidMapView(geoPoint: GeoPoint) {
AndroidView(
modifier = Modifier.fillMaxSize(),
factory = { context ->
MapView(context).apply {
setTileSource(TileSourceFactory.USGS_TOPO) // .MAPNIK doen't give me any proper view, just empty grey screen
maxZoomLevel = 20.0
minZoomLevel = 4.0
isHorizontalMapRepetitionEnabled = false
isVerticalMapRepetitionEnabled = false
setScrollableAreaLimitLatitude(
MapView.getTileSystem().maxLatitude,
MapView.getTileSystem().minLatitude, 0
)
setScrollableAreaLimitLongitude(
MapView.getTileSystem().minLongitude,
MapView.getTileSystem().maxLongitude,
0
)
this.controller.setCenter(geoPoint)
setBuiltInZoomControls(true)
setMultiTouchControls(true)
setUseDataConnection(true)
tileProvider.clearTileCache()
}
},
update = { view ->
}
)
}
It does not center. At the beginning I need to zoom it by myself to have proper view, not only small square. See screens. Where is the problem and why I cannot center my geoPoint? After zooming the view is disaster it does not refresh.

