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.

123 lines
4.6 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Wanderrouten",
  5. "en": "Hiking routes",
  6. "fr": "Itinéraires pédestres",
  7. "hu": "Turistautak",
  8. "pt": "Rotas de caminhada",
  9. "pt-br": "Rotas de caminhada"
  10. },
  11. "query": {
  12. "10": "relation[type=route][route~\"^(|.*;)hiking(|;.*)$\"][network~\"^(|.*;)(iwn)(|;.*)$\"]",
  13. "11": "relation[type=route][route~\"^(|.*;)hiking(|;.*)$\"][network~\"^(|.*;)(iwn|nwn)(|;.*)$\"]",
  14. "12": "relation[type=route][route~\"^(|.*;)hiking(|;.*)$\"][network~\"^(|.*;)(iwn|nwn|rwn)(|;.*)$\"]",
  15. "14": "relation[type=route][route~\"^(|.*;)hiking(|;.*)$\"]"
  16. },
  17. "members": true,
  18. "feature": {
  19. "pre": [
  20. "{% set network = tags.network %}",
  21. "{% for n in tags.network|split(';') %}",
  22. "{% if n|matches('wn$') %}{% set network = n %}{% endif %}",
  23. "{% endfor %}"
  24. ],
  25. "priority": "{{ const[network].priority|default(4) }}",
  26. "description": "{% if network %}{{ tagTrans('network', network) }}{% endif %}",
  27. "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[network|default('')].color|default(const[''].color) })|raw }}",
  28. "title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
  29. "styles": "",
  30. "markerSymbol": ""
  31. },
  32. "memberFeature": {
  33. "pre": [
  34. "{% set priority = 4 %}",
  35. "{% set network = '' %}",
  36. "{% set refs = [] %}",
  37. "",
  38. "{% for master in masters %}",
  39. " {% set masterNetwork = '' %}",
  40. " {% for n in master.tags.network|split(';') %}",
  41. " {% if n|matches('wn$') %}{% set masterNetwork = n %}{% endif %}",
  42. " {% endfor %}",
  43. " {% set _p = const[masterNetwork].priority|default(4) %}",
  44. " {% if _p < priority %}",
  45. " {% set priority = _p %}",
  46. " {% set network = masterNetwork %}",
  47. " {% endif %}",
  48. " {% if master.tags.ref %}",
  49. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  50. " {% endif %}",
  51. "{% endfor %}"
  52. ],
  53. "body": [
  54. "<h4>Routes</h4>",
  55. "<ul class='overpass-layer-list'>",
  56. "{% for master in masters %}",
  57. " {% set masterNetwork = '' %}",
  58. " {% for n in master.tags.network|split(';') %}",
  59. " {% if n|matches('wn$') %}{% set masterNetwork = n %}{% endif %}",
  60. " {% endfor %}",
  61. " <li data-object=\"{{ master.id }}\"><a>",
  62. " <div class='marker'>",
  63. " <div class='symbol'>{{ markerLine({ width: 4, color: const[masterNetwork].color|default(const[''].color) })|raw }}</div>",
  64. " </div>",
  65. " <div class='content'>",
  66. " <div class='description'>{{ tagTrans('network', masterNetwork) }}</div>",
  67. " <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 }}{% endif %}</div>",
  68. " </div>",
  69. " </a></li>",
  70. "{% endfor %}",
  71. "</ul>"
  72. ],
  73. "listExclude": "1",
  74. "style": {
  75. "color": "{{ const[network].color }}",
  76. "width": 4,
  77. "opacity": 1,
  78. "text": "{{ refs|join(' · ') }} ",
  79. "textRepeat": "1",
  80. "textOffset": "12",
  81. "textFontWeight": "bold"
  82. }
  83. },
  84. "const": {
  85. "iwn": {
  86. "color": "#ff0000",
  87. "priority": 0,
  88. "zoom": 10
  89. },
  90. "nwn": {
  91. "color": "#ff00ba",
  92. "priority": 1,
  93. "zoom": 11
  94. },
  95. "rwn": {
  96. "color": "#ba00ff",
  97. "priority": 2,
  98. "zoom": 12
  99. },
  100. "lwn": {
  101. "color": "#0000ff",
  102. "priority": 3,
  103. "zoom": 14
  104. },
  105. "": {
  106. "color": "#007fff",
  107. "priority": 4,
  108. "zoom": 14
  109. }
  110. },
  111. "info": [
  112. "<table>",
  113. "{% for value, data in const %}",
  114. "{% if data.zoom <= map.zoom %}",
  115. " <tr>",
  116. " <td>{{ markerLine({ 'width': 4, color: data.color })|raw }}</td>",
  117. " <td>{% if value %}{{ tagTrans('network', value) }}{% else %}{{ trans('unknown') }}{% endif %}</td>",
  118. " </tr>",
  119. "{% endif %}",
  120. "{% endfor %}",
  121. "</table>"
  122. ]
  123. }