diff --git a/css/app.css b/css/app.css index 6a0757c..b982113 100644 --- a/css/app.css +++ b/css/app.css @@ -107,10 +107,13 @@ a:visited { #fullscreen { padding: 2px; } -/* Override Bulma z-index for modals (TODO: SASS??) */ +/* Override some Bulma rules for modals (TODO: SASS??) */ .modal { z-index: 1000; } +.modal-content { + width: 60vw; +} /* Custom controls */ .site-control { padding-top: 3px; @@ -120,21 +123,21 @@ a:visited { /* Leaflef map container */ @media (max-width: 840px) { .map-sm { - height: 650px; + height: 450px; } } @media (min-width: 840px) and (max-width: 960px) { .map-sm { - height: 700px; + height: 600px; } } @media (min-width: 960px) and (max-width: 1280px) { .map-lg { - height: 750px; + height: 700px; } } @media (min-width: 1280px) { .map-lg { - height: 860px; + height: 800px; } } \ No newline at end of file diff --git a/img/foto_CNR_post_pulizia.webp b/img/foto_CNR_post_pulizia.webp new file mode 100644 index 0000000..74ca24e Binary files /dev/null and b/img/foto_CNR_post_pulizia.webp differ diff --git a/img/foto_CNR_pre_pulizia.webp b/img/foto_CNR_pre_pulizia.webp new file mode 100644 index 0000000..d6fa63c Binary files /dev/null and b/img/foto_CNR_pre_pulizia.webp differ diff --git a/img/foto_intonaci.webp b/img/foto_intonaci.webp new file mode 100644 index 0000000..26a3fbb Binary files /dev/null and b/img/foto_intonaci.webp differ diff --git a/img/pianta_gradola_grotta_azzurra.webp b/img/pianta_gradola_grotta_azzurra.webp new file mode 100644 index 0000000..f84d54d Binary files /dev/null and b/img/pianta_gradola_grotta_azzurra.webp differ diff --git a/img/planim_laser_scanner.webp b/img/planim_laser_scanner.webp new file mode 100644 index 0000000..436b4d9 Binary files /dev/null and b/img/planim_laser_scanner.webp differ diff --git a/img/planim_mura.webp b/img/planim_mura.webp new file mode 100644 index 0000000..a366414 Binary files /dev/null and b/img/planim_mura.webp differ diff --git a/img/planimetria.webp b/img/planimetria.webp new file mode 100644 index 0000000..0b1ca2a Binary files /dev/null and b/img/planimetria.webp differ diff --git a/img/ricostruzione_planim.webp b/img/ricostruzione_planim.webp new file mode 100644 index 0000000..7782ae5 Binary files /dev/null and b/img/ricostruzione_planim.webp differ diff --git a/img/vista_prosp_3d.webp b/img/vista_prosp_3d.webp new file mode 100644 index 0000000..22341ef Binary files /dev/null and b/img/vista_prosp_3d.webp differ diff --git a/js/caprigis.js b/js/caprigis.js index 531e3bf..c5d93d6 100644 --- a/js/caprigis.js +++ b/js/caprigis.js @@ -92,7 +92,7 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) { let data = {}; let coords = layer.getBounds().getCenter(); - if (fromStorage !== undefined) { + if (fromStorage !== 'undefined') { try { data = JSON.parse(fromStorage); const lat = data?.lat ?? coords[0]; @@ -109,7 +109,10 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) { .addTo(map) .bindTooltip(Object.keys(archeo).find(k => archeo[k] === layer)) .openTooltip(); - marker.on('click', () => UI.openModal(data)); + + if (typeof data === 'object') { + marker.on('click', () => UI.openModal(data)); + } }); // TODO Horrible? @@ -184,10 +187,21 @@ GIS.loadLayer = async function (geoJSON, options, popup = true) { else { layer.on("click", async () => { const fromStorage = localStorage.getItem(layerId); - const data = fromStorage !== undefined ? - JSON.parse(fromStorage) : + let data = {}; + + if (fromStorage !== 'undefined') { + try { + data = JSON.parse(fromStorage); + } catch (error) { + console.log(error); + } + } else { await GIS._fetchData(layerId); - UI.openModal(data); + } + + if (typeof data === 'object') { + UI.openModal(data); + } }); } } diff --git a/js/ui.js b/js/ui.js index 4729cd1..06783cc 100644 --- a/js/ui.js +++ b/js/ui.js @@ -60,8 +60,7 @@ UI.toggleMenu = function (triggerId) { UI.openModal = async function (data) { const modal = document.querySelector('.modal'); // DEBUG - modal.querySelector('.modal-content').innerHTML = ` -
Denominazione | ${data.denominazione} |
---|---|
Località | ${data.localita} |
Indirizzo | ${data.indirizzo} |
Stato di conservazione | ${data.stato_conserv} |
Documenti | ${data.documenti} |
Descrizione | ${data.descrizione} |