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.

293 lines
13 KiB

7 years ago
7 years ago
7 years ago
7 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": "{% if tags %}{{ tags.name|default(stopName)|default(trans('unknown')) }}{% else %}<li>{{ trans('loading') }}</li>{% endif %}",
  186. "listStopsDetails": "{{ refs|join(' · ') }}",
  187. "listStopsDescription": [
  188. "{% set stopTypes = [] %}",
  189. "{% if tags.railway in ['tram_stop'] %}{% set stopTypes = stopTypes|merge([ tagTrans('railway', tags.railway) ]) %}{% endif %}",
  190. "{% if tags.highway in ['bus_stop'] %}{% set stopTypes = stopTypes|merge([ tagTrans('highway', tags.highway) ]) %}{% endif %}",
  191. "{{ enumerate(stopTypes) }}"
  192. ],
  193. "listRoutesExclude": "true",
  194. "style:stop": {
  195. "width": "4",
  196. "color": "{{ color|default('#ff0000') }}",
  197. "radius": "3",
  198. "zIndex": "1"
  199. },
  200. "style:way": {
  201. "width": "4",
  202. "color": "{{ color|default('#ff0000') }}",
  203. "opacity": "1",
  204. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  205. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  206. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  207. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  208. "text": "{{ refs|join(' · ') }} ",
  209. "textRepeat": "1",
  210. "textOffset": "12",
  211. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  212. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  213. "pattern-repeat": "35",
  214. "pattern-polygon": "true",
  215. "pattern-pixelSize": "9",
  216. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  217. "pattern-path-width": "0",
  218. "pattern-path-color": "{{ color|default('#ff0000') }}",
  219. "pattern-path-fillOpacity": "1",
  220. "textFontWeight": "bold"
  221. }
  222. },
  223. "info": [
  224. "<table>",
  225. "{% for value, data in const %}",
  226. "{% if data.zoom <= map.zoom %}",
  227. " <tr>",
  228. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  229. " <td>{{ tagTrans('route', value) }}</td>",
  230. " </tr>",
  231. "{% endif %}",
  232. "{% endfor %}",
  233. "</table>"
  234. ],
  235. "const": {
  236. "train": {
  237. "sign": "<img data-src='maki:rail?fill=#ffffff'>",
  238. "zoom": 12,
  239. "color": "#00007f"
  240. },
  241. "subway": {
  242. "sign": "<img data-src='maki:rail-metro?fill=#ffffff'>",
  243. "zoom": 12,
  244. "color": "#0000ff"
  245. },
  246. "monorail": {
  247. "sign": "<span style='color: #ffffff'>M</span>",
  248. "zoom": 12,
  249. "color": "#006f8f"
  250. },
  251. "tram": {
  252. "sign": "<img data-src='maki:rail-light?fill=#ffffff'>",
  253. "zoom": 12,
  254. "color": "#7f007f"
  255. },
  256. "bus": {
  257. "sign": "<img data-src='maki:bus?fill=#ffffff'>",
  258. "zoom": 12,
  259. "color": "#af0000"
  260. },
  261. "trolleybus": {
  262. "sign": "<img data-src='maki:bus?fill=#ffffff'>",
  263. "zoom": 12,
  264. "color": "#af3f00"
  265. },
  266. "aerialway": {
  267. "sign": "<img data-src='maki:aerialway?fill=#ffffff'>",
  268. "zoom": 12,
  269. "color": "#00aaaa"
  270. },
  271. "ferry": {
  272. "sign": "<img data-src='maki:ferry?fill=#ffffff'>",
  273. "zoom": 12,
  274. "color": "#007fff"
  275. }
  276. },
  277. "filter": {
  278. "route": {
  279. "type": "select",
  280. "show_default": "true",
  281. "valueName": "{{ tagTrans('route', value) }}",
  282. "values": [
  283. "aerialway",
  284. "bus",
  285. "ferry",
  286. "subway",
  287. "train",
  288. "tram",
  289. "trolleybus"
  290. ]
  291. }
  292. }
  293. }