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.

178 lines
7.9 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 _p = const[master.tags.network].priority|default(4) %}",
  50. " {% if _p < priority %}",
  51. " {% set priority = _p %}",
  52. " {% set network = master.tags.network %}",
  53. " {% endif %}",
  54. " {% if master.tags.ref %}",
  55. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  56. " {% endif %}",
  57. " {% if master.role == 'forward' %}{% set dirForward = true %}",
  58. " {% elseif master.role == 'backward' %}{% set dirBackward = true %}",
  59. " {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
  60. " {% endif %}",
  61. " {% if master.flags.hover %}{% set hover = master.role|default('both') %}{% endif %}",
  62. " {% if master.flags.selected %}{% set selected = master.role|default('both') %}{% endif %}",
  63. "{% endfor %}"
  64. ],
  65. "title": "",
  66. "body": [
  67. "<h4>Routes</h4>",
  68. "<ul class='overpass-layer-list'>",
  69. "{% for master in masters %}",
  70. " <li data-object=\"{{ master.id }}\">",
  71. " <span class='markerParent'><div class='marker'>{{ markerLine({ width: 4, color: const[master.tags.network].color|default(const[''].color) })|raw }}</div></span>",
  72. " <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>",
  73. " <span class='description'>{{ tagTrans('network', master.tags.network) }}</span>",
  74. " </li>",
  75. "{% endfor %}",
  76. "</ul>"
  77. ],
  78. "listExclude": "1",
  79. "styles": "default{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}",
  80. "style": {
  81. "width": "4",
  82. "color": "{{ const[network].color }}",
  83. "opacity": "1",
  84. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  85. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  86. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  87. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  88. "text": "{{ refs|join(' · ') }} ",
  89. "textRepeat": "1",
  90. "textOffset": "12",
  91. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  92. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  93. "pattern-repeat": "35",
  94. "pattern-polygon": "true",
  95. "pattern-pixelSize": "9",
  96. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  97. "pattern-path-width": "0",
  98. "pattern-path-color": "{{ const[network].color }}",
  99. "pattern-path-fillOpacity": "1",
  100. "textFontWeight": "bold"
  101. },
  102. "style:hover": {
  103. "pane": "hover",
  104. "width": "4",
  105. "color": "black",
  106. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  107. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  108. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  109. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  110. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  111. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  112. "pattern-repeat": "35",
  113. "pattern-polygon": "true",
  114. "pattern-pixelSize": "9",
  115. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  116. "pattern-path-width": "0",
  117. "pattern-path-color": "black",
  118. "pattern-path-fillOpacity": "1"
  119. },
  120. "style:selected": {
  121. "pane": "selected",
  122. "width": "4",
  123. "color": "#3f3f3f",
  124. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  125. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  126. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  127. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  128. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  129. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  130. "pattern-repeat": "35",
  131. "pattern-polygon": "true",
  132. "pattern-pixelSize": "9",
  133. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  134. "pattern-path-width": "0",
  135. "pattern-path-color": "#3f3f3f",
  136. "pattern-path-fillOpacity": "1"
  137. }
  138. },
  139. "const": {
  140. "icn": {
  141. "color": "#ff0000",
  142. "priority": 0,
  143. "zoom": 6
  144. },
  145. "ncn": {
  146. "color": "#ff00ba",
  147. "priority": 1,
  148. "zoom": 9
  149. },
  150. "rcn": {
  151. "color": "#ba00ff",
  152. "priority": 2,
  153. "zoom": 12
  154. },
  155. "lcn": {
  156. "color": "#0000ff",
  157. "priority": 3,
  158. "zoom": 15
  159. },
  160. "": {
  161. "color": "#007fff",
  162. "priority": 4,
  163. "zoom": 15
  164. }
  165. },
  166. "info": [
  167. "<table>",
  168. "{% for value, data in const %}",
  169. "{% if data.zoom <= map.zoom %}",
  170. " <tr>",
  171. " <td>{{ markerLine({ 'width': 4, color: data.color })|raw }}</td>",
  172. " <td>{% if value %}{{ tagTrans('network', value) }}{% else %}{{ trans('unknown') }}{% endif %}</td>",
  173. " </tr>",
  174. "{% endif %}",
  175. "{% endfor %}",
  176. "</table>"
  177. ]
  178. }