Update footer.php

这个提交包含在:
Peter Goodhall 2024-05-19 17:50:10 +01:00
父节点 109e76f197
当前提交 1cf2b3cd41

查看文件

@ -836,22 +836,27 @@ if ($this->session->userdata('user_id') != null) {
var ShowGrid = "No"; var ShowGrid = "No";
<?php } ?> <?php } ?>
var layer = L.tileLayer(osmUrl, {
maxZoom: 18,
attribution: osmCopyright,
});
var map = L.map('map', {
layers: [layer],
center: [q_lat, q_lng],
zoom: q_zoom,
fullscreenControl: true,
fullscreenControlOptions: {
position: 'topleft'
},
});
var dashmap = L.map('map').setView([q_lat, q_lng], q_zoom); /*var printer = L.easyPrint({
var osm = new L.tileLayer(osmUrl, {minZoom: 1, maxZoom: 12,
attribution: osmCopyright
}).addTo(dashmap);
dashmap.addLayer(osm);
var printer = L.easyPrint({
sizeModes: ['Current'], sizeModes: ['Current'],
filename: 'myMap', filename: 'myMap',
exportOnly: true, exportOnly: true,
hideControlContainer: true hideControlContainer: true
}).addTo(dashmap); }).addTo(map);*/
var markers = {}; var markers = {};
@ -866,13 +871,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(dashmap) }).addTo(map)
.bindPopup(marker.html); .bindPopup(marker.html);
} }
}); });
Object.keys(markers).forEach(key => { Object.keys(markers).forEach(key => {
if (!newMarkers[key]) { if (!newMarkers[key]) {
dashmap.removeLayer(markers[key]); map.removeLayer(markers[key]);
} }
}); });
markers = newMarkers; markers = newMarkers;
@ -882,7 +887,6 @@ 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 } ?>