mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

map.flyTo({ center: someCenter, padding: somePadding }) ignores padding

Open leap95 opened this issue 1 year ago • 3 comments

mapbox-gl-js version: v3.2.0 (works in v3.1.0)

browser: Mozilla Firefox v124.0.2 (also tested it in Chrome v124.0.6367.61, doesn't work either)

Steps to Trigger Behavior

  1. Create map
  2. map.flyTo({ center: someCenter, padding: somePadding });
  3. profit ????

Link to Demonstration

https://jsbin.com/nefawexopu/edit?html,console,output Apparently, there is an error sometimes. The behaviour I experience on browser is this one. The red line is the center, the Golden Gate Bridge should be off center by 1000px.

Expected Behavior

I expected there to be padding. This pull request explains the expected behaviour.

Actual Behavior

There was no padding.

In all versions before v3.2.0 (since v1.9.0) I tested, there is padding, an offset to the center so that maps partly hidden behind some content for example don't also hide the important content of the map.

leap95 avatar Apr 17 '24 10:04 leap95

Im also getting this bug with the new version, any updates on this?

ricardoweiss avatar Apr 19 '24 08:04 ricardoweiss

I just downgraded to v3.1.2 for the time being.

leap95 avatar Apr 22 '24 11:04 leap95

Thanks for the reports, everyone, investigating... Related to our attempt to fix #11831.

mourner avatar Apr 23 '24 08:04 mourner

Hey everyone! This will be fixed in the upcoming GL JS v3.4.0

stepankuzmin avatar May 14 '24 13:05 stepankuzmin

Hey all! Please update the latest GL JS v3.4.0. I'll close this issue, but feel free to reopen if there are any questions.

stepankuzmin avatar May 27 '24 09:05 stepankuzmin