Browse Source

cycleway_types: render cycleway:right

cycleway
parent
commit
c09b60d86f
  1. 66
      cycleway_types.yaml

66
cycleway_types.yaml

@ -36,6 +36,18 @@ feature:
{% set leftOneway = 0 %} {% set leftOneway = 0 %}
{% endif %} {% 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: | styles: |
{% if tags.segregated %} {% if tags.segregated %}
footway, footway,
@ -44,6 +56,9 @@ feature:
{% if leftCycle %} {% if leftCycle %}
,left ,left
{% endif %} {% endif %}
{% if rightCycle %}
,right
{% endif %}
style: style:
width: | width: |
{% if tags.segregated == 'yes' %} {% if tags.segregated == 'yes' %}
@ -188,6 +203,39 @@ feature:
pattern-path-fillOpacity: 1 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: | description: |
{% if tags.cyclestreet == 'yes' %} {% if tags.cyclestreet == 'yes' %}
{{ keyTrans('cyclestreet') }} {{ keyTrans('cyclestreet') }}
@ -230,6 +278,21 @@ feature:
</ul></li> </ul></li>
{% endif %} {% endif %}
{% if rightCycle %}
<li>{{ keyTrans('cycleway:right') }}:<ul>
<li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
<li>
{{ keyTrans('cycleway:width') }}:
{% if not rightWidth %}
{{ trans('unknown') }}
{% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
{{ attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) }}
{% else %}
{{ rightWidth }}m
{% endif %}
</li>
</ul></li>
{% endif %}
</ul> </ul>
markerSymbol: '' markerSymbol: ''
@ -254,6 +317,9 @@ const:
color: '#003faf' color: '#003faf'
share_busway: share_busway:
color: '#ff7f00' color: '#ff7f00'
opposite:
color: '#ff0000'
warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.'
opposite_lane: opposite_lane:
color: '#ff0000' color: '#ff0000'
warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.'

Loading…
Cancel
Save