Preserve fiducial details when editing notes
This commit is contained in:
1 parent
fc1ee8f21a
commit
47b58a9b0e
2 files changed
+18
-4
No files matched your search
@@ -29,8 +29,8 @@
|
|||||||
<ApplicationId>it.liviomerola.lmemappecatastali.pro</ApplicationId>
|
<ApplicationId>it.liviomerola.lmemappecatastali.pro</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.0.19</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.0.20</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>119</ApplicationVersion>
|
<ApplicationVersion>120</ApplicationVersion>
|
||||||
<Version>$(ApplicationDisplayVersion)</Version>
|
<Version>$(ApplicationDisplayVersion)</Version>
|
||||||
|
|
||||||
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
||||||
|
|||||||
+16
-2
@@ -2518,6 +2518,13 @@ function managedNoteDate(note) {
|
|||||||
return Number.isNaN(date.getTime()) ? "Nota" : date.toLocaleString("it-IT");
|
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) {
|
function showManagedNotesDialog(record) {
|
||||||
const properties = record.layer?.feature?.properties || {};
|
const properties = record.layer?.feature?.properties || {};
|
||||||
const title = `Note - ${managedObjectEditableName(record) || "Oggetto"}`;
|
const title = `Note - ${managedObjectEditableName(record) || "Oggetto"}`;
|
||||||
@@ -5541,12 +5548,16 @@ function bindStoredFeaturePopup(feature, layer) {
|
|||||||
|
|
||||||
function updateStoredFeaturePopup(layer, sourceProperties) {
|
function updateStoredFeaturePopup(layer, sourceProperties) {
|
||||||
const properties = sourceProperties || layer?.feature?.properties || {};
|
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 label = properties.name || properties.Name || properties.label || properties.LABEL;
|
||||||
const notes = managedNotes(properties);
|
const notes = managedNotes(properties);
|
||||||
const photo = String(properties._lmePhoto || "");
|
const photo = String(properties._lmePhoto || "");
|
||||||
if (label || notes.length || photo) {
|
if (label || notes.length || photo) {
|
||||||
const image = photo.startsWith("data:image/") ? `<img class="lme-popup-photo" src="${photo}" alt="Foto allegata">` : "";
|
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}`);
|
layer.bindPopup(`${label ? `<strong>${escapeHtml(label)}</strong>` : ""}${noteList}${image}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -6207,7 +6218,10 @@ function bindFiducialPopup(feature, layer) {
|
|||||||
const monograph = /^https:\/\//i.test(url)
|
const monograph = /^https:\/\//i.test(url)
|
||||||
? `<p><a href="${escapeHtml(url)}" target="_blank" rel="noopener">Apri monografia ufficiale</a></p>`
|
? `<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);
|
applyStyleFromProperties(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user