Browse Source

Lanes: different width of parking lane depending on type

name-etym
parent
commit
e10345cf1c
  1. 66
      lanes.json

66
lanes.json

@ -16,8 +16,10 @@
"feature": {
"pre": [
"{% set oneway = tags.oneway in ['yes','1'] %}",
"{% set parking_left = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lane:both')) ? 2 : 0 %}",
"{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) ? 2 : 0 %}",
"{% set parking_left_type = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lane:both')) %}",
"{% set parking_left = parking_left_type ? const.parking[parking_left_type]|default(const.parking.other) : const.parking.no %}",
"{% set parking_right_type = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) %}",
"{% set parking_right = parking_right_type ? const.parking[parking_right_type]|default(const.parking.other) : const.parking.no %}",
"{% set cyclelane_left = attribute(tags, 'cycleway:left') == 'lane' ? 2 : ('opposite_lane' in tags.cycleway|split(';') ? 2 : (('lane' in tags.cycleway|split(';')) and not oneway ? 2 : 0)) %}",
"{% set cyclelane_right = attribute(tags, 'cycleway:right') == 'lane' ? 2 : ('lane' in tags.cycleway|split(';') ? 2 : 0) %}",
"{% set cycletrack_left = attribute(tags, 'cycleway:left') == 'track' ? 2 : ('opposite_track' in tags.cycleway|split(';') ? 2 : (('track' in tags.cycleway|split(';')) and not oneway ? 2 : 0)) %}",
@ -40,7 +42,7 @@
],
"markerSymbol": null,
"listMarkerSymbol": "line",
"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 %}",
"styles": "{% if sidewalk_left %}sidewalk_left,{% endif %}{% if cycletrack_left %}cycletrack_left,{% endif %}{% if parking_left.width %}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.width %},parking_right{% endif %}{% if cycletrack_right %},cycletrack_right{% endif %}{% if sidewalk_right %},sidewalk_right{% endif %}",
"style": {
"width": "{{ width }}",
"pane": "casing",
@ -49,13 +51,13 @@
"style:sidewalk_left": {
"width": "2m",
"color": "#4f4fbf",
"offset": "{{ lanes_width / -2 - cyclelane_left - parking_left - cycletrack_left - 1 }}m",
"offset": "{{ lanes_width / -2 - cyclelane_left - parking_left.width - cycletrack_left - 1 }}m",
"pane": "casing"
},
"style:parking_left": {
"width": "2m",
"color": "orange",
"offset": "{{ lanes_width / -2 - cyclelane_left - 1 }}m",
"width": "{{ parking_left.width }}m",
"color": "{{ parking_left.color }}",
"offset": "{{ lanes_width / -2 - cyclelane_left - parking_left.width / 2 }}m",
"pane": "casing"
},
"style:cyclelane_left": {
@ -73,25 +75,25 @@
"style:cycletrack_left": {
"width": "2m",
"color": "#bf5f3f",
"offset": "{{ lanes_width / -2 - cyclelane_left - parking_left - 1 }}m",
"offset": "{{ lanes_width / -2 - cyclelane_left - parking_left.width - 1 }}m",
"pane": "casing"
},
"style:cycletrack_right": {
"width": "2m",
"color": "#bf5f3f",
"offset": "{{ lanes_width / 2 + cyclelane_right + parking_right + 1 }}m",
"offset": "{{ lanes_width / 2 + cyclelane_right + parking_right.width + 1 }}m",
"pane": "casing"
},
"style:parking_right": {
"width": "2m",
"color": "orange",
"offset": "{{ lanes_width / 2 + cyclelane_right + 1 }}m",
"width": "{{ parking_left.width }}m",
"color": "{{ parking_left.color }}",
"offset": "{{ lanes_width / 2 + cyclelane_right + parking_right.width / 2 }}m",
"pane": "casing"
},
"style:sidewalk_right": {
"width": "2m",
"color": "#4f4fbf",
"offset": "{{ lanes_width / 2 + cyclelane_right + parking_right + cycletrack_right + 1 }}m",
"offset": "{{ lanes_width / 2 + cyclelane_right + parking_right.width + cycletrack_right + 1 }}m",
"pane": "casing"
},
"style:lane1": {
@ -260,5 +262,41 @@
" <td>{{ keyTrans('sidewalk') }}</td>",
" </tr>",
"</table>"
]
],
"const": {
"parking": {
"parallel": {
"width": "2",
"color": "orange"
},
"diagonal": {
"width": "2.5",
"color": "orange"
},
"perpendicular": {
"width": "3",
"color": "orange"
},
"no_parking": {
"width": "0.5",
"color": "#7f0000"
},
"no_stopping": {
"width": "0.5",
"color": "#7f0000"
},
"fire_lane": {
"width": "2",
"color": "#ff0000"
},
"other": {
"width": "2",
"color": "#ff0000"
},
"no": {
"width": "0",
"color": "#000000"
}
}
}
}
Loading…
Cancel
Save