|
@ -8,8 +8,11 @@ |
|
|
"14": "way[railway~'^(disused|construction|funicular|light_rail|miniature|monorail|narrow_gauge|preserved|rail|subway|tram)$'];" |
|
|
"14": "way[railway~'^(disused|construction|funicular|light_rail|miniature|monorail|narrow_gauge|preserved|rail|subway|tram)$'];" |
|
|
}, |
|
|
}, |
|
|
"feature": { |
|
|
"feature": { |
|
|
"pre": "{% set gauges = tags.gauge|split(';') %}", |
|
|
|
|
|
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}", |
|
|
|
|
|
|
|
|
"pre": [ |
|
|
|
|
|
"{% set gauges = tags.gauge|split(';') %}", |
|
|
|
|
|
"{% set width = max(3, 2.5 / map.metersPerPixel) %}" |
|
|
|
|
|
], |
|
|
|
|
|
"title": "{{ width }}{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}", |
|
|
"description": "{{ tags.gauge|default(trans('unknown'))|enumerate }}", |
|
|
"description": "{{ tags.gauge|default(trans('unknown'))|enumerate }}", |
|
|
"body": [ |
|
|
"body": [ |
|
|
"{{ tagTrans('railway', tags.railway) }}<br/>", |
|
|
"{{ tagTrans('railway', tags.railway) }}<br/>", |
|
@ -23,31 +26,36 @@ |
|
|
"listMarkerSymbol": "line", |
|
|
"listMarkerSymbol": "line", |
|
|
"styles": "{% if gauges|length < 2 %}default{% else %}{% for i, v in gauges %}{% if i != 0 %},{% endif %}gauge{{ i }}{% endfor %}{% endif %}", |
|
|
"styles": "{% if gauges|length < 2 %}default{% else %}{% for i, v in gauges %}{% if i != 0 %},{% endif %}gauge{{ i }}{% endfor %}{% endif %}", |
|
|
"style": { |
|
|
"style": { |
|
|
"width": "3", |
|
|
|
|
|
|
|
|
"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 %}" |
|
|
"color": "{% if tags.gauge %}{% if not tags.gauge|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], tags.gauge / 2000) }}{% endif %}{% else %}#404040{% endif %}" |
|
|
}, |
|
|
}, |
|
|
"style:gauge0": { |
|
|
"style:gauge0": { |
|
|
"width": "3", |
|
|
|
|
|
|
|
|
"width": "{{ width }}", |
|
|
|
|
|
"pane": "casing", |
|
|
"lineCap": "butt", |
|
|
"lineCap": "butt", |
|
|
"color": "{% if not gauges[0]|matches('^[0-9]+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[0] / 2000) }}{% endif %}", |
|
|
"color": "{% if not gauges[0]|matches('^[0-9]+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[0] / 2000) }}{% endif %}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}" |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}" |
|
|
}, |
|
|
}, |
|
|
"style:gauge1": { |
|
|
"style:gauge1": { |
|
|
"width": "3", |
|
|
|
|
|
|
|
|
"width": "{{ width }}", |
|
|
|
|
|
"pane": "casing", |
|
|
"lineCap": "butt", |
|
|
"lineCap": "butt", |
|
|
"color": "{% if not gauges[1]|matches('^[0-9]+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[1] / 2000) }}{% endif %}", |
|
|
"color": "{% if not gauges[1]|matches('^[0-9]+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[1] / 2000) }}{% endif %}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}", |
|
|
"dashOffset": "5" |
|
|
"dashOffset": "5" |
|
|
}, |
|
|
}, |
|
|
"style:gauge2": { |
|
|
"style:gauge2": { |
|
|
"width": "3", |
|
|
|
|
|
|
|
|
"width": "{{ width }}", |
|
|
|
|
|
"pane": "casing", |
|
|
"lineCap": "butt", |
|
|
"lineCap": "butt", |
|
|
"color": "{% if not gauges[2]|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[2] / 2000) }}{% endif %}", |
|
|
"color": "{% if not gauges[2]|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[2] / 2000) }}{% endif %}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}", |
|
|
"dashOffset": "10" |
|
|
"dashOffset": "10" |
|
|
}, |
|
|
}, |
|
|
"style:gauge3": { |
|
|
"style:gauge3": { |
|
|
"width": "3", |
|
|
|
|
|
|
|
|
"width": "{{ width }}", |
|
|
|
|
|
"pane": "casing", |
|
|
"lineCap": "butt", |
|
|
"lineCap": "butt", |
|
|
"color": "{% if not gauges[3]|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[3] / 2000) }}{% endif %}", |
|
|
"color": "{% if not gauges[3]|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[3] / 2000) }}{% endif %}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}", |
|
|
"dashArray": "5,{{ (gauges|length - 1) * 5 }}", |
|
|