diff --git a/map.js b/map.js new file mode 100644 index 0000000..3987a38 --- /dev/null +++ b/map.js @@ -0,0 +1,19 @@ +var mymap = L.map("mymap").setView([38.89305796,139.81933145], 15); +L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: + '© OpenStreetMap contributors' +}).addTo(mymap); + +L.geoJson(sample_json, { + style: function (feature) { + return feature.properties; + }, + onEachFeature: function(j, layer) { + let p = j.properties; + if (p) { + let name = p.name, desc = p.description; + let popup = "

" + name + "

" + "

" + desc + "

"; + layer.bindPopup(popup); + } + } +}).addTo(mymap);