From 18cb2fdd53bf8436fd8df58e9f2e3c0a9e9b515e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 29 Nov 2018 19:05:02 +0100 Subject: [PATCH] communication: include office=telecommunication and office=it --- communication.json | 48 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/communication.json b/communication.json index 27f8372..dbdb662 100644 --- a/communication.json +++ b/communication.json @@ -25,21 +25,38 @@ "node[amenity~'^(post_office|internet_cafe)$'];", "way[amenity~'^(post_office|internet_cafe)$'];", "relation[amenity~'^(post_office|internet_cafe)$'];", + "nwr[office~\"^(telecommunication|it)$\"];", ");" ], "16": [ "(node[amenity~'^(post_office|internet_cafe|post_box|telephone)$'];", "way[amenity~'^(post_office|internet_cafe)$'];", "relation[amenity~'^(post_office|internet_cafe)$'];", + "nwr[office~\"^(telecommunication|it)$\"];", ");" ] }, "feature": { + "pre": [ + "{% if tags.amenity %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% else %}", + " {% set key = 'office' %}", + " {% set value = tags.office %}", + "{% endif %}" + ], "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) |default(tagTrans('amenity', tags.amenity)) }}", - "description": "{{ tagTrans('amenity', tags.amenity) }}", + "description": [ + "{% if key == 'office' %}", + " {{ keyTrans('office') }} ({{ tagTrans('office', tags.office) }})", + "{% else %}", + " {{ tagTrans(key, value) }}", + "{% endif %}" + ], "body": "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", "markerSign": [ - "{% set data = const[tags.amenity] %}", + "{% set data = const[key ~ '=' ~ value] %}", "{% if data %}", "{{ data.sign|raw }}", "{% endif %}" @@ -47,30 +64,45 @@ }, "info": [ "", - "{% for value, data in const %}", + "{% for kv, data in const %}", "{% if data.zoom <= map.zoom %}", " ", " ", - " ", + " ", " ", "{% endif %}", "{% endfor %}", "
{{ markerCircle({})|raw }}
{{ data.sign|raw }}
{{ tagTrans('amenity', value) }}", + " {% if kv|split('=')[0] == 'office' %}", + " {{ keyTrans('office') }}", + " ({{ tagTrans('office', kv|split('=')[1]) }})", + " {% else %}", + " {{ tagTrans(kv|split('=')[0], kv|split('=')[1]) }}", + " {% endif %}", + "
" ], "const": { - "post_office": { + "amenity=post_office": { "sign": "", "zoom": 13 }, - "post_box": { + "amenity=post_box": { "sign": "", "zoom": 16 }, - "internet_cafe": { + "amenity=internet_cafe": { "sign": "", "zoom": 13 }, - "telephone": { + "office=telecommunication": { + "sign": "", + "zoom": 13 + }, + "office=it": { + "sign": "", + "zoom": 13 + }, + "amenity=telephone": { "sign": "", "zoom": 16 }