website/templates/shortcodes/map.html

22 lines
659 B
HTML
Raw Permalink Normal View History

2023-04-26 11:24:49 +02:00
<div id="map" class="nn"></div>
<script type="text/javascript" src="/vendor/leaflet/leaflet.js"></script>
<script type="text/javascript">
var map = L.map('map').setView([46.725, 2.834], 6);
2023-07-10 09:23:58 +02:00
map.scrollWheelZoom.disable();
2023-04-26 11:24:49 +02:00
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 10,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
var places = [
{{body|safe}}
];
for(i in places) {
2023-04-27 23:51:20 +02:00
var popup = '<strong>'+places[i][1]+'</strong>';
for(j in places[i][2]) {
2023-04-29 00:28:54 +02:00
popup += '<br/>'+places[i][2][j][0];
2023-04-27 23:51:20 +02:00
}
L.marker(places[i][0]).addTo(map)
.bindPopup(popup);
2023-04-26 11:24:49 +02:00
}
</script>