From 3b8466b204bd90be8518c8e800c2435ca6ee1555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 15 Jul 2018 21:52:56 +0200 Subject: [PATCH] pt: also load stop_areas, use relation name if stop_position has no name - missing: stop list of a route does not evaluate stop_areas --- pt.json | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pt.json b/pt.json index 3e3e9c5ef..2f76edc13 100644 --- a/pt.json +++ b/pt.json @@ -21,7 +21,12 @@ }, "query": { "12": "relation[type=route][route~\"^(subway|monorail|ferry|train)$\"];", - "14": "relation[type=route][route~\"^(subway|monorail|aerialway|bus|trolleybus|ferry|train|tram)$\"];" + "14": [ + "(", + "relation[type=route][route~\"^(subway|monorail|aerialway|bus|trolleybus|ferry|train|tram)$\"];", + "relation[type=public_transport][public_transport=stop_area];", + ")" + ] }, "members": true, "lists": { @@ -57,6 +62,8 @@ } }, "feature": { + "pre": "{% set isStopArea = tags.public_transport == 'stop_area' %}", + "listRoutesExclude": "{{ isStopArea }}", "styles": "", "title": [ "{% if tags.ref %}{{ tags.ref }} - {% endif %}", @@ -79,6 +86,14 @@ "listRoutesMarkerSymbol": "{{ markerCircle({fillColor:const[tags.route].color})|raw }}" }, "memberFeature": { + "pre": [ + "{% set stopName = '' %}", + "{% for master in masters %}", + " {% if master.tags.public_transport == 'stop_area' %}", + " {% set stopName = master.tags.name %}", + " {% endif %}", + "{% endfor %}" + ], "listStopsMarkerSymbol": "{{ markerCircle({})|raw }}", "style": { "color": [ @@ -91,14 +106,16 @@ "textOffset": "12", "textFontWeight": "bold" }, - "title": "{% if tags.public_transport == 'stop_position' %}{{ tags.name }}{% endif %}", - "listStopsTitle": "{{ tags.name }}", + "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 %}", "body": [ "

Routes

", "" ],