Don't constantly redraw the report rows

Because it's wasteful and interrupts my click handlers.
This commit is contained in:
Eli Ribble 2026-02-05 01:22:47 +00:00
parent 3cdad6fd77
commit d58a893651
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

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

View file

@ -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,