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
Note how the Map center is able to reach the bounds, and the map displays "empty" area which is desired.
Set max bounds to arbitrary bounds
maxBounds: [
[-360, -62],
[360, 75]
]
The map center is unable to reach the max bounds like before, and no empty area is able to be displayed.
Link to Demonstration
Untitled.mov
Notes
I understand if this behavior is considered somewhat intentional, but I think there needs to be an option that essentially allows adding empty space, and panning beyond the max bounds until a specific camera edge is reached.
for example we could have:
maxBoundsEdges: 'within' | 'centered' | 'contained'
contained: all edges of the camera must be within the max bounds (current behavior except at 90 lat)
centered: the camera center must be within the maxbounds, but edges can go beyond
within: the camera must contain one edge within the maxBounds, but it can pan beyond in all directions.
EX: the left side of the camera can pan up to the right side of the maxBounds and so on.
In all cases, empty space can be displayed when panning outside the bounds.
Note I could not get the global map.setPadding to have any effect on this
Expected Behavior
I expect that when the camera attempts to pan to the maxBounds, the map center is able to reach the max bounds, consistent with when the maxBounds are -90, 90.
The behavior of maxBounds with -90, 90 is a much better user experience.
Actual Behavior
When using a lat that is not -90, 90, the map center is unable to pan to the bound's edges, and no empty space is added beyond the map.
The text was updated successfully, but these errors were encountered:
mapbox-gl-js version:
3.5.1
browser:
Chrome
Steps to Trigger Behavior
Note how the Map center is able to reach the bounds, and the map displays "empty" area which is desired.
The map center is unable to reach the max bounds like before, and no empty area is able to be displayed.
Link to Demonstration
Untitled.mov
Notes
I understand if this behavior is considered somewhat intentional, but I think there needs to be an option that essentially allows adding empty space, and panning beyond the max bounds until a specific camera edge is reached.
for example we could have:
Note I could not get the global
map.setPadding
to have any effect on thisExpected Behavior
I expect that when the camera attempts to pan to the maxBounds, the map center is able to reach the max bounds, consistent with when the maxBounds are -90, 90.
The behavior of maxBounds with -90, 90 is a much better user experience.
Actual Behavior
When using a lat that is not -90, 90, the map center is unable to pan to the bound's edges, and no empty space is added beyond the map.
The text was updated successfully, but these errors were encountered: