Update footer.php

pull/3108/head
Peter Goodhall 2024-05-16 15:36:50 +01:00
rodzic 0335d42c1c
commit 4182b67471
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -838,20 +838,20 @@ if ($this->session->userdata('user_id') != null) {
var map = L.map('map').setView([q_lat, q_lng], q_zoom); var dashmap = L.map('map').setView([q_lat, q_lng], q_zoom);
var osm = new L.tileLayer(osmUrl, {minZoom: 1, maxZoom: 12, var osm = new L.tileLayer(osmUrl, {minZoom: 1, maxZoom: 12,
attribution: osmCopyright attribution: osmCopyright
}).addTo(map); }).addTo(dashmap);
map.addLayer(osm); dashmap.addLayer(osm);
var printer = L.easyPrint({ var printer = L.easyPrint({
sizeModes: ['Current'], sizeModes: ['Current'],
filename: 'myMap', filename: 'myMap',
exportOnly: true, exportOnly: true,
hideControlContainer: true hideControlContainer: true
}).addTo(map); }).addTo(dashmap);
var markers = {}; var markers = {};
@ -866,13 +866,13 @@ if ($this->session->userdata('user_id') != null) {
if (!markers[key]) { if (!markers[key]) {
L.marker([marker.lat, marker.lng], { L.marker([marker.lat, marker.lng], {
icon: redIconImg icon: redIconImg
}).addTo(map) }).addTo(dashmap)
.bindPopup(marker.html); .bindPopup(marker.html);
} }
}); });
Object.keys(markers).forEach(key => { Object.keys(markers).forEach(key => {
if (!newMarkers[key]) { if (!newMarkers[key]) {
map.removeLayer(markers[key]); dashmap.removeLayer(markers[key]);
} }
}); });
markers = newMarkers; markers = newMarkers;
@ -882,6 +882,7 @@ if ($this->session->userdata('user_id') != null) {
loadMarkers(); loadMarkers();
setInterval(loadMarkers, 5000); setInterval(loadMarkers, 5000);
var layerControl = new L.Control.Layers(null, { 'Gridsquares': maidenhead = L.maidenhead() }).addTo(dashmap);
}); });
</script> </script>
<?php } ?> <?php } ?>