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.

266 lines
12 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. "style:hover": {
  71. "width": 0
  72. },
  73. "style:selected": {
  74. "width": 0
  75. },
  76. "listStopsExclude": "true",
  77. "listRoutesMarkerSign": "{{ const[tags.route].sign|raw }}",
  78. "listRoutesMarkerSymbol": "{{ markerCircle({fillColor:const[tags.route].color})|raw }}",
  79. "listRoutesExclude": "{{ isStopArea }}"
  80. },
  81. "members": true,
  82. "memberFeature": {
  83. "pre": [
  84. "{% set stopName = '' %}",
  85. "{% set isStop = false %}",
  86. "{% set stopCount = 0 %}",
  87. "{% 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 %}",
  88. "{% set isWay = false %}",
  89. "{% set aRoute = null %}",
  90. "{% set refs = [] %}",
  91. "{% set dirForward = false %}",
  92. "{% set dirBackward = false %}",
  93. "{% set hover = false %}",
  94. "{% set selected = false %}",
  95. "{% for master in masters %}",
  96. " {% if master.tags.public_transport == 'stop_area' %}",
  97. " {% set stopName = master.tags.name %}",
  98. " {% else %}",
  99. " {% if master.role|matches('^(|.*stop)$') and isStop %}",
  100. " {% set isStop = true %}",
  101. " {% set stopCount = stopCount + 1 %}",
  102. " {% elseif master.role|matches('^(|forward|backward)$') and type == 'way' %}",
  103. " {% set isWay = true %}",
  104. " {% endif %}",
  105. " {% set aRoute = master %}",
  106. "",
  107. " {% if master.tags.ref %}",
  108. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  109. " {% endif %}",
  110. " {% if master.dir == 'forward' %}{% set dirForward = true %}",
  111. " {% elseif master.dir == 'backward' %}{% set dirBackward = true %}",
  112. " {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
  113. " {% endif %}",
  114. " {% endif %}",
  115. "",
  116. " {% if master.flags.hover %}{% set hover = master.dir|default('both') %}{% endif %}",
  117. " {% if master.flags.selected %}{% set selected = master.dir|default('both') %}{% endif %}",
  118. "{% endfor %}",
  119. "",
  120. "{% set refs = refs|unique|natsort({ insensitive: true }) %}",
  121. "{% set color = const[aRoute.tags.route].color %}"
  122. ],
  123. "title": "{% if isStop %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
  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. "styles": "{% if isStop and stopCount > 0 %}stop{% elseif isWay %}casing,way{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}{% endif %}",
  139. "listStopsMarkerSign": null,
  140. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  141. "listStopsExclude": "{{ not isStop or stopCount == 0 }}",
  142. "listStopsTitle": "{% if tags %}{{ tags.name|default(stopName)|default(trans('unknown')) }}{% else %}<li>{{ trans('loading') }}</li>{% endif %}",
  143. "listStopsDescription": "{{ refs|join(' · ') }}",
  144. "listRoutesExclude": "true",
  145. "markerSymbol": "{% if isStop and stopCount > 0 %}{% if hover or selected %}{{ markerPointer({ })|raw }}{% endif %}{% endif %}",
  146. "markerSign": " ",
  147. "style:stop": {
  148. "color": "{{ color|default('#ff0000') }}",
  149. "width": "4",
  150. "radius": "3",
  151. "zIndex": "1"
  152. },
  153. "style:way": {
  154. "color": "{{ color|default('#ff0000') }}",
  155. "width": "4",
  156. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  157. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  158. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  159. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  160. "opacity": 1,
  161. "text": "{{ refs|join(' · ') }} ",
  162. "textRepeat": "1",
  163. "textOffset": "12",
  164. "textFontWeight": "bold",
  165. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  166. "pattern-pixelSize": "9",
  167. "pattern-repeat": "35",
  168. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  169. "pattern-polygon": "true",
  170. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  171. "pattern-path-width": "0",
  172. "pattern-path-fillOpacity": "1",
  173. "pattern-path-color": "{{ color|default('#ff0000') }}"
  174. },
  175. "style:hover": {
  176. "pane": "hover",
  177. "width": "4",
  178. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  179. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  180. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  181. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  182. "color": "black",
  183. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  184. "pattern-pixelSize": "9",
  185. "pattern-repeat": "35",
  186. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  187. "pattern-polygon": "true",
  188. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  189. "pattern-path-width": "0",
  190. "pattern-path-fillOpacity": "1",
  191. "pattern-path-color": "black"
  192. },
  193. "style:selected": {
  194. "pane": "selected",
  195. "width": "4",
  196. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  197. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  198. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  199. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  200. "color": "#3f3f3f",
  201. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  202. "pattern-pixelSize": "9",
  203. "pattern-repeat": "35",
  204. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  205. "pattern-polygon": "true",
  206. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  207. "pattern-path-width": "0",
  208. "pattern-path-fillOpacity": "1",
  209. "pattern-path-color": "#3f3f3f"
  210. }
  211. },
  212. "info": [
  213. "<table>",
  214. "{% for value, data in const %}",
  215. "{% if data.zoom <= map.zoom %}",
  216. " <tr>",
  217. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  218. " <td>{{ tagTrans('route', value) }}</td>",
  219. " </tr>",
  220. "{% endif %}",
  221. "{% endfor %}",
  222. "</table>"
  223. ],
  224. "const": {
  225. "train": {
  226. "sign": "<img src='maki:rail?fill=#ffffff'>",
  227. "zoom": 12,
  228. "color": "#00007f"
  229. },
  230. "subway": {
  231. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  232. "zoom": 12,
  233. "color": "#0000ff"
  234. },
  235. "monorail": {
  236. "sign": "<span style='color: #ffffff'>M</span>",
  237. "zoom": 12,
  238. "color": "#006f8f"
  239. },
  240. "tram": {
  241. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  242. "zoom": 12,
  243. "color": "#7f007f"
  244. },
  245. "bus": {
  246. "sign": "<img src='maki:bus?fill=#ffffff'>",
  247. "zoom": 12,
  248. "color": "#af0000"
  249. },
  250. "trolleybus": {
  251. "sign": "<img src='maki:bus?fill=#ffffff'>",
  252. "zoom": 12,
  253. "color": "#af3f00"
  254. },
  255. "aerialway": {
  256. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  257. "zoom": 12,
  258. "color": "#00aaaa"
  259. },
  260. "ferry": {
  261. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  262. "zoom": 12,
  263. "color": "#007fff"
  264. }
  265. }
  266. }