From 01997790e513776bc8fde41e0c82ff82ca841bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 15 Jul 2018 22:11:46 +0200 Subject: [PATCH] pt: different styles for stop, way, platform --- pt.json | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/pt.json b/pt.json index 2f76edc..838c83c 100644 --- a/pt.json +++ b/pt.json @@ -88,17 +88,27 @@ "memberFeature": { "pre": [ "{% set stopName = '' %}", + "{% set isStop = false %}", + "{% set isWay = false %}", + "{% set aRoute = null %}", "{% for master in masters %}", " {% if master.tags.public_transport == 'stop_area' %}", - " {% set stopName = master.tags.name %}", + " {% set stopName = master.tags.name %}", + " {% else %}", + " {% if master.role|slice(-4) == 'stop' %}", + " {% set isStop = true %}", + " {% elseif master.role|matches('^(|forward|backward)$') %}", + " {% set isWay = true %}", + " {% endif %}", + " {% set aRoute = master %}", " {% endif %}", "{% endfor %}" ], "listStopsMarkerSymbol": "{{ markerCircle({})|raw }}", - "style": { + "styles": "{% if isStop %}stop{% elseif isWay %}way{% else %}platform{% endif %}", + "style:way": { "color": [ - "{% set master = masters[0] %}", - "{{ const[master.tags.route].color|default('#ff0000') }}" + "{{ const[aRoute.tags.route].color|default('#ff0000') }}" ], "width": "3", "text": "{% for master in masters %}{{ master.tags.ref }} {% endfor %} ", @@ -106,6 +116,17 @@ "textOffset": "12", "textFontWeight": "bold" }, + "style:stop": { + "color": [ + "{{ const[aRoute.tags.route].color|default('#ff0000') }}" + ], + "width": "5", + "radius": 3 + }, + "style:platform": { + "color": "#7f7f7f", + "width": "1" + }, "title": "{% if tags.public_transport == 'stop_position' %}{{ tags.name|default(stopName)|default(id) }}{% endif %}", "listStopsTitle": "{{ tags.name|default(stopName)|default(id) }}", "listStopsDescription": "{% for master in masters %}{{ master.tags.ref }} {% endfor %}", @@ -116,11 +137,12 @@ " {% if master.tags.public_transport != 'stop_area' %}", "
  • {{ master.tags.name|default(master.tags.ref) }}
  • ", " {% endif %}", + " {{ master.role }}", "{% endfor %}", "" ], "listRoutesExclude": "true", - "listStopsExclude": "{% set isStop = 0 %}{% for master in masters %}{% if master.role|slice(-4) == 'stop' %}{% set isStop = 1 %}{% endif %}{% endfor %}{{ not isStop }}" + "listStopsExclude": "{{ not isStop }}" }, "info": [ "",