maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.67k stars 716 forks source link

Globe with/without terrain can zoom too far out #4990

Open birkskyum opened 1 week ago

birkskyum commented 1 week ago

A globe with terrain will by default allow zooming to negative zoom levels, resulting in some undefined behavior.

The globe will show artifacts, and then jump back to the minZoom. There should be a hard limit on how far a user is allowed to zoom out.

https://github.com/user-attachments/assets/7f757c47-5620-4b5a-885b-f2c70d577b6f

Screenshot 2024-11-04 at 22 26 46

Repro:

birkskyum commented 5 days ago

When disabling terrain, and scroll zooming out it has a bounce to it, so here a better zoom constraint would help too

https://github.com/user-attachments/assets/c1088bb6-4fe7-476b-855e-5aa9923e59c6