Main categories of OpenStreetBrowser with support for whitewater
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.

186 lines
8.3 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Radrouten",
  5. "en": "Cycle Routes",
  6. "fr": "Itinéraires vélo",
  7. "hu": "Kerékpáros útvonalak",
  8. "pt": "Ciclovias",
  9. "pt-br": "Ciclorrotas"
  10. },
  11. "query": {
  12. "6": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"][network~'^(|.*;)(icn)(|;.*)$']",
  13. "9": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"][network~'^(|.*;)(icn|ncn)(|;.*)$']",
  14. "12": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"][network~'^(|.*;)(icn|ncn|rcn)(|;.*)$']",
  15. "15": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"]"
  16. },
  17. "members": true,
  18. "feature": {
  19. "pre": [
  20. "{% set network = tags.network %}",
  21. "{% for n in tags.network|split(';') %}",
  22. "{% if n|matches('cn$') %}{% set network = n %}{% endif %}",
  23. "{% endfor %}"
  24. ],
  25. "title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
  26. "description": "{{ tagTrans('network', network) }}",
  27. "markerSymbol": "",
  28. "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[network].color|default(const[''].color) })|raw }}",
  29. "priority": "{{ const[network].priority|default(4) }}",
  30. "styles": "",
  31. "style:hover": {
  32. "width": "0"
  33. },
  34. "style:selected": {
  35. "width": "0"
  36. }
  37. },
  38. "memberFeature": {
  39. "pre": [
  40. "{% set priority = 4 %}",
  41. "{% set network = '' %}",
  42. "{% set refs = [] %}",
  43. "{% set dirForward = false %}",
  44. "{% set dirBackward = false %}",
  45. "{% set hover = false %}",
  46. "{% set selected = false %}",
  47. "",
  48. "{% for master in masters %}",
  49. " {% set masterNetwork = '' %}",
  50. " {% for n in master.tags.network|split(';') %}",
  51. " {% if n|matches('cn$') %}{% set masterNetwork = n %}{% endif %}",
  52. " {% endfor %}",
  53. " {% set _p = const[masterNetwork].priority|default(4) %}",
  54. " {% if _p < priority %}",
  55. " {% set priority = _p %}",
  56. " {% set network = masterNetwork %}",
  57. " {% endif %}",
  58. " {% if master.tags.ref %}",
  59. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  60. " {% endif %}",
  61. " {% if master.role == 'forward' %}{% set dirForward = true %}",
  62. " {% elseif master.role == 'backward' %}{% set dirBackward = true %}",
  63. " {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
  64. " {% endif %}",
  65. " {% if master.flags.hover %}{% set hover = master.role|default('both') %}{% endif %}",
  66. " {% if master.flags.selected %}{% set selected = master.role|default('both') %}{% endif %}",
  67. "{% endfor %}"
  68. ],
  69. "title": "",
  70. "body": [
  71. "<h4>Routes</h4>",
  72. "<ul class='overpass-layer-list'>",
  73. "{% for master in masters %}",
  74. " {% set masterNetwork = '' %}",
  75. " {% for n in master.tags.network|split(';') %}",
  76. " {% if n|matches('cn$') %}{% set masterNetwork = n %}{% endif %}",
  77. " {% endfor %}",
  78. " <li data-object=\"{{ master.id }}\">",
  79. " <span class='markerParent'><div class='marker'>{{ markerLine({ width: 4, color: const[masterNetwork].color|default(const[''].color) })|raw }}</div></span>",
  80. " <span class='title'>{% if master.tags.ref and master.tags.name %}{{ master.tags.ref }} - {{ master.tags.name|default(master.tags.ref) }}{% elseif master.tags.ref %}{{ master.tags.ref }}{% elseif master.tags.name %}{{ master.tags.name }}{% else %}{{ trans('unnamed') }}{% endif %}</span>",
  81. " <span class='description'>{{ tagTrans('network', masterNetwork) }}</span>",
  82. " </li>",
  83. "{% endfor %}",
  84. "</ul>"
  85. ],
  86. "listExclude": "1",
  87. "styles": "default{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}",
  88. "style": {
  89. "width": "4",
  90. "color": "{{ const[network].color }}",
  91. "opacity": "1",
  92. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  93. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  94. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  95. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  96. "text": "{{ refs|join(' · ') }} ",
  97. "textRepeat": "1",
  98. "textOffset": "12",
  99. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  100. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  101. "pattern-repeat": "35",
  102. "pattern-polygon": "true",
  103. "pattern-pixelSize": "9",
  104. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  105. "pattern-path-width": "0",
  106. "pattern-path-color": "{{ const[network].color }}",
  107. "pattern-path-fillOpacity": "1",
  108. "textFontWeight": "bold"
  109. },
  110. "style:hover": {
  111. "pane": "hover",
  112. "width": "4",
  113. "color": "black",
  114. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  115. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  116. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  117. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  118. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  119. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  120. "pattern-repeat": "35",
  121. "pattern-polygon": "true",
  122. "pattern-pixelSize": "9",
  123. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  124. "pattern-path-width": "0",
  125. "pattern-path-color": "black",
  126. "pattern-path-fillOpacity": "1"
  127. },
  128. "style:selected": {
  129. "pane": "selected",
  130. "width": "4",
  131. "color": "#3f3f3f",
  132. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  133. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  134. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  135. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  136. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  137. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  138. "pattern-repeat": "35",
  139. "pattern-polygon": "true",
  140. "pattern-pixelSize": "9",
  141. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  142. "pattern-path-width": "0",
  143. "pattern-path-color": "#3f3f3f",
  144. "pattern-path-fillOpacity": "1"
  145. }
  146. },
  147. "const": {
  148. "icn": {
  149. "color": "#ff0000",
  150. "priority": 0,
  151. "zoom": 6
  152. },
  153. "ncn": {
  154. "color": "#ff00ba",
  155. "priority": 1,
  156. "zoom": 9
  157. },
  158. "rcn": {
  159. "color": "#ba00ff",
  160. "priority": 2,
  161. "zoom": 12
  162. },
  163. "lcn": {
  164. "color": "#0000ff",
  165. "priority": 3,
  166. "zoom": 15
  167. },
  168. "": {
  169. "color": "#007fff",
  170. "priority": 4,
  171. "zoom": 15
  172. }
  173. },
  174. "info": [
  175. "<table>",
  176. "{% for value, data in const %}",
  177. "{% if data.zoom <= map.zoom %}",
  178. " <tr>",
  179. " <td>{{ markerLine({ 'width': 4, color: data.color })|raw }}</td>",
  180. " <td>{% if value %}{{ tagTrans('network', value) }}{% else %}{{ trans('unknown') }}{% endif %}</td>",
  181. " </tr>",
  182. "{% endif %}",
  183. "{% endfor %}",
  184. "</table>"
  185. ]
  186. }