Browse Source

car_maxspeed: support maxspeed=walk

pedestrian
parent
commit
5f716f0b13
  1. 34
      car_maxspeed.json

34
car_maxspeed.json

@ -21,8 +21,8 @@
"{% set unit = null %}",
"",
"{% if tags.maxspeed is defined %}",
" {% if tags.maxspeed == 'none' %}",
" {% set maxspeed = 'none' %}",
" {% if const.colorOther[tags.maxspeed] %}",
" {% set maxspeed = tags.maxspeed %}",
" {% elseif tags.maxspeed|matches(\"^[0-9]+$\") %}",
" {% set maxspeedKmh = tags.maxspeed %}",
" {% set maxspeed = tags.maxspeed %}",
@ -36,8 +36,9 @@
"{% endif %}",
"",
"{% if attribute(tags, 'maxspeed:forward') is defined %}",
" {% if attribute(tags, 'maxspeed:forward') == 'none' %}",
" {% set maxspeedF = 'none' %}",
" {% set x = attribute(tags, 'maxspeed:forward') %}",
" {% if const.colorOther[x] %}",
" {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}",
" {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+$\") %}",
" {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}",
" {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}",
@ -51,8 +52,9 @@
"{% endif %}",
"",
"{% if attribute(tags, 'maxspeed:backward') is defined %}",
" {% if attribute(tags, 'maxspeed:backward') == 'none' %}",
" {% set maxspeedB = 'none' %}",
" {% set x = attribute(tags, 'maxspeed:backward') %}",
" {% if const.colorOther[x] %}",
" {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}",
" {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+$\") %}",
" {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}",
" {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}",
@ -65,8 +67,8 @@
" {% endif %}",
"{% endif %}",
"",
"{% if maxspeed == 'none' %}",
"{% set color = \"#0000ff\" %}",
"{% if const.colorOther[maxspeed] %}",
"{% set color = const.colorOther[maxspeed] %}",
"{% elseif not maxspeedKmh %}",
"{% set color = \"#404040\" %}",
"{% else %}",
@ -87,9 +89,9 @@
],
"description": [
"{% if maxspeedF or maxspeedB %}",
"<span style='color: {{ colorB }}'>{{ maxspeedB == 'none' ? tagTrans('maxspeed', 'none') : maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ maxspeedF == 'none' ? tagTrans('maxspeed', 'none') : maxspeedF|default(trans('unknown')) }}</span> {{ unit }}",
"<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 }}'>{{ maxspeed == 'none' ? tagTrans('maxspeed', 'none') : maxspeed }} {{ unit }}</span>",
"<span style='color: {{ color }}'>{{ const.colorOther[maxspeed] ? tagTrans('maxspeed', maxspeed) : maxspeed }} {{ unit }}</span>",
"{% elseif tags.maxspeed %}",
"{{ tags.maxspeed }}",
"{% else %}",
@ -131,6 +133,10 @@
"#ff0000",
"#af00af"
],
"colorOther": {
"none": "#0000ff",
"walk": "#00afff"
},
"highestColorSpeed": 150,
"offsetColorSpeed": 10
},
@ -141,6 +147,10 @@
" <td>{{ markerLine(evaluate({}))|raw }}</td>",
" <td colspan>{{ trans('unknown') }}</td>",
" </tr>",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": \"walk\" }))|raw }}</td>",
" <td colspan>{{ tagTrans('maxspeed', 'walk') }}</td>",
" </tr>",
"{% for i in range(10, 140, 20) %}",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
@ -163,6 +173,10 @@
" <td>{{ markerLine(evaluate({}))|raw }}</td>",
" <td colspan>{{ trans('unknown') }}</td>",
" </tr>",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": \"walk\" }))|raw }}</td>",
" <td colspan>{{ tagTrans('maxspeed', 'walk') }}</td>",
" </tr>",
"{% for i in range(10, 60, 10) %}",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",

Loading…
Cancel
Save