diff --git a/Customizations/JSON/TagRenderingConfig.ts b/Customizations/JSON/TagRenderingConfig.ts index 63403079c..ca2cea76e 100644 --- a/Customizations/JSON/TagRenderingConfig.ts +++ b/Customizations/JSON/TagRenderingConfig.ts @@ -133,7 +133,7 @@ export default class TagRenderingConfig { } if(this.render && this.question && this.freeform === undefined){ - throw `${context}: Detected a tagrendering which takes input without freeform key in ${context}` + throw `${context}: Detected a tagrendering which takes input without freeform key in ${context}; the question is ${this.question.txt}` } if(!json.multiAnswer && this.mappings !== undefined && this.question !== undefined){ diff --git a/Logic/FeatureSource/FilteringFeatureSource.ts b/Logic/FeatureSource/FilteringFeatureSource.ts index 2ac54ef28..a1e25e23b 100644 --- a/Logic/FeatureSource/FilteringFeatureSource.ts +++ b/Logic/FeatureSource/FilteringFeatureSource.ts @@ -42,7 +42,6 @@ export default class FilteringFeatureSource implements FeatureSource { const isShown = layer.layerDef.isShown const tags = f.feature.properties; - console.log("Is shown: ", isShown," known? ", isShown.IsKnown(tags), " result: ", isShown.GetRenderValue(tags).txt) if(isShown.IsKnown(tags)){ const result = layer.layerDef.isShown.GetRenderValue(f.feature.properties).txt; if(result !== "yes"){ diff --git a/assets/layers/playground/playground.json b/assets/layers/playground/playground.json index 81f125d82..df78ce6c5 100644 --- a/assets/layers/playground/playground.json +++ b/assets/layers/playground/playground.json @@ -288,6 +288,21 @@ "nl": "Van zonsopgang tot zonsondergang", "en": "Accessible from sunrise till sunset" } + }, + { + "if": "opening_hours=24/7", + "then": { + "nl": "Dag en nacht toegankelijk", + "en": "Always accessible" + } + }, + { + "if": "opening_hours=", + "then": { + "nl": "Dag en nacht toegankelijk", + "en": "Always accessible" + }, + "hideInAnswer": true } ] }, @@ -300,6 +315,18 @@ "icon": { "render": "https://upload.wikimedia.org/wikipedia/commons/0/00/Map_icons_by_Scott_de_Jonge_-_playground.svg" }, + "iconOverlays": [ + { + "if": { + "and": [ + "opening_hours!=24/7", + "opening_hours~*" + ] + }, + "then": "isOpen", + "badge": true + } + ], "width": { "render": "1" }, diff --git a/assets/layers/sport_pitch/sport_pitch.json b/assets/layers/sport_pitch/sport_pitch.json index 877928c85..1db714590 100644 --- a/assets/layers/sport_pitch/sport_pitch.json +++ b/assets/layers/sport_pitch/sport_pitch.json @@ -1,34 +1,42 @@ { "id": "sport_pitch", "name": { - "nl": "Sportterrein" + "nl": "Sportterrein", + "en": "Sport pitches" }, "wayHandling": 2, "minzoom": 12, "source": { "osmTags": { - "and": [ - "leisure=pitch" - ]} + "and": [ + "leisure=pitch" + ] + } }, "title": { "render": { - "nl": "Sportterrein" + "nl": "Sportterrein", + "en": "Sport pitch" } }, "description": { - "nl": "Een sportterrein" + "nl": "Een sportterrein", + "en": "A sport pitch" }, "tagRenderings": [ "images", { "render": { - "nl": "Hier kan men {sport} beoefenen" + "nl": "Hier kan men {sport} beoefenen", + "en": "{sport} is played here" }, "freeform": { "key": "sport" }, - "question": "Welke sporten kan men hier beoefenen?", + "question": { + "nl": "Welke sporten kan men hier beoefenen?", + "en": "Which sport can be played here?" + }, "multiAnswer": true, "mappings": [ { @@ -38,7 +46,8 @@ ] }, "then": { - "nl": "Hier kan men basketbal spelen" + "nl": "Hier kan men basketbal spelen", + "en": "Basketball is played here" } }, { @@ -48,7 +57,8 @@ ] }, "then": { - "nl": "Hier kan men voetbal spelen" + "nl": "Hier kan men voetbal spelen", + "en": "Soccer is played here" } }, { @@ -58,7 +68,8 @@ ] }, "then": { - "nl": "Dit is een pingpongtafel" + "nl": "Dit is een pingpongtafel", + "en": "This is a pingpong table" } }, { @@ -68,7 +79,8 @@ ] }, "then": { - "nl": "Hier kan men tennis spelen" + "nl": "Hier kan men tennis spelen", + "en": "Tennis is played here" } }, { @@ -78,7 +90,8 @@ ] }, "then": { - "nl": "Hier kan men korfbal spelen" + "nl": "Hier kan men korfbal spelen", + "en": "Korfball is played here" } }, { @@ -88,59 +101,62 @@ ] }, "then": { - "nl": "Hier kan men basketbal beoefenen" + "nl": "Hier kan men basketbal beoefenen", + "en": "Basketball is played here" + }, + "hideInAnswer": true + } + ] + }, + { + "question": { + "nl": "Wat is de ondergrond van dit sportveld?", + "en": "Which is the surface of this sport pitch?" + }, + "render": { + "nl": "De ondergrond is {surface}", + "en": "The surface is {surface}" + }, + "freeform": { + "key": "surface" + }, + "mappings": [ + { + "if": "surface=grass", + "then": { + "nl": "De ondergrond is gras", + "en": "The surface is grass" + } + }, + { + "if": "surface=sand", + "then": { + "nl": "De ondergrond is zand", + "en": "The surface is sand" + } + }, + { + "if": "surface=paving_stones", + "then": { + "nl": "De ondergrond bestaat uit stoeptegels", + "en": "The surface is paving stones" + } + }, + { + "if": "surface=asphalt", + "then": { + "nl": "De ondergrond is asfalt", + "en": "The surface is asphalt" + } + }, + { + "if": "surface=concrete", + "then": { + "nl": "De ondergrond is beton", + "en": "The surface is concrete" } } ] - },{ - "question": { - "nl": "Wat is de ondergrond van dit sportveld?", - "en": "Which is the surface of this sport pitch?" - }, - "render": { - "nl": "De ondergrond is {surface}", - "en": "The surface is {surface}" - }, - "freeform": { - "key": "surface" - }, - "mappings": [ - { - "if": "surface=grass", - "then": { - "nl": "De ondergrond is gras", - "en": "The surface is grass" - } - }, - { - "if": "surface=sand", - "then": { - "nl": "De ondergrond is zand", - "en": "The surface is sand" - } - }, - { - "if": "surface=paving_stones", - "then": { - "nl": "De ondergrond bestaat uit stoeptegels", - "en": "The surface is paving stones" - } - }, - { - "if": "surface=asphalt", - "then": { - "nl": "De ondergrond is asfalt", - "en": "The surface is asphalt" - } - }, - { - "if": "surface=concrete", - "then": { - "nl": "De ondergrond is beton", - "en": "The surface is concrete" - } - } - ] }, { "question": { @@ -151,7 +167,8 @@ "if": "access=public", "then": "Publiek toegankelijk" }, - {"if": "access=limited", + { + "if": "access=limited", "then": "Beperkt toegankelijk (enkel na reservatie, tijdens bepaalde uren, ...)" }, { @@ -169,7 +186,12 @@ "nl": "Moet men reserveren om gebruik te maken van dit sportveld?" }, "condition": { - "and": [ "access!=public", "access!=private", "access!=members"]}, + "and": [ + "access!=public", + "access!=private", + "access!=members" + ] + }, "mappings": [ { "if": "reservation=required", @@ -179,7 +201,8 @@ "if": "reservation=recommended", "then": "Reserveren is sterk aangeraden om gebruik te maken van dit sportterrein" }, - {"if": "reservation=yes", + { + "if": "reservation=yes", "then": "Reserveren is mogelijk, maar geen voorwaarde" }, { @@ -204,13 +227,52 @@ }, "render": "{email}" }, + { + "question": { + "nl": "Wanneer is dit sportveld toegankelijk?", + "en": "When is this pitch accessible?" + }, + "render": "{opening_hours()}", + "freeform": { + "key": "opening_hours", + "type": "opening_hours" + }, + "mappings": [ + { + "if": "opening_hours=", + "then": "24/7 toegankelijk", + "hideInAnswer": true + }, + { + "if": "opening_hours=24/7", + "then": { + "nl": "24/7 toegankelijk", + "en": "Always accessible" + } + } + ] + }, "questions", - {"render":"{reviews(name, sportpitch)}"} + { + "render": "{reviews(name, sportpitch)}" + } ], "hideUnderlayingFeaturesMinPercentage": 0, "icon": { "render": "circle:white;./assets/layers/sport_pitch/tabletennis.svg" }, + "iconOverlays": [ + { + "if": { + "and": [ + "opening_hours!=24/7", + "opening_hours~*" + ] + }, + "then": "isOpen", + "badge": true + } + ], "width": { "render": "1" },