Merge pull request #965 from pietervdvn/feature/entrance-kerb-info

Feature/entrance kerb info
This commit is contained in:
Pieter Vander Vennet 2022-07-19 12:02:37 +02:00 committed by GitHub
commit 9319f93bf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 6 deletions

View file

@ -340,6 +340,34 @@
"key": "width", "key": "width",
"type": "distance" "type": "distance"
} }
},
{
"id": "kerb-height",
"question": {
"en": "What is the height of this kerb?",
"nl": "Hoe hoog is deze stoeprand?",
"de": "Wie hoch ist der Bordstein?"
},
"render": {
"en": "Kerb height: {kerb:height}",
"nl": "Stoeprandhoogte: {kerb:height}",
"de": "Bordsteinhöhe: {kerb:height}"
},
"freeform": {
"key": "kerb:height",
"placeholder": {
"en": "Height of the kerb",
"nl": "Hoogte van de stoeprand",
"de": "Höhe des Bordsteins"
},
"type": "pnat"
},
"mappings": [
{
"if": "kerb-height=",
"then": "kerb-height=0"
}
]
} }
], ],
"mapRendering": [ "mapRendering": [

View file

@ -47,7 +47,7 @@
"calculatedTags": [ "calculatedTags": [
"_entrance_properties=feat.overlapWith('entrance')?.map(e => e.feat.properties).filter(p => p !== undefined).filter(p => p.width !== undefined)", "_entrance_properties=feat.overlapWith('entrance')?.map(e => e.feat.properties).filter(p => p !== undefined).filter(p => p.width !== undefined)",
"_entrance:id=feat.get('_entrance_properties')?.map(e => e.id)?.at(0)", "_entrance:id=feat.get('_entrance_properties')?.map(e => e.id)?.at(0)",
"_entrance:width=feat.get('_entrance_properties')?.map(e => e.width)" "_entrance:width=feat.get('_entrance_properties')?.map(e => e.width)?.at(0)"
], ],
"tagRenderings": [ "tagRenderings": [
{ {

View file

@ -35,17 +35,23 @@
"overrideAll": { "overrideAll": {
"+calculatedTags": [ "+calculatedTags": [
"_poi_walls_and_buildings_entrance_properties=feat.closestn('walls_and_buildings', 1, undefined, 1000).map(w => ({id: w.feat.properties.id, width: w.feat.properties['_entrance:width']}))[0]", "_poi_walls_and_buildings_entrance_properties=feat.closestn('walls_and_buildings', 1, undefined, 1000).map(w => ({id: w.feat.properties.id, width: w.feat.properties['_entrance:width']}))[0]",
"_poi_entrance:id=JSON.parce(feat.properties._poi_walls_and_buildings_entrance_properteis)?.id",
"_poi_entrance:width=JSON.parse(feat.properties._poi_walls_and_buildings_entrance_properties)?.width" "_poi_entrance:width=JSON.parse(feat.properties._poi_walls_and_buildings_entrance_properties)?.width"
], ],
"+tagRenderings": [ "+tagRenderings": [
{ {
"id": "_poi_entrance:width", "id": "_poi_entrance:width",
"condition": "entrance=", "condition": {
"and": [
"entrance=",
"kerb="
]
},
"render": { "render": {
"en": "This door has a width of {canonical(_poi_entrance:width)} meter", "en": "<a href='#{_poi_entrance:id}'>This door has a width of {canonical(_poi_entrance:width)} meters</a>",
"nl": "Deze deur heeft een breedte van {canonical(_poi_entrance:width)} meter", "nl": "<a href='#{_poi_entrance:id}'>Deze deur heeft een breedte van {canonical(_poi_entrance:width)} meter</a>",
"de": "Diese Tür hat eine Durchgangsbreite von {canonical(_poi_entrance:width)} Meter", "de": "<a href='#{_poi_entrance:id}'>Diese Tür hat eine Durchgangsbreite von {canonical(_poi_entrance:width)} Meter</a>",
"es": "Esta puerta tiene una ancho de {canonical(_poi_entrance:width)} metros" "es": "<a href='#{_poi_entrance:id}'>Esta puerta tiene una ancho de {canonical(_poi_entrance:width)} metros</a>"
}, },
"freeform": { "freeform": {
"key": "_poi_entrance:width", "key": "_poi_entrance:width",