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 {
34 {% block global-content %}
36 <div id="map" style="height: calc(100vh - 68px"></div>
43 var map = L.map('map').setView([51.505, -0.09], 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();
50 function showMarker(m) {
52 '/pinezki/popup/' + m.target.options.mid,
55 n = Math.min(3, ($('a', d).length));
57 let p = L.popup({minWidth: w}).setLatLng(m.latlng).setContent(data);
65 {% for e in entities %}
67 [{{ e.lat }}, {{ e.lon }}],
69 title: "{{ e.label }}",
73 ).on('click', showMarker).addTo(markers);
77 map.addLayer(markers);