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

map.fitBounds(...) behaves differently in v 1.9.0 #9477

Closed
waissbluth opened this issue Mar 29, 2020 · 2 comments · Fixed by #9480
Closed

map.fitBounds(...) behaves differently in v 1.9.0 #9477

waissbluth opened this issue Mar 29, 2020 · 2 comments · Fixed by #9480
Assignees
Labels

Comments

@waissbluth
Copy link

waissbluth commented Mar 29, 2020

mapbox-gl-js version: 1.9.0

browser: Chrome 80.0

Steps to Trigger Behavior

  1. Call map.fitBounds(bbox, { padding: { top: 200, left: 0, right: 0, bottom: 0 })

Link to Demonstration

v 1.9.0: https://jsfiddle.net/Lozwbnq5/2/
v 1.8.1: https://jsfiddle.net/pd6o2Ljc/2/

Expected Behavior

Both should behave the same; the behavior in v 1.8.1 seems more proper.

Actual Behavior

In version 1.9.0, the bounds from the top seem to be double (400px).

I believe this issue was introduced in #8638

@arindam1993
Copy link
Contributor

Yep, I think I know where this is coming from!

@arindam1993
Copy link
Contributor

Thanks for the detailed bugreport! fix has been merged and is going out in the 1.9.1 release.

rlue added a commit to rlue/sdaqs-sada that referenced this issue Jun 7, 2020
Version 1.8.0 of mapboxgl-js does not support a "padding" option
for the .flyTo() function.

Newer versions (up to 1.11.0-beta.1 as of this writing) fix this,
but come with a strange bug:
padding works perfectly initially,
but once a base has been selected for the first deployment,
all subsequent flyTo/fitBounds calls are off-center.

(My suspicion is that it's related to mapbox-gl-js #9477,[0]
in which padding is applied twice...?)

[0]: mapbox/mapbox-gl-js#9477
rlue added a commit to rlue/sdaqs-sada that referenced this issue Jun 12, 2020
Version 1.8.0 of mapboxgl-js does not support a "padding" option
for the .flyTo() function.

Newer versions (up to 1.11.0-beta.1 as of this writing) fix this,
but come with a strange bug:
padding works perfectly initially,
but once a base has been selected for the first deployment,
all subsequent flyTo/fitBounds calls are off-center.

(My suspicion is that it's related to mapbox-gl-js #9477,[0]
in which padding is applied twice...?)

[0]: mapbox/mapbox-gl-js#9477
rlue added a commit to rlue/sdaqs-sada that referenced this issue Nov 6, 2020
Version 1.8.0 of mapboxgl-js does not support a "padding" option
for the .flyTo() function.

Newer versions (up to 1.11.0-beta.1 as of this writing) fix this,
but come with a strange bug:
padding works perfectly initially,
but once a base has been selected for the first deployment,
all subsequent flyTo/fitBounds calls are off-center.

(My suspicion is that it's related to mapbox-gl-js #9477,[0]
in which padding is applied twice...?)

[0]: mapbox/mapbox-gl-js#9477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants