Browse Source

Lanes: improvements

name-etym
parent
commit
b97e89867a
  1. 31
      lanes.json

31
lanes.json

@ -19,12 +19,13 @@
"{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) %}", "{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) %}",
"{% set cyclelane_left = 'opposite_lane' in tags.cycleway|split(';') ? 1 : 0 %}", "{% set cyclelane_left = 'opposite_lane' in tags.cycleway|split(';') ? 1 : 0 %}",
"{% set cyclelane_right = 'lane' in tags.cycleway|split(';') ? 1 : 0 %}", "{% set cyclelane_right = 'lane' in tags.cycleway|split(';') ? 1 : 0 %}",
"{% set lanes = tags.lanes|default(1) %}",
"{% set oneway = tags.oneway in ['yes','1'] %}",
"{% set lanes = tags.lanes|default(oneway ? 1 : 2) %}",
"{% set lanes_width = lanes * 3 %}", "{% set lanes_width = lanes * 3 %}",
"{% set forward_lanes = attribute(tags, 'lanes:forward')|default(tags.oneway in ['yes','1'] ? lanes : lanes / 2) %}",
"{% set backward_lanes = attribute(tags, 'lanes:backward')|default(tags.oneway in ['yes','1'] ? 0 : lanes / 2) %}"
"{% set forward_lanes = attribute(tags, 'lanes:forward')|default(oneway ? lanes : lanes // 2) %}",
"{% set backward_lanes = attribute(tags, 'lanes:backward')|default(oneway ? 0 : lanes // 2) %}"
], ],
"description": "{{ keyTrans('lanes') }}: {{ lanes }} | {{ forward_lanes }} {{ backward_lanes }}",
"description": "{{ keyTrans('lanes') }}: {% if tags.lanes %}{{ tags.lanes }}{% else %}{{ lanes }}?{% endif %} {% if attribute(tags, 'lanes:forward') or attribute(tags, 'lanes:backward') %}(↑{{ forward_lanes }} ↓{{ backward_lanes }}){% endif %}",
"body": [ "body": [
"{{ tagTrans('railway', tags.railway) }}<br/>", "{{ tagTrans('railway', tags.railway) }}<br/>",
"{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}", "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
@ -140,67 +141,67 @@
"style:mark1": { "style:mark1": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 3 }}m", "offset": "{{ lanes_width / -2 + 3 }}m",
"dashArray": "{% if forward_lanes != 1 and lanes - backward_lanes != 1 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 1 and backward_lanes != 1 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark2": { "style:mark2": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 6 }}m", "offset": "{{ lanes_width / -2 + 6 }}m",
"dashArray": "{% if forward_lanes != 2 and lanes - backward_lanes != 2 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 2 and backward_lanes != 2 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark3": { "style:mark3": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 9 }}m", "offset": "{{ lanes_width / -2 + 9 }}m",
"dashArray": "{% if forward_lanes != 3 and lanes - backward_lanes != 3 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 3 and backward_lanes != 3 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark4": { "style:mark4": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 12 }}m", "offset": "{{ lanes_width / -2 + 12 }}m",
"dashArray": "{% if forward_lanes != 4 and lanes - backward_lanes != 4 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 4 and backward_lanes != 4 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark5": { "style:mark5": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 15 }}m", "offset": "{{ lanes_width / -2 + 15 }}m",
"dashArray": "{% if forward_lanes != 5 and lanes - backward_lanes != 5 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 5 and backward_lanes != 5 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark6": { "style:mark6": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 6 and lanes - backward_lanes != 6 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 6 and backward_lanes != 6 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark7": { "style:mark7": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 7 and lanes - backward_lanes != 7 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 7 and backward_lanes != 7 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark8": { "style:mark8": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 8 and lanes - backward_lanes != 8 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 8 and backward_lanes != 8 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark9": { "style:mark9": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 9 and lanes - backward_lanes != 9 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 9 and backward_lanes != 9 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark10": { "style:mark10": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 10 and lanes - backward_lanes != 10 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 10 and backward_lanes != 10 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark11": { "style:mark11": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 11 and lanes - backward_lanes != 11 %}5,5{% endif %}",
"dashArray": "{% if lanes - forward_lanes != 11 and backward_lanes != 11 %}5,5{% endif %}",
"color": "white" "color": "white"
} }
}, },

Loading…
Cancel
Save