From 932712e8d95be8db3f4d0de55eeb8952cae2e724 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 20 Jun 2023 19:51:19 +0200 Subject: [PATCH 1/9] Basic shower layer --- assets/layers/shower/license_info.json | 12 +++ assets/layers/shower/shower.json | 136 +++++++++++++++++++++++++ assets/layers/shower/shower.svg | 87 ++++++++++++++++ assets/themes/toilets/toilets.json | 3 +- 4 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 assets/layers/shower/license_info.json create mode 100644 assets/layers/shower/shower.json create mode 100644 assets/layers/shower/shower.svg diff --git a/assets/layers/shower/license_info.json b/assets/layers/shower/license_info.json new file mode 100644 index 000000000..c95abdc9e --- /dev/null +++ b/assets/layers/shower/license_info.json @@ -0,0 +1,12 @@ +[ + { + "path": "shower.svg", + "license": "CC0", + "authors": [ + "James" + ], + "sources": [ + "https://github.com/gravitystorm/openstreetmap-carto/blob/master/symbols/amenity/shower.svg" + ] + } +] \ No newline at end of file diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json new file mode 100644 index 000000000..5a3a197f2 --- /dev/null +++ b/assets/layers/shower/shower.json @@ -0,0 +1,136 @@ +{ + "id": "shower", + "name": { + "en": "Shower" + }, + "minzoom": 12, + "source": { + "osmTags": "amenity=shower" + }, + "title": { + "render": { + "en": "Shower" + } + }, + "presets": [], + "tagRenderings": [ + "images", + "level", + { + "id": "access", + "question": { + "en": "Who can use this shower?" + }, + "mappings": [ + { + "if": "access=yes", + "then": { + "en": "Anyone can use this shower" + } + }, + { + "if": "access=customers", + "then": { + "en": "Only customers can use this shower" + } + }, + { + "if": "access=key", + "then": { + "en": "Accesible, but one has to ask for a key" + } + } + ] + }, + { + "id": "fee", + "question": { + "en": "Is there a fee for using this shower?" + }, + "mappings": [ + { + "if": "fee=yes", + "then": { + "en": "There is a fee for using this shower" + } + }, + { + "if": "fee=no", + "then": { + "en": "This shower is free to use" + } + } + ] + }, + { + "id": "charge", + "condition": "fee=yes", + "question": { + "en": "How much does it cost to use this shower?" + }, + "freeform": { + "key": "charge", + "type": "string", + "placeholder": { + "en": "e.g. 1€" + } + }, + "render": { + "en": "It costs {charge} to use this shower" + } + }, + "opening_hours", + { + "id": "hot_water", + "question": { + "en": "Does this shower have hot water available?" + }, + "mappings": [ + { + "if": "hot_water=yes", + "then": { + "en": "Hot water is available here" + } + }, + { + "if": "hot_water=fee", + "then": { + "en": "Hot water is available here, but there is a fee" + } + }, + { + "if": "hot_water=no", + "then": { + "en": "There is no hot water available here" + } + } + ] + } + ], + "filter": [], + "deletion": { + "softDeletionTags": { + "and": [ + "disused:amenity={amenity}", + "amenity=" + ] + }, + "neededChangesets": 1 + }, + "allowMove": { + "enableImproveAccuracy": true, + "enableRelocation": false + }, + "mapRendering": [ + { + "icon": "circle:white;./assets/layers/shower/shower.svg", + "location": [ + "point", + "centroid" + ] + } + ], + "description": { + "en": "A layer showing (public) showers" + } +} \ No newline at end of file diff --git a/assets/layers/shower/shower.svg b/assets/layers/shower/shower.svg new file mode 100644 index 000000000..4ff22a701 --- /dev/null +++ b/assets/layers/shower/shower.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/themes/toilets/toilets.json b/assets/themes/toilets/toilets.json index 8e91bf8fb..5f28908ba 100644 --- a/assets/themes/toilets/toilets.json +++ b/assets/themes/toilets/toilets.json @@ -41,6 +41,7 @@ "icon": "./assets/themes/toilets/toilets.svg", "layers": [ "toilet", - "toilet_at_amenity" + "toilet_at_amenity", + "shower" ] } \ No newline at end of file From 7728982a310fa692e2062b9f2734b41567da084b Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 20 Jun 2023 22:45:04 +0200 Subject: [PATCH 2/9] Change placeholder --- assets/layers/shower/shower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json index 5a3a197f2..0ff035a76 100644 --- a/assets/layers/shower/shower.json +++ b/assets/layers/shower/shower.json @@ -72,7 +72,7 @@ "key": "charge", "type": "string", "placeholder": { - "en": "e.g. 1€" + "en": "e.g. 1 EUR" } }, "render": { From 6e0553d6623fdaf700e3640ec898150b7fb49b96 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Wed, 21 Jun 2023 10:19:03 +0200 Subject: [PATCH 3/9] Fix typo in payment question --- assets/tagRenderings/questions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/tagRenderings/questions.json b/assets/tagRenderings/questions.json index 739fbd545..3a21ec490 100644 --- a/assets/tagRenderings/questions.json +++ b/assets/tagRenderings/questions.json @@ -977,7 +977,7 @@ }, { "if": "payment:debit_cards=yes", - "ifnot": "payment_debit_cards=no", + "ifnot": "payment:debit_cards=no", "icon": "./assets/tagRenderings/payment_card.svg", "then": { "en": "Debit cards are accepted here", From ff501fc44e47aaeb54a88cd7055fc45d4999f377 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Wed, 21 Jun 2023 12:00:21 +0200 Subject: [PATCH 4/9] Add psyment options --- assets/layers/shower/shower.json | 11 +++++++++++ assets/layers/toilet/toilet.json | 6 +++++- .../layers/toilet_at_amenity/toilet_at_amenity.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json index 0ff035a76..f6192eea3 100644 --- a/assets/layers/shower/shower.json +++ b/assets/layers/shower/shower.json @@ -105,6 +105,17 @@ } } ] + }, + { + "builtin": "payment-options-split", + "override": { + "condition": { + "or": [ + "fee=yes", + "hot_water=fee" + ] + } + } } ], "filter": [], diff --git a/assets/layers/toilet/toilet.json b/assets/layers/toilet/toilet.json index 02ae4005c..413025301 100644 --- a/assets/layers/toilet/toilet.json +++ b/assets/layers/toilet/toilet.json @@ -241,7 +241,11 @@ "condition": "fee=yes", "freeform": { "key": "charge", - "type": "string" + "type": "string", + "placeholder": { + "en": "e.g. 0.50 EUR", + "nl": "bijv. 0,50 EUR" + } }, "id": "toilet-charge" }, diff --git a/assets/layers/toilet_at_amenity/toilet_at_amenity.json b/assets/layers/toilet_at_amenity/toilet_at_amenity.json index f9964e306..b10d13f7a 100644 --- a/assets/layers/toilet_at_amenity/toilet_at_amenity.json +++ b/assets/layers/toilet_at_amenity/toilet_at_amenity.json @@ -344,7 +344,7 @@ "mapRendering": [ { "icon": { - "render": "./assets/layers/toilet/toilets.svg", + "render": "circle:white;./assets/layers/toilet/toilets.svg", "mappings": [ { "if": { From 51292cc5292612a67a82eefa0538a73f293a5e4e Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 27 Jun 2023 21:29:41 +0200 Subject: [PATCH 5/9] Add filter, move free to filters.json --- assets/layers/filters/filters.json | 23 +++++++++++++++++++- assets/layers/shower/shower.json | 34 ++++++++++++++++++++++++++++-- assets/layers/toilet/toilet.json | 22 +------------------ 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/assets/layers/filters/filters.json b/assets/layers/filters/filters.json index db570487e..4b1f6edad 100644 --- a/assets/layers/filters/filters.json +++ b/assets/layers/filters/filters.json @@ -173,6 +173,27 @@ } } ] + }, + { + "id": "free", + "options": [ + { + "question": { + "en": "Free to use", + "nl": "Gratis toegankelijk", + "de": "Nutzung kostenlos", + "fr": "Utilisation gratuite", + "da": "Gratis at bruge" + }, + "osmTags": { + "or": [ + "fee=no", + "fee=0", + "charge=0" + ] + } + } + ] } ] -} +} \ No newline at end of file diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json index f6192eea3..927edc9bb 100644 --- a/assets/layers/shower/shower.json +++ b/assets/layers/shower/shower.json @@ -12,7 +12,19 @@ "en": "Shower" } }, - "presets": [], + "presets": [ + { + "title": { + "en": "a shower" + }, + "description": { + "en": "A (public) shower" + }, + "tags": [ + "amenity=shower" + ] + } + ], "tagRenderings": [ "images", "level", @@ -118,7 +130,25 @@ } } ], - "filter": [], + "filter": [ + "free", + { + "id": "hot-water", + "options": [ + { + "question": { + "en": "Hot water available" + }, + "osmTags": { + "or": [ + "hot_water=yes", + "hot_water=fee" + ] + } + } + ] + } + ], "deletion": { "softDeletionTags": { "and": [ diff --git a/assets/layers/toilet/toilet.json b/assets/layers/toilet/toilet.json index 413025301..1b5344bc8 100644 --- a/assets/layers/toilet/toilet.json +++ b/assets/layers/toilet/toilet.json @@ -646,27 +646,7 @@ } ] }, - { - "id": "free", - "options": [ - { - "question": { - "en": "Free to use", - "nl": "Gratis toegankelijk", - "de": "Nutzung kostenlos", - "fr": "Utilisation gratuite", - "da": "Gratis at bruge" - }, - "osmTags": { - "or": [ - "fee=no", - "fee=0", - "charge=0" - ] - } - } - ] - }, + "free", "open_now" ], "deletion": { From f938ad3dc59d0e5ef5ae345b849737eb2abd9a8c Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 27 Jun 2023 21:32:29 +0200 Subject: [PATCH 6/9] Reset translations --- langs/layers/da.json | 14 +++--- langs/layers/de.json | 14 +++--- langs/layers/en.json | 104 ++++++++++++++++++++++++++++++++++++++++--- langs/layers/fr.json | 14 +++--- langs/layers/nl.json | 17 ++++--- 5 files changed, 128 insertions(+), 35 deletions(-) diff --git a/langs/layers/da.json b/langs/layers/da.json index 7f4f909dc..ec0318dc8 100644 --- a/langs/layers/da.json +++ b/langs/layers/da.json @@ -2047,6 +2047,13 @@ "question": "Åbent nu" } } + }, + "7": { + "options": { + "0": { + "question": "Gratis at bruge" + } + } } } }, @@ -2232,13 +2239,6 @@ "question": "Har et puslebord" } } - }, - "2": { - "options": { - "0": { - "question": "Gratis at bruge" - } - } } }, "name": "Toiletter", diff --git a/langs/layers/de.json b/langs/layers/de.json index e6bc1c6af..13dcdcb16 100644 --- a/langs/layers/de.json +++ b/langs/layers/de.json @@ -4474,6 +4474,13 @@ "question": "Bio-Produkte im Angebot" } } + }, + "7": { + "options": { + "0": { + "question": "Nutzung kostenlos" + } + } } } }, @@ -8226,13 +8233,6 @@ "question": "Mit Wickeltisch" } } - }, - "2": { - "options": { - "0": { - "question": "Nutzung kostenlos" - } - } } }, "name": "Toiletten", diff --git a/langs/layers/en.json b/langs/layers/en.json index 0a0dfe6b4..6d195e84f 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -4480,6 +4480,13 @@ "question": "Has organic options" } } + }, + "7": { + "options": { + "0": { + "question": "Free to use" + } + } } } }, @@ -7512,6 +7519,76 @@ "render": "Shop" } }, + "shower": { + "description": "A layer showing (public) showers", + "filter": { + "1": { + "options": { + "0": { + "question": "Hot water available" + } + } + } + }, + "name": "Shower", + "presets": { + "0": { + "description": "A (public) shower", + "title": "a shower" + } + }, + "tagRenderings": { + "access": { + "mappings": { + "0": { + "then": "Anyone can use this shower" + }, + "1": { + "then": "Only customers can use this shower" + }, + "2": { + "then": "Accesible, but one has to ask for a key" + } + }, + "question": "Who can use this shower?" + }, + "charge": { + "freeform": { + "placeholder": "e.g. 1 EUR" + }, + "question": "How much does it cost to use this shower?", + "render": "It costs {charge} to use this shower" + }, + "fee": { + "mappings": { + "0": { + "then": "There is a fee for using this shower" + }, + "1": { + "then": "This shower is free to use" + } + }, + "question": "Is there a fee for using this shower?" + }, + "hot_water": { + "mappings": { + "0": { + "then": "Hot water is available here" + }, + "1": { + "then": "Hot water is available here, but there is a fee" + }, + "2": { + "then": "There is no hot water available here" + } + }, + "question": "Does this shower have hot water available?" + } + }, + "title": { + "render": "Shower" + } + }, "slow_roads": { "description": "All carfree roads", "tagRenderings": { @@ -7666,6 +7743,23 @@ } }, "tagRenderings": { + "basketball-hoops": { + "mappings": { + "0": { + "then": "This basketball pitch has a single hoop" + }, + "1": { + "then": "This basketball pitch has two hoops" + }, + "2": { + "then": "This basketball pitch has four hoops" + }, + "3": { + "then": "This basketball pitch has {hoops} hoops" + } + }, + "question": "How much basketball hoops does this pitch have?" + }, "sport-pitch-access": { "mappings": { "0": { @@ -8277,13 +8371,6 @@ "question": "Has a changing table" } } - }, - "2": { - "options": { - "0": { - "question": "Free to use" - } - } } }, "name": "Toilets", @@ -8342,6 +8429,9 @@ "render": "The changing table is located at {changing_table:location}" }, "toilet-charge": { + "freeform": { + "placeholder": "e.g. 0.50 EUR" + }, "question": "How much does one have to pay for these toilets?", "render": "The fee is {charge}" }, diff --git a/langs/layers/fr.json b/langs/layers/fr.json index 4a95ff067..3422af286 100644 --- a/langs/layers/fr.json +++ b/langs/layers/fr.json @@ -3153,6 +3153,13 @@ "question": "Sans information sur le revêtement podotactile" } } + }, + "7": { + "options": { + "0": { + "question": "Utilisation gratuite" + } + } } } }, @@ -5064,13 +5071,6 @@ "question": "A une table à langer" } } - }, - "2": { - "options": { - "0": { - "question": "Utilisation gratuite" - } - } } }, "name": "Toilettes", diff --git a/langs/layers/nl.json b/langs/layers/nl.json index 61347aa03..20b31c9b4 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -4365,6 +4365,13 @@ "question": "Heeft biologische opties" } } + }, + "7": { + "options": { + "0": { + "question": "Gratis toegankelijk" + } + } } } }, @@ -7895,13 +7902,6 @@ "question": "Heeft een luiertafel" } } - }, - "2": { - "options": { - "0": { - "question": "Gratis toegankelijk" - } - } } }, "name": "Toiletten", @@ -7960,6 +7960,9 @@ "render": "De luiertafel bevindt zich in {changing_table:location}" }, "toilet-charge": { + "freeform": { + "placeholder": "bijv. 0,50 EUR" + }, "question": "Hoeveel moet men betalen om deze toiletten te gebruiken?", "render": "De toiletten gebruiken kost {charge}" }, From 23e3992f7f618ca566eb35492f0428ea0ab51e5a Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 27 Jun 2023 21:36:48 +0200 Subject: [PATCH 7/9] Change comma to point --- assets/layers/shower/shower.json | 2 +- assets/layers/toilet/toilet.json | 2 +- langs/layers/en.json | 2 +- langs/layers/nl.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json index 927edc9bb..24218b940 100644 --- a/assets/layers/shower/shower.json +++ b/assets/layers/shower/shower.json @@ -84,7 +84,7 @@ "key": "charge", "type": "string", "placeholder": { - "en": "e.g. 1 EUR" + "en": "e.g. 1.50 EUR" } }, "render": { diff --git a/assets/layers/toilet/toilet.json b/assets/layers/toilet/toilet.json index 1b5344bc8..85f7bc2e6 100644 --- a/assets/layers/toilet/toilet.json +++ b/assets/layers/toilet/toilet.json @@ -244,7 +244,7 @@ "type": "string", "placeholder": { "en": "e.g. 0.50 EUR", - "nl": "bijv. 0,50 EUR" + "nl": "bijv. 0.50 EUR" } }, "id": "toilet-charge" diff --git a/langs/layers/en.json b/langs/layers/en.json index 6d195e84f..27f216f22 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -7554,7 +7554,7 @@ }, "charge": { "freeform": { - "placeholder": "e.g. 1 EUR" + "placeholder": "e.g. 1.50 EUR" }, "question": "How much does it cost to use this shower?", "render": "It costs {charge} to use this shower" diff --git a/langs/layers/nl.json b/langs/layers/nl.json index 20b31c9b4..d160b55f2 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -7961,7 +7961,7 @@ }, "toilet-charge": { "freeform": { - "placeholder": "bijv. 0,50 EUR" + "placeholder": "bijv. 0.50 EUR" }, "question": "Hoeveel moet men betalen om deze toiletten te gebruiken?", "render": "De toiletten gebruiken kost {charge}" From c0a602ac39612d2930c991dedea0d00fa39954f3 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 27 Jun 2023 21:38:29 +0200 Subject: [PATCH 8/9] Add open_now filter and badge --- assets/layers/shower/shower.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json index 24218b940..ebcd34029 100644 --- a/assets/layers/shower/shower.json +++ b/assets/layers/shower/shower.json @@ -147,7 +147,8 @@ } } ] - } + }, + "open_now" ], "deletion": { "softDeletionTags": { @@ -168,6 +169,12 @@ "location": [ "point", "centroid" + ], + "iconBadges": [ + { + "if": "opening_hours~*", + "then": "icons.isOpen" + } ] } ], From 269695cb83c22644ceb8c5e540e3fd1e42bc7d3c Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Tue, 27 Jun 2023 23:49:31 +0200 Subject: [PATCH 9/9] Remove charge tag when changing to fee=no --- assets/layers/shower/shower.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/layers/shower/shower.json b/assets/layers/shower/shower.json index ebcd34029..4831bd663 100644 --- a/assets/layers/shower/shower.json +++ b/assets/layers/shower/shower.json @@ -70,7 +70,10 @@ "if": "fee=no", "then": { "en": "This shower is free to use" - } + }, + "addExtraTags": [ + "charge=" + ] } ] },