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.

190 lines
8.4 KiB

3 years ago
  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 }}\"><a>",
  79. " <div class='marker'>",
  80. " <div class='symbol'>{{ markerLine({ width: 4, color: const[masterNetwork].color|default(const[''].color) })|raw }}</div>",
  81. " </div>",
  82. " <div class='content'>",
  83. " <div class='description'>{{ tagTrans('network', masterNetwork) }}</div>",
  84. " <div 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 %}</div>",
  85. " </div>",
  86. " </a></li>",
  87. "{% endfor %}",
  88. "</ul>"
  89. ],
  90. "listExclude": "1",
  91. "styles": "default{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}",
  92. "style": {
  93. "width": "4",
  94. "color": "{{ const[network].color }}",
  95. "opacity": "1",
  96. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  97. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  98. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  99. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  100. "text": "{{ refs|join(' · ') }} ",
  101. "textRepeat": "1",
  102. "textOffset": "12",
  103. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  104. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  105. "pattern-repeat": "35",
  106. "pattern-polygon": "true",
  107. "pattern-pixelSize": "9",
  108. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  109. "pattern-path-width": "0",
  110. "pattern-path-color": "{{ const[network].color }}",
  111. "pattern-path-fillOpacity": "1",
  112. "textFontWeight": "bold"
  113. },
  114. "style:hover": {
  115. "pane": "hover",
  116. "width": "4",
  117. "color": "black",
  118. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  119. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  120. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  121. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  122. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  123. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  124. "pattern-repeat": "35",
  125. "pattern-polygon": "true",
  126. "pattern-pixelSize": "9",
  127. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  128. "pattern-path-width": "0",
  129. "pattern-path-color": "black",
  130. "pattern-path-fillOpacity": "1"
  131. },
  132. "style:selected": {
  133. "pane": "selected",
  134. "width": "4",
  135. "color": "#3f3f3f",
  136. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  137. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  138. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  139. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  140. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  141. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  142. "pattern-repeat": "35",
  143. "pattern-polygon": "true",
  144. "pattern-pixelSize": "9",
  145. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  146. "pattern-path-width": "0",
  147. "pattern-path-color": "#3f3f3f",
  148. "pattern-path-fillOpacity": "1"
  149. }
  150. },
  151. "const": {
  152. "icn": {
  153. "color": "#ff0000",
  154. "priority": 0,
  155. "zoom": 6
  156. },
  157. "ncn": {
  158. "color": "#ff00ba",
  159. "priority": 1,
  160. "zoom": 9
  161. },
  162. "rcn": {
  163. "color": "#ba00ff",
  164. "priority": 2,
  165. "zoom": 12
  166. },
  167. "lcn": {
  168. "color": "#0000ff",
  169. "priority": 3,
  170. "zoom": 15
  171. },
  172. "": {
  173. "color": "#007fff",
  174. "priority": 4,
  175. "zoom": 15
  176. }
  177. },
  178. "info": [
  179. "<table>",
  180. "{% for value, data in const %}",
  181. "{% if data.zoom <= map.zoom %}",
  182. " <tr>",
  183. " <td>{{ markerLine({ 'width': 4, color: data.color })|raw }}</td>",
  184. " <td>{% if value %}{{ tagTrans('network', value) }}{% else %}{{ trans('unknown') }}{% endif %}</td>",
  185. " </tr>",
  186. "{% endif %}",
  187. "{% endfor %}",
  188. "</table>"
  189. ]
  190. }