Skip to content
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

map.fitBounds() sets an error bounds when using "equirectangular" projection. #13263

Open
r-White55Kai opened this issue Aug 27, 2024 · 3 comments
Labels

Comments

@r-White55Kai
Copy link

mapbox-gl-js version:

3.6.0

browser:

Chrome newest version on Mac

Steps to Trigger Behavior

  1. Using "equirectangular" projection
  2. map.fitBounds([
    [116, 39.5], // southwestern corner of the bounds
    [116.5, 40] // northeastern corner of the bounds
    ])

Link to Demonstration

https://jsfiddle.net/cc_meow/gmftzqcL/37/
https://jsfiddle.net/cc_meow/gmftzqcL/39/

Expected Behavior

This should give the map of Beijing
20240827-115451

Actual Behavior

Give the map of Gaotang
image

@r-White55Kai
Copy link
Author

Could somebody help me? 👀

@stepankuzmin
Copy link
Contributor

Hi @r-White55Kai,

We've improved the fitBounds in the latest v3.7.0-beta.1 release. Could you please try it out and share your feedback? Thanks!

@r-White55Kai
Copy link
Author

Hi @r-White55Kai,

We've improved the fitBounds in the latest v3.7.0-beta.1 release. Could you please try it out and share your feedback? Thanks!

Great! It solves my problem perfectly, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
@stepankuzmin @r-White55Kai and others