mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.11k stars 2.21k forks source link

FitBounds done not function with projections other than Mercator. #13170

Closed DDDgfx closed 1 week ago

DDDgfx commented 4 months ago

mapbox-gl-js version: 3^

browser: Chrome

Steps to Trigger Behavior

  1. Call fitBounds via js.
  2. A flyTo is initiated that drives the camera to northwest infinity above Alaska.
  3. Switch the style to mercator projection and behavior is normal.
    1. No errors are thrown.

Link to Demonstration

https://jsbin.com/

Expected Behavior

fitBounds acts as expected

Actual Behavior

fitBounds flys to northwest infinity.

stepankuzmin commented 1 week ago

Hi @DDDgfx,

We've improved the fitBounds in the latest v3.7.0-beta.1 release.