Browse Source

Car Maxspeed: bugfix

fossil
parent
commit
5307e70452
  1. 2
      car_maxspeed.json

2
car_maxspeed.json

@ -10,7 +10,7 @@
"17": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified|service|living_street|pedestrian|track|road)$\"];" "17": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified|service|living_street|pedestrian|track|road)$\"];"
}, },
"feature": { "feature": {
"pre": "{% if tags.maxspeed is not defined %}\n{% set maxspeedKmh = null %}\n{% set maxspeed = null %}\n{% set unit = null %}\n{% else %}\n\n{% if tags.maxspeed|matches(\"^[0-9]+$\") %}\n{% set maxspeedKmh = tags.maxspeed %}\n{% set maxspeed = tags.maxspeed %}\n{% set unit = \"km/h\" %}\n{% endif %}\n\n\n{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}\n{% if m %}\n{% set maxspeedKmh = m[1] * 1.60934 %}\n{% set maxspeed = tags.maxspeed %}\n{% set unit = \"mph\" %}\n{% endif %}\n\n{% endif %}\n\n{% if not maxspeedKmh %}\n{% set color = \"#404040\" %}\n{% else %}\n{% set color = colorInterpolate([ 'green', 'orange', 'red' ], maxspeedKmh / 150) %}\n{% endif %}",
"pre": "{% if tags.maxspeed is not defined %}\n{% set maxspeedKmh = null %}\n{% set maxspeed = null %}\n{% set unit = null %}\n{% else %}\n\n{% if tags.maxspeed|matches(\"^[0-9]+$\") %}\n{% set maxspeedKmh = tags.maxspeed %}\n{% set maxspeed = tags.maxspeed %}\n{% set unit = \"km/h\" %}\n{% endif %}\n\n\n{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}\n{% if m %}\n{% set maxspeedKmh = m[1] * 1.60934 %}\n{% set maxspeed = m[1] %}\n{% set unit = \"mph\" %}\n{% endif %}\n\n{% endif %}\n\n{% if not maxspeedKmh %}\n{% set color = \"#404040\" %}\n{% else %}\n{% set color = colorInterpolate([ 'green', 'orange', 'red' ], maxspeedKmh / 150) %}\n{% endif %}",
"description": "{% if maxspeed %}\n<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>\n{% else %}\n{{ trans('unknown') }}\n{% endif %}", "description": "{% if maxspeed %}\n<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>\n{% else %}\n{{ trans('unknown') }}\n{% endif %}",
"style": { "style": {
"color": "{{ color }}" "color": "{{ color }}"

Loading…
Cancel
Save