|
|
@ -10,6 +10,19 @@ |
|
|
|
"18": "(node[railway];way[railway];)" |
|
|
|
}, |
|
|
|
"feature": { |
|
|
|
"pre": [ |
|
|
|
"{% set railway_type = null %}", |
|
|
|
"", |
|
|
|
"{% if tags.railway == 'disused' %}", |
|
|
|
" {% set railway_type = attribute(tags, 'disused:railway')|default(tags.disused) %}", |
|
|
|
"{% elseif tags.railway == 'abandoned' %}", |
|
|
|
" {% set railway_type = attribute(tags, 'abandoned:railway')|default(tags.abandoned) %}", |
|
|
|
"{% elseif tags.railway == 'proposed' %}", |
|
|
|
" {% set railway_type = attribute(tags, 'proposed:railway')|default(tags.proposed) %}", |
|
|
|
"{% elseif tags.railway in [ 'rail', 'narrow_gauge', 'subway', 'light_rail', 'tram' ] %}", |
|
|
|
" {% set railway_type = tags.railway %}", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}", |
|
|
|
"description": "{{ tagTrans('railway', tags.railway) }}", |
|
|
|
"body": [ |
|
|
@ -20,14 +33,14 @@ |
|
|
|
"{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}<br/>{% endif %}", |
|
|
|
"" |
|
|
|
], |
|
|
|
"markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X{% endif %}", |
|
|
|
"markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}H{% endif %}", |
|
|
|
"markerSymbol": [ |
|
|
|
"{% if tags.railway == 'signal' %}", |
|
|
|
"<svg anchorX='5' anchorY='8' width='9' height='15'>", |
|
|
|
" <rect x='0.5' y='0.5' width='8' height='14' style='fill: #000000; fill-opacity: 1;' />", |
|
|
|
" <circle cx='4.5' cy='4.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #7f7f7f;'/>", |
|
|
|
" <circle cx='4.5' cy='10.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #ff0000;'/>", |
|
|
|
"</svg>", |
|
|
|
"</Xsvg>", |
|
|
|
"{% elseif tags.railway == 'switch' %}", |
|
|
|
"<svg anchorX='5' anchorY='8' width='9' height='15'>", |
|
|
|
" <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />", |
|
|
@ -40,8 +53,6 @@ |
|
|
|
" <line x1='2' x2='7' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", |
|
|
|
" <line x1='7' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", |
|
|
|
"</svg>", |
|
|
|
"{% elseif tags.railway not in [ 'rail', 'tram', 'subway', 'narrow_gauge', 'abandoned', 'disused', 'light_rail' ] %}", |
|
|
|
"{{ markerPointer({})|raw }}", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"listMarkerSymbol": [ |
|
|
@ -58,32 +69,42 @@ |
|
|
|
"{% else %}5", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}", |
|
|
|
"styles": [ |
|
|
|
"{% if railway_type %}", |
|
|
|
"highlight,default", |
|
|
|
"{% else %}", |
|
|
|
"default", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"style": { |
|
|
|
"width": [ |
|
|
|
"{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", |
|
|
|
"1", |
|
|
|
"{% else %}", |
|
|
|
" {% if tags.railway == 'rail' %}", |
|
|
|
" {% if tags.usage == 'main' or tags.usage == 'branch' %}", |
|
|
|
" 3", |
|
|
|
" {% else %}", |
|
|
|
" 2", |
|
|
|
" {% endif %}", |
|
|
|
" {% elseif tags.railway == 'platform' %}", |
|
|
|
"{% if tags.railway in [ 'platform' ] %}", |
|
|
|
"1", |
|
|
|
"{% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", |
|
|
|
"0", |
|
|
|
"{% elseif tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", |
|
|
|
"1", |
|
|
|
"{% elseif tags.usage == 'main' or tags.usage == 'branch' %}", |
|
|
|
" 3", |
|
|
|
"{% else %}", |
|
|
|
" 2", |
|
|
|
" {% endif %}", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#000000{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}", |
|
|
|
"color": "{{ const[railway_type].color }}", |
|
|
|
"opacity": "1", |
|
|
|
"lineCap": [ |
|
|
|
"{% if tags.railway in [ 'disused', 'abandoned', 'proposed' ] %}", |
|
|
|
"butt", |
|
|
|
"{% else %}", |
|
|
|
"round", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"dashArray": [ |
|
|
|
"{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}", |
|
|
|
"{% if tags.tunnel %}5,5{% endif %}" |
|
|
|
"{% if tags.railway == 'disused' %}1,5", |
|
|
|
"{% elseif tags.railway == 'abandoned' %}1,7", |
|
|
|
"{% elseif tags.railway == 'proposed' %}2,2", |
|
|
|
"{% elseif tags.tunnel %}5,5", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"fill": [ |
|
|
|
"{% if tags.railway == 'platform' %}", |
|
|
@ -108,11 +129,21 @@ |
|
|
|
"{% endif %}" |
|
|
|
] |
|
|
|
}, |
|
|
|
"style:casing": { |
|
|
|
"width": "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}5{% else %}{% if tags.railway == 'rail' %}{% if tags.usage == 'main' or tags.usage == 'branch' %}7{% else %}6{% endif %}{% elseif tags.railway == 'platform' %}5{% else %}6{% endif %}{% endif %}", |
|
|
|
"color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#000000{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}", |
|
|
|
"lineCap": "butt", |
|
|
|
"dashArray": "2,4" |
|
|
|
"style:highlight": { |
|
|
|
"width": [ |
|
|
|
"{% if tags.railway in [ 'platform' ] %}", |
|
|
|
"1", |
|
|
|
"{% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", |
|
|
|
"0", |
|
|
|
"{% elseif tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", |
|
|
|
"1", |
|
|
|
"{% elseif tags.usage == 'main' or tags.usage == 'branch' %}", |
|
|
|
" 3", |
|
|
|
"{% else %}", |
|
|
|
" 2", |
|
|
|
"{% endif %}" |
|
|
|
], |
|
|
|
"color": "#ffffff" |
|
|
|
} |
|
|
|
}, |
|
|
|
"info": [ |
|
|
@ -122,6 +153,10 @@ |
|
|
|
" <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>", |
|
|
|
" </tr>", |
|
|
|
" <tr>", |
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"branch\" }))|raw }}</td>", |
|
|
|
" <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'branch') }}</td>", |
|
|
|
" </tr>", |
|
|
|
" <tr>", |
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>", |
|
|
|
" <td>{{ tagTrans('railway', 'rail') }}</td>", |
|
|
|
" </tr>", |
|
|
@ -130,13 +165,13 @@ |
|
|
|
" <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>", |
|
|
|
" </tr>", |
|
|
|
" <tr>", |
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>", |
|
|
|
" <td>{{ tagTrans('railway', 'light_rail') }}</td>", |
|
|
|
" </tr>", |
|
|
|
" <tr>", |
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>", |
|
|
|
" <td>{{ tagTrans('railway', 'subway') }}</td>", |
|
|
|
" </tr>", |
|
|
|
" <tr>", |
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>", |
|
|
|
" <td>{{ tagTrans('railway', 'light_rail') }}</td>", |
|
|
|
" </tr>", |
|
|
|
"{% if map.zoom >= 14 %}", |
|
|
|
" <tr>", |
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>", |
|
|
@ -144,5 +179,22 @@ |
|
|
|
" </tr>", |
|
|
|
"{% endif %}", |
|
|
|
"</table>" |
|
|
|
] |
|
|
|
], |
|
|
|
"const": { |
|
|
|
"rail": { |
|
|
|
"color": "#000000" |
|
|
|
}, |
|
|
|
"narrow_gauge": { |
|
|
|
"color": "#7f003f" |
|
|
|
}, |
|
|
|
"subway": { |
|
|
|
"color": "#0000ff" |
|
|
|
}, |
|
|
|
"light_rail": { |
|
|
|
"color": "#7f00ff" |
|
|
|
}, |
|
|
|
"tram": { |
|
|
|
"color": "#ff00ff" |
|
|
|
} |
|
|
|
} |
|
|
|
} |