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:title" content="Wakacje z Wolnymi Lekturami">
18 <meta property="og:image" content="{% static 'references/preview.png' %}">
19 <meta property="og:image:alt" content="Mapa miejsc w książkach na Wolnych Lekturach">
20 <meta property="og:image:width" content="1200">
21 <meta property="og:image:height" content="630">
27 <script src="{% static 'contrib/leaflet-1.9.4/leaflet.js' %}"></script>
28 <script src="{% static 'contrib/leaflet.markercluster-1.4.1/leaflet.markercluster.js' %}"></script>
30 var map = L.map('references-map').setView([52, 20], 7);
31 L.Icon.Default.imagePath='{{ STATIC_URL }}contrib/leaflet-1.9.4/images/'
33 if (navigator.geolocation) {
34 navigator.geolocation.getCurrentPosition(function(position) {
36 [position.coords.latitude, position.coords.longitude], 8,
44 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
45 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
47 var markers = L.markerClusterGroup();
49 function showMarker(m) {
51 '/mapa/popup/' + m.target.options.mid,
53 let p = L.popup({minWidth: 340}).setLatLng(m.latlng).setContent(data);
59 {% cache 60 references-map %}
61 {% for e in entities %}
63 [{{ e.lat }}, {{ e.lon }}],
65 title: "{{ e.label }}",
69 ).on('click', showMarker).addTo(markers);
74 map.addLayer(markers);