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.24k stars 2.23k forks source link

setting `maxBounds` on `equirectangular` projection has different results based on the map container size #13290

Open pflopez opened 2 months ago

pflopez commented 2 months ago

mapbox-gl-js version: v3.6.0

browser: Chrome

Steps to Trigger Behavior

  1. Set two maps, one with a smaller vertical container than the other. Both maps have the same configuration, using equirectangular projection.
  2. Set the same maxBounds to both maps.
  3. Notice that the maxBounds for the first map and the second map do not behave the same.

Link to Demonstration

https://codepen.io/pflopez/pen/xxvbZdB

Expected Behavior

Both maps should have the same max bounds, regardless of the size of the map container.

Actual Behavior

The max bounds of each map are different.

pflopez commented 2 months ago

In a way, related to https://github.com/mapbox/mapbox-gl-js/issues/12391, as Im trying to manually fix the extraneous empty space issue via setting max bounds.