diff options
Diffstat (limited to 'static/js/leaflet-map.js')
-rw-r--r-- | static/js/leaflet-map.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/static/js/leaflet-map.js b/static/js/leaflet-map.js new file mode 100644 index 0000000..1f9e90f --- /dev/null +++ b/static/js/leaflet-map.js @@ -0,0 +1,19 @@ +function initMap() { + var latLong = [50.084750, 8.247026]; // Wiesbaden + + var map = L.map("map").setView(latLong, 5); + + L.tileLayer("https://b.tile.openstreetmap.org/{z}/{x}/{y}.png", { + attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>', + maxZoom: 18, + }).addTo(map); + + var icon = L.icon({ + iconUrl: "images/map-marker.png", + iconSize: [25, 41], + //iconUrl: "images/map-loc.png", + //iconSize: [57, 66], + }); + var marker = L.marker(latLong, { icon: icon }).addTo(map); +} +document.addEventListener("DOMContentLoaded", initMap); |