From 529e8ecfd82e23c5c8df12ed6126cf6d8da37cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 8 Aug 2018 07:06:18 +0200 Subject: [PATCH] car_routes: complete; color by 'network' tag --- car_routes.json | 18 +++++++++++++++--- railway-routes.json | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/car_routes.json b/car_routes.json index 2cb3ba7..22e00ba 100644 --- a/car_routes.json +++ b/car_routes.json @@ -8,18 +8,25 @@ }, "members": true, "feature": { + "pre": "{% set color = '#' ~ tags.network|default('')|md5|slice(0, 6) %}", "description": "{% if tags.network %}{{ tagTrans('network', tags.network) }}{% endif %}", - "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': '#ff0000' )].color })|raw }}", + "title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% else %}{{ trans('unnamed') }}{% endif %}", + "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}", + "markerSymbol": "", "styles": "" }, "memberFeature": { "pre": [ "{% set refs = [] %}", + "{% set color = '#d41d8c' %}", "{% if tags.ref %}", " {% set refs = refs|merge([ tags.ref ]) %}", "{% endif %}", "", "{% for master in masters %}", + " {% if master.tags.network %}", + " {% set color = '#' ~ master.tags.network|md5|slice(0, 6) %}", + " {% endif %}", " {% if master.tags.ref %}", " {% set refs = refs|merge([ master.tags.ref ]) %}", " {% endif %}", @@ -29,13 +36,18 @@ "

Routes

", "" ], "listExclude": "1", "style": { - "color": "#ff0000", + "color": "{{ color }}", "width": 4, "opacity": 1, "text": "{{ refs|join(' ') }} ", diff --git a/railway-routes.json b/railway-routes.json index c81f51f..ba5c66f 100644 --- a/railway-routes.json +++ b/railway-routes.json @@ -32,7 +32,7 @@ "title": "", "body": [ "

Routes

", - "