Don't constantly redraw the report rows
Because it's wasteful and interrupts my click handlers.
This commit is contained in:
parent
3cdad6fd77
commit
d58a893651
2 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue