From c09b60d86f46622fe695d9afb165271932f452d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Jul 2024 07:34:10 +0200 Subject: [PATCH] cycleway_types: render cycleway:right --- cycleway_types.yaml | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index eacd97b..e9eb8d5 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -36,6 +36,18 @@ feature: {% set leftOneway = 0 %} {% endif %} + {% set rightCycle = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} + {% if rightCycle in ['no', 'separate'] %} + {% set rightCycle = '' %} + {% endif %} + + {% set rightOneway = attribute(tags, 'cycleway:right:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %} + {% if not rightOneway or rightOneway in ['yes'] %} + {% set rightOneway = map.driving_side == 'left' ? -1 : 1 %} + {% elseif rightOneway in ['no'] %} + {% set rightOneway = 0 %} + {% endif %} + styles: | {% if tags.segregated %} footway, @@ -44,6 +56,9 @@ feature: {% if leftCycle %} ,left {% endif %} + {% if rightCycle %} + ,right + {% endif %} style: width: | {% if tags.segregated == 'yes' %} @@ -188,6 +203,39 @@ feature: pattern-path-fillOpacity: 1 + style:right: + offset: 5 + + color: | + {{ const.types[rightCycle].color|default('#ff0000') }} + + width: 3 + + lineCap: | + {{ rightOneway ? 'butt' : 'round' }} + dashArray: | + {{ rightOneway ? '27,8' : '' }} + dashOffset: | + {{ rightOneway == -1 ? 28 : 0 }} + noClip: true +# {{ rightOneway }} + pattern: | + {% if rightOneway %}arrowHead{% endif %} + pattern-offset: | + {{ rightOneway == -1 ? 4 : 30.5 }} + pattern-lineOffset: 5 + pattern-repeat: 35 + pattern-polygon: true + pattern-pixelSize: 9 + pattern-angleCorrection: | + {{ rightOneway == -1 ? 180 : 0 }} + pattern-path-width: 0 + + pattern-path-color: | + {{ const.types[rightCycle].color|default('#ff0000') }} + + pattern-path-fillOpacity: 1 + description: | {% if tags.cyclestreet == 'yes' %} {{ keyTrans('cyclestreet') }} @@ -230,6 +278,21 @@ feature: {% endif %} + {% if rightCycle %} +
  • {{ keyTrans('cycleway:right') }}:
  • + {% endif %} markerSymbol: '' @@ -254,6 +317,9 @@ const: color: '#003faf' share_busway: color: '#ff7f00' + opposite: + color: '#ff0000' + warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' opposite_lane: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.'