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.

267 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. "fr": "Carte des transports publics",
  7. "hu": "Tömegközlekedési térkép",
  8. "pt-br": "Mapa de transporte público"
  9. },
  10. "query": {
  11. "12": "relation[type=route][route~\"^(subway|monorail|ferry|train)$\"];",
  12. "14": [
  13. "(",
  14. "relation[type=route][route~\"^(subway|monorail|aerialway|bus|trolleybus|ferry|train|tram)$\"];",
  15. "relation[type=public_transport][public_transport=stop_area];",
  16. ")"
  17. ]
  18. },
  19. "lists": {
  20. "stops": {
  21. "prefix": "listStops",
  22. "name": {
  23. "ast": "Paraes y estaciones",
  24. "cs": "Zastávky & Stanice",
  25. "de": "Haltestellen",
  26. "el": "Στάσεις & Σταθμοί",
  27. "en": "Stops & Stations",
  28. "es": "Paradas y estaciones",
  29. "fr": "Arrêts/Stops, Stations",
  30. "hu": "Megállók és állomások",
  31. "it": "Stazioni e fermate",
  32. "ja": "停留所と駅",
  33. "nl": "Haltes en Stations",
  34. "pl": "Przystanki i Stacje",
  35. "pt-br": "Paradas e estações",
  36. "ru": "Остановки и станции",
  37. "uk": "Зупинки та станції"
  38. }
  39. },
  40. "routes": {
  41. "prefix": "listRoutes",
  42. "name": {
  43. "de": "Routen",
  44. "en": "Routes",
  45. "fr": "Lignes",
  46. "hu": "Útvonalak",
  47. "pt": "Rotas",
  48. "pt-br": "Rotas"
  49. }
  50. }
  51. },
  52. "feature": {
  53. "pre": "{% set isStopArea = tags.public_transport == 'stop_area' %}",
  54. "title": [
  55. "{% if tags.ref %}{{ tags.ref }} - {% endif %}",
  56. "",
  57. "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}"
  58. ],
  59. "description": "{{ tagTrans('route', tags.route) }}",
  60. "body": [
  61. "<h4>Stops</h4><ul>",
  62. "{% for member in members %}",
  63. "{% 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' %}",
  64. "<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>",
  65. "{% endif %}",
  66. "{% endfor %}",
  67. "</ul>"
  68. ],
  69. "markerSymbol": "",
  70. "styles": "",
  71. "style:hover": {
  72. "width": "0"
  73. },
  74. "style:selected": {
  75. "width": "0"
  76. },
  77. "listStopsExclude": "true",
  78. "listRoutesMarkerSign": "{{ const[tags.route].sign|raw }}",
  79. "listRoutesMarkerSymbol": "{{ markerCircle({fillColor:const[tags.route].color})|raw }}",
  80. "listRoutesExclude": "{{ isStopArea }}"
  81. },
  82. "members": true,
  83. "memberFeature": {
  84. "pre": [
  85. "{% set stopName = '' %}",
  86. "{% set isStop = false %}",
  87. "{% set stopCount = 0 %}",
  88. "{% 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 %}",
  89. "{% set isWay = false %}",
  90. "{% set aRoute = null %}",
  91. "{% set refs = [] %}",
  92. "{% set dirForward = false %}",
  93. "{% set dirBackward = false %}",
  94. "{% set hover = false %}",
  95. "{% set selected = false %}",
  96. "{% for master in masters %}",
  97. " {% if master.tags.public_transport == 'stop_area' %}",
  98. " {% set stopName = master.tags.name %}",
  99. " {% else %}",
  100. " {% if master.role|matches('^(|.*stop)$') and isStop %}",
  101. " {% set isStop = true %}",
  102. " {% set stopCount = stopCount + 1 %}",
  103. " {% elseif master.role|matches('^(|forward|backward)$') and type == 'way' %}",
  104. " {% set isWay = true %}",
  105. " {% endif %}",
  106. " {% set aRoute = master %}",
  107. "",
  108. " {% if master.tags.ref %}",
  109. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  110. " {% endif %}",
  111. " {% if master.dir == 'forward' %}{% set dirForward = true %}",
  112. " {% elseif master.dir == 'backward' %}{% set dirBackward = true %}",
  113. " {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
  114. " {% endif %}",
  115. " {% endif %}",
  116. "",
  117. " {% if master.flags.hover %}{% set hover = master.dir|default('both') %}{% endif %}",
  118. " {% if master.flags.selected %}{% set selected = master.dir|default('both') %}{% endif %}",
  119. "{% endfor %}",
  120. "",
  121. "{% set refs = refs|unique|natsort({ insensitive: true }) %}",
  122. "{% set color = const[aRoute.tags.route].color %}"
  123. ],
  124. "title": "{% if isStop %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
  125. "body": [
  126. "<h4>Routes</h4>",
  127. "<ul class='overpass-layer-list'>",
  128. "{% for master in masters %}",
  129. " {% if master.tags.public_transport != 'stop_area' %}",
  130. " <li data-object=\"{{ master.id }}\">",
  131. " <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>",
  132. " <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>",
  133. " <span class='description'>{{ tagTrans('route', master.tags.route) }}</span>",
  134. " </li>",
  135. " {% endif %}",
  136. "{% endfor %}",
  137. "</ul>"
  138. ],
  139. "markerSign": " ",
  140. "markerSymbol": "{% if isStop and stopCount > 0 %}{% if hover or selected %}{{ markerPointer({ })|raw }}{% endif %}{% endif %}",
  141. "styles": "{% if isStop and stopCount > 0 %}stop{% elseif isWay %}casing,way{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}{% endif %}",
  142. "style:hover": {
  143. "pane": "hover",
  144. "width": "4",
  145. "color": "black",
  146. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  147. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  148. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  149. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  150. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  151. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  152. "pattern-repeat": "35",
  153. "pattern-polygon": "true",
  154. "pattern-pixelSize": "9",
  155. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  156. "pattern-path-width": "0",
  157. "pattern-path-color": "black",
  158. "pattern-path-fillOpacity": "1"
  159. },
  160. "style:selected": {
  161. "pane": "selected",
  162. "width": "4",
  163. "color": "#3f3f3f",
  164. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  165. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  166. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  167. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  168. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  169. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  170. "pattern-repeat": "35",
  171. "pattern-polygon": "true",
  172. "pattern-pixelSize": "9",
  173. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  174. "pattern-path-width": "0",
  175. "pattern-path-color": "#3f3f3f",
  176. "pattern-path-fillOpacity": "1"
  177. },
  178. "listStopsMarkerSign": null,
  179. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  180. "listStopsExclude": "{{ not isStop or stopCount == 0 }}",
  181. "listStopsTitle": "{% if tags %}{{ tags.name|default(stopName)|default(trans('unknown')) }}{% else %}<li>{{ trans('loading') }}</li>{% endif %}",
  182. "listStopsDescription": "{{ refs|join(' · ') }}",
  183. "listRoutesExclude": "true",
  184. "style:stop": {
  185. "width": "4",
  186. "color": "{{ color|default('#ff0000') }}",
  187. "radius": "3",
  188. "zIndex": "1"
  189. },
  190. "style:way": {
  191. "width": "4",
  192. "color": "{{ color|default('#ff0000') }}",
  193. "opacity": "1",
  194. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  195. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  196. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  197. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  198. "text": "{{ refs|join(' · ') }} ",
  199. "textRepeat": "1",
  200. "textOffset": "12",
  201. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  202. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  203. "pattern-repeat": "35",
  204. "pattern-polygon": "true",
  205. "pattern-pixelSize": "9",
  206. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  207. "pattern-path-width": "0",
  208. "pattern-path-color": "{{ color|default('#ff0000') }}",
  209. "pattern-path-fillOpacity": "1",
  210. "textFontWeight": "bold"
  211. }
  212. },
  213. "info": [
  214. "<table>",
  215. "{% for value, data in const %}",
  216. "{% if data.zoom <= map.zoom %}",
  217. " <tr>",
  218. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  219. " <td>{{ tagTrans('route', value) }}</td>",
  220. " </tr>",
  221. "{% endif %}",
  222. "{% endfor %}",
  223. "</table>"
  224. ],
  225. "const": {
  226. "train": {
  227. "sign": "<img src='maki:rail?fill=#ffffff'>",
  228. "zoom": 12,
  229. "color": "#00007f"
  230. },
  231. "subway": {
  232. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  233. "zoom": 12,
  234. "color": "#0000ff"
  235. },
  236. "monorail": {
  237. "sign": "<span style='color: #ffffff'>M</span>",
  238. "zoom": 12,
  239. "color": "#006f8f"
  240. },
  241. "tram": {
  242. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  243. "zoom": 12,
  244. "color": "#7f007f"
  245. },
  246. "bus": {
  247. "sign": "<img src='maki:bus?fill=#ffffff'>",
  248. "zoom": 12,
  249. "color": "#af0000"
  250. },
  251. "trolleybus": {
  252. "sign": "<img src='maki:bus?fill=#ffffff'>",
  253. "zoom": 12,
  254. "color": "#af3f00"
  255. },
  256. "aerialway": {
  257. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  258. "zoom": 12,
  259. "color": "#00aaaa"
  260. },
  261. "ferry": {
  262. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  263. "zoom": 12,
  264. "color": "#007fff"
  265. }
  266. }
  267. }