Repository navigation
Conversation
When the last tile loaded after a zoom, the markers were refreshed while MapLibre still kept a tile from another zoom level on screen. That tile's cluster stayed next to the new one until the map moved again. The markers are now refreshed again once the map is idle.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This fixes "should display clustered markers" in
ui/app/manager/test/map.test.ts, which failed on slower runs with two cluster markers on screen after zooming in. Users can see the same duplicate, so the fix is in the map rather than the test.When the last tile loaded after a zoom, the markers were refreshed while MapLibre still kept a tile from another zoom level on screen. That tile's cluster stayed next to the new one until the map moved again. The markers are now refreshed again once the map is idle.
Likely cause: while zoom tiles load, MapLibre keeps the loaded tiles of other zoom levels on screen as placeholders, and
querySourceFeaturesreturns their features too, so the same assets come back clustered at two zoom levels with differentcluster_ids. The source already counts as loaded once the last ideal tile arrives, before the placeholders are removed on the next frame, and nothingAssetMaplistens to fires after that frame. It only shows when that tile arrives after the zoom has finished, for example on a slow connection or device.Checklist