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.

192 lines
8.2 KiB

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