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