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.

195 lines
7.6 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Public transport map",
  5. "de": "ÖV Karte"
  6. },
  7. "query": {
  8. "12": "relation[type=route][route~\"^(subway|monorail|ferry|train)$\"];",
  9. "14": [
  10. "(",
  11. "relation[type=route][route~\"^(subway|monorail|aerialway|bus|trolleybus|ferry|train|tram)$\"];",
  12. "relation[type=public_transport][public_transport=stop_area];",
  13. ")"
  14. ]
  15. },
  16. "members": true,
  17. "lists": {
  18. "stops": {
  19. "prefix": "listStops",
  20. "name": {
  21. "ast": "Paraes y estaciones",
  22. "cs": "Zastávky & Stanice",
  23. "de": "Haltestellen",
  24. "el": "Στάσεις & Σταθμοί",
  25. "en": "Stops & Stations",
  26. "es": "Paradas y estaciones",
  27. "fr": "Arrêts/Stops, Stations",
  28. "hu": "Megállók és állomások",
  29. "it": "Stazioni e fermate",
  30. "ja": "停留所と駅",
  31. "nl": "Haltes en Stations",
  32. "pl": "Przystanki i Stacje",
  33. "pt-br": "Paradas e Estações",
  34. "ru": "Остановки и станции",
  35. "uk": "Зупинки та станції"
  36. }
  37. },
  38. "routes": {
  39. "prefix": "listRoutes",
  40. "name": {
  41. "de": "Routen",
  42. "en": "Routes",
  43. "fr": "Lignes",
  44. "pt": "Rotas",
  45. "pt-br": "Rotas"
  46. }
  47. }
  48. },
  49. "feature": {
  50. "pre": "{% set isStopArea = tags.public_transport == 'stop_area' %}",
  51. "listRoutesExclude": "{{ isStopArea }}",
  52. "styles": "",
  53. "title": [
  54. "{% if tags.ref %}{{ tags.ref }} - {% endif %}",
  55. "",
  56. "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}"
  57. ],
  58. "description": "{{ tagTrans('route', tags.route) }}",
  59. "body": [
  60. "<h4>Stops</h4><ul>",
  61. "{% for member in members %}",
  62. "{% if member.tags.highway == 'bus_stop' or member.tags.amenity == 'bus_station' or member.tags.amenity == 'ferry_terminal' or member.tags.railway == 'tram_stop' or member.tags.railway == 'halt' or member.tags.railway == 'station' or member.tags.aerialway == 'station' or member.tags.public_transport == 'stop_position' or member.role|slice(-4) == 'stop' %}",
  63. "<li data-object='{{ member.id }}' data-sublayer='member'><b>{{ member.tags.name|default(member.id) }}</li>",
  64. "{% endif %}",
  65. "{% endfor %}",
  66. "</ul>"
  67. ],
  68. "listStopsExclude": "true",
  69. "listRoutesMarkerSign": "{{ const[tags.route].sign|raw }}",
  70. "markerSymbol": null,
  71. "listRoutesMarkerSymbol": "{{ markerCircle({fillColor:const[tags.route].color})|raw }}"
  72. },
  73. "memberFeature": {
  74. "pre": [
  75. "{% set stopName = '' %}",
  76. "{% set isStop = false %}",
  77. "{% if tags.highway == 'bus_stop' or tags.amenity == 'bus_station' or tags.amenity == 'ferry_terminal' or tags.railway == 'tram_stop' or tags.railway == 'halt' or tags.railway == 'station' or tags.aerialway == 'station' or tags.public_transport == 'stop_position' %}{% set isStop = true %}{% endif %}",
  78. "{% set isWay = false %}",
  79. "{% set aRoute = null %}",
  80. "{% set refs = [] %}",
  81. "{% for master in masters %}",
  82. " {% if master.tags.public_transport == 'stop_area' %}",
  83. " {% set stopName = master.tags.name %}",
  84. " {% else %}",
  85. " {% if master.role|matches('^(|.*stop)$') and isStop %}",
  86. " {% set isStop = true %}",
  87. " {% elseif master.role|matches('^(|forward|backward)$') and type == 'way' %}",
  88. " {% set isWay = true %}",
  89. " {% endif %}",
  90. " {% set aRoute = master %}",
  91. "",
  92. " {% if master.tags.ref %}",
  93. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  94. " {% endif %}",
  95. " {% endif %}",
  96. "{% endfor %}",
  97. "",
  98. "{% set refs = refs|unique|natsort({ insensitive: true }) %}",
  99. "{% set color = const[aRoute.tags.route].color %}"
  100. ],
  101. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  102. "listStopsMarkerSign": "",
  103. "styles": "{% if isStop %}stop{% elseif isWay %}way{% else %}{% endif %}",
  104. "style:way": {
  105. "color": [
  106. "{{ color|default('#ff0000') }}"
  107. ],
  108. "width": "3",
  109. "text": "{{ refs|join(' ') }} ",
  110. "textRepeat": "1",
  111. "textOffset": "12",
  112. "textFontWeight": "bold"
  113. },
  114. "style:stop": {
  115. "color": [
  116. "{{ color|default('#ff0000') }}"
  117. ],
  118. "width": "5",
  119. "radius": 3
  120. },
  121. "title": "{% if isStop %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
  122. "listStopsTitle": "{{ tags.name|default(stopName)|default(id) }}",
  123. "listStopsDescription": "{{ refs|join(' ') }}",
  124. "body": [
  125. "<h4>Routes</h4>",
  126. "<ul class='overpass-layer-list'>",
  127. "{% for master in masters %}",
  128. " {% if master.tags.public_transport != 'stop_area' %}",
  129. " <li data-object=\"{{ master.id }}\">",
  130. " <span class='markerParent'><div class='marker'>{{ markerCircle({fillColor:const[master.tags.route].color})|raw }}</div><div class='icon'>{{ const[master.tags.route].sign|raw }}</div></span>",
  131. " <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>",
  132. " <span class='description'>{{ tagTrans('route', master.tags.route) }}</span>",
  133. " </li>",
  134. " {% endif %}",
  135. "{% endfor %}",
  136. "</ul>"
  137. ],
  138. "listRoutesExclude": "true",
  139. "listStopsExclude": "{{ not isStop }}"
  140. },
  141. "info": [
  142. "<table>",
  143. "{% for value, data in const %}",
  144. "{% if data.zoom <= map.zoom %}",
  145. " <tr>",
  146. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  147. " <td>{{ tagTrans('route', value) }}</td>",
  148. " </tr>",
  149. "{% endif %}",
  150. "{% endfor %}",
  151. "</table>"
  152. ],
  153. "const": {
  154. "train": {
  155. "sign": "<img src='maki:rail?fill=#ffffff'>",
  156. "zoom": 12,
  157. "color": "#00007f"
  158. },
  159. "subway": {
  160. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  161. "zoom": 12,
  162. "color": "#0000ff"
  163. },
  164. "monorail": {
  165. "sign": "<span style='color: #ffffff'>M</span>",
  166. "zoom": 12,
  167. "color": "#006f8f"
  168. },
  169. "tram": {
  170. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  171. "zoom": 12,
  172. "color": "#7f007f"
  173. },
  174. "bus": {
  175. "sign": "<img src='maki:bus?fill=#ffffff'>",
  176. "zoom": 12,
  177. "color": "#af0000"
  178. },
  179. "trolleybus": {
  180. "sign": "<img src='maki:bus?fill=#ffffff'>",
  181. "zoom": 12,
  182. "color": "#af3f00"
  183. },
  184. "aerialway": {
  185. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  186. "zoom": 12,
  187. "color": "#00aaaa"
  188. },
  189. "ferry": {
  190. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  191. "zoom": 12,
  192. "color": "#007fff"
  193. }
  194. }
  195. }