From 39d5ca424fd8c7c2eb4da90d019b3dacd105a07c Mon Sep 17 00:00:00 2001 From: Andrews Leruth Date: Tue, 19 Jul 2022 08:36:41 +0200 Subject: [PATCH 1/5] added kerb type and height question for entrance --- assets/layers/entrance/entrance.json | 90 ++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/assets/layers/entrance/entrance.json b/assets/layers/entrance/entrance.json index c5df0bb8d3..efb9a8400b 100644 --- a/assets/layers/entrance/entrance.json +++ b/assets/layers/entrance/entrance.json @@ -340,6 +340,96 @@ "key": "width", "type": "distance" } + }, + { + "id": "kerb-type", + "question": { + "en": "What is the height of this kerb?", + "nl": "Hoe hoog is deze stoeprand?", + "de": "Wie hoch ist der Bordstein?" + }, + "mappings": [ + { + "if": "kerb=raised", + "then": { + "en": "This kerb is raised (>3 cm)", + "nl": "Deze stoeprand is hoog (>3 cm)", + "de": "Der Bordstein ist erhöht (>3 cm)" + }, + "icon": { + "path": "./assets/layers/kerbs/raised.svg", + "class": "small" + } + }, + { + "if": "kerb=lowered", + "then": { + "en": "This kerb is lowered (~3 cm)", + "nl": "Deze stoeprand is verlaagd (~3 cm)", + "de": "Der Bordstein ist abgesenkt (~3 cm)" + }, + "icon": { + "path": "./assets/layers/kerbs/lowered.svg", + "class": "small" + } + }, + { + "if": "kerb=flush", + "then": { + "en": "This kerb is flush (~0cm)", + "nl": "Deze stoeprand is vlak (~0cm)", + "de": "Der Bordstein ist bündig (~0cm)" + }, + "icon": { + "path": "./assets/layers/kerbs/flush.svg", + "class": "small" + } + }, + { + "if": "kerb=no", + "then": { + "en": "There is no kerb here", + "nl": "Er is hier geen stoeprand", + "de": "Hier gibt es keinen Bordstein" + }, + "hideInAnswer": true, + "icon": { + "path": "./assets/layers/kerbs/no.svg", + "class": "small" + } + }, + { + "if": "kerb=yes", + "then": { + "en": "There is a kerb of unknown height", + "nl": "Er is een stoeprand met onbekende hoogte", + "de": "Es gibt einen Bordstein mit unbekannter Höhe" + }, + "hideInAnswer": true + } + ] + }, + { + "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" + } } ], "mapRendering": [ From 2611bd20523836c2c2e946fc191f9d9f79240fb9 Mon Sep 17 00:00:00 2001 From: Andrews Leruth Date: Tue, 19 Jul 2022 09:41:25 +0200 Subject: [PATCH 2/5] added calculated tags --- assets/layers/entrance/entrance.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/layers/entrance/entrance.json b/assets/layers/entrance/entrance.json index efb9a8400b..651d251c94 100644 --- a/assets/layers/entrance/entrance.json +++ b/assets/layers/entrance/entrance.json @@ -32,6 +32,9 @@ "es": "Entrada" } }, + "calculatedTags": [ + "" + ], "tagRenderings": [ "images", { From ce24fb5b8852a8c293c05dec7cc5dc21dce6867d Mon Sep 17 00:00:00 2001 From: Andrews Leruth Date: Tue, 19 Jul 2022 10:50:29 +0200 Subject: [PATCH 3/5] entrance now has kerb-height questions --- assets/layers/entrance/entrance.json | 77 ++----------------- .../walls_and_buildings.json | 2 +- 2 files changed, 8 insertions(+), 71 deletions(-) diff --git a/assets/layers/entrance/entrance.json b/assets/layers/entrance/entrance.json index 651d251c94..4f5a4dca31 100644 --- a/assets/layers/entrance/entrance.json +++ b/assets/layers/entrance/entrance.json @@ -33,7 +33,6 @@ } }, "calculatedTags": [ - "" ], "tagRenderings": [ "images", @@ -344,74 +343,6 @@ "type": "distance" } }, - { - "id": "kerb-type", - "question": { - "en": "What is the height of this kerb?", - "nl": "Hoe hoog is deze stoeprand?", - "de": "Wie hoch ist der Bordstein?" - }, - "mappings": [ - { - "if": "kerb=raised", - "then": { - "en": "This kerb is raised (>3 cm)", - "nl": "Deze stoeprand is hoog (>3 cm)", - "de": "Der Bordstein ist erhöht (>3 cm)" - }, - "icon": { - "path": "./assets/layers/kerbs/raised.svg", - "class": "small" - } - }, - { - "if": "kerb=lowered", - "then": { - "en": "This kerb is lowered (~3 cm)", - "nl": "Deze stoeprand is verlaagd (~3 cm)", - "de": "Der Bordstein ist abgesenkt (~3 cm)" - }, - "icon": { - "path": "./assets/layers/kerbs/lowered.svg", - "class": "small" - } - }, - { - "if": "kerb=flush", - "then": { - "en": "This kerb is flush (~0cm)", - "nl": "Deze stoeprand is vlak (~0cm)", - "de": "Der Bordstein ist bündig (~0cm)" - }, - "icon": { - "path": "./assets/layers/kerbs/flush.svg", - "class": "small" - } - }, - { - "if": "kerb=no", - "then": { - "en": "There is no kerb here", - "nl": "Er is hier geen stoeprand", - "de": "Hier gibt es keinen Bordstein" - }, - "hideInAnswer": true, - "icon": { - "path": "./assets/layers/kerbs/no.svg", - "class": "small" - } - }, - { - "if": "kerb=yes", - "then": { - "en": "There is a kerb of unknown height", - "nl": "Er is een stoeprand met onbekende hoogte", - "de": "Es gibt einen Bordstein mit unbekannter Höhe" - }, - "hideInAnswer": true - } - ] - }, { "id": "kerb-height", "question": { @@ -432,7 +363,13 @@ "de": "Höhe des Bordsteins" }, "type": "pnat" - } + }, + "mappings": [ + { + "if": "kerb-height=", + "then": "kerb-height=0" + } + ] } ], "mapRendering": [ diff --git a/assets/layers/walls_and_buildings/walls_and_buildings.json b/assets/layers/walls_and_buildings/walls_and_buildings.json index 133a2bf0f2..4ef1816e6a 100644 --- a/assets/layers/walls_and_buildings/walls_and_buildings.json +++ b/assets/layers/walls_and_buildings/walls_and_buildings.json @@ -47,7 +47,7 @@ "calculatedTags": [ "_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:width=feat.get('_entrance_properties')?.map(e => e.width)" + "_entrance:width=feat.get('_entrance_properties')?.map(e => e.width)?.at(0)" ], "tagRenderings": [ { From 665ece1d3e6bd531eeeecff658eac1c8da80f067 Mon Sep 17 00:00:00 2001 From: Andrews Leruth Date: Tue, 19 Jul 2022 10:56:07 +0200 Subject: [PATCH 4/5] removed calulatedTags --- assets/layers/entrance/entrance.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/assets/layers/entrance/entrance.json b/assets/layers/entrance/entrance.json index 4f5a4dca31..8683d4106c 100644 --- a/assets/layers/entrance/entrance.json +++ b/assets/layers/entrance/entrance.json @@ -32,8 +32,6 @@ "es": "Entrada" } }, - "calculatedTags": [ - ], "tagRenderings": [ "images", { From f4f845ae8f04959e5bce7f46e5457ec505d4a385 Mon Sep 17 00:00:00 2001 From: Andrews Leruth Date: Tue, 19 Jul 2022 11:53:16 +0200 Subject: [PATCH 5/5] fixed typo --- assets/themes/onwheels/onwheels.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/assets/themes/onwheels/onwheels.json b/assets/themes/onwheels/onwheels.json index 2994e849b3..d62f1e68b9 100644 --- a/assets/themes/onwheels/onwheels.json +++ b/assets/themes/onwheels/onwheels.json @@ -34,17 +34,23 @@ "overrideAll": { "+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_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" ], "+tagRenderings": [ { "id": "_poi_entrance:width", - "condition": "entrance=", + "condition": { + "and": [ + "entrance=", + "kerb=" + ] + }, "render": { - "en": "This door has a width of {canonical(_poi_entrance:width)} meter", - "nl": "Deze deur heeft een breedte van {canonical(_poi_entrance:width)} meter", - "de": "Diese Tür hat eine Durchgangsbreite von {canonical(_poi_entrance:width)} Meter", - "es": "Esta puerta tiene una ancho de {canonical(_poi_entrance:width)} metros" + "en": "This door has a width of {canonical(_poi_entrance:width)} meters", + "nl": "Deze deur heeft een breedte van {canonical(_poi_entrance:width)} meter", + "de": "Diese Tür hat eine Durchgangsbreite von {canonical(_poi_entrance:width)} Meter", + "es": "Esta puerta tiene una ancho de {canonical(_poi_entrance:width)} metros" }, "freeform": { "key": "_poi_entrance:width",