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.

96 lines
3.0 KiB

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