From 77c7d520cd7144ff740730350710c015cd33f8cb Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 15 May 2021 14:05:21 +0200 Subject: [PATCH] WIP --- static/js/map.js | 8 ++++++-- web_view.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/map.js b/static/js/map.js index b5df921..485f8f1 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -146,7 +146,12 @@ function update_wikidata(check_for_missing = true) { } if (missing_qids.length) { - var params = { qids: missing_qids.join(",") }; + var c = map.getCenter(); + var params = { + qids: missing_qids.join(","), + lat: c.lat.toFixed(5), + lon: c.lng.toFixed(5), + }; axios.get(missing_url, { params: params }).then((response) => { response.data.isa_count.forEach((isa) => { isa_labels[isa.qid] = isa.label; @@ -437,7 +442,6 @@ function open_detail(qid) { var item_osm_candidates_url = `/api/1/item/${qid}/candidates`; var bounds = map.getBounds(); - var params = { bounds: bounds.toBBoxString() }; axios diff --git a/web_view.py b/web_view.py index 40d85f8..7418b02 100755 --- a/web_view.py +++ b/web_view.py @@ -177,7 +177,7 @@ def get_markers(all_items): "markers": locations, "image_list": image_filenames, "street_address": street_address, - "isa_list": [v["id"] for v in item.get_claim("P31")], + "isa_list": [v["id"] for v in item.get_claim("P31") if v], } items.append(item)