diff --git a/html/static/js/map-multipoint.js b/html/static/js/map-multipoint.js
index 4b76d4af..6c993a03 100644
--- a/html/static/js/map-multipoint.js
+++ b/html/static/js/map-multipoint.js
@@ -193,6 +193,9 @@ class MapMultipoint extends HTMLElement {
on(a, b) {
return this._map.on(a, b);
}
+ once(a, b) {
+ return this._map.once(a, b);
+ }
queryRenderedFeatures(a) {
return this._map.queryRenderedFeatures(a);
}
diff --git a/rmo/template/status.html b/rmo/template/status.html
index c4f8f98f..e439104f 100644
--- a/rmo/template/status.html
+++ b/rmo/template/status.html
@@ -107,14 +107,16 @@ function onLoad() {
checkboxNuisance.onclick()
checkboxWater.onclick()
});
- map.on('render', () => {
+ function _updateReports() {
const nuisances = map.queryRenderedFeatures({target: {layerId: 'nuisance'}});
const pools = map.queryRenderedFeatures({target: {layerId: 'pool'}});
const uniqueFeatures = getUniqueFeatures(nuisances, pools, 'public_id');
// Populate features for the listing overlay.
renderReports(uniqueFeatures);
- });
+ }
+ map.once("idle", _updateReports);
+ map.on('moveend', _updateReports);
getGeolocation({
enableHighAccuracy: true,
timeout: 10000,