1 {% extends "2022/base.html" %}
6 {% block global-content %}
8 <div id="references-map"></div>
14 <link rel="stylesheet" type="text/css" media="all" href="{% static 'contrib/leaflet-1.9.4/leaflet.css' %}">
15 <link rel="stylesheet" type="text/css" media="all" href="{% static 'contrib/leaflet.markercluster-1.4.1/MarkerCluster.css' %}">
16 <link rel="stylesheet" type="text/css" media="all" href="{% static 'contrib/leaflet.markercluster-1.4.1/MarkerCluster.Default.css' %}">
17 <meta property="og:type" content="website">
18 <meta property="og:title" content="Wakacje z Wolnymi Lekturami">
19 <meta property="og:image" content="{% static 'references/preview.png' %}">
20 <meta property="og:image:alt" content="Mapa miejsc w książkach na Wolnych Lekturach">
21 <meta property="og:image:width" content="1200">
22 <meta property="og:image:height" content="630">
28 <script src="{% static 'contrib/leaflet-1.9.4/leaflet.js' %}"></script>
29 <script src="{% static 'contrib/leaflet.markercluster-1.4.1/leaflet.markercluster.js' %}"></script>
31 var map = L.map('references-map').setView([52, 20], 7);
32 L.Icon.Default.imagePath='{{ STATIC_URL }}contrib/leaflet-1.9.4/images/'
34 if (navigator.geolocation) {
35 navigator.geolocation.getCurrentPosition(function(position) {
37 [position.coords.latitude, position.coords.longitude], 8,
45 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
46 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
48 var markers = L.markerClusterGroup();
50 function showMarker(m) {
52 '/mapa/popup/' + m.target.options.mid,
54 let p = L.popup({minWidth: 340}).setLatLng(m.latlng).setContent(data);
60 {% cache 60 references-map %}
62 {% for e in entities %}
64 [{{ e.lat }}, {{ e.lon }}],
66 title: "{{ e.label }}",
70 ).on('click', showMarker).addTo(markers);
75 map.addLayer(markers);