query: ( way[highway=cycleway]; way[cyclestreet=yes]; way[bicycle_road=yes]; way[highway=path][bicycle][bicycle!=no]; way["cycleway"]["cycleway"!~"(no|separate)"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; way["cycleway:both"]["cycleway:both"!~"(no|separate)"]; ) feature: pre: | {% set type = tags.highway %} {% if tags.highway == 'path' and tags.bicycle and tags.bicycle != 'no' %} {% set type = 'cycleway' %} {% endif %} {% if tags.cyclestreet == 'yes' %} {% set type = 'cyclestreet' %} {% elseif tags.bicycle_road in ['yes', 'designated'] %} {% set type = 'bicycle_road' %} {% endif %} {% set mainOneway = tags.oneway %} {% if mainOneway == 'yes' %} {% set mainOneway = 1 %} {% elseif mainOneway == 'no' %} {% set mainOneway = 0 %} {% endif %} {% set oneway = attribute(tags, 'oneway:bicycle')|default(tags.oneway) %} {% if oneway == 'yes' %} {% set oneway = 1 %} {% elseif oneway == 'no' %} {% set oneway = 0 %} {% endif %} {% set leftCycle = '' %}{% set rightCycle = '' %} {% if tags.cycleway %} {% if const.otherInfrastructure[tags.cycleway] %} {# skip #} {% elseif (tags.oneway in ['yes', 1] and map.driving_side == 'right') or (tags.oneway in [-1] and map.driving_side == 'left') %} {{ tags.cycleway|debug }} {% if tags.cycleway matches '/^opposite/' %} {% set leftCycle = tags.cycleway %} {% else %} {% set rightCycle = tags.cycleway %} {% endif %} {% elseif (tags.oneway in ['yes', 1] and map.driving_side == 'left') or (tags.oneway in [-1] and map.driving_side == 'right') %} {% if tags.cycleway matches '/^opposite/' %} {% set rightCycle = tags.cycleway %} {% else %} {% set leftCycle = tags.cycleway %} {% endif %} {% else %} {% set leftCycle = tags.cycleway %} {% set rightCycle = tags.cycleway %} {% endif %} {% endif %} {% set leftCycle1 = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} {% if leftCycle1 %}{% set leftCycle = leftCycle1 %}{% endif %} {% if const.hiddenTypes[leftCycle] %} {% set leftCycle = '' %} {% endif %} {% set leftOneway = attribute(tags, 'cycleway:left:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %} {% if not leftOneway or leftOneway in ['yes'] %} {% set leftOneway = map.driving_side == 'left' ? 1 : -1 %} {% elseif leftOneway in ['no'] %} {% set leftOneway = 0 %} {% endif %} {% set rightCycle1 = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} {% if rightCycle1 %}{% set rightCycle = rightCycle1 %}{% endif %} {% if const.hiddenTypes[rightCycle] %} {% 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 %} {% if mainOneway and ((not rightCycle and mainOneway == rightOneway) or (not leftCycle and mainOneway == leftOneway)) %} {% set oneway = mainOneway %} {% elseif mainOneway == oneway and ((rightCycle and mainOneway == rightOneway) or (leftCycle and mainOneway == leftOneway)) %} {% set oneway = 0 %} {% endif %} {% if oneway and attribute(tags, 'oneway:bicycle') == 'no' and not rightCycle and not leftCycle %} {% set oneway = 0 %} {% endif %} styles: | {% if tags.bridge and tags.bridge != 'no' %} bridge_outer,bridge_inner, {% endif %} {% if const.otherInfrastructure[tags.cycleway|default(tags.path)] %} other, {% endif %} {% if tags.segregated %} footway, {% endif %} default {% if leftCycle %} ,left {% endif %} {% if rightCycle %} ,right {% endif %} style: width: | {% if tags.segregated == 'yes' %} {{ const.types[type].width / 2 }} {% else %} {{ const.types[type].width }} {% endif %} dashArray: | {% if oneway and tags.segregated == 'no' %} 5,5,5,20 {% elseif oneway %} 25,10 {% elseif tags.segregated == 'no' %} 5,5 {% endif %} dashOffset: | {% if oneway and tags.segregated == 'no' %} 5 {% elseif oneway %} 10 {% elseif tags.segregated == 'no' %} 0 {% endif %} lineCap: | {% if tags.segregated == 'no' or oneway %} butt {% else %} round {% endif %} color: | {{ const.types[type].color }} offset: | {% if tags.segregated == 'yes' %} {{ const.types[type].width / 2 - 1 }} {% else %} 0 {% endif %} pattern: | {% if oneway -%} arrowHead {%- endif %} pattern-repeat: | 35 pattern-offset: | {{ oneway == -1 ? 17 : 22 }} noClip: | {{ oneway != 0 }} pattern-polygon: true pattern-pixelSize: 9 pattern-angleCorrection: | {{ oneway == -1 ? 180 : 0 }} pattern-path-color: | {{ const.types[type].color }} pattern-path-width: 0 pattern-path-fillOpacity: 1 zIndex: |- {{ tags.layer|default(0) }} style:footway: color: | {{ const.types.footway.color }} width: | {% if tags.segregated == 'yes' %} {{ const.types.footway.width / 2 }} {% else %} {{ const.types.footway.width }} {% endif %} dashArray: | {% if oneway and tags.segregated == 'no' %} 5,5,5,5,5,10 {% elseif oneway %} 25,10 {% elseif tags.segregated == 'no' %} 5,5 {% endif %} dashOffset: | {% if oneway %} 10 {% elseif tags.segregated == 'no' %} 5 {% endif %} noClip: | {{ oneway != 0 }} lineCap: | {% if tags.segregated == 'no' or oneway %} butt {% else %} round {% endif %} offset: | {% if tags.segregated == 'yes' %} {{ (const.types.footway.width / 2 - 1) * -1 }} {% endif %} zIndex: |- {{ tags.layer|default(0) }} style:left: offset: -5 color: | {{ const.types[leftCycle].color|default('#ff0000') }} width: 3 lineCap: | {{ leftOneway ? 'butt' : 'round' }} dashArray: | {{ leftOneway ? '27,8' : '' }} dashOffset: | {{ leftOneway == -1 ? 28 : 0 }} noClip: true # {{ leftOneway }} pattern: | {% if leftOneway %}arrowHead{% endif %} pattern-offset: | {{ leftOneway == -1 ? 4 : 30.5 }} pattern-lineOffset: -5 pattern-repeat: 35 pattern-polygon: true pattern-pixelSize: 9 pattern-angleCorrection: | {{ leftOneway == -1 ? 180 : 0 }} pattern-path-width: 0 pattern-path-color: | {{ const.types[leftCycle].color|default('#ff0000') }} pattern-path-fillOpacity: 1 zIndex: |- {{ tags.layer|default(0) }} 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 zIndex: |- {{ tags.layer|default(0) }} style:other: width: | {{ const.types[type].width + const.otherInfrastructure[tags.cycleway].extraWidth }} color: | {{ const.otherInfrastructure[tags.cycleway].color }} lineCap: | {{ const.otherInfrastructure[tags.cycleway].lineCap|default('round') }} dashArray: | {{ const.otherInfrastructure[tags.cycleway].dashArray|default('') }} offset: 0 zIndex: |- {{ tags.layer|default(0) - 0.1 }} style:bridge_outer: width: | {{ const.types[type].width|default(5) + 8 }} color: black lineCap: butt zIndex: |- {{ tags.layer|default(0) - 0.21 }} style:bridge_inner: width: | {{ const.types[type].width|default(5) + 4 }} color: white lineCap: butt zIndex: |- {{ tags.layer|default(0) - 0.2 }} description: | {% if tags.cyclestreet == 'yes' %} {{ keyTrans('cyclestreet') }} {% elseif tags.bicycle_road in ['yes', 'designated'] %} {{ keyTrans('bicycle_road') }} {% elseif tags.segregated %} {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }} {% elseif tags.highway %} {{ tagTrans('highway', tags.highway) }} {% endif %} body: |
Symbol | |
---|---|
{{ markerLine({ width: v.width|default(4), color: v.color }) }} | {{ k }} |
{{ markerLine(evaluate({ highway: 'cycleway', cycleway: k })) }} | {{ k }} |
{{ markerLine({ width: 4, color: '#ff0000' }) }} | Deprecated or invalid tag! |