From f1c7378fbfa61bfa87c588bd83b83627c5942582 Mon Sep 17 00:00:00 2001 From: Reuben Dowle Date: Wed, 16 Aug 2023 22:56:38 +1200 Subject: [PATCH] Places: Fix markers not updating correctly (#3636) --- frontend/src/page/places.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/page/places.vue b/frontend/src/page/places.vue index f59ae16ab..7012f99ee 100644 --- a/frontend/src/page/places.vue +++ b/frontend/src/page/places.vue @@ -635,7 +635,14 @@ export default { } }); - this.map.on('idle', this.updateMarkers); + // Following example for cluster updates from here: https://maplibre.org/maplibre-gl-js/docs/examples/cluster-html/ + this.map.on('data', (e) => { + if (e.sourceId !== 'photos' || !e.isSourceLoaded) return; + + this.map.on('move', this.updateMarkers); + this.map.on('moveend', this.updateMarkers); + this.updateMarkers(); + }); this.search(); },