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
{{ message }}
Repository navigation
Allow each edge to have different padding when fitting to bounds #1339
Camera.prototype.fitBounds() accepts padding and offset options for adding slop area (in pixels) around the fitted bounds. In mapbox/mapbox-gl-native#1783, I’m instead allowing each side of the bounds to have a different padding amount. It would be great to have this in gl-js as well.
Independent edge padding is necessary on iOS, because it’s customary to include about 32 points of top padding to make room for a translucent top bar overlay. In gl-js, it isn’t possible to express this behavior with a combination of padding and offset: you don’t want any padding to be added in the horizontal direction.
Activity
jfirebaugh commentedon Dec 4, 2015
Added in #1675.
benmcginnis commentedon Dec 29, 2016
Any chance of this happening?
mohsen1 commentedon Dec 31, 2016
This is blocking us from using MapBox GL. I submitted #3876 to resolve another blocker :)
mollymerp commentedon Jan 3, 2017
@benjamintd @mohsen1 picking this up today -- I'll see what we can do!
andrewharvey commentedon Feb 9, 2017
https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/ is a good example of how it could be used. So that the fitBounds for the route ensure that the route fills the space to the right of the controls/instructions.