|
|
@@ -251,27 +251,32 @@ $(document).ready(function(){
|
|
|
showMap(mapDiv, false);
|
|
|
|
|
|
let greySquareIcon = L.divIcon({
|
|
|
- html: '<svg style="width:5px;height:5px;fill:#808080" width="512px" height="512px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><title>ionicons-v5-q</title><path d="M416,464H96a48.05,48.05,0,0,1-48-48V96A48.05,48.05,0,0,1,96,48H416a48.05,48.05,0,0,1,48,48V416A48.05,48.05,0,0,1,416,464Z"/></svg>',
|
|
|
+ html: '<svg style="width:5px;height:5px;fill:#808080" width="512px" height="512px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M416,464H96a48.05,48.05,0,0,1-48-48V96A48.05,48.05,0,0,1,96,48H416a48.05,48.05,0,0,1,48,48V416A48.05,48.05,0,0,1,416,464Z"/></svg>',
|
|
|
className: "",
|
|
|
iconSize: [5, 5],
|
|
|
iconAnchor: [0, 10],
|
|
|
});
|
|
|
|
|
|
+ var clusters = L.markerClusterGroup();
|
|
|
+
|
|
|
let allStructures = mapDiv.data('all-structures') ?? [];
|
|
|
allStructures.forEach(function (item) {
|
|
|
- L.marker([item.lat, item.long], { icon: greySquareIcon, zIndexOffset: -1 }).addTo(map);
|
|
|
+ // L.marker([item.lat, item.long], { icon: greySquareIcon, zIndexOffset: -1 }).addTo(map);
|
|
|
+ clusters.addLayer(L.marker([item.lat, item.long], { icon: greySquareIcon, zIndexOffset: -1 }))
|
|
|
});
|
|
|
+ map.addLayer(clusters);
|
|
|
|
|
|
- let orangeSquareIcon = L.divIcon({
|
|
|
- html: '<svg style="width:8px;height:8px;fill:#e4611b" width="512px" height="512px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><title>ionicons-v5-q</title><path d="M416,464H96a48.05,48.05,0,0,1-48-48V96A48.05,48.05,0,0,1,96,48H416a48.05,48.05,0,0,1,48,48V416A48.05,48.05,0,0,1,416,464Z"/></svg>',
|
|
|
- className: "",
|
|
|
- iconSize: [8, 8],
|
|
|
- iconAnchor: [0, 16],
|
|
|
- });
|
|
|
+ // let orangeSquareIcon = L.divIcon({
|
|
|
+ // html: '<svg style="width:8px;height:8px;fill:#e4611b" width="512px" height="512px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><title>ionicons-v5-q</title><path d="M416,464H96a48.05,48.05,0,0,1-48-48V96A48.05,48.05,0,0,1,96,48H416a48.05,48.05,0,0,1,48,48V416A48.05,48.05,0,0,1,416,464Z"/></svg>',
|
|
|
+ // className: "",
|
|
|
+ // iconSize: [8, 8],
|
|
|
+ // iconAnchor: [0, 16],
|
|
|
+ // });
|
|
|
|
|
|
let selectedStructures = mapDiv.data('selected-structures') ?? [];
|
|
|
selectedStructures.forEach(function (item) {
|
|
|
- L.marker([item.lat, item.long], { icon: orangeSquareIcon }).addTo(map);
|
|
|
+ L.marker([item.lat, item.long]).addTo(map);
|
|
|
+ // L.marker([item.lat, item.long], { icon: orangeSquareIcon }).addTo(map);
|
|
|
});
|
|
|
}
|
|
|
|