-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow each edge to have different padding when fitting to bounds #1339
Comments
Added in #1675. |
Any chance of this happening? |
This is blocking us from using MapBox GL. I submitted #3876 to resolve another blocker :) |
@benjamintd @mohsen1 picking this up today -- I'll see what we can do! |
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. |
Camera.prototype.fitBounds()
acceptspadding
andoffset
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
andoffset
: you don’t want any padding to be added in the horizontal direction.The text was updated successfully, but these errors were encountered: