-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollTo / scrollToAndCenter using different coordinates after scaling #29
Comments
Hi, it's possible that the jump is caused by using wrong coordinates for |
I've created a fork here There's a button on the first fragment that calls scrollToAndCenter with fixed pixel co-ordinates. If you zoom in a bit at a time and click the button, you should see it jumps to a different place each time. It's more noticeable the more you zoom in. |
That's because the scroll is affected by the scale. |
8192 is the size of the map at scale 1. So 4096 corresponds to the center of the map, at scale 1.
|
Alternatively, a common use case is to center on a marker. That's when mapView.addMarker(marker, 0.5, 0.5) You can then center on that marker using the |
Thanks for you help. I have it working using the scale now. I think I got confused as I am porting over from TileView, where I was able to call defineBounds, then scrollToAndCenter without making any transformations. |
Hi, I'm having an issue once the map has been scaled, calling scrollTo causes the map to jump to a completely different place, depending on how much the map has been scaled.
It looks like this has something to do with setConstrainedScroll being called and the values there being clipped to scrollLimitX/Y
I'm using a single level with min and max limits set
I wonder if this setup is correct. I'm also having an issue with defineBounds not having any effect. This isn't a problem, as it's easy enough to calculate the pixels required, but I'm mentioning it in case it's related.
The text was updated successfully, but these errors were encountered: