From 4225e151fa1f995507862df5d5629415fb86975b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Thu, 1 Nov 2018 10:06:06 +0100
Subject: [PATCH] pt: show arrowHeads to indicate direction of routes

---
 pt.json | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/pt.json b/pt.json
index 5ef6590..210e56f 100644
--- a/pt.json
+++ b/pt.json
@@ -82,6 +82,8 @@
             "{% set isWay = false %}",
             "{% set aRoute = null %}",
             "{% set refs = [] %}",
+            "{% set dirForward = false %}",
+            "{% set dirBackward = false %}",
             "{% for master in masters %}",
             "  {% if master.tags.public_transport == 'stop_area' %}",
             "    {% set stopName = master.tags.name %}",
@@ -97,6 +99,10 @@
             "    {% if master.tags.ref %}",
             "      {% set refs = refs|merge([ master.tags.ref ]) %}",
             "    {% endif %}",
+            "    {% if master.dir == 'forward' %}{% set dirForward = true %}",
+            "    {% elseif master.dir == 'backward' %}{% set dirBackward = true %}",
+            "    {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
+            "    {% endif %}",
             "  {% endif %}",
             "{% endfor %}",
             "",
@@ -128,11 +134,19 @@
         "markerSymbol": "{% if isStop and stopCount > 0 %}{{ markerCircle({ width: 0, fill: true, fillColor: color, fillOpacity: '1', radius: 5 })|raw }}{% endif %}",
         "style:way": {
             "width": "3",
+            "opacity": "{% if (dirForward and dirBackward) or (not dirForward and not dirBackward) %}1{% else %}0{% endif %}",
             "color": "{{ color|default('#ff0000') }}",
             "text": "{{ refs|join(' ยท ') }}             ",
             "textRepeat": "1",
             "textOffset": "12",
-            "textFontWeight": "bold"
+            "textFontWeight": "bold",
+            "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
+            "pattern-pixelSize": "4",
+            "pattern-repeat": "7",
+            "pattern-polygon": "",
+            "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
+            "pattern-path-weight": "2",
+            "pattern-path-color": "{{ color|default('#ff0000') }}"
         }
     },
     "info": [