-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Make Map#flyTo respect maxBounds #2521
Comments
related to #2801 |
any workaround? this problem is very frustrating |
I commented out these lines and made a custom build: https://github.com/mapbox/mapbox-gl-js/blob/b9e10b9/src/ui/camera.js#L613-L621 It's not good, but it works if you need it. |
Oh thanks! Your changes was merged, right? So is it going to be in the next release? |
My suggestion is a workaround you would have to apply yourself. I'm not sure when a fix is coming. |
- Enable anti-meridian crossing for `easeTo`-based methods for consistency with `flyTo`. - Fix #2521 by disabling anti-meridian crossing if `maxBounds` is set.
- Enable anti-meridian crossing for `easeTo`-based methods for consistency with `flyTo`. - Fix #2521 by disabling anti-meridian crossing if `maxBounds` is set.
Hello,
When using
flyTo
on a map with maxBounds set, it attempts to cross the antimeridian even if it can't. So instead of flying across the map, it flies into the edge.easeTo
does not have this problem.So, with a map with
maxBounds: [[-180,-85],[180,85]]
, starting at[-130, 60]
, and attempting toflyTo([130, 60])
, you wind up at[-164,60]
or so, depending on your zoom.Here's a demo with mapbox-gl v0.18.0: http://jsbin.com/mogodi/edit?js,output
I suspect this was introduced #1857.
The text was updated successfully, but these errors were encountered: