Browse Source

car_maxspeed: maxspeed=none magenta, other values blue

heritage
parent
commit
9862c05ae6
  1. 33
      car_maxspeed.json

33
car_maxspeed.json

@ -32,6 +32,8 @@
" {% set maxspeedKmh = m[1] * 1.60934 %}", " {% set maxspeedKmh = m[1] * 1.60934 %}",
" {% set maxspeed = m[1] %}", " {% set maxspeed = m[1] %}",
" {% set unit = \"mph\" %}", " {% set unit = \"mph\" %}",
" {% else %}",
" {% set maxspeed = 'other' %}",
" {% endif %}", " {% endif %}",
"{% endif %}", "{% endif %}",
"", "",
@ -48,6 +50,8 @@
" {% set maxspeedFKmh = m[1] * 1.60934 %}", " {% set maxspeedFKmh = m[1] * 1.60934 %}",
" {% set maxspeedF = m[1] %}", " {% set maxspeedF = m[1] %}",
" {% set unit = \"mph\" %}", " {% set unit = \"mph\" %}",
" {% else %}",
" {% set maxspeedF = 'other' %}",
" {% endif %}", " {% endif %}",
"{% endif %}", "{% endif %}",
"", "",
@ -64,6 +68,8 @@
" {% set maxspeedBKmh = m[1] * 1.60934 %}", " {% set maxspeedBKmh = m[1] * 1.60934 %}",
" {% set maxspeedB = m[1] %}", " {% set maxspeedB = m[1] %}",
" {% set unit = \"mph\" %}", " {% set unit = \"mph\" %}",
" {% else %}",
" {% set maxspeedB = 'other' %}",
" {% endif %}", " {% endif %}",
"{% endif %}", "{% endif %}",
"", "",
@ -75,23 +81,23 @@
"{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
"{% endif %}", "{% endif %}",
"", "",
"{% if maxspeedF == 'none' %}",
"{% set colorF = \"#0000ff\" %}",
"{% if const.colorOther[maxspeedF] %}",
"{% set colorF = const.colorOther[maxspeedF] %}",
"{% elseif maxspeedFKmh %}", "{% elseif maxspeedFKmh %}",
"{% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", "{% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
"{% endif %}", "{% endif %}",
"", "",
"{% if maxspeedB == 'none' %}",
"{% set colorB = \"#0000ff\" %}",
"{% if const.colorOther[maxspeedB] %}",
"{% set colorB = const.colorOther[maxspeedB] %}",
"{% elseif maxspeedBKmh %}", "{% elseif maxspeedBKmh %}",
"{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", "{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
"{% endif %}" "{% endif %}"
], ],
"description": [ "description": [
"{% if maxspeedF or maxspeedB %}", "{% if maxspeedF or maxspeedB %}",
"<span style='color: {{ colorB }}'>{{ const.colorOther[maxspeedB] ? tagTrans('maxspeed', maxspeedB) : maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ const.colorOther[maxspeedF] ? tagTrans('maxspeed', maxspeedF) : maxspeedF|default(trans('unknown')) }}</span> {{ unit }}",
"{% elseif maxspeed %}",
"<span style='color: {{ color }}'>{{ const.colorOther[maxspeed] ? tagTrans('maxspeed', maxspeed) : maxspeed }} {{ unit }}</span>",
"<span style='color: {{ colorB }}'>{{ maxspeedB == 'other' ? attribute(tags, 'maxspeed:backward') : const.colorOther[maxspeedB] ? tagTrans('maxspeed', maxspeedB) : maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ maxspeedF == 'other' ? attribute(tags, 'maxspeed:forward') : const.colorOther[maxspeedF] ? tagTrans('maxspeed', maxspeedF) : maxspeedF|default(trans('unknown')) }}</span> {{ unit }}",
"{% elseif maxspeed == 'other' %}",
"<span style='color: {{ color }}'>{{ maxspeed == 'other' ? tags.maxspeed : const.colorOther[maxspeed] ? tagTrans('maxspeed', maxspeed) : maxspeed }} {{ unit }}</span>",
"{% elseif tags.maxspeed %}", "{% elseif tags.maxspeed %}",
"{{ tags.maxspeed }}", "{{ tags.maxspeed }}",
"{% else %}", "{% else %}",
@ -106,9 +112,9 @@
"color": "{{ color }}", "color": "{{ color }}",
"text": [ "text": [
"{% if maxspeedB or maxspeedF %}", "{% if maxspeedB or maxspeedF %}",
" {% if maxspeedB %}🡸 {{ maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF }} 🡺{% endif %} ",
" {% if maxspeedB %}🡸 {{ maxspeedB == 'other' ? attribute(tags, 'maxspeed:backward') : maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF == 'other' ? attribute(tags, 'maxspeed:forward') : maxspeedF }} 🡺{% endif %} ",
"{% else %}", "{% else %}",
" {{ maxspeed }} ",
" {{ maxspeed == 'other' ? tags.maxspeed : maxspeed }} ",
"{% endif %}" "{% endif %}"
], ],
"textRepeat": "1", "textRepeat": "1",
@ -134,8 +140,9 @@
"#af00af" "#af00af"
], ],
"colorOther": { "colorOther": {
"none": "#0000ff",
"walk": "#00afff"
"none": "#ff00ff",
"walk": "#00afff",
"other": "#0000ff"
}, },
"highestColorSpeed": 150, "highestColorSpeed": 150,
"offsetColorSpeed": 10 "offsetColorSpeed": 10
@ -154,6 +161,10 @@
" <td>{{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}</td>", " <td>{{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}</td>",
" <td>{{ tagTrans('maxspeed', 'none') }}</td>", " <td>{{ tagTrans('maxspeed', 'none') }}</td>",
" </tr>", " </tr>",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": \"other\" }))|raw }}</td>",
" <td>{{ trans('other') }}</td>",
" </tr>",
"</table>", "</table>",
"<div style='display: inline-block; width: 49%;'>", "<div style='display: inline-block; width: 49%;'>",
"<table>", "<table>",

Loading…
Cancel
Save