website/templates/shortcodes/map.html
Pascal Engélibert c9f851fa77
Carte: prestas
2023-04-27 23:51:20 +02:00

21 lines
704 B
HTML

<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);
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) {
var popup = '<strong>'+places[i][1]+'</strong>';
for(j in places[i][2]) {
popup += '<br/>'+places[i][2][j][0]+'&nbsp;: <a href="mailto:'+places[i][2][j][1]+'">'+places[i][2][j][1]+'</a>';
}
L.marker(places[i][0]).addTo(map)
.bindPopup(popup);
}
</script>