From 6a9efac3be30a3daf54a508adba146e292fbd26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Fri, 26 Jan 2018 21:05:01 +0100 Subject: [PATCH] Communication: improve code, map key, better icons --- communication.json | 54 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/communication.json b/communication.json index 43c3f04f..1dce4614 100644 --- a/communication.json +++ b/communication.json @@ -18,13 +18,59 @@ "uk": "Телекомунікації" }, "query": { - "13": "(node[amenity~'^(post_office|internet_cafe)$'];way[amenity~'^(post_office|internet_cafe)$'];relation[amenity~'^(post_office|internet_cafe)$'];);", - "16": "(node[amenity~'^(post_office|internet_cafe|post_box|telephone)$'];way[amenity~'^(post_office|internet_cafe)$'];relation[amenity~'^(post_office|internet_cafe)$'];);" + "13": [ + "(", + "node[amenity~'^(post_office|internet_cafe)$'];", + "way[amenity~'^(post_office|internet_cafe)$'];", + "relation[amenity~'^(post_office|internet_cafe)$'];", + ");" + ], + "16": [ + "(node[amenity~'^(post_office|internet_cafe|post_box|telephone)$'];", + "way[amenity~'^(post_office|internet_cafe)$'];", + "relation[amenity~'^(post_office|internet_cafe)$'];", + ");" + ] }, "feature": { "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) |default(tagTrans('amenity', tags.amenity)) }}", "description": "{{ tagTrans('amenity', tags.amenity) }}", "body": "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", - "markerSign": "{% if tags.amenity=='post_office' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}" + "markerSign": [ + "{% set data = const[tags.amenity] %}", + "{% if data %}", + "{{ data.sign|raw }}", + "{% endif %}" + ] + }, + "info": [ + "", + "{% for value, data in const %}", + "{% if data.zoom <= map.zoom %}", + " ", + " ", + " ", + " ", + "{% endif %}", + "{% endfor %}", + "
{{ markerCircle({})|raw }}
{{ data.sign|raw }}
{{ tagTrans('amenity', value) }}
" + ], + "const": { + "post_office": { + "sign": "", + "zoom": 13 + }, + "post_box": { + "sign": "", + "zoom": 16 + }, + "internet_cafe": { + "sign": "", + "zoom": 13 + }, + "telephone": { + "sign": "", + "zoom": 16 + } } -} +} \ No newline at end of file