Skip to content

Commit

Permalink
Merge pull request #734 from Lernwerkstatt/leaflet-map-fix
Browse files Browse the repository at this point in the history
Update mapbox implementation
  • Loading branch information
danielstreif authored Apr 25, 2024
2 parents c4e4e1f + 44c6072 commit 865f66e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions static/js/map.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const mymap = L.map("mapid").setView([52.49065, 13.44831], 16);

L.tileLayer(
"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}",
"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",
{
attribution:
'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
'© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>',
tileSize: 512,
maxZoom: 18,
id: "mapbox.streets",
zoomOffset: -1,
id: "mapbox/streets-v12",
accessToken:
"pk.eyJ1Ijoic3Rhcm1hZXJrZXIiLCJhIjoiY2pqZjZhNDE1MGEyMTN2cXN2cHYyM3J1OCJ9.BhLnttNctRll0LVyaWqu2g"
"pk.eyJ1IjoibGVybndlcmtzdGF0dCIsImEiOiJjbHZlZTV4aGYwODB0MmlwcjZobTNvdXh0In0.eAgHJ3c0Yl5XahdyJQWcYQ",
}
).addTo(mymap);

const marker = L.marker([52.49065, 13.44831], {
title: "Die Lernwerkstatt",
alt: "Die Lernwerkstatt"
alt: "Die Lernwerkstatt",
}).addTo(mymap);
marker.bindPopup("<b>Hallo!</b><br>Besuch uns mal!").openPopup();

0 comments on commit 865f66e

Please sign in to comment.