Themes: add toilet information in food and shops

This commit is contained in:
Pieter Vander Vennet 2025-04-21 04:10:51 +02:00
parent 92eca242ec
commit 3bc8eae6b1
9 changed files with 174 additions and 15 deletions

View file

@ -1433,7 +1433,8 @@
"dog-access", "dog-access",
"internet", "internet",
"internet-fee", "internet-fee",
"internet-ssid" "internet-ssid",
"toilet_at_amenity_lib.all"
], ],
"filter": [ "filter": [
"open_now", "open_now",

View file

@ -1827,7 +1827,11 @@
"labels": [ "labels": [
"level" "level"
], ],
"condition": "repeat_on~*", "condition": {
"and": [
"repeat_on~*"
]
},
"render": { "render": {
"en": "Multiple, identical objects can be found on floors {repeat_on}.", "en": "Multiple, identical objects can be found on floors {repeat_on}.",
"nl": "Er zijn verschillende, identieke objecten op verdiepingen {repeat_on}.", "nl": "Er zijn verschillende, identieke objecten op verdiepingen {repeat_on}.",
@ -1842,7 +1846,11 @@
"labels": [ "labels": [
"level" "level"
], ],
"condition": "repeat_on=", "condition": {
"and": [
"repeat_on="
]
},
"question": { "question": {
"nl": "Op welke verdieping bevindt dit punt zich?", "nl": "Op welke verdieping bevindt dit punt zich?",
"en": "On what level is this feature located?", "en": "On what level is this feature located?",
@ -2053,7 +2061,11 @@
"pl": "Czy w {title()} wolno palić?" "pl": "Czy w {title()} wolno palić?"
}, },
"#condition": "Based on https://en.wikipedia.org/wiki/List_of_smoking_bans", "#condition": "Based on https://en.wikipedia.org/wiki/List_of_smoking_bans",
"condition": "_country!~al|be", "condition": {
"and": [
"_country!~al|be"
]
},
"mappings": [ "mappings": [
{ {
"if": "smoking=yes", "if": "smoking=yes",
@ -2401,7 +2413,11 @@
"labels": [ "labels": [
"internet-all" "internet-all"
], ],
"condition": "internet_access~.*wlan.*", "condition": {
"and": [
"internet_access~.*wlan.*"
]
},
"question": { "question": {
"en": "What is the network name for the wireless internet access?", "en": "What is the network name for the wireless internet access?",
"nl": "Wat is de netwerknaam voor de draadloze internettoegang?", "nl": "Wat is de netwerknaam voor de draadloze internettoegang?",
@ -3321,6 +3337,29 @@
"freeform": { "freeform": {
"key": "name" "key": "name"
} }
},
{
"id": "has_toilets",
"question": {
"en": "Has {title()} toilets?",
"nl": "Heeft {title()} toiletten?"
},
"mappings": [
{
"if": "toilets=yes",
"then": {
"en": "Has toilets",
"nl": "Heeft toiletten"
}
},
{
"if": "toilets=no",
"then": {
"en": "Has no toilets",
"nl": "Heeft geenad toiletten"
}
}
]
} }
], ],
"allowMove": false, "allowMove": false,

View file

@ -1326,7 +1326,8 @@
} }
}, },
"dog-access", "dog-access",
"description" "description",
"toilet_at_amenity_lib.all"
], ],
"filter": [ "filter": [
{ {

View file

@ -1494,7 +1494,11 @@
"prefixed", "prefixed",
"adult-changing-table" "adult-changing-table"
], ],
"condition": "changing_table:adult=yes", "condition": {
"and": [
"changing_table:adult=yes"
]
},
"classes": "bold text-lg" "classes": "bold text-lg"
} }
}, },

View file

@ -141,14 +141,32 @@
"lineRendering": [], "lineRendering": [],
"tagRenderings": [ "tagRenderings": [
"images", "images",
{
"id": "dead",
"labels": [
"hidden",
"relevant_questions"
],
"condition": "id=",
"render": "Only used to make sure 'relevant-questions' is known"
},
{ {
"builtin": "toilet.amenity-no-prefix", "builtin": "toilet.amenity-no-prefix",
"prefix": "toilets" "prefix": "toilets",
"override": {
"labels+": [
"relevant_questions"
]
}
}, },
{ {
"builtin": "opening_hours", "builtin": "opening_hours",
"override": { "override": {
"condition": "toilets:access!=no", "condition": {
"and+": [
"toilets:access!=no"
]
},
"question": { "question": {
"en": "When is the amenity where these toilets are located open?", "en": "When is the amenity where these toilets are located open?",
"de": "Wann ist der Ort, an dem sich diese Toiletten befinden, geöffnet?", "de": "Wann ist der Ort, an dem sich diese Toiletten befinden, geöffnet?",
@ -159,7 +177,14 @@
} }
} }
}, },
"toilet.amenity-prefixed", {
"builtin": "toilet.amenity-prefixed",
"override": {
"labels+": [
"relevant_questions"
]
}
},
{ {
"id": "toilets-wheelchair", "id": "toilets-wheelchair",
"labels": [ "labels": [

View file

@ -0,0 +1,88 @@
{
"id": "toilet_at_amenity_lib",
"description": "Special layer which makes it easy to add, as a group, information about toilets to any POI",
"source": "special:library",
"tagRenderings": [
{
"id": "toilets-group",
"labels": [
"all"
],
"render": {
"special": {
"type": "group",
"header": "grouptitle",
"labels": "toilet-questions"
}
}
},
{
"id": "grouptitle",
"render": {
"en": "Toilet information",
"nl": "Informatie over de toiletten"
},
"mappings": [
{
"if": "toilets=no",
"then": {
"en": "Does not have toilets",
"nl": "Heeft geen toiletten"
}
}
]
},
{
"builtin": "has_toilets",
"override": {
"labels+": [
"toilet-questions",
"hidden",
"all"
]
}
},
{
"builtin": "toilet_at_amenity.relevant_questions",
"override": {
"labels+": [
"toilet-questions",
"hidden",
"all"
],
"condition": {
"and+": [
"toilets=yes"
]
}
}
},
{
"id": "toilet-question-box",
"labels": [
"toilet-questions",
"all"
],
"render": {
"special": {
"type": "questions",
"labels": "toilet-questions"
}
}
}
],
"allowMove": false,
"pointRendering": [
{
"location": [
"centroid",
"point"
],
"marker": [
{
"icon": "circle"
}
]
}
]
}

View file

@ -410,7 +410,8 @@ export class ExpandTagRendering extends Conversion<
name + name +
" was not found.\n\tDid you mean one of " + " was not found.\n\tDid you mean one of " +
candidates.join(", ") + candidates.join(", ") +
"?\n(Hint: did you add a new label and are you trying to use this label at the same time? Run 'reset:layeroverview' first" "?\n(Hint: did you add a new label and are you trying to use this label at the same time? Run 'reset:layeroverview' first\n" +
"HINT: are you overriding a `condition`? Check that the source condition has the format `condition: {and: [...]}`"
) )
continue continue
} }

View file

@ -14,7 +14,7 @@ import NearbyImagesCollapsed from "../Image/NearbyImagesCollapsed.svelte"
class NearbyImageVis implements SpecialVisualizationSvelte { class NearbyImageVis implements SpecialVisualizationSvelte {
// Class must be in SpecialVisualisations due to weird cyclical import that breaks the tests // Class must be in SpecialVisualisations due to weird cyclical import that breaks the tests
args: [ args = [
{ {
name: "mode", name: "mode",
defaultValue: "closed", defaultValue: "closed",
@ -26,7 +26,7 @@ class NearbyImageVis implements SpecialVisualizationSvelte {
doc: "If 'readonly' or 'yes', will not show the 'link'-button", doc: "If 'readonly' or 'yes', will not show the 'link'-button",
}, },
] ]
group: "images" group = "images"
docs = docs =
"A component showing nearby images loaded from various online services such as Mapillary. In edit mode and when used on a feature, the user can select an image to add to the feature" "A component showing nearby images loaded from various online services such as Mapillary. In edit mode and when used on a feature, the user can select an image to add to the feature"
funcName = "nearby_images" funcName = "nearby_images"

View file

@ -97,7 +97,7 @@ export interface SpecialVisualization {
defaultValue?: string defaultValue?: string
doc: string doc: string
required?: false | boolean, required?: false | boolean,
type?: "key" type?: "key" | string
}[] }[]
readonly getLayerDependencies?: (argument: string[]) => string[] readonly getLayerDependencies?: (argument: string[]) => string[]
@ -112,7 +112,7 @@ export interface SpecialVisualization {
): BaseUIElement ): BaseUIElement
} }
export interface SpecialVisualizationSvelte { export interface SpecialVisualizationSvelte extends SpecialVisualization {
readonly funcName: string readonly funcName: string
readonly docs: string readonly docs: string
/** /**