diff --git a/webgis/geojson/preistorici.geojson b/webgis/geojson/preistorici.geojson new file mode 100644 index 0000000..8833c42 --- /dev/null +++ b/webgis/geojson/preistorici.geojson @@ -0,0 +1,19 @@ +{ +"type": "FeatureCollection", +"name": "preistorici", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, +"features": [ +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Valletta di Cetrella", "oggetto": "Spargimento di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.229480619506239, 40.549096057236518 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Punta Capocchia", "oggetto": "Spargimento di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.198744713836438, 40.554761782142606 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Punta del Miglio", "oggetto": "Spargimento di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.198699377122848, 40.556721558105025 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Punta Campetiello", "oggetto": "Spargimento di frammenti ceramici e industria litica" }, "geometry": { "type": "Point", "coordinates": [ 14.198565753124916, 40.549317256129129 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Rio Latino-Cala di Mezzo", "oggetto": "Spargimento di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.199252962257196, 40.54739533970816 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Pino", "oggetto": "Spargimento di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.202236833854124, 40.546958367996154 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Grotta del Pisco", "oggetto": "Concentrazione di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.202644864276412, 40.543834209174214 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Punta del Pino", "oggetto": "Concentrazione di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.197557607783281, 40.541821470187763 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Capo Ruglio-Limmo", "oggetto": "Concentrazione di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.199714680892935, 40.538709765491753 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Belvedere della Migliara", "oggetto": "Concentrazione di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.209803292737673, 40.539939232521711 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Punta Carena-Limmo", "oggetto": "Concentrazione di frammenti ceramici" }, "geometry": { "type": "Point", "coordinates": [ 14.199528561752958, 40.536773037148208 ] } }, +{ "type": "Feature", "properties": { "id": null, "denominazione": "Anacapri località Punta dell’Arcera", "oggetto": "Affioramento materiale ceramico" }, "geometry": { "type": "Point", "coordinates": [ 14.200509266452157, 40.558637768309111 ] } } +] +} diff --git a/webgis/img/icons/preistorici.png b/webgis/img/icons/preistorici.png new file mode 100644 index 0000000..d3724bb Binary files /dev/null and b/webgis/img/icons/preistorici.png differ diff --git a/webgis/js/gis.js b/webgis/js/gis.js index d471cd4..7350b92 100644 --- a/webgis/js/gis.js +++ b/webgis/js/gis.js @@ -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(` +
Denominazione: | ${geoJsonPoint.properties.denominazione} |
---|---|
Oggetto: | ${geoJsonPoint.properties.oggetto} |