forked from MapComplete/MapComplete
Add question on accessibility of bicycle pumps
This commit is contained in:
parent
fa2e9db571
commit
6ff4d22de3
3 changed files with 73 additions and 4 deletions
|
@ -96,6 +96,14 @@ export default class PointRenderingConfig extends WithContextLoader {
|
|||
img.SetClass("badge")
|
||||
}
|
||||
return img
|
||||
} else if (Svg.All[htmlSpec + ".svg"] !== undefined) {
|
||||
const svg = (Svg.All[htmlSpec + ".svg"] as string)
|
||||
const img = new Img(svg, true)
|
||||
.SetStyle(style)
|
||||
if (isBadge) {
|
||||
img.SetClass("badge")
|
||||
}
|
||||
return img
|
||||
} else {
|
||||
return new FixedUiElement(`<img src="${htmlSpec}" style="${style}" />`);
|
||||
}
|
||||
|
@ -126,7 +134,7 @@ export default class PointRenderingConfig extends WithContextLoader {
|
|||
}
|
||||
return PointRenderingConfig.FromHtmlMulti(htmlDefs, rotation, false, defaultPin)
|
||||
}
|
||||
|
||||
|
||||
public GetSimpleIcon(tags: UIEventSource<any>): BaseUIElement {
|
||||
const self = this;
|
||||
if (this.icon === undefined) {
|
||||
|
@ -192,10 +200,10 @@ export default class PointRenderingConfig extends WithContextLoader {
|
|||
|
||||
const icon = this.GetSimpleIcon(tags)
|
||||
let badges = undefined;
|
||||
if( options?.includeBadges ?? true){
|
||||
if (options?.includeBadges ?? true) {
|
||||
badges = this.GetBadges(tags)
|
||||
}
|
||||
const iconAndBadges = new Combine([icon,badges ])
|
||||
const iconAndBadges = new Combine([icon, badges])
|
||||
.SetClass("block relative")
|
||||
|
||||
if (!options?.noSize) {
|
||||
|
|
|
@ -277,6 +277,54 @@
|
|||
],
|
||||
"id": "bike_repair_station-opening_hours"
|
||||
},
|
||||
{
|
||||
"id": "access",
|
||||
"question": {
|
||||
"en": "Who is allowed to use this repair station?",
|
||||
"nl": "Wie kan dit herstelpunt gebruiken?"
|
||||
},
|
||||
"mappings": [
|
||||
{
|
||||
"if": "access=yes",
|
||||
"then": {
|
||||
"en": "Publicly accessible",
|
||||
"nl": "Publiek toegankelijk"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "access=public",
|
||||
"then": {
|
||||
"en": "Publicly accessible",
|
||||
"nl": "Publiek toegankelijk"
|
||||
},
|
||||
"hideInAnswer": true
|
||||
},
|
||||
{
|
||||
"if": "access=customers",
|
||||
"then": {
|
||||
"en": "Only for customers",
|
||||
"nl": "Enkel voor klanten van de bijhorende zaak"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "access=private",
|
||||
"then": {
|
||||
"en": "Not accessible to the general public",
|
||||
"nl": "Niet publiek toegankelijk"
|
||||
},
|
||||
"icon": "./assets/svg/invalid.svg"
|
||||
},
|
||||
{
|
||||
"if": "access=no",
|
||||
"then": {
|
||||
"en": "Not accessible to the general public",
|
||||
"nl": "Niet publiek toegankelijk"
|
||||
},
|
||||
"icon": "./assets/svg/invalid.svg",
|
||||
"hideInAnswer": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"labels": [
|
||||
"operator-info"
|
||||
|
@ -753,7 +801,14 @@
|
|||
{
|
||||
"if": "operator=De Fietsambassade Gent",
|
||||
"then": "./assets/themes/cyclofix/fietsambassade_gent_logo_small.svg"
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"or": ["access=no","access=private"]
|
||||
},
|
||||
"then": "invalid"
|
||||
}
|
||||
|
||||
],
|
||||
"iconSize": {
|
||||
"render": "50,50,bottom"
|
||||
|
|
|
@ -169,10 +169,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"badges": [
|
||||
"iconBadges": [
|
||||
{
|
||||
"if": "service:bicycle:pump:operational_status=broken",
|
||||
"then": "close:red"
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"or": ["access=no","access=private"]
|
||||
},
|
||||
"then": "invalid"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue