-
-
Notifications
You must be signed in to change notification settings - Fork 872
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
[BUG] Map warps to other side of the planet when map center hits antimeridian #2022
Comments
I'm not able to reproduce this with a normal pan gesture but with a fling gesture. fling.bug.mp4 |
This will occur when camera constraints are set. The end of the fling jumps past the constraints. |
The workaround is probably to inset the constraints a bit from the edge? But we need to look into this. |
I have no camera constraints set myself. I see what is happening though. Since the behavior around the international dateline has changed, my old logic no longer works. Before: Panning map to -180 would simply stop there. I never had to deal with it. Old Logic: If map centerpoint goes EAST of -40 (or WEST of -180), I move the map to longitude -40 (or -180).
But now, the map is allowed to move west of -180, to 180. My old logic sees 180 as > -40, so my logic below warps the map all the way to the other side of my domain to the east side (-40). Any way to have a flag that puts the "barrier" at -180 back? If not, I'll have to think about how to mitigate. Perhaps if the fling stops anywhere between -180 and "a ways west" of there, snap back to -180, otherwise if they are over the Atlantic Ocean, snap back to -40, or something like that. Using camera constraints would probably be optimal but I could never get it too "not" thrown an exceptions when changing device orientation, which many times causes it to go out of bounds. |
What is the bug?
When I pan my map west to -180, instead of stopping like a wall, it flips around to the other side of the globe.
Is there a way to put the "wall" behavior back? I enjoyed that natural blocking behavior actually.
How can we reproduce it?
Unless it's something in my code specifically, just pan/fling westward beyond -180 and see what happens.
If you cannot reproduce, I'll give more info on my setup for troubleshooting.
Do you have a potential solution?
No response
Platforms
All
Severity
Minimum: Allows normal functioning
The text was updated successfully, but these errors were encountered: