diff --git a/car_maxspeed.json b/car_maxspeed.json index 6c11f5a..7b9e568 100644 --- a/car_maxspeed.json +++ b/car_maxspeed.json @@ -21,7 +21,9 @@ "{% set unit = null %}", "", "{% if tags.maxspeed is defined %}", - " {% if tags.maxspeed|matches(\"^[0-9]+$\") %}", + " {% if tags.maxspeed == 'none' %}", + " {% set maxspeed = 'none' %}", + " {% elseif tags.maxspeed|matches(\"^[0-9]+$\") %}", " {% set maxspeedKmh = tags.maxspeed %}", " {% set maxspeed = tags.maxspeed %}", " {% set unit = \"km/h\" %}", @@ -34,7 +36,9 @@ "{% endif %}", "", "{% if attribute(tags, 'maxspeed:forward') is defined %}", - " {% if attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+$\") %}", + " {% if attribute(tags, 'maxspeed:forward') == 'none' %}", + " {% set maxspeedF = 'none' %}", + " {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+$\") %}", " {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}", " {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}", " {% set unit = \"km/h\" %}", @@ -47,7 +51,9 @@ "{% endif %}", "", "{% if attribute(tags, 'maxspeed:backward') is defined %}", - " {% if attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+$\") %}", + " {% if attribute(tags, 'maxspeed:backward') == 'none' %}", + " {% set maxspeedB = 'none' %}", + " {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+$\") %}", " {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}", " {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}", " {% set unit = \"km/h\" %}", @@ -59,25 +65,31 @@ " {% endif %}", "{% endif %}", "", - "{% if not maxspeedKmh %}", + "{% if maxspeed == 'none' %}", + "{% set color = \"#0000ff\" %}", + "{% elseif not maxspeedKmh %}", "{% set color = \"#404040\" %}", "{% else %}", "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", "{% endif %}", "", - "{% if maxspeedFKmh %}", + "{% if maxspeedF == 'none' %}", + "{% set colorF = \"#0000ff\" %}", + "{% elseif maxspeedFKmh %}", "{% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", "{% endif %}", "", - "{% if maxspeedBKmh %}", + "{% if maxspeedB == 'none' %}", + "{% set colorB = \"#0000ff\" %}", + "{% elseif maxspeedBKmh %}", "{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", "{% endif %}" ], "description": [ "{% if maxspeedF or maxspeedB %}", - "{{ maxspeedB|default(trans('unknown')) }} / {{ maxspeedF|default(trans('unknown')) }} {{ unit }}", + "{{ maxspeedB == 'none' ? tagTrans('maxspeed', 'none') : maxspeedB|default(trans('unknown')) }} / {{ maxspeedF == 'none' ? tagTrans('maxspeed', 'none') : maxspeedF|default(trans('unknown')) }} {{ unit }}", "{% elseif maxspeed %}", - "{{ maxspeed }} {{ unit }}", + "{{ maxspeed == 'none' ? tagTrans('maxspeed', 'none') : maxspeed }} {{ unit }}", "{% elseif tags.maxspeed %}", "{{ tags.maxspeed }}", "{% else %}", @@ -139,6 +151,10 @@ " {{ markerLine(evaluate({ \"maxspeed\": 150 }))|raw }}", " ≥150km/h", " ", + " ", + " {{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}", + " {{ tagTrans('maxspeed', 'none') }}", + " ", "", "", "", @@ -162,6 +178,10 @@ " {{ markerLine(evaluate({ \"maxspeed\": (95 * 1.60934)|round }))|raw }}", " ≥95mph", " ", + " ", + " {{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}", + " {{ tagTrans('maxspeed', 'none') }}", + " ", "", "" ]