Browse Source

Lanes: show sidewalks

name-etym
parent
commit
4c498a2c11
  1. 24
      lanes.json

24
lanes.json

@ -15,11 +15,13 @@
},
"feature": {
"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 parking_left = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lane:both')) ? 1 : 0 %}",
"{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) ? 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 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) %}",
"{% set lanes_width = lanes * 3 %}",
"{% set forward_lanes = attribute(tags, 'lanes:forward')|default(oneway ? lanes : lanes // 2) %}",
@ -36,12 +38,18 @@
],
"markerSymbol": null,
"listMarkerSymbol": "line",
"styles": "{% 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 %}",
"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 %}",
"style": {
"width": "{{ width }}",
"pane": "casing",
"color": "{% if tags.gauge %}{% if not tags.gauge|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], tags.gauge / 2000) }}{% endif %}{% else %}#404040{% endif %}"
},
"style:sidewalk_left": {
"width": "2m",
"color": "#4f4fbf",
"offset": "{{ lanes_width / -2 - (cyclelane_left * 2) - (parking_left * 2) - 1 }}m",
"pane": "casing"
},
"style:parking_left": {
"width": "2m",
"color": "orange",
@ -66,6 +74,12 @@
"offset": "{{ lanes_width / 2 + (cyclelane_right * 2) + 1 }}m",
"pane": "casing"
},
"style:sidewalk_right": {
"width": "2m",
"color": "#4f4fbf",
"offset": "{{ lanes_width / 2 + (cyclelane_right * 2) + (parking_right * 2) + 1 }}m",
"pane": "casing"
},
"style:lane1": {
"width": "3.1m",
"offset": "{{ lanes_width / -2 + 1.5 }}m",
@ -219,6 +233,10 @@
" <td>{{ markerLine({ 'width': 5, 'color': '#af3f3f' })|raw }}</td>",
" <td>{{ tagTrans('cycleway', 'lane') }}</td>",
" </tr>",
" <tr>",
" <td>{{ markerLine({ 'width': 5, 'color': '#4f4fbf' })|raw }}</td>",
" <td>{{ keyTrans('sidewalk') }}</td>",
" </tr>",
"</table>"
]
}
Loading…
Cancel
Save