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.

235 lines
11 KiB

6 years ago
6 years ago
6 years ago
6 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. "{% set dirForward = false %}",
  86. "{% set dirBackward = false %}",
  87. "{% set hover = false %}",
  88. "{% set selected = false %}",
  89. "{% for master in masters %}",
  90. " {% if master.tags.public_transport == 'stop_area' %}",
  91. " {% set stopName = master.tags.name %}",
  92. " {% else %}",
  93. " {% if master.role|matches('^(|.*stop)$') and isStop %}",
  94. " {% set isStop = true %}",
  95. " {% set stopCount = stopCount + 1 %}",
  96. " {% elseif master.role|matches('^(|forward|backward)$') and type == 'way' %}",
  97. " {% set isWay = true %}",
  98. " {% endif %}",
  99. " {% set aRoute = master %}",
  100. "",
  101. " {% if master.tags.ref %}",
  102. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  103. " {% endif %}",
  104. " {% if master.dir == 'forward' %}{% set dirForward = true %}",
  105. " {% elseif master.dir == 'backward' %}{% set dirBackward = true %}",
  106. " {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
  107. " {% endif %}",
  108. " {% endif %}",
  109. "",
  110. " {% if master.flags.hover %}{% set hover = master.dir|default('both') %}{% endif %}",
  111. " {% if master.flags.selected %}{% set selected = master.dir|default('both') %}{% endif %}",
  112. "{% endfor %}",
  113. "",
  114. "{% set refs = refs|unique|natsort({ insensitive: true }) %}",
  115. "{% set color = const[aRoute.tags.route].color %}"
  116. ],
  117. "title": "{% if isStop %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
  118. "body": [
  119. "<h4>Routes</h4>",
  120. "<ul class='overpass-layer-list'>",
  121. "{% for master in masters %}",
  122. " {% if master.tags.public_transport != 'stop_area' %}",
  123. " <li data-object=\"{{ master.id }}\">",
  124. " <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>",
  125. " <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>",
  126. " <span class='description'>{{ tagTrans('route', master.tags.route) }}{{ master.dir }}</span>",
  127. " </li>",
  128. " {% endif %}",
  129. "{% endfor %}",
  130. "</ul>"
  131. ],
  132. "styles": "{% if isStop and stopCount > 0 %}{% elseif isWay %}way{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}{% endif %}",
  133. "listStopsMarkerSign": null,
  134. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  135. "listStopsExclude": "{{ not isStop or stopCount == 0 }}",
  136. "listStopsTitle": "{% if tags %}{{ tags.name|default(stopName)|default(trans('unknown')) }}{% else %}<li>{{ trans('loading') }}</li>{% endif %}",
  137. "listStopsDescription": "{{ refs|join(' · ') }}",
  138. "listRoutesExclude": "true",
  139. "markerSymbol": "{% if isStop and stopCount > 0 %}{% if hover or selected %}{{ markerCircle({ width: 0, fill: true, fillColor: hover ? '#000000' : '#3f3f3f', fillOpacity: '1', radius: 7 })|raw }}{% else %}{{ markerCircle({ width: 0, fill: true, fillColor: color, fillOpacity: '1', radius: 5 })|raw }}{% endif %}{% endif %}",
  140. "style:way": {
  141. "width": "3",
  142. "opacity": "{% if (dirForward and dirBackward) or (not dirForward and not dirBackward) %}1{% else %}0{% endif %}",
  143. "color": "{{ color|default('#ff0000') }}",
  144. "text": "{{ refs|join(' · ') }} ",
  145. "textRepeat": "1",
  146. "textOffset": "12",
  147. "textFontWeight": "bold",
  148. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  149. "pattern-pixelSize": "4",
  150. "pattern-repeat": "7",
  151. "pattern-polygon": "",
  152. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  153. "pattern-path-weight": "2",
  154. "pattern-path-color": "{{ color|default('#ff0000') }}"
  155. },
  156. "style:hover": {
  157. "pane": "hover",
  158. "width": "{% if hover == 'forward' or hover == 'backward' %}0{% else %}4{% endif %}",
  159. "color": "black",
  160. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  161. "pattern-pixelSize": "4",
  162. "pattern-repeat": "7",
  163. "pattern-polygon": "",
  164. "pattern-path-weight": "2",
  165. "pattern-path-color": "black",
  166. "pattern-path-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}"
  167. },
  168. "style:selected": {
  169. "pane": "selected",
  170. "width": "{% if selected == 'forward' or selected == 'backward' %}0{% else %}3{% endif %}",
  171. "color": "#3f3f3f",
  172. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  173. "pattern-pixelSize": "4",
  174. "pattern-repeat": "7",
  175. "pattern-polygon": "",
  176. "pattern-path-weight": "2",
  177. "pattern-path-color": "#3f3f3f",
  178. "pattern-path-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}"
  179. }
  180. },
  181. "info": [
  182. "<table>",
  183. "{% for value, data in const %}",
  184. "{% if data.zoom <= map.zoom %}",
  185. " <tr>",
  186. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  187. " <td>{{ tagTrans('route', value) }}</td>",
  188. " </tr>",
  189. "{% endif %}",
  190. "{% endfor %}",
  191. "</table>"
  192. ],
  193. "const": {
  194. "train": {
  195. "sign": "<img src='maki:rail?fill=#ffffff'>",
  196. "zoom": 12,
  197. "color": "#00007f"
  198. },
  199. "subway": {
  200. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  201. "zoom": 12,
  202. "color": "#0000ff"
  203. },
  204. "monorail": {
  205. "sign": "<span style='color: #ffffff'>M</span>",
  206. "zoom": 12,
  207. "color": "#006f8f"
  208. },
  209. "tram": {
  210. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  211. "zoom": 12,
  212. "color": "#7f007f"
  213. },
  214. "bus": {
  215. "sign": "<img src='maki:bus?fill=#ffffff'>",
  216. "zoom": 12,
  217. "color": "#af0000"
  218. },
  219. "trolleybus": {
  220. "sign": "<img src='maki:bus?fill=#ffffff'>",
  221. "zoom": 12,
  222. "color": "#af3f00"
  223. },
  224. "aerialway": {
  225. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  226. "zoom": 12,
  227. "color": "#00aaaa"
  228. },
  229. "ferry": {
  230. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  231. "zoom": 12,
  232. "color": "#007fff"
  233. }
  234. }
  235. }