Cluster options + images

This commit is contained in:
2024-11-30 12:01:15 +01:00
parent 07f8dd9a86
commit 165806ae05
10 changed files with 17 additions and 17 deletions

View File

@@ -60,7 +60,6 @@ const optionsFabbricati = {
fillColor: '#5b5d5f',
fillOpacity: 0.8
};
const MARKER_NAMES = {
sites: {
'gradola' : 'Villa di Gradola',
@@ -75,6 +74,11 @@ const MARKER_NAMES = {
'lopozzo' : 'Località Lo Pozzo',
},
};
const clusterOptions = {
spiderfyOnMaxZoom: false,
showCoverageOnHover: false,
disableClusteringAtZoom: 19,
};
/**
* Capitalize a text string
@@ -159,10 +163,9 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) {
* @returns {L.markerClusterGroup}
*/
GIS.sitesMarkers = async function (sitesGroup) {
let sitesMarkers = L.markerClusterGroup({
showCoverageOnHover: false,
disableClusteringAtZoom: 19,
});
let sitesMarkers = L.markerClusterGroup(
clusterOptions
);
for (let id in MARKER_NAMES.sites) {
let layer = sitesGroup.customGetLayer(id);
@@ -203,10 +206,9 @@ GIS.notConserved = async function () {
let notConserData = await fetch(`${API_URL}/not_conserved`)
.then(data => data.json());
let notConserved = L.markerClusterGroup({
showCoverageOnHover: false,
disableClusteringAtZoom: 19,
});
let notConserved = L.markerClusterGroup(
clusterOptions
);
for (let record of notConserData.records) {
notConserved.addLayer(L.marker(
@@ -230,10 +232,9 @@ GIS.findings = async function () {
let findingsData = await fetch(`${API_URL}/finding`)
.then(data => data.json());
let findings = L.markerClusterGroup({
showCoverageOnHover: false,
disableClusteringAtZoom: 19,
});
let findings = L.markerClusterGroup(
clusterOptions
);
for (let record of findingsData) {
findings.addLayer(L.marker(