From b18162fb1a7d351eb7724826ff8d892e3bb3c8a2 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 22 Oct 2021 12:06:10 +0100 Subject: [PATCH] Track which map bounds are already done --- frontend/App.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/App.vue b/frontend/App.vue index 1dc17df..d36ba13 100644 --- a/frontend/App.vue +++ b/frontend/App.vue @@ -1473,6 +1473,13 @@ export default { } }, load_wikidata_items(bounds) { + bounds ||= this.map.getBounds(); + var this_update = this.map_update_number += 1; + + for(const b of this.bounds_done) { + if (b.contains(bounds)) return; // already done + } + this.load_button_pressed = true; this.wikidata_loaded = false; this.osm_loaded = false; @@ -1607,6 +1614,8 @@ export default { if (!item.wikidata) missing_qids.push(qid); } + this.bounds_done.push(this.map.getBounds()); + if (missing_qids.length == 0) { this.update_wikidata(); this.check_for_missing_done = true;