From bfdcab8be398a2dad6734f686cebc4ba23e27a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P=2E?= Date: Mon, 25 May 2026 14:40:02 +0200 Subject: [PATCH] Fix errors in building techs --- webgis/js/gis.js | 2 +- webgis/js/ui.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/webgis/js/gis.js b/webgis/js/gis.js index 45fa7e2..24e5d7d 100644 --- a/webgis/js/gis.js +++ b/webgis/js/gis.js @@ -140,7 +140,7 @@ GIS.buildingTechs = async function () { techs.addLayer(marker); const markerLabel = `${record.coordinates[0]} ${record.coordinates[1]}`; marker.options.data = record; - marker.options.site = record.site.label; + marker.options.site = record.site?.label; GisState.markers.buildingTechs[markerLabel] = marker; } diff --git a/webgis/js/ui.js b/webgis/js/ui.js index 95c4b22..5e4f871 100644 --- a/webgis/js/ui.js +++ b/webgis/js/ui.js @@ -277,18 +277,28 @@ UI.imageGallery = function (galleryId, items, video = false) { * @returns {string} */ UI.createBuildingTechTable = function(record) { - return html` + let table = html` + ;` + + if (record.site) { + table += html` + `; + } + + table += html`
Tecnica${record.technique}
Descrizione${record.description}
Funzione${record.function}
Materiale${record.material}
Sito${record.site.label}
Comune${record.municipality}
- ;` + `; + + return table; } export default UI;