From 4f9978e59610428713f6e29667bb654f28b0632d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Sun, 12 Jan 2020 22:32:00 +0100
Subject: [PATCH] Lanes: improve cycleway=lane, cycleway:left/right=lane

---
 lanes.json | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lanes.json b/lanes.json
index 6715b9d..6ed9529 100644
--- a/lanes.json
+++ b/lanes.json
@@ -17,9 +17,9 @@
         "pre": [
             "{% set parking_left = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lane:both')) %}",
             "{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) %}",
-            "{% set cyclelane_left = 'opposite_lane' in tags.cycleway|split(';') ? 1 : 0 %}",
-            "{% set cyclelane_right = 'lane' in tags.cycleway|split(';') ? 1 : 0 %}",
             "{% set oneway = tags.oneway in ['yes','1'] %}",
+            "{% set cyclelane_left = attribute(tags, 'cycleway:left') == 'lane' ? 1 : ('opposite_lane' in tags.cycleway|split(';') ? 1 : (('lane' in tags.cycleway|split(';')) and not oneway ? 1 : 0)) %}",
+            "{% set cyclelane_right = attribute(tags, 'cycleway:right') == 'lane' ? 1 : ('lane' in tags.cycleway|split(';') ? 1 : 0) %}",
             "{% set lanes = tags.lanes|default(oneway ? 1 : 2) %}",
             "{% set lanes_width = lanes * 3 %}",
             "{% set forward_lanes = attribute(tags, 'lanes:forward')|default(oneway ? lanes : lanes // 2) %}",
@@ -50,13 +50,13 @@
         },
         "style:cyclelane_left": {
             "width": "2m",
-            "color": "green",
+            "color": "#af3f3f",
             "offset": "{{ lanes_width / -2 - 1 }}m",
             "pane": "casing"
         },
         "style:cyclelane_right": {
             "width": "2m",
-            "color": "green",
+            "color": "#af3f3f",
             "offset": "{{ lanes_width / 2 + 1 }}m",
             "pane": "casing"
         },
@@ -215,6 +215,10 @@
         "    <td>{{ markerLine({'styles':'left,right,mark', 'style:left': { 'width': 3, 'color': 'grey', 'offset': -1.5 },'style:right': { 'width': 3, 'color': 'grey', 'offset': 1.5 },'style:mark': { 'width': 1, 'color': 'white', 'dashArray': '5,5'} })|raw }}</td>",
         "    <td>{{ keyTrans('lanes') }}</td>",
         "  </tr>",
+        "  <tr>",
+        "    <td>{{ markerLine({ 'width': 5, 'color': '#af3f3f' })|raw }}</td>",
+        "    <td>{{ tagTrans('cycleway', 'lane') }}</td>",
+        "  </tr>",
         "</table>"
     ]
 }