From 31a731c1b8c8296eff82add9b3f58cbdf6bbebeb Mon Sep 17 00:00:00 2001 From: mcbloch Date: Sat, 6 Apr 2019 19:05:41 +0200 Subject: [PATCH 1/2] do not query osm for 'None' locations --- app/templates/maps.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/templates/maps.html b/app/templates/maps.html index da45976..88077fe 100644 --- a/app/templates/maps.html +++ b/app/templates/maps.html @@ -23,13 +23,16 @@ let locations = []; let loc = {}; - {% for loc in locations -%} +{% for loc in locations -%} + {% if loc.address %} loc = { "address": "{{loc.address}}", "name": "{{loc.name}}" }; - locations.push(loc); - {%- endfor %} + locations.push(loc); + + {% endif %} +{%- endfor %} loadmap(locations); From dd3fe26b866a02d6c2af26399b742d219c226cd2 Mon Sep 17 00:00:00 2001 From: mcbloch Date: Sat, 6 Apr 2019 19:31:04 +0200 Subject: [PATCH 2/2] add anchor so the marker points to the correct location --- app/static/js/map.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/static/js/map.js b/app/static/js/map.js index 45a198f..db2126e 100644 --- a/app/static/js/map.js +++ b/app/static/js/map.js @@ -27,7 +27,8 @@ function performRequest(url, location, success_callback) { let marker_icon = L.icon({ iconUrl: "/static/images/marker-icon.png", - shadowUrl: "/static/images/marker-shadow.png" + shadowUrl: "/static/images/marker-shadow.png", + iconAnchor: [12, 41] }); let callback = function OSMCallBack(location, data) {