Add prehistoric sites
This commit is contained in:
@@ -135,12 +135,14 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) {
|
||||
let markersGroup = await this.sitesMarkers(sitesGroup);
|
||||
let notConservedGroup = await this.notConserved();
|
||||
let findingsGroup = await this.findings();
|
||||
let prehistoric = await this.prehistoric();
|
||||
|
||||
const archeo = {
|
||||
'Beni archeologici (punti)' : markersGroup,
|
||||
'Beni archeologici (strutture)' : sitesGroup,
|
||||
'Beni non conservati' : notConservedGroup,
|
||||
'Rinvenimenti' : findingsGroup,
|
||||
'Siti preistorici' : prehistoric,
|
||||
'Vincoli archeologici' : layerVincoli,
|
||||
'Vincoli paesistici' : layerPaesistici,
|
||||
};
|
||||
@@ -151,6 +153,7 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) {
|
||||
sitesGroup.addTo(map);
|
||||
notConservedGroup.addTo(map);
|
||||
findingsGroup.addTo(map);
|
||||
prehistoric.addTo(map);
|
||||
|
||||
L.control.layers(baseMap, archeo).addTo(map);
|
||||
|
||||
@@ -249,6 +252,36 @@ GIS.findings = async function () {
|
||||
|
||||
return findings;
|
||||
}
|
||||
/**
|
||||
* Create group for prehistoric sites
|
||||
*
|
||||
*/
|
||||
GIS.prehistoric = async function () {
|
||||
const geo = await fetch(`${BASE_URL}/geojson/preistorici.geojson`)
|
||||
.then(res => res.json());
|
||||
|
||||
let prehistoric = L.markerClusterGroup(
|
||||
clusterOptions
|
||||
);
|
||||
|
||||
L.geoJSON(geo, {
|
||||
pointToLayer: function(geoJsonPoint, latlng) {
|
||||
prehistoric.addLayer(
|
||||
L.marker(latlng, {
|
||||
icon: Icons.prehistoric
|
||||
}).bindTooltip(geoJsonPoint.properties.denominazione)
|
||||
.bindPopup(`
|
||||
<table class="table is-striped is-size-6 m-2">
|
||||
<tr><th>Denominazione:</th><td>${geoJsonPoint.properties.denominazione}</td></tr>
|
||||
<tr><th>Oggetto:</th><td>${geoJsonPoint.properties.oggetto}</td></tr>
|
||||
</table>
|
||||
`)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return prehistoric;
|
||||
}
|
||||
/*
|
||||
GIS._prepareLayers = async function(layer) {
|
||||
const fromStorage = localStorage.getItem(layer.id);
|
||||
|
||||
@@ -30,6 +30,15 @@ Icons.finding = L.icon(
|
||||
}
|
||||
);
|
||||
|
||||
Icons.prehistoric = L.icon(
|
||||
{
|
||||
iconUrl: 'img/icons/preistorici.png',
|
||||
iconSize: [18, 27],
|
||||
iconAnchor: [10, 24],
|
||||
tooltipAnchor: [0, -22],
|
||||
}
|
||||
);
|
||||
|
||||
Icons.camera = L.divIcon({className: 'fa fa-camera'});
|
||||
|
||||
export default Icons;
|
||||
Reference in New Issue
Block a user