maplibre / maplibre-gl-js

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

Raster layer doesn't smoothly transition between zoom levels if the tiles are already loaded #4987

Open kubapelc opened 1 week ago

kubapelc commented 1 week ago

maplibre-gl-js version: v5.0.0-pre.5

browser: Firefox 128.4.0esr (win)

Steps to Trigger Behavior

  1. Open any raster map
  2. Zoom in at least one zoom level: observe that the transition to the more detailed tiles is smooth
  3. Zoom back out: the transition is now abrupt. Same with zooming back in.

Demo

Video demo: https://github.com/user-attachments/assets/3144ae09-cf91-4a69-a951-e86f239c1f21

Expected Behavior

Transitions between tile detail levels are always smooth.

Actual Behavior

Whether the transition is smooth depends on whether the tiles were already loaded or not.

HarelM commented 1 week ago

What is the first version you see this issue? There was a cancel pending tiles loading flag that was added not long ago...

kubapelc commented 1 week ago

What is the first version you see this issue?

I've checked several versions and it happens as far back as 1.14.0. My guess is that smooth transition between already loaded zoom levels was never implemented.

I think it would make sense to have this feature, as it would make using MapLibre with traditional raster maps that have labels baked into the tile images much more pleasant.