Cluster options + images
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user