You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I was trying to work around issue #9641 by using map.easeTo() instead of map.fitBounds(), I encountered that easeTo applies an additional padding if fitBounds was already called with a padding from the same side. I was expecting easeTo to respect the original padding that was passed to fitBounds, but that does not seem to be the case.
Hi @waissbluth , I agree that this is confusing, but FWIW its actually intended behaviour and a sideffect of introducing two different concepts with the same name. Theres a lot more context in #4268 and #8638 but I'll provide short summary here.
In your case the first call to fitBounds is updating the zoom and center to account for padding, and then you add additional fov based padding on top with the call to easeTo.
Hello,
As I was trying to work around issue #9641 by using
map.easeTo()
instead ofmap.fitBounds()
, I encountered that easeTo applies an additional padding if fitBounds was already called with a padding from the same side. I was expecting easeTo to respect the original padding that was passed to fitBounds, but that does not seem to be the case.mapbox-gl-js version: v.10.0
browser: Chome for Mac 81.0.4044.113
Steps to Trigger Behavior
map.fitBounds(bbox, {padding: {top: 100})
map.easeTo({padding: {top: 100, left: 100})
Link to Demonstration
https://jsfiddle.net/xqc2br59/
Expected Behavior
To have the bounding box be centered on the screen with 100px at the top.
Actual Behavior
The bounding box has a 200px padding at the top.
The text was updated successfully, but these errors were encountered: