Main categories of OpenStreetBrowser
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.

295 lines
14 KiB

7 years ago
7 years ago
7 years ago
7 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 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')) }}"
  58. ],
  59. "description": "{{ tagTrans('route', tags.route) }}",
  60. "body": [
  61. "<h4>{{ repoTrans('category:pt:stops') }}</h4><ul class='fa-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(0, 4) == 'stop' %}",
  64. "<li data-object='{{ member.id }}' data-sublayer='member'><i class='fa-li {% if member.role == 'stop_entry_only' %}fas fa-sign-in-alt{% elseif member.role == 'stop_exit_only' %}fas fa-sign-out-alt{% else %}fas fa-minus{% endif %}'></i><b>{% if member.tags %}{{ member.tags.name|default(trans('unknown')) }}{% else %}<i>{{ trans('loading') }}</i>{% endif %}</b></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>{{ repoTrans('category:pt: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. " <a href='#pt/{{ master.id }}'>",
  132. " <div class='marker'><div class='symbol'>{{ markerCircle({fillColor:const[master.tags.route].color})|raw }}</div><div class='sign'>{{ const[master.tags.route].sign|raw }}</div></div>",
  133. " <div class='content'>",
  134. " <div class='description'>{{ tagTrans('route', master.tags.route) }}</div>",
  135. " <div 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 %}</div>",
  136. " </div>",
  137. " </a>",
  138. " </li>",
  139. " {% endif %}",
  140. "{% endfor %}",
  141. "</ul>"
  142. ],
  143. "markerSign": " ",
  144. "markerSymbol": "{% if isStop and stopCount > 0 %}{% if hover or selected %}{{ markerPointer({ })|raw }}{% endif %}{% endif %}",
  145. "styles": "{% if isStop and stopCount > 0 %}stop{% elseif isWay %}casing,way{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}{% endif %}",
  146. "style:hover": {
  147. "pane": "hover",
  148. "width": "4",
  149. "color": "black",
  150. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  151. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  152. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  153. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  154. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  155. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  156. "pattern-repeat": "35",
  157. "pattern-polygon": "true",
  158. "pattern-pixelSize": "9",
  159. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  160. "pattern-path-width": "0",
  161. "pattern-path-color": "black",
  162. "pattern-path-fillOpacity": "1"
  163. },
  164. "style:selected": {
  165. "pane": "selected",
  166. "width": "4",
  167. "color": "#3f3f3f",
  168. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  169. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  170. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  171. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  172. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  173. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  174. "pattern-repeat": "35",
  175. "pattern-polygon": "true",
  176. "pattern-pixelSize": "9",
  177. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  178. "pattern-path-width": "0",
  179. "pattern-path-color": "#3f3f3f",
  180. "pattern-path-fillOpacity": "1"
  181. },
  182. "listStopsMarkerSign": null,
  183. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  184. "listStopsExclude": "{{ not isStop or stopCount == 0 }}",
  185. "listStopsTitle": [
  186. "{% if tags %}{{ tags.name|default(stopName)|default(trans('unknown')) }}{% else %}<li>{{ trans('loading') }}</li>{% endif %}<br/>",
  187. "<i>{{ refs|join(' · ') }}</i>"
  188. ],
  189. "description": [
  190. "{% set stopTypes = [] %}",
  191. "{% if tags.railway in ['tram_stop'] %}{% set stopTypes = stopTypes|merge([ tagTrans('railway', tags.railway) ]) %}{% endif %}",
  192. "{% if tags.highway in ['bus_stop'] %}{% set stopTypes = stopTypes|merge([ tagTrans('highway', tags.highway) ]) %}{% endif %}",
  193. "{% if stopTypes|length %}{{ enumerate(stopTypes) }}{% elseif isStop %}{{ tagTrans('public_transport', 'stop_position') }}{% else %}{{ keyTrans('route') }}{% endif %}"
  194. ],
  195. "listRoutesExclude": "true",
  196. "style:stop": {
  197. "width": "4",
  198. "color": "{{ color|default('#ff0000') }}",
  199. "radius": "3",
  200. "zIndex": "1"
  201. },
  202. "style:way": {
  203. "width": "4",
  204. "color": "{{ color|default('#ff0000') }}",
  205. "opacity": "1",
  206. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  207. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  208. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  209. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  210. "text1": "{{ refs|join(' · ') }} ",
  211. "textRepeat": "1",
  212. "textOffset": "12",
  213. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  214. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  215. "pattern-repeat": "35",
  216. "pattern-polygon": "true",
  217. "pattern-pixelSize": "9",
  218. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  219. "pattern-path-width": "0",
  220. "pattern-path-color": "{{ color|default('#ff0000') }}",
  221. "pattern-path-fillOpacity": "1",
  222. "textFontWeight": "bold"
  223. }
  224. },
  225. "info": [
  226. "<table>",
  227. "{% for value, data in const %}",
  228. "{% if data.zoom <= map.zoom %}",
  229. " <tr>",
  230. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  231. " <td>{{ tagTrans('route', value) }}</td>",
  232. " </tr>",
  233. "{% endif %}",
  234. "{% endfor %}",
  235. "</table>"
  236. ],
  237. "const": {
  238. "train": {
  239. "sign": "<img data-src='maki:rail?fill=#ffffff'>",
  240. "zoom": 12,
  241. "color": "#00007f"
  242. },
  243. "subway": {
  244. "sign": "<img data-src='maki:rail-metro?fill=#ffffff'>",
  245. "zoom": 12,
  246. "color": "#0000ff"
  247. },
  248. "monorail": {
  249. "sign": "<span style='color: #ffffff'>M</span>",
  250. "zoom": 12,
  251. "color": "#006f8f"
  252. },
  253. "tram": {
  254. "sign": "<img data-src='maki:rail-light?fill=#ffffff'>",
  255. "zoom": 12,
  256. "color": "#7f007f"
  257. },
  258. "bus": {
  259. "sign": "<img data-src='maki:bus?fill=#ffffff'>",
  260. "zoom": 12,
  261. "color": "#af0000"
  262. },
  263. "trolleybus": {
  264. "sign": "<img data-src='maki:bus?fill=#ffffff'>",
  265. "zoom": 12,
  266. "color": "#af3f00"
  267. },
  268. "aerialway": {
  269. "sign": "<img data-src='maki:aerialway?fill=#ffffff'>",
  270. "zoom": 12,
  271. "color": "#00aaaa"
  272. },
  273. "ferry": {
  274. "sign": "<img data-src='maki:ferry?fill=#ffffff'>",
  275. "zoom": 12,
  276. "color": "#007fff"
  277. }
  278. },
  279. "filter": {
  280. "route": {
  281. "type": "select",
  282. "show_default": "true",
  283. "valueName": "{{ tagTrans('route', value) }}",
  284. "values": [
  285. "aerialway",
  286. "bus",
  287. "ferry",
  288. "subway",
  289. "train",
  290. "tram",
  291. "trolleybus"
  292. ]
  293. }
  294. }
  295. }