Replies: 1 comment
-
Thanks for taking the time to open this issue.
This will reload the source and its data. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When updating a vector tile source URL while tiles are still being fetched, MapLibre sometimes continues to display tiles from the old URL mixed with tiles from the new URL, resulting in inconsistent sources and data for the same layer.
Version: 5.6.2
Browsers: Firefox, Chromium, Vivaldi (likely a non-browser specific issue)
Steps to Trigger Behavior
source.tiles = [newTileURL];
Link to Demonstration
https://jsbin.com/duciyoc/edit?output
'Reproduce bug' button loads tile URL 1 (ocean contours), and then very quickly after, sets the tile URL for the existing source to the second one (mountain contours) and zooms in / out on an area where this issue is noticeable. If the issue is not reproduced, re-run the JSbin container and try again - a few times may be necessary.
Here is a video demonstration as well. At the end of the video I demonstrate the bug with my private tile server where the bug is a lot clearer: https://vimeo.com/1109544583
Expected Behavior
HTTP requests for loading tiles are resent to the new tile URL and the map consistently loads the data from the new tile URL on all tiles.
Actual Behavior
HTTP requests are sometimes not sent out again with the updated tile URL, and the map inconsistently shows tiles in the same layer for two different tile URLs. Notice in the screenshot, only an API call with the old URL is made despite having updated the source to use the second tile URL.
I believe this is due to the tiles being in the 'loading' state, since waiting until all tiles are loaded in the viewport and swapping URLs does not reproduce this issue. The last 10 seconds of the video linked above makes this clear with my own dataset.
I have noticed this in my application since I need to serve geometries on the same layer dynamically while the user might still be interacting with the map.
What I've tried
sourceCache.clearTiles();
Beta Was this translation helpful? Give feedback.
All reactions