Skip to content
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

Closed
1ec5 opened this issue Jun 25, 2015 · 5 comments · Fixed by #3890
Closed

Allow each edge to have different padding when fitting to bounds #1339

1ec5 opened this issue Jun 25, 2015 · 5 comments · Fixed by #3890

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jun 25, 2015

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.

@jfirebaugh
Copy link
Contributor

Added in #1675.

@benmcginnis
Copy link

Any chance of this happening?

@mohsen1
Copy link

mohsen1 commented Dec 31, 2016

This is blocking us from using MapBox GL. I submitted #3876 to resolve another blocker :)

@mollymerp
Copy link
Contributor

@benjamintd @mohsen1 picking this up today -- I'll see what we can do!

@andrewharvey
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants