Google saved places: a name or description changed here survives a new export (the last imported text is kept per point, a field differing from it counts as a hand edit); the popup marks such a point as edited
This commit is contained in:
1 parent
3f4b30d737
commit
064871b687
4 files changed
+38
-5
No files matched your search
+8
-1
@@ -1536,7 +1536,7 @@ function nodeKeys(node) {
|
||||
// for — see _registerPointInteractivity) adds Edit/Delete buttons; the
|
||||
// click handling for them lives in _wireNoteActions, not here, since this
|
||||
// only builds markup, it has no map/store access of its own.
|
||||
function popupHtml({ name, description, time, category, photos, icon, approximate }, { editable = false, movable = false } = {}) {
|
||||
function popupHtml({ name, description, time, category, photos, icon, approximate, imported }, { editable = false, movable = false } = {}) {
|
||||
const parts = [];
|
||||
if (name) {
|
||||
const glyph = icon && POI_ICONS[icon] ? `<span class="gpx-popup__header-icon">${POI_ICONS[icon]}</span>` : "";
|
||||
@@ -1546,6 +1546,13 @@ function popupHtml({ name, description, time, category, photos, icon, approximat
|
||||
if (photos?.length > 0) parts.push(formatPhotos(photos));
|
||||
// Google saved places Nominatim couldn't pin down (GoogleSaved).
|
||||
if (approximate) parts.push(`<p class="gpx-popup__approximate">≈ Approximate position, check it</p>`);
|
||||
// Renamed or redescribed here: a new Google export leaves it as it is
|
||||
// (Library#upsert_by_source_id). MapLibre hands nested properties back
|
||||
// as JSON text.
|
||||
const last = typeof imported === "string" ? JSON.parse(imported) : imported;
|
||||
if (last && ((last.name ?? "") !== (name ?? "") || (last.description ?? "") !== (description ?? ""))) {
|
||||
parts.push(`<p class="gpx-popup__edited">✎ Edited here, Google updates keep your text</p>`);
|
||||
}
|
||||
// A Note's description is self-authored by the (logged-in) viewer, not
|
||||
// uploaded/untrusted like every other description here — formatDescription
|
||||
// is deliberately left alone for that untrusted case (see
|
||||
|
||||
Reference in new issue
Block a user