Places: Fix markers not updating correctly (#3636)

This commit is contained in:
Reuben Dowle 2023-08-16 22:56:38 +12:00 committed by GitHub
parent be0fdc1774
commit f1c7378fbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
},