larsmaxfield / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in WebGL2
https://maplibre.org/maplibre-gl-js/docs/
Other
0 stars 0 forks source link

[Feature] With renderWorldCopies=False, allow "underzooming" to show entire map on non-square viewports #20

Open larsmaxfield opened 1 month ago

larsmaxfield commented 1 month ago

Currently if renderWorldCopies = False and the viewport is not square, the map does not zoom out enough to show the entire map, instead stopping when the map's bounds are reached on the left and right sides (with a wide viewport) or the top and bottom sides (with a tall viewport). This appears to be the expected behavior because this keeps only the map in view, and not the empty area(s) around the map.

image

However, this can be annoying in certain cases when a user zooms out with the expectation that they can see the whole map, only to be stopped prematurely.

An option could be added to allow for this "underzooming" of a non-world-copies map where the area around the map is simply transparent/black.

larsmaxfield commented 1 month ago

Look into how the current zoom-out logic is applied with renderWorldCopies = True, because there it is also used to limit underzooming.

image