1 {% extends "2022/base.html" %}
6 <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
7 integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
9 <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
10 integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
11 crossorigin=""></script>
13 <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css">
14 <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css">
15 <script src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"></script>
17 .leaflet-popup-content h2 {
33 {% block global-content %}
35 <div id="map" style="height: calc(100vh - 68px"></div>
42 var map = L.map('map').setView([51.505, -0.09], 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();
49 function showMarker(m) {
51 '/pinezki/popup/' + m.target.options.mid,
54 n = Math.min(3, ($('a', d).length));
56 let p = L.popup({minWidth: w}).setLatLng(m.latlng).setContent(data);
64 {% for e in entities %}
66 [{{ e.lat }}, {{ e.lon }}],
68 title: "{{ e.label }}",
72 ).on('click', showMarker).addTo(markers);
76 map.addLayer(markers);