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.

104 lines
3.8 KiB

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