Show geojson on map

This commit is contained in:
Edward Betts 2021-05-08 13:14:30 +02:00
parent 49fa050b89
commit 6ac18907b2

View file

@ -1,7 +1,5 @@
'use strict'; 'use strict';
// Create a map
var options = {}; var options = {};
if (start_lat || start_lng) { if (start_lat || start_lng) {
start_lat = start_lat.toFixed(5); start_lat = start_lat.toFixed(5);
@ -351,6 +349,14 @@ function load_wikidata_items() {
</p>` </p>`
marker.bindPopup(popup); marker.bindPopup(popup);
marker.addTo(group); 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; osm_loaded = true;