-
-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stale tiles being shown when calling VectorTileSource#setTiles while the map is moving #913
Conversation
…ile the map is moving
Bundle size report: Size Change: +5 B
ℹ️ View Details
|
Besides the comment above I think this looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! With the latest commit it lgtm.
No problem! 😄 |
@vanilla-lake I'm running the benchmark and i see the following error in the console: |
I think I saw a similar error message with the headless version |
I see this sourceCaches error as well on the commit before this (c8e8345), and I see it immediately when going to the workertransfer test |
The issue is indeed related to the changes in this PR. Sorry about that... I created PR #984 which should hopefully resolve the issue. |
@vanilla-lake the issue is also reproducible in "real world" if you destroy the map instance during JSON request. UPDATE: How deep does the rabbit hole go? (c) |
Thanks for the fix @khmm12! Your fix seems correct, since calling This error could happen anytime there is a vector tile source and |
Fix stale tiles being shown when calling VectorTileSource#setTiles while the map is moving
Before this PR, when calling
VectorTileSource#setTiles
, the source cache was cleared before the TileJSON was reloaded asynchronously. If the map was moving whileVectorTileSource#setTiles
was called, it was possible for the cache to be repopulated with the old tiles ifVectorTileSource#loadTile
happened to be called before the TileJSON had been reloaded. This was due to theVectorTileSource#tiles
property, which is used byVectorTileSource#loadTile
, only being updated asynchronously after the TileJSON had reloaded.Launch Checklist
maplibre-gl-js
changelog:<changelog></changelog>
.