Preserve fiducial details when editing notes

This commit is contained in:
livio committed 2026-10-05 09:18:30 +02:00
1 parent fc1ee8f21a
commit 47b58a9b0e
2 files changed
+18 -4

No files matched your search

+16 -2
View File
@@ -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
? `<div class="lme-popup-notes"><strong>Note</strong>${notes.map(note => `<p>${escapeHtml(note.text).replaceAll("\n", "<br>")}</p>`).join("")}</div>`
: "";
}
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/") ? `<img class="lme-popup-photo" src="${photo}" alt="Foto allegata">` : "";
const noteList = notes.length ? `<div class="lme-popup-notes"><strong>Note</strong>${notes.map(note => `<p>${escapeHtml(note.text).replaceAll("\n", "<br>")}</p>`).join("")}</div>` : "";
const noteList = managedNotesPopupMarkup(properties);
layer.bindPopup(`${label ? `<strong>${escapeHtml(label)}</strong>` : ""}${noteList}${image}`);
return;
}
@@ -6207,7 +6218,10 @@ function bindFiducialPopup(feature, layer) {
const monograph = /^https:\/\//i.test(url)
? `<p><a href="${escapeHtml(url)}" target="_blank" rel="noopener">Apri monografia ufficiale</a></p>`
: "";
layer.bindPopup(`<strong>${escapeHtml(properties._lmeDisplayName || properties.name || "Punto fiduciale")}</strong><p>${rows.join("<br>")}</p>${monograph}<small>Posizione cartografica sperimentale GloboGIS: verificare prima dell'uso topografico.</small>`);
const notes = managedNotesPopupMarkup(properties);
const photo = String(properties._lmePhoto || "");
const image = photo.startsWith("data:image/") ? `<img class="lme-popup-photo" src="${photo}" alt="Foto allegata">` : "";
layer.bindPopup(`<strong>${escapeHtml(properties._lmeDisplayName || properties.name || "Punto fiduciale")}</strong><p>${rows.join("<br>")}</p>${monograph}${notes}${image}<small>Posizione cartografica sperimentale GloboGIS: verificare prima dell'uso topografico.</small>`);
applyStyleFromProperties(layer);
}