Main categories of OpenStreetBrowser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.0 KiB

  1. query: |
  2. (
  3. way[highway=cycleway];
  4. way["cycleway:width"];
  5. )
  6. feature:
  7. style:
  8. pre: |
  9. {% set width = attribute(tags, 'cycleway:width') %}
  10. {% if width matches "/'$/" %}
  11. {% set width = (width|slice(0, -1)) * 0.3048 %}
  12. {% endif %}
  13. width: 4
  14. color: |
  15. {% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %}
  16. {% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %}
  17. {% if width %}
  18. {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }}
  19. {% else %}black
  20. {% endif %}
  21. lineCap: |
  22. {{ tags.oneway in ['yes', 1, -1] ? 'butt' : 'round' }}
  23. dashArray: |
  24. {{ tags.oneway in ['yes', 1, -1] ? '27,8' : '' }}
  25. dashOffset: |
  26. {{ tags.oneway in [-1] ? 28 : 0 }}
  27. noClip: |
  28. {{ tags.oneway in ['yes', 1, -1] }}
  29. pattern: |
  30. {% if tags.oneway in ['yes', 1, -1] %}arrowHead{% endif %}
  31. pattern-offset: |
  32. {{ tags.oneway in [-1] ? 4 : 30.5 }}
  33. pattern-repeat: 35
  34. pattern-polygon: true
  35. pattern-pixelSize: 9
  36. pattern-angleCorrection: |
  37. {{ tags.oneway in [-1] ? 180 : 0 }}
  38. pattern-path-width: 0
  39. pattern-path-color: |
  40. {% if width %}
  41. {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }}
  42. {% else %}black
  43. {% endif %}
  44. pattern-path-fillOpacity: 1
  45. markerSymbol: false
  46. listMarkerSymbol: line
  47. description: |
  48. {{ tagTrans('highway', tags.highway) }}
  49. details: |
  50. {% if not attribute(tags, 'cycleway:width') %}
  51. {% elseif attribute(tags, 'cycleway:width') matches "/'$/" %}
  52. {{ attribute(tags, 'cycleway:width') }}
  53. {% else %}
  54. {{ attribute(tags, 'cycleway:width') }}m
  55. {% endif %}
  56. body: |
  57. <ul>
  58. <li>
  59. {{ keyTrans('cycleway:width') }}:
  60. {% if not attribute(tags, 'cycleway:width') %}
  61. {{ trans('unknown') }}
  62. {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %}
  63. {{ attribute(tags, 'cycleway:width') }}
  64. {% else %}
  65. {{ attribute(tags, 'cycleway:width') }}m
  66. {% endif %}
  67. </ul>
  68. info: |
  69. <table>
  70. <tr>
  71. <th>Symbol</th>
  72. <th>{{ keyTrans('oneway') }}={{ tagTrans('oneway', 'yes') }}</th>
  73. <th>{{ keyTrans('oneway') }}={{ tagTrans('oneway', 'no') }}</th>
  74. </tr>
  75. {% for v in range(0, 1, 0.25) %}
  76. <tr>
  77. <td>
  78. {{ markerLine({ width: 4, color: colorInterpolate(const.colorScheme, v) }) }}
  79. </td>
  80. <td>
  81. {% if v == 0 %}<={% elseif v == 1 %}>={% endif %}
  82. {{ (const.minWidthOneway + (v * (const.optWidthOneway - const.minWidthOneway)))|number_format(2) }}m
  83. </td>
  84. <td>
  85. {% if v == 0 %}<={% elseif v == 1 %}>={% endif %}
  86. {{ (const.minWidthBoth + (v * (const.optWidthBoth - const.minWidthBoth)))|number_format(2) }}m
  87. </td>
  88. </tr>
  89. {% endfor %}
  90. </table>
  91. const:
  92. minWidthBoth: 1.5
  93. optWidthBoth: 5
  94. minWidthOneway: 0.75
  95. optWidthOneway: 3
  96. colorScheme: ['#ff0000', '#7f7fff', '#0000ff']