From 6ac18907b21ffbe71f7d9818ceb85854e5b7912d Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 8 May 2021 13:14:30 +0200 Subject: [PATCH] Show geojson on map --- static/js/map.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/map.js b/static/js/map.js index 7516b7a..4628bc3 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -1,7 +1,5 @@ 'use strict'; -// Create a map - var options = {}; if (start_lat || start_lng) { start_lat = start_lat.toFixed(5); @@ -351,6 +349,14 @@ function load_wikidata_items() {

` marker.bindPopup(popup); marker.addTo(group); + + if (osm.type != 'node' && osm.geojson) { + var mapStyle = {fillOpacity: 0}; + var geojson = L.geoJSON(null, {style: mapStyle}); + geojson.addTo(map); + geojson.addData(osm.geojson); + console.log(osm.geojson); + } }); osm_loaded = true;