forked from MapComplete/MapComplete
Themes(food): add whether a highchair is available, see #2447
This commit is contained in:
parent
30e706dfb7
commit
268328b6fe
8 changed files with 106 additions and 2 deletions
|
@ -521,6 +521,17 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "baby_highchair",
|
||||
"options": [
|
||||
{
|
||||
"question": {
|
||||
"en": "Has a high chair for infants available"
|
||||
},
|
||||
"osmTags": "highchair!=no"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"allowMove": false
|
||||
|
|
|
@ -902,6 +902,7 @@
|
|||
"cs": "<h3>Otevírací hodiny drive-through</h3>{opening_hours_table(opening_hours:drive_through)}"
|
||||
}
|
||||
},
|
||||
"child_highchair",
|
||||
{
|
||||
"question": {
|
||||
"nl": "Heeft deze eetgelegenheid een vegetarische optie?",
|
||||
|
@ -1643,6 +1644,7 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"filters.baby_highchair",
|
||||
"filters.has_organic",
|
||||
"filters.sugar_free",
|
||||
"filters.gluten_free",
|
||||
|
|
23
assets/layers/questions/baby_chair.svg
Normal file
23
assets/layers/questions/baby_chair.svg
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 218 218" xml:space="preserve">
|
||||
<path d="M151.967,218h-3.155c-1.381,0-2.5-1.119-2.5-2.5s1.119-2.5,2.5-2.5h0.405l-1.994-20.932H78.086l-1.995,20.941
|
||||
c1.278,0.111,2.28,1.184,2.28,2.49c0,1.381-1.119,2.5-2.5,2.5h-2.528c-0.704,0-1.376-0.297-1.85-0.818
|
||||
c-0.474-0.521-0.706-1.218-0.639-1.918L82.806,89.772c-5.058-1.573-8.892-6.122-9.322-11.63l-2.633-33.7
|
||||
c-0.055-0.695,0.184-1.381,0.657-1.893c0.473-0.511,1.139-0.802,1.835-0.802h67.38l6.858-31.811C148.822,4.179,153.998,0,159.888,0
|
||||
c0.726,0,1.415,0.315,1.89,0.864c0.475,0.548,0.688,1.276,0.584,1.994l-6.036,41.729l-4.458,34.234
|
||||
c-0.688,5.283-4.465,9.522-9.361,10.989l11.949,125.453c0.067,0.701-0.166,1.397-0.639,1.918
|
||||
C153.343,217.703,152.671,218,151.967,218z M78.562,187.068h68.186l-7.478-78.514H86.04L78.562,187.068z M86.516,103.554h52.278
|
||||
l-1.256-13.191H87.772L86.516,103.554z M76.046,46.748l2.422,31.005c0.334,4.267,3.948,7.61,8.228,7.61h52.031
|
||||
c4.132,0,7.65-3.09,8.184-7.187l4.093-31.428h-8.208c-0.034,0.001-0.068,0.001-0.103,0H76.046z M145.837,41.748h5.848l5.227-36.132
|
||||
c-2.208,0.952-3.916,2.927-4.444,5.375L145.837,41.748z M113.295,81.254c-0.297,0-0.594-0.053-0.877-0.159
|
||||
c-0.674-0.252-16.507-6.333-16.507-19.316c0-6.562,4.293-10.801,10.938-10.801c2.857,0,5.003,1.368,6.446,2.756
|
||||
c1.442-1.388,3.589-2.756,6.445-2.756c6.645,0,10.938,4.24,10.938,10.801c0,12.983-15.833,19.063-16.506,19.316
|
||||
C113.889,81.201,113.592,81.254,113.295,81.254z M106.849,55.978c-2.709,0-5.938,1.006-5.938,5.801
|
||||
c0,8.055,9.42,12.928,12.384,14.261c2.959-1.331,12.383-6.205,12.383-14.261c0-4.795-3.229-5.801-5.938-5.801
|
||||
c-2.628,0-4.213,2.901-4.228,2.931c-0.43,0.827-1.285,1.345-2.217,1.345s-1.787-0.519-2.217-1.345
|
||||
C111.07,58.895,109.466,55.978,106.849,55.978z M108.485,37.688H58.112c-1.381,0-2.5-1.119-2.5-2.5s1.119-2.5,2.5-2.5h50.373
|
||||
c1.381,0,2.5,1.119,2.5,2.5S109.866,37.688,108.485,37.688z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
2
assets/layers/questions/baby_chair.svg.license
Normal file
2
assets/layers/questions/baby_chair.svg.license
Normal file
|
@ -0,0 +1,2 @@
|
|||
SPDX-FileCopyrightText: New Borns
|
||||
SPDX-License-Identifier: CC0-1.0
|
|
@ -19,6 +19,16 @@
|
|||
"https://commons.wikimedia.org/wiki/File:Noun_telecoil_audio_induction_hearing_loop_symbol_2011213.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "baby_chair.svg",
|
||||
"license": "CC0-1.0",
|
||||
"authors": [
|
||||
"New Borns"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.svgrepo.com/svg/35946/baby-chair-with-heart"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "cash.svg",
|
||||
"license": "CC-BY-3.0",
|
||||
|
|
|
@ -3629,6 +3629,59 @@
|
|||
"freeform": {
|
||||
"key": "ref"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "child_highchair",
|
||||
"question": {
|
||||
"en": "Is there a high chair (also known as booster chair) for toddlers available here?"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "highchair",
|
||||
"type": "nat"
|
||||
},
|
||||
"render": {
|
||||
"en": "{highchair} highchairs are available"
|
||||
},
|
||||
"mappings": [
|
||||
{
|
||||
"if": "highchair=no",
|
||||
"alsoShowIf": "highchair=0",
|
||||
"then": {
|
||||
"en": "No highchair available"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "highchair=yes",
|
||||
"icon": {
|
||||
"path": "./assets/layers/questions/baby_chair.svg",
|
||||
"class": "medium"
|
||||
},
|
||||
"then": {
|
||||
"en": "At least one high chair is available"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "highchair=1",
|
||||
"icon": {
|
||||
"path": "./assets/layers/questions/baby_chair.svg",
|
||||
"class": "medium"
|
||||
},
|
||||
"then": {
|
||||
"en": "One high chair is available"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "highchair=2",
|
||||
"icon": {
|
||||
"path": "./assets/layers/questions/baby_chair.svg",
|
||||
"class": "medium"
|
||||
},
|
||||
"then": {
|
||||
"en": "Two high chairs are available"
|
||||
}
|
||||
}
|
||||
],
|
||||
"filters": ["filters.child_highchair"]
|
||||
}
|
||||
],
|
||||
"allowMove": false,
|
||||
|
|
|
@ -207,7 +207,7 @@ class LayerBuilder extends Conversion<object, Map<string, LayerConfigJson>> {
|
|||
}
|
||||
}
|
||||
|
||||
context = context.inOperation("building Layer " + id).enters("layer", id)
|
||||
context = context.inOperation("building Layer " + id).enters("layer:", id)
|
||||
|
||||
const config = this._layerConfigJsons.get(id)
|
||||
if (config.id !== id) {
|
||||
|
@ -855,7 +855,7 @@ class LayerOverviewUtils extends Script {
|
|||
sharedQuestions
|
||||
)
|
||||
builder.writeLayer(sharedQuestionsDef)
|
||||
const allLayers = builder.convertStrict({}, ConversionContext.construct([], []))
|
||||
const allLayers = builder.convertStrict({}, ConversionContext.construct([], ["Building the layer index"]))
|
||||
if (layerState.get("usersettings") !== "clean") {
|
||||
// We always need the calculated tags of 'usersettings', so we export them separately if dirty
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@ export class PruneFilters extends DesugaringStep<LayerConfigJson> {
|
|||
): FilterConfigJson {
|
||||
if (filter.options.length === 1) {
|
||||
const option = filter.options[0]
|
||||
if(!option.osmTags){
|
||||
context.err("Found a filter without osmTags. Did you forget to add them? The filter is:", JSON.stringify(option))
|
||||
}
|
||||
const tags = TagUtils.Tag(option.osmTags)
|
||||
const optimized = TagUtils.removeKnownParts(tags, sourceTags, true)
|
||||
if (optimized === true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue