You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading one of your other threads and you mentioned the ability to centre the maps after the config - any chance you could share how to do this please?
Also when loading have to zoom for scroll to start becoming visible?
The MapView configuration should be done inside onCreateView(). You can find examples in the demo package. Like this one.
That should solve the tile visibility issue. Although I also suspect your padding setting to have something to do with that. Usually, the padding is a multiple of tileSize (like one or two). The padding is the number in pixels which is virtually added to the visible part on the screen to compute the tiles that should be fetched. A huge padding like that will trigger way too much tiles to be loaded and cause memory strain on your device.
As for centering, you can do the following in onStart():
post {
if (binding.mapview.width !=0&& binding.mapview.height !=0) {
this.cancel()
binding.mapview.scrollToAndCenter( binding.mapview.width /2, binding.mapview.height /2)
}
}
I also replaced scrollTo with scrollToAndCenter().
Hi,
I was reading one of your other threads and you mentioned the ability to centre the maps after the config - any chance you could share how to do this please?
Also when loading have to zoom for scroll to start becoming visible?
Here's my config setup
`
val tileSize = 256
val config = MapViewConfiguration(
levelCount = map.levelCount,
fullWidth = map.fullWidth,
fullHeight = map.fullHeight,
tileSize = tileSize,
tileStreamProvider = tileStreamProvider
).apply {
setMaxScale(2f)
setMinimumScaleMode(MinimumScaleMode.FILL)
setPadding(12800)
}
The text was updated successfully, but these errors were encountered: