1 {% extends "2022/base.html" %}
5 {% block global-content %}
7 <div id="references-map"></div>
13 <link rel="stylesheet" type="text/css" media="all" href="{% static 'contrib/leaflet-1.9.4/leaflet.css' %}">
14 <link rel="stylesheet" type="text/css" media="all" href="{% static 'contrib/leaflet.markercluster-1.4.1/MarkerCluster.css' %}">
15 <link rel="stylesheet" type="text/css" media="all" href="{% static 'contrib/leaflet.markercluster-1.4.1/MarkerCluster.Default.css' %}">
20 <script src="{% static 'contrib/leaflet-1.9.4/leaflet.js' %}"></script>
21 <script src="{% static 'contrib/leaflet.markercluster-1.4.1/leaflet.markercluster.js' %}"></script>
23 var map = L.map('references-map').setView([52, 20], 7);
25 if (navigator.geolocation) {
26 navigator.geolocation.getCurrentPosition(function(position) {
28 [position.coords.latitude, position.coords.longitude], 8,
36 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
37 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
39 var markers = L.markerClusterGroup();
41 function showMarker(m) {
43 '/mapa/popup/' + m.target.options.mid,
45 let p = L.popup({minWidth: 340}).setLatLng(m.latlng).setContent(data);
52 {% for e in entities %}
54 [{{ e.lat }}, {{ e.lon }}],
56 title: "{{ e.label }}",
60 ).on('click', showMarker).addTo(markers);
64 map.addLayer(markers);