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.

259 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) }}{{ master.dir }}</span>",
  133. " </li>",
  134. " {% endif %}",
  135. "{% endfor %}",
  136. "</ul>"
  137. ],
  138. "styles": "{% if isStop and stopCount > 0 %}{% 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 %}{{ 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 %}",
  146. "style:way": {
  147. "color": "{{ color|default('#ff0000') }}",
  148. "width": "4",
  149. "dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
  150. "dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
  151. "lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
  152. "noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
  153. "opacity": 1,
  154. "text": "{{ refs|join(' · ') }} ",
  155. "textRepeat": "1",
  156. "textOffset": "12",
  157. "textFontWeight": "bold",
  158. "pattern": "{% if dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
  159. "pattern-pixelSize": "9",
  160. "pattern-repeat": "35",
  161. "pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
  162. "pattern-polygon": "true",
  163. "pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
  164. "pattern-path-weight": "0",
  165. "pattern-path-fillOpacity": "1",
  166. "pattern-path-color": "{{ color|default('#ff0000') }}"
  167. },
  168. "style:hover": {
  169. "pane": "hover",
  170. "width": "4",
  171. "dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
  172. "dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
  173. "lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
  174. "noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
  175. "color": "black",
  176. "pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
  177. "pattern-pixelSize": "9",
  178. "pattern-repeat": "35",
  179. "pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
  180. "pattern-polygon": "true",
  181. "pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
  182. "pattern-path-weight": "0",
  183. "pattern-path-fillOpacity": "1",
  184. "pattern-path-color": "black"
  185. },
  186. "style:selected": {
  187. "pane": "selected",
  188. "width": "4",
  189. "dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
  190. "dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
  191. "lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
  192. "noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
  193. "color": "#3f3f3f",
  194. "pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
  195. "pattern-pixelSize": "9",
  196. "pattern-repeat": "35",
  197. "pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
  198. "pattern-polygon": "true",
  199. "pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
  200. "pattern-path-weight": "0",
  201. "pattern-path-fillOpacity": "1",
  202. "pattern-path-color": "#3f3f3f"
  203. }
  204. },
  205. "info": [
  206. "<table>",
  207. "{% for value, data in const %}",
  208. "{% if data.zoom <= map.zoom %}",
  209. " <tr>",
  210. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  211. " <td>{{ tagTrans('route', value) }}</td>",
  212. " </tr>",
  213. "{% endif %}",
  214. "{% endfor %}",
  215. "</table>"
  216. ],
  217. "const": {
  218. "train": {
  219. "sign": "<img src='maki:rail?fill=#ffffff'>",
  220. "zoom": 12,
  221. "color": "#00007f"
  222. },
  223. "subway": {
  224. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  225. "zoom": 12,
  226. "color": "#0000ff"
  227. },
  228. "monorail": {
  229. "sign": "<span style='color: #ffffff'>M</span>",
  230. "zoom": 12,
  231. "color": "#006f8f"
  232. },
  233. "tram": {
  234. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  235. "zoom": 12,
  236. "color": "#7f007f"
  237. },
  238. "bus": {
  239. "sign": "<img src='maki:bus?fill=#ffffff'>",
  240. "zoom": 12,
  241. "color": "#af0000"
  242. },
  243. "trolleybus": {
  244. "sign": "<img src='maki:bus?fill=#ffffff'>",
  245. "zoom": 12,
  246. "color": "#af3f00"
  247. },
  248. "aerialway": {
  249. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  250. "zoom": 12,
  251. "color": "#00aaaa"
  252. },
  253. "ferry": {
  254. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  255. "zoom": 12,
  256. "color": "#007fff"
  257. }
  258. }
  259. }