diff --git a/railway-electrification.json b/railway-electrification.json index 7e61111e..66bb031b 100644 --- a/railway-electrification.json +++ b/railway-electrification.json @@ -16,18 +16,18 @@ "pre": [ "{% if tags.electrified and tags.electrified != 'no' %}", " {% if not tags.voltage is defined %}", - " {% set color = '#7f7f7f' %}", + " {% set color = const.colorUnknown %}", " {% elseif not tags.voltage|matches('^[0-9]+$') %}", - " {% set color = '#ff0000' %}", - " {% elseif tags.voltage < 1000 %}", - " {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}", + " {% set color = const.colorIllegal %}", + " {% elseif tags.voltage < const.range[1] %}", + " {% set color = colorInterpolate(const.scheme|slice(0, 2), tags.voltage / const.range[1]) %}", " {% else %}", - " {% set color = colorInterpolate([ 'blue', '#af0000' ], (tags.voltage - 1000) / 24000) %}", + " {% set color = colorInterpolate(const.scheme|slice(1, 2), (tags.voltage - const.range[1]) / (const.range[2] - const.range[1])) %}", " {% endif %}", "{% elseif tags.electrified and tags.electrified == 'no' %}", - " {% set color = '#000000' %}", + " {% set color = const.colorNone %}", "{% else %}", - " {% set color = '#7f7f7f' %}", + " {% set color = const.colorUnknown %}", "{% endif %}", "", "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", @@ -35,9 +35,9 @@ " {% else %}", " {% if tags.railway == 'rail' %}", " {% if tags.usage == 'main' or tags.usage == 'branch' %}", - " {% set width=3 %}", + " {% set width=4 %}", " {% else %}", - " {% set width=2.5 %}", + " {% set width=3 %}", " {% endif %}", " {% else %}", " {% set width=2 %}", @@ -84,32 +84,33 @@ "width": "{{ width }}", "color": "white", "opacity": "1", + "lineCap": "butt", "fill": null } }, "info": [ "
{{ markerLine({ 'width': 3, 'color': color })|raw }} | ", + "{{ markerLine({ 'width': 3, 'color': const.colorNone })|raw }} | ", "{{ trans('not electrified') }} | ", "
{{ markerLine({ 'width': 3, 'color': color })|raw }} | ", "{{ i }}V | ", "|
{{ markerLine({ 'width': 3, 'color': color })|raw }} | ", "{{ i }}V | ", "|
{{ markerLine({ 'width': 3, 'color': color })|raw }} | ", "{{ trans('tag:frequency=0') }} | ", @@ -121,14 +122,22 @@ "|
{{ markerLine({ 'width': 3, 'color': '#7f7f7f' })|raw }} | ", + "{{ markerLine({ 'width': 3, 'color': const.colorUnknown })|raw }} | ", "{{ trans('unknown') }} | ", "
{{ markerLine({ 'width': 3, 'color': '#ff0000' })|raw }} | ", + "{{ markerLine({ 'width': 3, 'color': const.colorIllegal })|raw }} | ", "{{ trans('illegal value') }} | ", "