From 3fa3d78f4104c5754bf1beef4b133b4ef0189c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 18 Oct 2022 21:20:16 +0200 Subject: [PATCH] culture-media: add icons depending on type --- culture-media.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/culture-media.yaml b/culture-media.yaml index 3b9e697..bffbb72 100644 --- a/culture-media.yaml +++ b/culture-media.yaml @@ -17,7 +17,7 @@ feature: {% set str = 'has wikidata tag' %} {% set wikidata = tags.wikidata|wikidataEntity %} - {% if wikidata.claims.P18|length == 0 %} + {% if wikidata and wikidata.claims.P18|length == 0 %} {% set color = '#007fff' %} {% set str = 'has wikidata tag, but wikidata object does not have an image' %} {% endif %} @@ -59,6 +59,17 @@ feature: {% endif %} markerSymbol: "{{ markerPointer({ fillColor: color })|raw }}" listMarkerSymbol: "{{ markerCircle({ fillColor: color })|raw }}" + + markerSign: | + {% set icon = '' %} + {% for kv, d in const.types|reverse %} + {% set k = kv|split('=')[0] %} + {% set v = kv|split('=')[1] %} + {% if d.icon and v and attribute(tags, k) == v %} + {% set icon = d.icon %} + {% endif %} + {% endfor %} + {{ icon|raw }} filter: type: name: "{{ trans('filter:type') }}" @@ -119,16 +130,27 @@ info: | const: types: tourism=artwork: + icon: '' tourism=attraction: + icon: '' historic=memorial: + icon: '' historic=monument: + icon: '' historic=wayside_cross: + icon: '' historic=wayside_shrine: + icon: '' historic=building: + icon: '' amenity=fountain: + icon: '' amenity=arts_centre: + icon: '' amenity=place_of_worship: + icon: '' amenity=theatre: + icon: '' heritage: other: query: 'nwr[historic][historic!~"^(memorial|monument|wayside_cross|wayside_shrine|building)$"]'