Themes(surveillance): fix tagging

This commit is contained in:
Pieter Vander Vennet 2024-11-21 11:43:28 +01:00
parent 1cc00b11b5
commit 208d7ecf4e
3 changed files with 104 additions and 92 deletions

View file

@ -456,11 +456,7 @@
}, },
"mappings": [ "mappings": [
{ {
"if": { "if": "surveillance=public",
"and": [
"surveillance=public"
]
},
"then": { "then": {
"en": "A public area is surveilled, such as a street, a bridge, a square, a park, a train station, a public corridor or tunnel, …", "en": "A public area is surveilled, such as a street, a bridge, a square, a park, a train station, a public corridor or tunnel, …",
"nl": "Bewaking van de publieke ruimte, dus een straat, een brug, een park, een plein, een stationsgebouw, een publiek toegankelijke gang of tunnel…", "nl": "Bewaking van de publieke ruimte, dus een straat, een brug, een park, een plein, een stationsgebouw, een publiek toegankelijke gang of tunnel…",
@ -475,11 +471,7 @@
} }
}, },
{ {
"if": { "if": "surveillance=outdoor",
"and": [
"surveillance=outdoor"
]
},
"then": { "then": {
"en": "An outdoor, yet private area is surveilled (e.g. a parking lot, a fuel station, courtyard, entrance, private driveway, …)", "en": "An outdoor, yet private area is surveilled (e.g. a parking lot, a fuel station, courtyard, entrance, private driveway, …)",
"nl": "Een buitenruimte met privaat karakter (zoals een privé-oprit, een parking, tankstation, …)", "nl": "Een buitenruimte met privaat karakter (zoals een privé-oprit, een parking, tankstation, …)",
@ -517,20 +509,13 @@
}, },
{ {
"question": { "question": {
"en": "Is the public space surveilled by this camera an indoor or outdoor space?", "en": "Is this camera located inside or outside?",
"nl": "Bevindt de bewaakte publieke ruimte camera zich binnen of buiten?", "nl": "Bevindt de camera zich binnen of buiten?"
"fr": "L'espace public surveillé par cette caméra est-il un espace intérieur ou extérieur ?",
"it": "Lo spazio pubblico sorvegliato da questa videocamera è all'aperto o al chiuso?",
"de": "Handelt es sich bei dem von dieser Kamera überwachten öffentlichen Raum um einen Innen- oder Außenbereich?",
"da": "Er det offentlige rum, der overvåges af dette kamera, et indendørs eller udendørs rum?",
"es": "¿El espacio público vigilado por esta cámara es interior o exterior?",
"ca": "L'espai públic vigilat per aquesta càmera és un espai interior o exterior?",
"cs": "Je veřejný prostor sledovaný touto kamerou vnitřní nebo venkovní prostor?",
"sl": "Ali je javni prostor, ki ga nadzoruje ta kamera, notranji ali zunanji?"
}, },
"condition": { "condition": {
"and": [ "and": [
"surveillance:type=public" "surveillance!=outdoor",
"surveillance!=indoor"
] ]
}, },
"mappings": [ "mappings": [
@ -583,7 +568,7 @@
"hideInAnswer": true "hideInAnswer": true
} }
], ],
"id": "is_indoor" "id": "camera_is_indoor"
}, },
{ {
"question": { "question": {
@ -614,9 +599,20 @@
"type": "nat" "type": "nat"
}, },
"condition": { "condition": {
"and": [
"camera:type!=doorbell",
{
"or": [ "or": [
"indoor=yes", "indoor=yes",
"surveillance:type=ye" "surveillance=indoor"
]
},
{
"or": [
"surveillance:type=alpr",
"surveillance:type=camera"
]
}
] ]
}, },
"id": "Level" "id": "Level"

View file

@ -4,20 +4,26 @@
"en": "Changes made with MapComplete", "en": "Changes made with MapComplete",
"de": "Änderungen mit MapComplete", "de": "Änderungen mit MapComplete",
"cs": "Změny provedené pomocí MapComplete", "cs": "Změny provedené pomocí MapComplete",
"es": "Cambios realizados con MapComplete" "es": "Cambios realizados con MapComplete",
"fr": "Modifications faites avec MapComplete",
"nl": "Wijzigingen gemaakt met MapComplete"
}, },
"shortDescription": { "shortDescription": {
"en": "Shows changes made by MapComplete", "en": "Shows changes made by MapComplete",
"de": "Zeigt die von MapComplete vorgenommenen Änderungen an", "de": "Zeigt die von MapComplete vorgenommenen Änderungen an",
"cs": "Zobrazuje změny provedené nástrojem MapComplete", "cs": "Zobrazuje změny provedené nástrojem MapComplete",
"es": "Muestra los cambios realizados por MapComplete" "es": "Muestra los cambios realizados por MapComplete",
"fr": "Afficher les modifications faites avec MapComplete",
"nl": "Toont wijzigingen gemaakt met MapComplete"
}, },
"description": { "description": {
"en": "This maps shows all the changes made with MapComplete", "en": "This maps shows all the changes made with MapComplete",
"de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen", "de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen",
"es": "Este mapa muestra todos los cambios realizados con MapComplete", "es": "Este mapa muestra todos los cambios realizados con MapComplete",
"pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete", "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete",
"cs": "Tyto mapy zobrazují všechny změny provedené pomocí MapComplete" "cs": "Tyto mapy zobrazují všechny změny provedené pomocí MapComplete",
"fr": "Cette carte montre tous les changements effectués avec MapComplete",
"nl": "Deze kaarten tonen alle wijzigingen die zijn gemaakt met MapComplete"
}, },
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
"hideFromOverview": true, "hideFromOverview": true,
@ -30,7 +36,9 @@
"name": { "name": {
"en": "Changeset centers", "en": "Changeset centers",
"de": "Changeset-Zentren", "de": "Changeset-Zentren",
"es": "Centros de conjuntos de cambios" "es": "Centros de conjuntos de cambios",
"fr": "Centre du groupe de modifications",
"nl": "Changeset centra"
}, },
"minzoom": 0, "minzoom": 0,
"source": { "source": {
@ -43,14 +51,16 @@
"en": "Changeset for {theme}", "en": "Changeset for {theme}",
"de": "Änderungssatz für {theme}", "de": "Änderungssatz für {theme}",
"cs": "Sada změn pro {theme}", "cs": "Sada změn pro {theme}",
"es": "Conjunto de cambios para {theme}" "es": "Conjunto de cambios para {theme}",
"nl": "Changeset voor {theme}"
} }
}, },
"description": { "description": {
"en": "Shows all MapComplete changes", "en": "Shows all MapComplete changes",
"de": "Zeigt alle MapComplete-Änderungen", "de": "Zeigt alle MapComplete-Änderungen",
"es": "Muestra todos los cambios de MapComplete", "es": "Muestra todos los cambios de MapComplete",
"cs": "Zobrazí všechny změny MapComplete" "cs": "Zobrazí všechny změny MapComplete",
"nl": "Toon alle MapComplete-wijzigingen"
}, },
"tagRenderings": [ "tagRenderings": [
{ {
@ -59,7 +69,8 @@
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"de": "Änderungssatz <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "de": "Änderungssatz <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"cs": "Sada změn <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "cs": "Sada změn <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"es": "Conjunto de cambios <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>" "es": "Conjunto de cambios <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"nl": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
} }
}, },
{ {
@ -68,7 +79,8 @@
"en": "What contributor did make this change?", "en": "What contributor did make this change?",
"de": "Wer hat zu dieser Änderung beigetragen?", "de": "Wer hat zu dieser Änderung beigetragen?",
"cs": "Který přispěvatel provedl tuto změnu?", "cs": "Který přispěvatel provedl tuto změnu?",
"es": "¿Qué colaborador realizó este cambio?" "es": "¿Qué colaborador realizó este cambio?",
"nl": "Welke bijdrager maakte deze verandering?"
}, },
"freeform": { "freeform": {
"key": "user" "key": "user"
@ -77,7 +89,9 @@
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>", "en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"de": "Änderung vorgenommen von <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>", "de": "Änderung vorgenommen von <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"cs": "Změna provedena uživatelem <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>", "cs": "Změna provedena uživatelem <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"es": "Cambio realizado por <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>" "es": "Cambio realizado por <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"fr": "Modification faite par <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"nl": "Wijziging aangebracht door <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
} }
}, },
{ {
@ -86,7 +100,8 @@
"en": "What theme was used to make this change?", "en": "What theme was used to make this change?",
"de": "Welches Thema wurde für diese Änderung verwendet?", "de": "Welches Thema wurde für diese Änderung verwendet?",
"cs": "Jaký motiv byl použit k provedení této změny?", "cs": "Jaký motiv byl použit k provedení této změny?",
"es": "¿Qué tema se utilizó para realizar este cambio?" "es": "¿Qué tema se utilizó para realizar este cambio?",
"nl": "Welk thema werd gebruikt voor deze wijziging?"
}, },
"freeform": { "freeform": {
"key": "theme" "key": "theme"
@ -94,7 +109,8 @@
"render": { "render": {
"en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>", "en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>",
"de": "Änderung mit Thema <a href='https://mapcomplete.org/{theme}'>{theme}</a>", "de": "Änderung mit Thema <a href='https://mapcomplete.org/{theme}'>{theme}</a>",
"es": "Cambio con el tema <a href='https://mapcomplete.org/{theme}'>{theme}</a>" "es": "Cambio con el tema <a href='https://mapcomplete.org/{theme}'>{theme}</a>",
"nl": "Verander met thema <a href='https://mapcomplete.org/{theme}'>{theme}</a>"
} }
}, },
{ {
@ -106,13 +122,15 @@
"en": "What locale (language) was this change made in?", "en": "What locale (language) was this change made in?",
"de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?", "de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?",
"cs": "V jakém prostředí (jazyce) byla tato změna provedena?", "cs": "V jakém prostředí (jazyce) byla tato změna provedena?",
"es": "¿En qué configuración regional (idioma) se realizó este cambio?" "es": "¿En qué configuración regional (idioma) se realizó este cambio?",
"nl": "In welke 'locale' (taal) is deze wijziging gemaakt?"
}, },
"render": { "render": {
"en": "User locale is {locale}", "en": "User locale is {locale}",
"de": "Die Benutzersprache ist {locale}", "de": "Die Benutzersprache ist {locale}",
"cs": "Uživatelské prostředí je {locale}", "cs": "Uživatelské prostředí je {locale}",
"es": "Configuración regional del usuario es {locale}" "es": "Configuración regional del usuario es {locale}",
"nl": "De gebruikerstaal (locale) is {locale}"
} }
}, },
{ {
@ -121,13 +139,15 @@
"en": "Change with with <a href='{host}'>{host}</a>", "en": "Change with with <a href='{host}'>{host}</a>",
"de": "Änderung mit <a href='{host}'>{host}</a>", "de": "Änderung mit <a href='{host}'>{host}</a>",
"cs": "Změnit pomocí <a href='{host}'>{host}</a>", "cs": "Změnit pomocí <a href='{host}'>{host}</a>",
"es": "Cambio realizado con <a href='{host}'>{host}</a>" "es": "Cambio realizado con <a href='{host}'>{host}</a>",
"nl": "Gewijzigd met <a href='{host}'>{host}</a>"
}, },
"question": { "question": {
"en": "What host (website) was this change made with?", "en": "What host (website) was this change made with?",
"de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?", "de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?",
"cs": "U jakého hostitele (webové stránky) byla tato změna provedena?", "cs": "U jakého hostitele (webové stránky) byla tato změna provedena?",
"es": "¿Con qué anfitrión (sitio web) se realizó este cambio?" "es": "¿Con qué anfitrión (sitio web) se realizó este cambio?",
"nl": "Met welke host (website) is deze wijziging gemaakt?"
}, },
"freeform": { "freeform": {
"key": "host" "key": "host"
@ -151,13 +171,17 @@
"en": "What version of MapComplete was used to make this change?", "en": "What version of MapComplete was used to make this change?",
"de": "Welche Version von MapComplete wurde verwendet, um diese Änderung vorzunehmen?", "de": "Welche Version von MapComplete wurde verwendet, um diese Änderung vorzunehmen?",
"cs": "Jaká verze aplikace MapComplete byla použita k provedení této změny?", "cs": "Jaká verze aplikace MapComplete byla použita k provedení této změny?",
"es": "¿Qué versión de MapComplete se utilizó para realizar este cambio?" "es": "¿Qué versión de MapComplete se utilizó para realizar este cambio?",
"fr": "Quelle version de MapCompletee a été utilisée pour faire cette modification?",
"nl": "Welke versie van MapComplete is gebruikt voor deze wijziging?"
}, },
"render": { "render": {
"en": "Made with {editor}", "en": "Made with {editor}",
"de": "Erstellt mit {editor}", "de": "Erstellt mit {editor}",
"cs": "Vytvořeno pomocí {editor}", "cs": "Vytvořeno pomocí {editor}",
"es": "Hecho con {editor}" "es": "Hecho con {editor}",
"fr": "Fait avec {editor}",
"nl": "Gemaakt met {editor}"
}, },
"freeform": { "freeform": {
"key": "editor" "key": "editor"
@ -559,7 +583,9 @@
"de": "Themenname enthält {search}", "de": "Themenname enthält {search}",
"es": "El nombre del tema contiene {search}", "es": "El nombre del tema contiene {search}",
"pl": "Nazwa tematu zawiera {search}", "pl": "Nazwa tematu zawiera {search}",
"cs": "Název obsahuje {search}" "cs": "Název obsahuje {search}",
"fr": "Le nom du thème contient {search}",
"nl": "Themanaam bevat {search}"
} }
} }
] ]
@ -578,7 +604,9 @@
"en": "Themename does <b>not</b> contain {search}", "en": "Themename does <b>not</b> contain {search}",
"de": "Themename enthält <b>nicht</b> {search}", "de": "Themename enthält <b>nicht</b> {search}",
"es": "El nombre del tema <b>no</b> contiene {search}", "es": "El nombre del tema <b>no</b> contiene {search}",
"cs": "Název motivu <b>neobsahuje</b> {search}" "cs": "Název motivu <b>neobsahuje</b> {search}",
"fr": "Le nom du thème <b>ne contient pas</b> {search}",
"nl": "Themanaam bevat <b>geen</b> {search}"
} }
} }
] ]
@ -597,7 +625,9 @@
"en": "Made by contributor {search}", "en": "Made by contributor {search}",
"de": "Erstellt von Mitwirkendem {search}", "de": "Erstellt von Mitwirkendem {search}",
"es": "Hecho por el colaborador {search}", "es": "Hecho por el colaborador {search}",
"cs": "Vytvořeno přispěvatelem {search}" "cs": "Vytvořeno přispěvatelem {search}",
"fr": "Fait par le·a contributeur·trice {search}",
"nl": "Toegevoegd door {search}"
} }
} }
] ]
@ -616,7 +646,9 @@
"en": "<b>Not</b> made by contributor {search}", "en": "<b>Not</b> made by contributor {search}",
"de": "<b>Nicht</b> erstellt von Mitwirkendem {search}", "de": "<b>Nicht</b> erstellt von Mitwirkendem {search}",
"es": "<b>No</b> hecho por el colaborador {search}", "es": "<b>No</b> hecho por el colaborador {search}",
"cs": "<b>Nevytvořeno</b> přispěvatelem {search}" "cs": "<b>Nevytvořeno</b> přispěvatelem {search}",
"fr": "<b>Pas</b> fait par le·a contributeur·trice {search}",
"nl": "<b>Niet</b> toegevoegd door {search}"
} }
} }
] ]
@ -636,7 +668,9 @@
"en": "Made before {search}", "en": "Made before {search}",
"de": "Erstellt vor {search}", "de": "Erstellt vor {search}",
"es": "Hecho antes de {search}", "es": "Hecho antes de {search}",
"cs": "Vytvořeno před {search}" "cs": "Vytvořeno před {search}",
"fr": "Fait avant {search}",
"nl": "Toegevoegd vóór {search}"
} }
} }
] ]
@ -656,7 +690,9 @@
"en": "Made after {search}", "en": "Made after {search}",
"de": "Erstellt nach {search}", "de": "Erstellt nach {search}",
"es": "Hecho después de {search}", "es": "Hecho después de {search}",
"cs": "Vytvořeno po {search}" "cs": "Vytvořeno po {search}",
"fr": "Fait après {search}",
"nl": "Toegevoegd na {search}"
} }
} }
] ]
@ -675,7 +711,9 @@
"en": "User language (iso-code) {search}", "en": "User language (iso-code) {search}",
"de": "Benutzersprache (ISO-Code) {search}", "de": "Benutzersprache (ISO-Code) {search}",
"es": "Idioma del usuario (código ISO) {search}", "es": "Idioma del usuario (código ISO) {search}",
"cs": "Jazyk uživatele (iso-kód) {search}" "cs": "Jazyk uživatele (iso-kód) {search}",
"fr": "Langage utilisateur (code iso) {search}",
"nl": "Gebruikerstaal (iso-code) {search}"
} }
} }
] ]
@ -694,7 +732,8 @@
"en": "Made with host {search}", "en": "Made with host {search}",
"de": "Erstellt mit Host {search}", "de": "Erstellt mit Host {search}",
"cs": "Vytvořeno pomocí hostitele {search}", "cs": "Vytvořeno pomocí hostitele {search}",
"es": "Hecho con el anfitrión {search}" "es": "Hecho con el anfitrión {search}",
"nl": "Gemaakt met {search}"
} }
} }
] ]
@ -708,7 +747,8 @@
"en": "Changeset added at least one image", "en": "Changeset added at least one image",
"de": "Changeset hat mindestens ein Bild hinzugefügt", "de": "Changeset hat mindestens ein Bild hinzugefügt",
"cs": "Sada změn přidala alespoň jeden obrázek", "cs": "Sada změn přidala alespoň jeden obrázek",
"es": "El conjunto de cambios agregó al menos una imagen" "es": "El conjunto de cambios agregó al menos una imagen",
"nl": "Changeset voegde minstens één afbeelding toe"
} }
} }
] ]
@ -722,7 +762,8 @@
"en": "Exclude GRB theme", "en": "Exclude GRB theme",
"de": "GRB-Thema ausschließen", "de": "GRB-Thema ausschließen",
"cs": "Vyloučit motiv GRB", "cs": "Vyloučit motiv GRB",
"es": "Excluir el tema GRB" "es": "Excluir el tema GRB",
"nl": "GRB-thema uitsluiten"
} }
} }
] ]
@ -736,7 +777,8 @@
"en": "Exclude etymology theme", "en": "Exclude etymology theme",
"de": "Etymologie-Thema ausschließen", "de": "Etymologie-Thema ausschließen",
"es": "Excluir el tema de etimología", "es": "Excluir el tema de etimología",
"cs": "Vyloučit etymologii tématu" "cs": "Vyloučit etymologii tématu",
"nl": "Thema etymologie uitsluiten"
} }
} }
] ]
@ -754,7 +796,9 @@
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>", "en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>",
"de": "Weitere Statistiken findest du <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>", "de": "Weitere Statistiken findest du <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>",
"cs": "Další statistiky najdete <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>zde</a>", "cs": "Další statistiky najdete <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>zde</a>",
"es": "Puedes encontrar más estadísticas <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>aquí</a>" "es": "Puedes encontrar más estadísticas <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>aquí</a>",
"fr": "Plus de statistiques peuvent être trouvées <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>ici</a>",
"nl": "Meer statistieken vind je <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>"
} }
}, },
{ {

View file

@ -4,39 +4,11 @@ export class ThemeMetaTagging {
public static readonly themeName = "usersettings" public static readonly themeName = "usersettings"
public metaTaggging_for_usersettings(feat: {properties: Record<string, string>}) { public metaTaggging_for_usersettings(feat: {properties: Record<string, string>}) {
Utils.AddLazyProperty(feat.properties, "_mastodon_candidate_md", () => Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_md', () => feat.properties._description.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/)?.at(1) )
feat.properties._description Utils.AddLazyProperty(feat.properties, '_d', () => feat.properties._description?.replace(/&lt;/g,'<')?.replace(/&gt;/g,'>') ?? '' )
.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/) Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_a', () => (feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName("a")).filter(a => a.href.match(/mastodon|en.osm.town/) !== null)[0]?.href }) (feat) )
?.at(1) Utils.AddLazyProperty(feat.properties, '_mastodon_link', () => (feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName("a")).filter(a => a.getAttribute("rel")?.indexOf('me') >= 0)[0]?.href})(feat) )
) Utils.AddLazyProperty(feat.properties, '_mastodon_candidate', () => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a )
Utils.AddLazyProperty( feat.properties['__current_backgroun'] = 'initial_value'
feat.properties,
"_d",
() => feat.properties._description?.replace(/&lt;/g, "<")?.replace(/&gt;/g, ">") ?? ""
)
Utils.AddLazyProperty(feat.properties, "_mastodon_candidate_a", () =>
((feat) => {
const e = document.createElement("div")
e.innerHTML = feat.properties._d
return Array.from(e.getElementsByTagName("a")).filter(
(a) => a.href.match(/mastodon|en.osm.town/) !== null
)[0]?.href
})(feat)
)
Utils.AddLazyProperty(feat.properties, "_mastodon_link", () =>
((feat) => {
const e = document.createElement("div")
e.innerHTML = feat.properties._d
return Array.from(e.getElementsByTagName("a")).filter(
(a) => a.getAttribute("rel")?.indexOf("me") >= 0
)[0]?.href
})(feat)
)
Utils.AddLazyProperty(
feat.properties,
"_mastodon_candidate",
() => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a
)
feat.properties["__current_backgroun"] = "initial_value"
} }
} }