Browse Source

culture-media: add icons depending on type

master
parent
commit
3fa3d78f41
  1. 24
      culture-media.yaml

24
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 %}
<span style='color: white;'>{{ icon|raw }}</span>
filter:
type:
name: "{{ trans('filter:type') }}"
@ -119,16 +130,27 @@ info: |
const:
types:
tourism=artwork:
icon: '<i class="fas fa-palette"></i>'
tourism=attraction:
icon: '<i class="fas fa-chess"></i>'
historic=memorial:
icon: '<i class="fas fa-monument"></i>'
historic=monument:
icon: '<i class="fas fa-monument"></i>'
historic=wayside_cross:
icon: '<i class="fas fa-cross"></i>'
historic=wayside_shrine:
icon: '<i class="fas fa-vihara"></i>'
historic=building:
icon: '<i class="fas fa-home"></i>'
amenity=fountain:
icon: '<img data-src="temaki:fountain?stroke=white">'
amenity=arts_centre:
icon: '<i class="fas fa-university"></i>'
amenity=place_of_worship:
icon: '<i class="fas fa-place-of-worship"></i>'
amenity=theatre:
icon: '<i class="fas fa-theater-masks"></i>'
heritage:
other:
query: 'nwr[historic][historic!~"^(memorial|monument|wayside_cross|wayside_shrine|building)$"]'

Loading…
Cancel
Save