From e67cb131a9891d94c76de963fc2e0ceb173b88c6 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 11 May 2021 10:04:32 +0200 Subject: [PATCH] Show item street address in popup --- static/js/map.js | 3 +++ web_view.py | 1 + 2 files changed, 4 insertions(+) diff --git a/static/js/map.js b/static/js/map.js index d3c34c1..a75f43c 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -283,6 +283,9 @@ function add_wikidata_marker(item, marker_data) { if (item.image_list && item.image_list.length) { popup += `
`; } + if (item.street_address && item.street_address.length) { + popup += `
street address: ${item.street_address[0]["text"]}`; + } popup += "

"; marker.bindPopup(popup); var group = add_to_feature_group(item.qid, marker); diff --git a/web_view.py b/web_view.py index 6819dc5..8fdcd96 100755 --- a/web_view.py +++ b/web_view.py @@ -152,6 +152,7 @@ def get_markers(all_items): "description": item.description(), "markers": locations, "image_list": image_filenames, + "street_address": item.get_claim("P6375"), "isa_list": [v["id"] for v in item.get_claim("P31")], } items.append(item)