From d58a893651f17d1694555e22e4d774632d8b0499 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 5 Feb 2026 01:22:47 +0000 Subject: [PATCH] Don't constantly redraw the report rows Because it's wasteful and interrupts my click handlers. --- html/static/js/map-multipoint.js | 3 +++ rmo/template/status.html | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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,