From 0bac4ff2a47b148e5880ef08bf6828a23951dff4 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Fri, 18 Apr 2025 10:07:45 +0200 Subject: [PATCH 01/10] add sauna layer --- assets/layers/sauna/license_info.json | 12 +++ assets/layers/sauna/sauna.json | 124 ++++++++++++++++++++++++++ assets/layers/sauna/sauna.svg | 26 ++++++ assets/layers/sauna/sauna.svg.license | 2 + 4 files changed, 164 insertions(+) create mode 100644 assets/layers/sauna/license_info.json create mode 100644 assets/layers/sauna/sauna.json create mode 100644 assets/layers/sauna/sauna.svg create mode 100644 assets/layers/sauna/sauna.svg.license diff --git a/assets/layers/sauna/license_info.json b/assets/layers/sauna/license_info.json new file mode 100644 index 0000000000..9e41697de5 --- /dev/null +++ b/assets/layers/sauna/license_info.json @@ -0,0 +1,12 @@ +[ + { + "path": "sauna.svg", + "license": "CC0-1.0", + "authors": [ + "Geozeisig" + ], + "sources": [ + "https://wiki.openstreetmap.org/wiki/File:Sauna-14.svg" + ] + } +] \ No newline at end of file diff --git a/assets/layers/sauna/sauna.json b/assets/layers/sauna/sauna.json new file mode 100644 index 0000000000..177027a599 --- /dev/null +++ b/assets/layers/sauna/sauna.json @@ -0,0 +1,124 @@ +{ + "credits": "Osmwithspace", + "minzoom": 8, + "pointRendering": [ + { + "location": [ + "point", + "centroid" + ], + "marker": [ + { + "icon": "./assets/layers/sauna/sauna.svg" + } + ] + } + ], + "tagRenderings": [ + "images", + "reviews", + "opening_hours", + { + "id": "charge_cost_rewritten", + "rewrite": { + "sourceString": [ + "{key}", + "{time}" + ], + "into": [ + [ + "2 hours", + { + "en": "2 hours", + "de": "2 Stunden" + } + ], + [ + "4 hours", + { + "en": "4 hours", + "de": "4 Stunden" + } + ], + [ + "day", + { + "en": "one day", + "de": "einen Tag" + } + ] + ] + }, + "renderings": [ + { + "id": "charge_{key}", + "question": { + "en": "What is the entrance fee for {time}?", + "de": "Was ist der Eintrittspreis für {time}?" + }, + "render": { + "en": "entrance fee for {time}: {charge}", + "de": "Eintrittspreis für {time}: {charge}" + }, + "freeform": { + "key": "charge", + "type": "currency", + "inline": true, + "postfixDistinguished": "{key}", + "addExtraTags": [ + "fee=yes" + ] + }, + "mappings": [ + { + "if": "fee=no", + "addExtraTags": [ + "charge=" + ], + "then": { + "en": "The sauna is free of charge", + "de": "Die Sauna ist kostenlos" + }, + "hideInAnswer": "fee!=no" + } + ] + } + ] + }, + "contact", + "defibrillator.defibrillator-fixme" + ], + "lineRendering": [ + { + "width": 1, + "color": "blue" + } + ], + "credits:uid": 8770388, + "source": { + "osmTags": { + "and": [ + "leisure~.*sauna.*", + { + "or": [ + "opening_hours!=", + "website!=", + "phone!=" + ] + } + ] + } + }, + "description": { + "en": "A sauna is a small room or house designed as a place to experience dry or wet heat sessions, or an establishment with one or more of these and auxiliary facilities." + }, + "id": "sauna", + "name": { + "en": "Sauna" + }, + "title": { + "render": { + "en": "{name}" + } + } +} \ No newline at end of file diff --git a/assets/layers/sauna/sauna.svg b/assets/layers/sauna/sauna.svg new file mode 100644 index 0000000000..49f43a322b --- /dev/null +++ b/assets/layers/sauna/sauna.svg @@ -0,0 +1,26 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/layers/sauna/sauna.svg.license b/assets/layers/sauna/sauna.svg.license new file mode 100644 index 0000000000..5e3616ed7f --- /dev/null +++ b/assets/layers/sauna/sauna.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Geozeisig +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file From 0a022508a5902227d5b58c6a5599999119ac0c1d Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Fri, 18 Apr 2025 10:26:21 +0200 Subject: [PATCH 02/10] add sauna_at_leisure layer --- assets/layers/sauna/sauna_at_leisure.json | 234 ++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 assets/layers/sauna/sauna_at_leisure.json diff --git a/assets/layers/sauna/sauna_at_leisure.json b/assets/layers/sauna/sauna_at_leisure.json new file mode 100644 index 0000000000..c9eb354522 --- /dev/null +++ b/assets/layers/sauna/sauna_at_leisure.json @@ -0,0 +1,234 @@ +{ + "credits": "Osmwithspace", + "minzoom": 8, + "pointRendering": [ + { + "location": [ + "point", + "centroid" + ], + "marker": [ + { + "icon": "./assets/layers/sauna/sauna.svg" + } + ] + } + ], + "tagRenderings": [ + "images", + "reviews", + { + "builtin": "toilet_at_amenity.toilet-access", + "override": { + "condition": "leisure!=water_park", + "question": { + "en": "Is this sauna publicly accessible?", + "de": "Ist die Sauna öffentlich zugänglich?" + }, + "render": { + "en": "Access is {sauna:access}", + "de": "Zugang ist {sauna:access}", + "fr": "{sauna:access}", + "nl": "{sauna:access}", + "it": "{sauna:access}", + "es": "{sauna:access}", + "da": "{sauna:access}", + "ca": "{sauna:access}", + "cs": "{sauna:access}", + "sl": "{sauna:access}", + "uk": "{sauna:access}" + }, + "freeform": { + "key": "sauna:access" + }, + "mappings": [ + { + "if": "sauna:access=yes", + "then": { + "en": "Public access", + "de": "Der Zugang ist öffentlich", + "fr": "Accès publique", + "nl": "Publiek toegankelijk", + "it": "Accesso pubblico", + "ru": "Свободный доступ", + "es": "Acceso público", + "da": "Offentlig adgang", + "ca": "Accés públic", + "cs": "Veřejný přístup", + "sl": "Javno dostopno" + } + }, + { + "if": "sauna:access=customers", + "then": { + "en": "Only access to customers of the amenity", + "de": "Nur Zugang für Kunden der Einrichtung", + "nl": "Enkel toegankelijk voor klanten van de voorziening", + "fr": "Accessibles uniquement au clients du lieu", + "ca": "Només accessible a clients de l'instal·lació", + "cs": "Přístup pouze zákazníkům zařízení občanské vybavenosti", + "sl": "Samo za stranke lokala", + "es": "Solo acceso para clientes del servicio" + } + }, + { + "if": "sauna:access=no", + "then": { + "en": "Not accessible, even for customers of the amenity", + "de": "Nicht zugänglich, auch nicht für Kunden der Einrichtung", + "nl": "Niet toegankelijk, ook niet voor klanten van de voorziening", + "fr": "Non accessibles, même pour les clients du lieu", + "ca": "No accessible, inclús per als clients de la instal·lació", + "cs": "Není přístupný, a to ani pro zákazníky občanské vybavenosti", + "sl": "Ni dostopno niti za stranke lokala", + "es": "Inaccesible, incluso para clientes del servicio" + } + }, + { + "if": "sauna:access=public", + "then": { + "en": "Public access", + "de": "Öffentlicher Zugang", + "fr": "Accès publique", + "nl": "Publiek toegankelijk", + "it": "Accesso pubblico", + "ru": "Свободный доступ", + "es": "Acceso público", + "da": "Offentlig adgang", + "ca": "Accés públic", + "cs": "Veřejný přístup" + }, + "hideInAnswer": true + } + ] + } + }, + { + "builtin": "opening_hours", + "override": { + "question": { + "en": "What are the opening hours of this sauna?", + "de": "Wie lauten die Öffnungszeiten von dieser Sauna?" + }, + "render": { + "en": "

Opening hours

{opening_hours_table(sauna:opening_hours)}", + "de": "

Öffnungszeiten

{opening_hours_table(sauna:opening_hours)}" + }, + "freeform": { + "key": "sauna:opening_hours", + "type": "opening_hours" + } + } + }, + { + "id": "charge_cost_rewritten", + "rewrite": { + "sourceString": [ + "{time_key}", + "{time_name}" + ], + "into": [ + [ + "2 hours", + { + "en": "2 hours", + "de": "2 Stunden" + } + ], + [ + "4 hours", + { + "en": "4 hours", + "de": "4 Stunden" + } + ], + [ + "day", + { + "en": "one day", + "de": "einen Tag" + } + ] + ] + }, + "renderings": [ + { + "id": "charge_{time_key}", + "question": { + "en": "What is the entrance fee for {time_name}?", + "de": "Was ist der Eintrittspreis für {time_name}?" + }, + "render": { + "en": "entrance fee for {time_name}: {sauna:charge}", + "de": "Eintrittspreis für {time_name}: {sauna:charge}" + }, + "freeform": { + "key": "sauna:charge", + "type": "currency", + "inline": true, + "postfixDistinguished": "{time_key}", + "addExtraTags": [ + "sauna:fee=yes" + ] + }, + "mappings": [ + { + "if": "sauna:fee=no", + "addExtraTags": [ + "sauna:charge=" + ], + "then": { + "en": "The sauna is free of charge", + "de": "Die Sauna ist kostenlos" + }, + "hideInAnswer": "sauna:fee!=no" + } + ] + } + ] + }, + "contact", + "defibrillator.defibrillator-fixme" + ], + "lineRendering": [ + { + "width": 1, + "color": "blue" + } + ], + "credits:uid": 8770388, + "source": { + "osmTags": { + "or": [ + { + "and": [ + "sauna=yes", + "leisure=water_park" + ] + }, + { + "and": [ + "sauna=yes", + "leisure!=water_park", + "sauna:access!=no", + "sauna:access!=private", + "sauna:access!=customers" + ] + } + ] + } + }, + "description": { + "en": "A sauna is a small room or house designed as a place to experience dry or wet heat sessions, or an establishment with one or more of these and auxiliary facilities." + }, + "id": "sauna_at_leisure", + "name": { + "en": "Saunas at other amenities", + "de": "Saunen in anderen Einrichtungen" + }, + "title": { + "render": { + "en": "{name}" + } + } +} \ No newline at end of file From 718472de4fa5d2412026a31392b52c40afce5c53 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Fri, 18 Apr 2025 10:26:36 +0200 Subject: [PATCH 03/10] add sauna theme --- assets/themes/sauna/sauna.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 assets/themes/sauna/sauna.json diff --git a/assets/themes/sauna/sauna.json b/assets/themes/sauna/sauna.json new file mode 100644 index 0000000000..c03f737daa --- /dev/null +++ b/assets/themes/sauna/sauna.json @@ -0,0 +1,16 @@ +{ + "credits": "Osmwithspace", + "credits:uid": 8770388, + "id": "sauna", + "title": { + "en": "Sauna" + }, + "layers": [ + "./assets/layers/sauna/sauna.json", + "./assets/layers/sauna/sauna_at_leisure.json" + ], + "description": { + "en": "Sauna" + }, + "icon": "./assets/layers/sauna/sauna.svg" +} \ No newline at end of file From b06f937c5b4499dd5447176192908b1ec05ad3b7 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Fri, 18 Apr 2025 21:31:11 +0200 Subject: [PATCH 04/10] add "allowMove": true --- assets/layers/sauna/sauna.json | 1 + assets/layers/sauna/sauna_at_leisure.json | 1 + 2 files changed, 2 insertions(+) diff --git a/assets/layers/sauna/sauna.json b/assets/layers/sauna/sauna.json index 177027a599..9ad22a9791 100644 --- a/assets/layers/sauna/sauna.json +++ b/assets/layers/sauna/sauna.json @@ -1,6 +1,7 @@ { "credits": "Osmwithspace", "minzoom": 8, + "allowMove": true, "pointRendering": [ { "location": [ diff --git a/assets/layers/sauna/sauna_at_leisure.json b/assets/layers/sauna/sauna_at_leisure.json index c9eb354522..9b824f7395 100644 --- a/assets/layers/sauna/sauna_at_leisure.json +++ b/assets/layers/sauna/sauna_at_leisure.json @@ -1,6 +1,7 @@ { "credits": "Osmwithspace", "minzoom": 8, + "allowMove": true, "pointRendering": [ { "location": [ From 522c4e8b8cdd3710752a66d9751f12e6b3f2f7d2 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Tue, 3 Jun 2025 23:11:30 +0200 Subject: [PATCH 05/10] leisure=sauna --- assets/layers/sauna/sauna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/layers/sauna/sauna.json b/assets/layers/sauna/sauna.json index 9ad22a9791..c941ae593e 100644 --- a/assets/layers/sauna/sauna.json +++ b/assets/layers/sauna/sauna.json @@ -99,7 +99,7 @@ "source": { "osmTags": { "and": [ - "leisure~.*sauna.*", + "leisure=sauna", { "or": [ "opening_hours!=", From c7ec2e6cab35127ffceb52861f262c22b3ea7798 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Sat, 21 Jun 2025 23:57:21 +0200 Subject: [PATCH 06/10] move "fixme" into "questions/questions.json" --- .../layers/defibrillator/defibrillator.json | 32 +------------------ assets/layers/questions/questions.json | 30 +++++++++++++++++ assets/layers/sauna/sauna.json | 2 +- assets/layers/sauna/sauna_at_leisure.json | 2 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/assets/layers/defibrillator/defibrillator.json b/assets/layers/defibrillator/defibrillator.json index 5315a90402..829a52d6dc 100644 --- a/assets/layers/defibrillator/defibrillator.json +++ b/assets/layers/defibrillator/defibrillator.json @@ -688,37 +688,7 @@ ], "id": "defibrillator-survey:date" }, - { - "render": { - "en": "Extra information for OpenStreetMap experts: {fixme}", - "nl": "Extra informatie voor OpenStreetMap experts: {fixme}", - "fr": "Informations supplémentaires pour les experts d'OpenStreetMap : {fixme}", - "it": "Informazioni aggiuntive per gli esperti di OpenStreetMap: {fixme}", - "de": "Zusätzliche Informationen für OpenStreetMap-Experten: {fixme}", - "ru": "Дополнительная информация для экспертов OpenStreetMap: {fixme}", - "sl": "Dodatne informacije za OpenStreetMap strokovnjake: {fixme}", - "es": "Información adicional para expertos de OpenStreetMap: {fixme}", - "ca": "Informació addicional per als experts en OpenStreetMap: {fixme}", - "pl": "Więcej informacji dla doświadczonych użytkowników OpenStreetMap: {fixme}", - "cs": "Další informace pro experty OpenStreetMap: {fixme}" - }, - "question": { - "en": "Is there something wrong with how this is mapped, that you weren't able to fix here? (leave a note to OpenStreetMap experts)", - "nl": "Is er iets mis met de informatie over deze defibrillator dat je hier niet opgelost kreeg? (laat hier een berichtje achter voor OpenStreetMap experts)", - "fr": "Y a-t-il quelque chose qui ne va pas dans la manière dont ça a été cartographié, et que vous n'avez pas pu réparer ici ? (laisser une note pour les experts d'OpenStreetMap)", - "it": "C'è qualcosa di sbagliato nel modo in cui è mappato, che non sei riuscito a correggere qui? (lascia una nota agli esperti di OpenStreetMap)", - "de": "Gibt es einen Fehler in der Kartierung, den Sie hier nicht beheben konnten? (hinterlasse eine Notiz für OpenStreetMap-Experten)", - "sl": "Ali je kaj narobe s tem vnosom na zemljevid, in tega niste mogli sami popraviti tu? (pustite opombo OpenStreetMap strokovnjakom)", - "es": "¿Hay algo mal en cómo está mapeado esto, que no hayas podido arreglar aquí? (deja una nota para los expertos de OpenStreetMap)", - "ca": "Hi ha alguna cosa malament en la manera de com està mapejat això, que no heu pogut solucionar aquí? (deixeu una nota als experts d'OpenStreetMap)", - "cs": "Je na tom, jak je to zmapováno, něco v nepořádku, co jste zde nedokázali opravit? (zanechte poznámku odborníkům na OpenStreetMap)" - }, - "freeform": { - "key": "fixme", - "type": "text" - }, - "id": "defibrillator-fixme" - } + "fixme" ], "filter": [ "has_image", diff --git a/assets/layers/questions/questions.json b/assets/layers/questions/questions.json index a85373e649..ff566ac8ac 100644 --- a/assets/layers/questions/questions.json +++ b/assets/layers/questions/questions.json @@ -765,6 +765,36 @@ "cs": "Neopakujte již uvedená fakta" } }, + { + "render": { + "en": "Extra information for OpenStreetMap experts: {fixme}", + "nl": "Extra informatie voor OpenStreetMap experts: {fixme}", + "fr": "Informations supplémentaires pour les experts d'OpenStreetMap : {fixme}", + "it": "Informazioni aggiuntive per gli esperti di OpenStreetMap: {fixme}", + "de": "Zusätzliche Informationen für OpenStreetMap-Experten: {fixme}", + "ru": "Дополнительная информация для экспертов OpenStreetMap: {fixme}", + "sl": "Dodatne informacije za OpenStreetMap strokovnjake: {fixme}", + "es": "Información adicional para expertos de OpenStreetMap: {fixme}", + "ca": "Informació addicional per als experts en OpenStreetMap: {fixme}", + "pl": "Więcej informacji dla doświadczonych użytkowników OpenStreetMap: {fixme}", + "cs": "Další informace pro experty OpenStreetMap: {fixme}" + }, + "question": { + "en": "Is there something wrong with how this is mapped, that you weren't able to fix here? (leave a note to OpenStreetMap experts)", + "fr": "Y a-t-il quelque chose qui ne va pas dans la manière dont ça a été cartographié, et que vous n'avez pas pu réparer ici ? (laisser une note pour les experts d'OpenStreetMap)", + "it": "C'è qualcosa di sbagliato nel modo in cui è mappato, che non sei riuscito a correggere qui? (lascia una nota agli esperti di OpenStreetMap)", + "de": "Gibt es einen Fehler in der Kartierung, den Sie hier nicht beheben konnten? (hinterlasse eine Notiz für OpenStreetMap-Experten)", + "sl": "Ali je kaj narobe s tem vnosom na zemljevid, in tega niste mogli sami popraviti tu? (pustite opombo OpenStreetMap strokovnjakom)", + "es": "¿Hay algo mal en cómo está mapeado esto, que no hayas podido arreglar aquí? (deja una nota para los expertos de OpenStreetMap)", + "ca": "Hi ha alguna cosa malament en la manera de com està mapejat això, que no heu pogut solucionar aquí? (deixeu una nota als experts d'OpenStreetMap)", + "cs": "Je na tom, jak je to zmapováno, něco v nepořádku, co jste zde nedokázali opravit? (zanechte poznámku odborníkům na OpenStreetMap)" + }, + "freeform": { + "key": "fixme", + "type": "text" + }, + "id": "fixme" + }, { "id": "opening_hours", "question": { diff --git a/assets/layers/sauna/sauna.json b/assets/layers/sauna/sauna.json index c941ae593e..bf1c3b5558 100644 --- a/assets/layers/sauna/sauna.json +++ b/assets/layers/sauna/sauna.json @@ -87,7 +87,7 @@ ] }, "contact", - "defibrillator.defibrillator-fixme" + "fixme" ], "lineRendering": [ { diff --git a/assets/layers/sauna/sauna_at_leisure.json b/assets/layers/sauna/sauna_at_leisure.json index 9b824f7395..47200c4424 100644 --- a/assets/layers/sauna/sauna_at_leisure.json +++ b/assets/layers/sauna/sauna_at_leisure.json @@ -189,7 +189,7 @@ ] }, "contact", - "defibrillator.defibrillator-fixme" + "fixme" ], "lineRendering": [ { From fe43c41d30b6b8ae23c192c16368ba3dc0c3cac9 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Sun, 22 Jun 2025 00:15:50 +0200 Subject: [PATCH 07/10] move sauna_at_leisure to own directory --- .../sauna_at_leisure.json | 95 +++---------------- 1 file changed, 11 insertions(+), 84 deletions(-) rename assets/layers/{sauna => sauna_at_leisure}/sauna_at_leisure.json (68%) diff --git a/assets/layers/sauna/sauna_at_leisure.json b/assets/layers/sauna_at_leisure/sauna_at_leisure.json similarity index 68% rename from assets/layers/sauna/sauna_at_leisure.json rename to assets/layers/sauna_at_leisure/sauna_at_leisure.json index 47200c4424..bf6082d126 100644 --- a/assets/layers/sauna/sauna_at_leisure.json +++ b/assets/layers/sauna_at_leisure/sauna_at_leisure.json @@ -16,6 +16,17 @@ } ], "tagRenderings": [ + { + "builtin": "sauna.*", + "override": { + "condition": { + "and+": [ + "sauna=yes" + ] + } + }, + "prefix": "sauna" + }, "images", "reviews", { @@ -104,90 +115,6 @@ ] } }, - { - "builtin": "opening_hours", - "override": { - "question": { - "en": "What are the opening hours of this sauna?", - "de": "Wie lauten die Öffnungszeiten von dieser Sauna?" - }, - "render": { - "en": "

Opening hours

{opening_hours_table(sauna:opening_hours)}", - "de": "

Öffnungszeiten

{opening_hours_table(sauna:opening_hours)}" - }, - "freeform": { - "key": "sauna:opening_hours", - "type": "opening_hours" - } - } - }, - { - "id": "charge_cost_rewritten", - "rewrite": { - "sourceString": [ - "{time_key}", - "{time_name}" - ], - "into": [ - [ - "2 hours", - { - "en": "2 hours", - "de": "2 Stunden" - } - ], - [ - "4 hours", - { - "en": "4 hours", - "de": "4 Stunden" - } - ], - [ - "day", - { - "en": "one day", - "de": "einen Tag" - } - ] - ] - }, - "renderings": [ - { - "id": "charge_{time_key}", - "question": { - "en": "What is the entrance fee for {time_name}?", - "de": "Was ist der Eintrittspreis für {time_name}?" - }, - "render": { - "en": "entrance fee for {time_name}: {sauna:charge}", - "de": "Eintrittspreis für {time_name}: {sauna:charge}" - }, - "freeform": { - "key": "sauna:charge", - "type": "currency", - "inline": true, - "postfixDistinguished": "{time_key}", - "addExtraTags": [ - "sauna:fee=yes" - ] - }, - "mappings": [ - { - "if": "sauna:fee=no", - "addExtraTags": [ - "sauna:charge=" - ], - "then": { - "en": "The sauna is free of charge", - "de": "Die Sauna ist kostenlos" - }, - "hideInAnswer": "sauna:fee!=no" - } - ] - } - ] - }, "contact", "fixme" ], From ccbbba56280f0ac0771f2dfa3967eef8233a70cb Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 3 Jul 2025 01:47:22 +0200 Subject: [PATCH 08/10] Fix: fix sauna theme --- .../sauna_at_leisure/sauna_at_leisure.json | 157 ++++++++---------- assets/themes/sauna/sauna.json | 6 +- .../AddPrefixToTagRenderingConfig.ts | 40 ++++- 3 files changed, 115 insertions(+), 88 deletions(-) diff --git a/assets/layers/sauna_at_leisure/sauna_at_leisure.json b/assets/layers/sauna_at_leisure/sauna_at_leisure.json index bf6082d126..1bb01a2929 100644 --- a/assets/layers/sauna_at_leisure/sauna_at_leisure.json +++ b/assets/layers/sauna_at_leisure/sauna_at_leisure.json @@ -30,90 +30,79 @@ "images", "reviews", { - "builtin": "toilet_at_amenity.toilet-access", - "override": { - "condition": "leisure!=water_park", - "question": { - "en": "Is this sauna publicly accessible?", - "de": "Ist die Sauna öffentlich zugänglich?" - }, - "render": { - "en": "Access is {sauna:access}", - "de": "Zugang ist {sauna:access}", - "fr": "{sauna:access}", - "nl": "{sauna:access}", - "it": "{sauna:access}", - "es": "{sauna:access}", - "da": "{sauna:access}", - "ca": "{sauna:access}", - "cs": "{sauna:access}", - "sl": "{sauna:access}", - "uk": "{sauna:access}" - }, - "freeform": { - "key": "sauna:access" - }, - "mappings": [ - { - "if": "sauna:access=yes", - "then": { - "en": "Public access", - "de": "Der Zugang ist öffentlich", - "fr": "Accès publique", - "nl": "Publiek toegankelijk", - "it": "Accesso pubblico", - "ru": "Свободный доступ", - "es": "Acceso público", - "da": "Offentlig adgang", - "ca": "Accés públic", - "cs": "Veřejný přístup", - "sl": "Javno dostopno" - } - }, - { - "if": "sauna:access=customers", - "then": { - "en": "Only access to customers of the amenity", - "de": "Nur Zugang für Kunden der Einrichtung", - "nl": "Enkel toegankelijk voor klanten van de voorziening", - "fr": "Accessibles uniquement au clients du lieu", - "ca": "Només accessible a clients de l'instal·lació", - "cs": "Přístup pouze zákazníkům zařízení občanské vybavenosti", - "sl": "Samo za stranke lokala", - "es": "Solo acceso para clientes del servicio" - } - }, - { - "if": "sauna:access=no", - "then": { - "en": "Not accessible, even for customers of the amenity", - "de": "Nicht zugänglich, auch nicht für Kunden der Einrichtung", - "nl": "Niet toegankelijk, ook niet voor klanten van de voorziening", - "fr": "Non accessibles, même pour les clients du lieu", - "ca": "No accessible, inclús per als clients de la instal·lació", - "cs": "Není přístupný, a to ani pro zákazníky občanské vybavenosti", - "sl": "Ni dostopno niti za stranke lokala", - "es": "Inaccesible, incluso para clientes del servicio" - } - }, - { - "if": "sauna:access=public", - "then": { - "en": "Public access", - "de": "Öffentlicher Zugang", - "fr": "Accès publique", - "nl": "Publiek toegankelijk", - "it": "Accesso pubblico", - "ru": "Свободный доступ", - "es": "Acceso público", - "da": "Offentlig adgang", - "ca": "Accés públic", - "cs": "Veřejný přístup" - }, - "hideInAnswer": true + "id": "sauna_access", + "condition": "leisure!=water_park", + "question": { + "en": "Is this sauna publicly accessible?", + "de": "Ist die Sauna öffentlich zugänglich?" + }, + "render": { + "en": "Access is {sauna:access}", + "de": "Zugang ist {sauna:access}" + }, + "freeform": { + "key": "sauna:access" + }, + "mappings": [ + { + "if": "sauna:access=yes", + "then": { + "en": "Public access", + "de": "Der Zugang ist öffentlich", + "fr": "Accès publique", + "nl": "Publiek toegankelijk", + "it": "Accesso pubblico", + "ru": "Свободный доступ", + "es": "Acceso público", + "da": "Offentlig adgang", + "ca": "Accés públic", + "cs": "Veřejný přístup", + "sl": "Javno dostopno" } - ] - } + }, + { + "if": "sauna:access=customers", + "then": { + "en": "Only access to customers of the amenity", + "de": "Nur Zugang für Kunden der Einrichtung", + "nl": "Enkel toegankelijk voor klanten van de voorziening", + "fr": "Accessibles uniquement au clients du lieu", + "ca": "Només accessible a clients de l'instal·lació", + "cs": "Přístup pouze zákazníkům zařízení občanské vybavenosti", + "sl": "Samo za stranke lokala", + "es": "Solo acceso para clientes del servicio" + } + }, + { + "if": "sauna:access=no", + "then": { + "en": "Not accessible, even for customers of the amenity", + "de": "Nicht zugänglich, auch nicht für Kunden der Einrichtung", + "nl": "Niet toegankelijk, ook niet voor klanten van de voorziening", + "fr": "Non accessibles, même pour les clients du lieu", + "ca": "No accessible, inclús per als clients de la instal·lació", + "cs": "Není přístupný, a to ani pro zákazníky občanské vybavenosti", + "sl": "Ni dostopno niti za stranke lokala", + "es": "Inaccesible, incluso para clientes del servicio" + } + }, + { + "if": "sauna:access=public", + "then": { + "en": "Public access", + "de": "Öffentlicher Zugang", + "fr": "Accès publique", + "nl": "Publiek toegankelijk", + "it": "Accesso pubblico", + "ru": "Свободный доступ", + "es": "Acceso público", + "da": "Offentlig adgang", + "ca": "Accés públic", + "cs": "Veřejný přístup" + }, + "hideInAnswer": true + } + ] }, "contact", "fixme" @@ -159,4 +148,4 @@ "en": "{name}" } } -} \ No newline at end of file +} diff --git a/assets/themes/sauna/sauna.json b/assets/themes/sauna/sauna.json index c03f737daa..b0056e88c1 100644 --- a/assets/themes/sauna/sauna.json +++ b/assets/themes/sauna/sauna.json @@ -6,11 +6,11 @@ "en": "Sauna" }, "layers": [ - "./assets/layers/sauna/sauna.json", - "./assets/layers/sauna/sauna_at_leisure.json" + "sauna", + "sauna_at_leisure" ], "description": { "en": "Sauna" }, "icon": "./assets/layers/sauna/sauna.svg" -} \ No newline at end of file +} diff --git a/src/Models/ThemeConfig/Conversion/AddPrefixToTagRenderingConfig.ts b/src/Models/ThemeConfig/Conversion/AddPrefixToTagRenderingConfig.ts index 5feb391f7c..176b39459f 100644 --- a/src/Models/ThemeConfig/Conversion/AddPrefixToTagRenderingConfig.ts +++ b/src/Models/ThemeConfig/Conversion/AddPrefixToTagRenderingConfig.ts @@ -6,6 +6,7 @@ import { MappingConfigJson, QuestionableTagRenderingConfigJson, } from "../Json/QuestionableTagRenderingConfigJson" +import { Utils } from "../../../Utils" export default class AddPrefixToTagRenderingConfig extends DesugaringStep { private readonly _prefix: string @@ -18,6 +19,40 @@ export default class AddPrefixToTagRenderingConfig extends DesugaringStep "Some argument with a {PREFIX:key}" + * + * // Don't rewrite metatags + * new AddPrefixToTagRenderingConfig("PREFIX").rewriteArguments("Some argument with a {_calculated_key}") // => "Some argument with a {_calculated_key}" + * + + */ + private rewriteArguments(txt: string) { + const regex = /(.*?){([^}]*)}(.*)/s + let match = txt.match(regex) + if (!match) { + return txt + } + let result = "" + while (match) { + const [_, normal, key, leftover] = match + if (key.startsWith("_")) { + result += normal + "{" + key + "}" + } else { + result += normal + "{" + this._prefix + ":" + key + "}" + } + match = leftover.match(regex) + if (!match) { + result += leftover + } + } + if(txt !== result){ + console.log(">>> Rewritten", txt, "into", result) + } + return result + } + /** * * const edit = new AddPrefixToTagRenderingConfig("PREFIX") @@ -29,6 +64,9 @@ export default class AddPrefixToTagRenderingConfig extends DesugaringStep "{opening_hours_table(PREFIX:opening_hours,,)}" + * + * // Should prefix links, e.g. for 'phone' + * new AddPrefixToTagRenderingConfig("PREFIX").updateString("{link({phone},tel:{phone},,,,)}") // => "{link({PREFIX:phone},tel:{PREFIX:phone},,,,)}" */ private updateString(str: string): string { const parsed = SpecialVisualizations.constructSpecification(str) @@ -45,7 +83,7 @@ export default class AddPrefixToTagRenderingConfig extends DesugaringStep Date: Thu, 3 Jul 2025 17:32:22 +0200 Subject: [PATCH 09/10] Themes(sauna): refactor 'sauna_at_leisure' to contain all sauna relevant questions and 'layers/sauna.json' to contain only related questions; include 'sauna_at_leisure' in 'hotels' and 'beauty shops'; add beauty shop types --- assets/layers/sauna/sauna.json | 135 ++------ .../sauna_at_leisure/sauna_at_leisure.json | 289 ++++++++++++++---- assets/layers/shops/shops.json | 82 ++++- .../tourism_accomodation.json | 1 + assets/themes/sauna/sauna.json | 107 ++++++- .../ThemeConfig/Conversion/PrepareLayer.ts | 2 +- src/Models/ThemeConfig/LayerConfig.ts | 2 +- src/UI/Popup/DataVisualisations.ts | 8 + 8 files changed, 452 insertions(+), 174 deletions(-) diff --git a/assets/layers/sauna/sauna.json b/assets/layers/sauna/sauna.json index bf1c3b5558..23fedd0237 100644 --- a/assets/layers/sauna/sauna.json +++ b/assets/layers/sauna/sauna.json @@ -1,7 +1,24 @@ { - "credits": "Osmwithspace", + "id": "sauna", + "name": { + "en": "Sauna" + }, + "description": { + "en": "A sauna is a small room or house designed as a place to experience dry or wet heat sessions, or an establishment with one or more of these and auxiliary facilities." + }, + "source": { + "osmTags": { + "and": [ + "leisure=sauna" + ] + } + }, "minzoom": 8, - "allowMove": true, + "title": { + "render": { + "en": "{name}" + } + }, "pointRendering": [ { "location": [ @@ -15,111 +32,21 @@ ] } ], - "tagRenderings": [ - "images", - "reviews", - "opening_hours", - { - "id": "charge_cost_rewritten", - "rewrite": { - "sourceString": [ - "{key}", - "{time}" - ], - "into": [ - [ - "2 hours", - { - "en": "2 hours", - "de": "2 Stunden" - } - ], - [ - "4 hours", - { - "en": "4 hours", - "de": "4 Stunden" - } - ], - [ - "day", - { - "en": "one day", - "de": "einen Tag" - } - ] - ] - }, - "renderings": [ - { - "id": "charge_{key}", - "question": { - "en": "What is the entrance fee for {time}?", - "de": "Was ist der Eintrittspreis für {time}?" - }, - "render": { - "en": "entrance fee for {time}: {charge}", - "de": "Eintrittspreis für {time}: {charge}" - }, - "freeform": { - "key": "charge", - "type": "currency", - "inline": true, - "postfixDistinguished": "{key}", - "addExtraTags": [ - "fee=yes" - ] - }, - "mappings": [ - { - "if": "fee=no", - "addExtraTags": [ - "charge=" - ], - "then": { - "en": "The sauna is free of charge", - "de": "Die Sauna ist kostenlos" - }, - "hideInAnswer": "fee!=no" - } - ] - } - ] - }, - "contact", - "fixme" - ], "lineRendering": [ { "width": 1, "color": "blue" } ], - "credits:uid": 8770388, - "source": { - "osmTags": { - "and": [ - "leisure=sauna", - { - "or": [ - "opening_hours!=", - "website!=", - "phone!=" - ] - } - ] - } - }, - "description": { - "en": "A sauna is a small room or house designed as a place to experience dry or wet heat sessions, or an establishment with one or more of these and auxiliary facilities." - }, - "id": "sauna", - "name": { - "en": "Sauna" - }, - "title": { - "render": { - "en": "{name}" - } - } -} \ No newline at end of file + "tagRenderings": [ + "images", + "reviews", + "opening_hours", + "contact", + "sauna_at_leisure.sauna_expanded", + "fixme" + ], + "allowMove": true, + "credits": "Osmwithspace", + "credits:uid": 8770388 +} diff --git a/assets/layers/sauna_at_leisure/sauna_at_leisure.json b/assets/layers/sauna_at_leisure/sauna_at_leisure.json index 1bb01a2929..e2f965c66f 100644 --- a/assets/layers/sauna_at_leisure/sauna_at_leisure.json +++ b/assets/layers/sauna_at_leisure/sauna_at_leisure.json @@ -1,7 +1,26 @@ { - "credits": "Osmwithspace", + "id": "sauna_at_leisure", + "name": { + "en": "Saunas at other amenities", + "de": "Saunen in anderen Einrichtungen" + }, + "description": { + "en": "A sauna is a small room or house designed as a place to experience dry or wet heat sessions, or an establishment with one or more of these and auxiliary facilities." + }, + "#": "Use 'sauna_at_leisure.sauna_grouped' in a layer.tagRenderings to add the 'sauna information' expandle block (incl 'has sauna'); use 'sauna_at_leisure.expanded' to get all sauna questions directly (which does _not_ include the 'has sauna' question)", + "source": { + "osmTags": { + "or": [ + "sauna=yes" + ] + } + }, "minzoom": 8, - "allowMove": true, + "title": { + "render": { + "en": "{name}" + } + }, "pointRendering": [ { "location": [ @@ -15,34 +34,132 @@ ] } ], + "lineRendering": [ + { + "width": 1, + "color": "blue" + } + ], "tagRenderings": [ { - "builtin": "sauna.*", - "override": { - "condition": { - "and+": [ - "sauna=yes" - ] + "id": "sauna-group", + "labels": [ + "sauna_grouped" + ], + "render": { + "special": { + "type": "group", + "header": "sauna-header", + "labels": "has_sauna;sauna_expanded;sauna-questions" } - }, - "prefix": "sauna" + } + }, + { + "id": "sauna-header", + "labels": [ + "sauna_grouped", + "hidden" + ], + "render": { + "en": "Sauna information" + }, + "icon": "./assets/layers/sauna/sauna.svg", + "mappings": [ + { + "if": "sauna=no", + "then": { + "en": "No sauna" + } + } + ] + }, + { + "id": "sauna-picture-carousel", + "labels": [ + "sauna_expanded", + "sauna_grouped", + "hidden" + ], + "render": { + "special": { + "type": "image_carousel", + "image_key": "sayna:panoramax;sauna:image;sauna:mapillary" + } + } + }, + { + "id": "sauna-picture", + "condition": { + "and": [ + { + "or": [ + "sauna=yes", + "leisure=sauna", + "beauty=sauna" + ] + } + ] + }, + "labels": [ + "sauna_expanded", + "sauna_grouped", + "hidden" + ], + "render": { + "special": { + "type": "image_upload", + "image_key": "sauna:panoramax", + "label": { + "en": "Add a picture of the sauna" + } + } + } + }, + { + "question": { + "en": "Does {title()} have a sauna?" + }, + "id": "has_sauna", + "labels": [ + "sauna_grouped", + "at_leisure_only", + "hidden" + ], + "mappings": [ + { + "if": "sauna=yes", + "then": { + "en": "Has a sauna" + } + }, + { + "if": "sauna=no", + "then": { + "en": "No sauna" + } + } + ] }, - "images", - "reviews", { "id": "sauna_access", - "condition": "leisure!=water_park", + "labels": [ + "sauna_expanded", + "sauna_grouped", + "hidden" + ], + "condition": { + "and": [ + { + "or": [ + "sauna=yes" + ] + } + ] + }, "question": { "en": "Is this sauna publicly accessible?", "de": "Ist die Sauna öffentlich zugänglich?" }, - "render": { - "en": "Access is {sauna:access}", - "de": "Zugang ist {sauna:access}" - }, - "freeform": { - "key": "sauna:access" - }, "mappings": [ { "if": "sauna:access=yes", @@ -104,48 +221,104 @@ } ] }, - "contact", - "fixme" - ], - "lineRendering": [ { - "width": 1, - "color": "blue" - } - ], - "credits:uid": 8770388, - "source": { - "osmTags": { - "or": [ - { - "and": [ - "sauna=yes", - "leisure=water_park" + "id": "charge_cost_rewritten", + "rewrite": { + "sourceString": [ + "{key}", + "{time}" + ], + "into": [ + [ + "2 hours", + { + "en": "2 hours", + "de": "2 Stunden" + } + ], + [ + "4 hours", + { + "en": "4 hours", + "de": "4 Stunden" + } + ], + [ + "day", + { + "en": "one day", + "de": "einen Tag" + } ] - }, + ] + }, + "renderings": [ { - "and": [ - "sauna=yes", - "leisure!=water_park", - "sauna:access!=no", - "sauna:access!=private", - "sauna:access!=customers" - ] + "id": "charge_{key}", + "labels": [ + "sauna_expanded", + "sauna_grouped", + "hidden" + ], + "question": { + "en": "What is the entrance fee for {time}?", + "de": "Was ist der Eintrittspreis für {time}?" + }, + "render": { + "en": "entrance fee for {time}: {charge}", + "de": "Eintrittspreis für {time}: {charge}" + }, + "freeform": { + "key": "charge", + "type": "currency", + "inline": true, + "postfixDistinguished": "{key}", + "addExtraTags": [ + "fee=yes" + ] + }, + "mappings": [ + { + "if": "fee=no", + "addExtraTags": [ + "charge=" + ], + "then": { + "en": "The sauna is free of charge", + "de": "Die Sauna ist kostenlos" + } + } + ], + "condition": { + "and": [ + "access!=customers", + "access!=no", + "access!=private", + { + "or": [ + "sauna=yes" + ] + } + ] + } } ] + }, + { + "id": "sauna-questions", + "labels": [ + "sauna_grouped", + "hidden" + ], + "render": { + "special": { + "type": "questions", + "labels": "at_leisure_only;sauna_expanded" + } + } } - }, - "description": { - "en": "A sauna is a small room or house designed as a place to experience dry or wet heat sessions, or an establishment with one or more of these and auxiliary facilities." - }, - "id": "sauna_at_leisure", - "name": { - "en": "Saunas at other amenities", - "de": "Saunen in anderen Einrichtungen" - }, - "title": { - "render": { - "en": "{name}" - } - } + ], + "allowMove": true, + "credits": "Osmwithspace", + "credits:uid": 8770388 } diff --git a/assets/layers/shops/shops.json b/assets/layers/shops/shops.json index cceec48e18..e66da0144b 100644 --- a/assets/layers/shops/shops.json +++ b/assets/layers/shops/shops.json @@ -365,6 +365,69 @@ "filter": true } }, + { + "id": "beauty_shop_type", + "question": { + "en": "What type of beauty shop is this?" + }, + "multiAnswer": true, + "mappings": [ + { + "if": "beauty=nails", + "then": { + "en": "Offers nail care services such as manicures, pedicures, and nail enhancements" + } + }, + { + "if": "beauty=skin_care", + "then": { + "en": "Offers skin care services" + } + }, + { + "if": "beauty=tanning", + "then": { + "en": "Offers tanning services such as sunbeds" + } + }, + { + "if": "beauty=cosmetics", + "then": { + "en": "Offers cosmetic services, such as makeup" + } + }, + { + "if": "beauty=massage", + "then": { + "en": "Offers massages" + } + }, + { + "if": "beauty=waxing", + "then": { + "en": "Offers hair removal through waxing" + } + }, + { + "if": "beauty=hair_removal", + "then": { + "en": "Offers hair removal services, e.g. with a laser" + } + }, + { + "if": "beauty=eyebrow", + "then": { + "en": "Offers eyebrow enhancement services" + } + }, + { + "if": "beauty=pedicure", + "then": { + "en": "Offers pedicure services" + } + } + ] + }, { "id": "brand", "question": { @@ -1357,9 +1420,7 @@ { "builtin": "bike_cleaning.bike_cleaning-service_bicycle_cleaning_charge" }, - "internet", - "internet-fee", - "internet-ssid", + "internet-all", { "id": "organic", "question": { @@ -1471,6 +1532,21 @@ } } }, + { + "builtin": "sauna_at_leisure.sauna_grouped", + "override": { + "condition": { + "and+": [ + { + "or": [ + "shop=beauty", + "shop=massage" + ] + } + ] + } + } + }, "description", "toilet_at_amenity_lib.all" ], diff --git a/assets/layers/tourism_accomodation/tourism_accomodation.json b/assets/layers/tourism_accomodation/tourism_accomodation.json index 75885933f9..7e32981e39 100644 --- a/assets/layers/tourism_accomodation/tourism_accomodation.json +++ b/assets/layers/tourism_accomodation/tourism_accomodation.json @@ -408,6 +408,7 @@ "contact", "wheelchair-access", "toilet_at_amenity_lib.all", + "sauna_at_leisure.sauna_grouped", "internet-all", "dog-access" ], diff --git a/assets/themes/sauna/sauna.json b/assets/themes/sauna/sauna.json index b0056e88c1..eb66bb7b59 100644 --- a/assets/themes/sauna/sauna.json +++ b/assets/themes/sauna/sauna.json @@ -1,16 +1,109 @@ { - "credits": "Osmwithspace", - "credits:uid": 8770388, "id": "sauna", "title": { "en": "Sauna" }, - "layers": [ - "sauna", - "sauna_at_leisure" - ], "description": { "en": "Sauna" }, - "icon": "./assets/layers/sauna/sauna.svg" + "icon": "./assets/layers/sauna/sauna.svg", + "credits": [ + "Osmwithspace" + ], + "#layers": "sauna_at_leisure acts as fallback-layer and will show all objects with `sauna=yes`", + "layers": [ + "sauna", + { + "builtin": "tourism_accomodation", + "override": { + "id": "tourism_accomodation_with_sauna", + "presets=": [], + "filter=": [], + "minzoom": 8, + "source": { + "osmTags": { + "and+": "sauna=yes" + } + } + } + }, + { + "builtin": "tourism_accomodation", + "override": { + "minzoom": 18, + "name=": null, + "filter": { + "sameAs": "tourism_accomodation_with_sauna" + } + } + }, + { + "builtin": "shops", + "override": { + "id": "shops_with_sauna", + "source": { + "osmTags": + { + "and+": [ + "sauna=yes" + ] + } + + }, + "presets=":[], + "minzoom": 8, + "filter=": [] + } + }, + { + "builtin": "shops", + "hideTagRenderingsWithLabels": [ + "shop_types" + ], + "override": { + "id": "beauty_shops", + "minzoom": 18, + "name=": null, + "source": { + "osmTags": { + "and+": [ + { + "or": [ + "shop=beauty", + "shop=massage" + ] + } + ] + } + }, + "presets=": [ + { + "tags": [ + "shop=beauty" + ], + "title": { + "en": "a beauty shop" + } + }, + { + "tags": [ + "shop=massage" + ], + "title": { + "en": "a massage shop" + } + } + ] + } + }, + { + "builtin": "toilet", + "override": { + "minzoom":18, + "name=": null + } + }, + "sauna_at_leisure" + ], + "credits:uid": 8770388 } diff --git a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts index 3f9c37b09d..62256c392d 100644 --- a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -1072,7 +1072,7 @@ class DeriveSource extends DesugaringStep { return json } - json.source = { osmTags } + json.source = { osmTags: {and: [osmTags]} } return json } } diff --git a/src/Models/ThemeConfig/LayerConfig.ts b/src/Models/ThemeConfig/LayerConfig.ts index d270044586..db66b509e7 100644 --- a/src/Models/ThemeConfig/LayerConfig.ts +++ b/src/Models/ThemeConfig/LayerConfig.ts @@ -71,7 +71,7 @@ export default class LayerConfig extends WithContextLoader { * If this layer is based on another layer, this might be indicated here * @private */ - private readonly _basedOn: string | undefined + public readonly _basedOn: string | undefined constructor( json: LayerConfigJson, diff --git a/src/UI/Popup/DataVisualisations.ts b/src/UI/Popup/DataVisualisations.ts index d1b5a885fd..05b15f4710 100644 --- a/src/UI/Popup/DataVisualisations.ts +++ b/src/UI/Popup/DataVisualisations.ts @@ -248,6 +248,10 @@ class PresetTypeSelect extends SpecialVisualizationSvelte { layer: LayerConfig, ): SvelteUIElement { const t = Translations.t.preset_type + if(layer._basedOn !== layer.id){ + console.warn("Trying to use the _original_ layer") + layer = state.theme.layers.find(l => l.id === layer._basedOn) ?? layer + } const question: QuestionableTagRenderingConfigJson = { id: layer.id + "-type", question: t.question.translations, @@ -260,6 +264,10 @@ class PresetTypeSelect extends SpecialVisualizationSvelte { }).translations, })), } + if(question.mappings.length === 0){ + console.error("No mappings for preset_type_select, something went wrong") + return undefined + } const config = new TagRenderingConfig(question) return new SvelteUIElement(TagRenderingEditable, { config, From 5f932c80a3a04a649c6e697c4d829d1a4c7bf0e6 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 3 Jul 2025 17:51:24 +0200 Subject: [PATCH 10/10] Themes(sauna): add sauna question to sports centre --- .../layers/sports_centre/sports_centre.json | 3 ++- assets/themes/sauna/sauna.json | 26 +++++++++++++++++++ .../ThemeConfig/Conversion/PrepareTheme.ts | 6 ++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/assets/layers/sports_centre/sports_centre.json b/assets/layers/sports_centre/sports_centre.json index 6d59fc0ec0..795ec5d5e5 100644 --- a/assets/layers/sports_centre/sports_centre.json +++ b/assets/layers/sports_centre/sports_centre.json @@ -1446,7 +1446,8 @@ "it": "Quali sport si praticano in questa struttura?", "cs": "Jaké sporty se provozují na tomto sportovišti?" } - } + }, + "sauna_at_leisure.sauna_grouped" ], "filter": [ "open_now" diff --git a/assets/themes/sauna/sauna.json b/assets/themes/sauna/sauna.json index eb66bb7b59..0f45cb7eec 100644 --- a/assets/themes/sauna/sauna.json +++ b/assets/themes/sauna/sauna.json @@ -37,6 +37,32 @@ } } }, + { + "builtin": "sports_centre", + "override": { + "minzoom": 8, + "id": "sports_centre_with_sauna", + "presets=": [], + "filter=":[], + "source": { + "osmTags": { + "and+": [ + "sauna=yes" + ] + } + } + } + }, + { + "builtin": "sports_centre", + "override": { + "name": null, + "minzoom": 18, + "filter": { + "sameAs": "sports_centre_with_sauna" + } + } + }, { "builtin": "shops", "override": { diff --git a/src/Models/ThemeConfig/Conversion/PrepareTheme.ts b/src/Models/ThemeConfig/Conversion/PrepareTheme.ts index e156b5f9b1..5a17a7684c 100644 --- a/src/Models/ThemeConfig/Conversion/PrepareTheme.ts +++ b/src/Models/ThemeConfig/Conversion/PrepareTheme.ts @@ -505,7 +505,11 @@ class WarnForUnsubstitutedLayersInTheme extends DesugaringStep if (layer["builtin"] !== undefined) { continue } - if (layer["source"]["geojson"] !== undefined) { + if(layer["override"]!==undefined){ + context.err("Got an `override` block without a `builtin`-specification") + continue + } + if (layer["source"]?.["geojson"] !== undefined) { // We turn a blind eye for import layers continue }