Main categories of OpenStreetBrowser with public transport zoom level
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.

192 lines
8.4 KiB

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