Skip to content

On idle remove duplicate cluster marker after zooming - #3598

Open
Ekhorn wants to merge 1 commit into
mainfrom
fix/duplicate-cluster-marker
Open

Ekhorn wants to merge 1 commit into
mainfrom
fix/duplicate-cluster-marker

Conversation

@Ekhorn

@Ekhorn Ekhorn commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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 querySourceFeatures returns their features too, so the same assets come back clustered at two zoom levels with different cluster_ids. The source already counts as loaded once the last ideal tile arrives, before the placeholders are removed on the next frame, and nothing AssetMap listens 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

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

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.
@Ekhorn
Ekhorn requested a review from a team November 20, 2026 10:17
@Ekhorn Ekhorn self-assigned this Nov 20, 2026
@sonarqubecloud

Copy link
Copy Markdown

@Ekhorn Ekhorn changed the title Fix duplicate cluster marker after zooming the map On idle remove duplicate cluster marker after zooming Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant