From 86a6bdfc090a3123f752666152c8ceb01163f8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 14 Jan 2020 14:08:27 +0100 Subject: [PATCH] Lanes: add cycleway=track resp. cycleway=opposite_track --- lanes.json | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lanes.json b/lanes.json index 8712d8b..adb2fea 100644 --- a/lanes.json +++ b/lanes.json @@ -20,6 +20,8 @@ "{% 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 cycletrack_left = attribute(tags, 'cycleway:left') == 'track' ? 1 : ('opposite_track' in tags.cycleway|split(';') ? 1 : (('track' in tags.cycleway|split(';')) and not oneway ? 1 : 0)) %}", + "{% set cycletrack_right = attribute(tags, 'cycleway:right') == 'track' ? 1 : ('track' in tags.cycleway|split(';') ? 1 : 0) %}", "{% set sidewalk_left = tags.sidewalk in ['both', 'left'] ? 1 : 0 %}", "{% set sidewalk_right = tags.sidewalk in ['both', 'right'] ? 1 : 0 %}", "{% set lanes = tags.lanes|default(oneway ? 1 : 2) %}", @@ -38,7 +40,7 @@ ], "markerSymbol": null, "listMarkerSymbol": "line", - "styles": "{% if sidewalk_left %}sidewalk_left,{% endif %}{% if parking_left %}parking_left,{% endif %}{% if cyclelane_left %}cyclelane_left,{% endif %}{% if lanes == 1 %}lane1{% else %}{% for i in 1..lanes - 1 %}lane{{ i }},mark{{ i }},{% endfor %}lane{{ lanes }}{% endif %}{% if cyclelane_right %},cyclelane_right{% endif %}{% if parking_right %},parking_right{% endif %}{% if sidewalk_right %},sidewalk_right{% endif %}", + "styles": "{% if sidewalk_left %}sidewalk_left,{% endif %}{% if cycletrack_left %}cycletrack_left,{% endif %}{% if parking_left %}parking_left,{% endif %}{% if cyclelane_left %}cyclelane_left,{% endif %}{% if lanes == 1 %}lane1{% else %}{% for i in 1..lanes - 1 %}lane{{ i }},mark{{ i }},{% endfor %}lane{{ lanes }}{% endif %}{% if cyclelane_right %},cyclelane_right{% endif %}{% if parking_right %},parking_right{% endif %}{% if cycletrack_right %},cycletrack_right{% endif %}{% if sidewalk_right %},sidewalk_right{% endif %}", "style": { "width": "{{ width }}", "pane": "casing", @@ -47,7 +49,7 @@ "style:sidewalk_left": { "width": "2m", "color": "#4f4fbf", - "offset": "{{ lanes_width / -2 - (cyclelane_left * 2) - (parking_left * 2) - 1 }}m", + "offset": "{{ lanes_width / -2 - (cyclelane_left * 2) - (parking_left * 2) - (cycletrack_left * 2) - 1 }}m", "pane": "casing" }, "style:parking_left": { @@ -68,6 +70,18 @@ "offset": "{{ lanes_width / 2 + 1 }}m", "pane": "casing" }, + "style:cycletrack_left": { + "width": "2m", + "color": "#bf5f3f", + "offset": "{{ lanes_width / -2 - (cyclelane_left * 2) - (parking_left * 2) - 1 }}m", + "pane": "casing" + }, + "style:cycletrack_right": { + "width": "2m", + "color": "#bf5f3f", + "offset": "{{ lanes_width / 2 + (cyclelane_right * 2) + (parking_right * 2) + 1 }}m", + "pane": "casing" + }, "style:parking_right": { "width": "2m", "color": "orange", @@ -77,7 +91,7 @@ "style:sidewalk_right": { "width": "2m", "color": "#4f4fbf", - "offset": "{{ lanes_width / 2 + (cyclelane_right * 2) + (parking_right * 2) + 1 }}m", + "offset": "{{ lanes_width / 2 + (cyclelane_right * 2) + (parking_right * 2) + (cycletrack_right * 2) + 1 }}m", "pane": "casing" }, "style:lane1": { @@ -230,10 +244,18 @@ " {{ keyTrans('lanes') }}", " ", " ", + " {{ markerLine({ 'width': 5, 'color': 'orange' })|raw }}", + " {{ keyTrans('parking:lane') }}", + " ", + " ", " {{ markerLine({ 'width': 5, 'color': '#af3f3f' })|raw }}", " {{ tagTrans('cycleway', 'lane') }}", " ", " ", + " {{ markerLine({ 'width': 5, 'color': '#bf5f3f' })|raw }}", + " {{ tagTrans('cycleway', 'track') }}", + " ", + " ", " {{ markerLine({ 'width': 5, 'color': '#4f4fbf' })|raw }}", " {{ keyTrans('sidewalk') }}", " ",