From 47b58a9b0ee37dfda4dc9cd469770e6a926f2816 Mon Sep 17 00:00:00 2001 From: livio Date: Mon, 5 Oct 2026 09:18:30 +0200 Subject: [PATCH] Preserve fiducial details when editing notes --- LMEMappeCatastaliApp.csproj | 4 ++-- wwwroot/js/lme-map.js | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/LMEMappeCatastaliApp.csproj b/LMEMappeCatastaliApp.csproj index d76c313..92a2f20 100644 --- a/LMEMappeCatastaliApp.csproj +++ b/LMEMappeCatastaliApp.csproj @@ -29,8 +29,8 @@ it.liviomerola.lmemappecatastali.pro - 1.0.19 - 119 + 1.0.20 + 120 $(ApplicationDisplayVersion) diff --git a/wwwroot/js/lme-map.js b/wwwroot/js/lme-map.js index 56a2039..8137499 100644 --- a/wwwroot/js/lme-map.js +++ b/wwwroot/js/lme-map.js @@ -2518,6 +2518,13 @@ function managedNoteDate(note) { return Number.isNaN(date.getTime()) ? "Nota" : date.toLocaleString("it-IT"); } +function managedNotesPopupMarkup(properties) { + const notes = managedNotes(properties); + return notes.length + ? `
Note${notes.map(note => `

${escapeHtml(note.text).replaceAll("\n", "
")}

`).join("")}
` + : ""; +} + function showManagedNotesDialog(record) { const properties = record.layer?.feature?.properties || {}; const title = `Note - ${managedObjectEditableName(record) || "Oggetto"}`; @@ -5541,12 +5548,16 @@ function bindStoredFeaturePopup(feature, layer) { function updateStoredFeaturePopup(layer, sourceProperties) { const properties = sourceProperties || layer?.feature?.properties || {}; + if (properties._lmeFiducialSheetKey) { + bindFiducialPopup({ type: "Feature", properties }, layer); + return; + } const label = properties.name || properties.Name || properties.label || properties.LABEL; const notes = managedNotes(properties); const photo = String(properties._lmePhoto || ""); if (label || notes.length || photo) { const image = photo.startsWith("data:image/") ? `Foto allegata` : ""; - const noteList = notes.length ? `
Note${notes.map(note => `

${escapeHtml(note.text).replaceAll("\n", "
")}

`).join("")}
` : ""; + const noteList = managedNotesPopupMarkup(properties); layer.bindPopup(`${label ? `${escapeHtml(label)}` : ""}${noteList}${image}`); return; } @@ -6207,7 +6218,10 @@ function bindFiducialPopup(feature, layer) { const monograph = /^https:\/\//i.test(url) ? `

Apri monografia ufficiale

` : ""; - layer.bindPopup(`${escapeHtml(properties._lmeDisplayName || properties.name || "Punto fiduciale")}

${rows.join("
")}

${monograph}Posizione cartografica sperimentale GloboGIS: verificare prima dell'uso topografico.`); + const notes = managedNotesPopupMarkup(properties); + const photo = String(properties._lmePhoto || ""); + const image = photo.startsWith("data:image/") ? `Foto allegata` : ""; + layer.bindPopup(`${escapeHtml(properties._lmeDisplayName || properties.name || "Punto fiduciale")}

${rows.join("
")}

${monograph}${notes}${image}Posizione cartografica sperimentale GloboGIS: verificare prima dell'uso topografico.`); applyStyleFromProperties(layer); }