From e17ef2db6dfe5e6676076858cd845e56bf9947f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 28 Jul 2018 21:59:44 +0200 Subject: [PATCH] cycle_routes: use new members queries --- cycle_routes.json | 56 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/cycle_routes.json b/cycle_routes.json index 581ed13c5..2a1da864e 100644 --- a/cycle_routes.json +++ b/cycle_routes.json @@ -13,12 +13,62 @@ "12": "relation[type=route][route=bicycle][network~'^(icn|ncn|rcn)$']", "15": "relation[type=route][route=bicycle]" }, + "members": true, "feature": { - "priority": "{% if tags.network=='icn' %}0{% elseif tags.network=='ncn' %}1{% elseif tags.network=='rcn' %}2{% else %}3{% endif %}", + "priority": "{{ {icn:0,ncn:1,rcn:2,lcn:3}[tags.network] }}", + "description": "{{ tagTrans('network', tags.network) }}", + "styles": "" + }, + "memberFeature": { + "pre": [ + "{% set priority = 4 %}", + "{% set network = '' %}", + "{% set refs = [] %}", + "", + "{% for master in masters %}", + " {% set _p = {icn:0,ncn:1,rcn:2,lcn:3}[master.tags.network] %}", + " {% if _p < priority %}", + " {% set priority = _p %}", + " {% set network = master.tags.network %}", + " {% endif %}", + " {% if master.tags.ref %}", + " {% set refs = refs|merge([ master.tags.ref ]) %}", + " {% endif %}", + "{% endfor %}" + ], + "title": "", + "body": [ + "" + ], + "listExclude": "1", "style": { + "color": "{{ const[network].color }}", "width": 4, - "color": "{% if tags.network=='icn' %}#ff0000{% elseif tags.network=='ncn' %}#ff007f{% elseif tags.network=='rcn' %}#7f00ff{% else %}#0000ff{% endif %}", - "opacity": 1 + "opacity": 1, + "text": "{{ refs|join(' ') }} ", + "textRepeat": "1", + "textOffset": "12", + "textFontWeight": "bold" + } + }, + "const": { + "icn": { + "color": "#ff0000" + }, + "ncn": { + "color": "#ff007f" + }, + "rcn": { + "color": "#7f00ff" + }, + "lcn": { + "color": "#0000ff" } } }