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.

63 lines
2.6 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Power routes"
  5. },
  6. "query": {
  7. "10": "relation[type=route][route=power]"
  8. },
  9. "members": true,
  10. "feature": {
  11. "pre": "{% set color = '#' ~ tags.operator|default('')|md5|slice(0, 6) %}",
  12. "description": "{% if tags.operator %}{{ tags.operator }}{% endif %}",
  13. "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 %}",
  14. "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}",
  15. "markerSymbol": "",
  16. "styles": ""
  17. },
  18. "memberFeature": {
  19. "pre": [
  20. "{% set refs = [] %}",
  21. "{% set color = '#d41d8c' %}",
  22. "{% if tags.ref %}",
  23. " {% for ref in tags.ref|split(';') %}",
  24. " {% set refs = refs|merge([ ref|trim ]) %}",
  25. " {% endfor %}",
  26. "{% endif %}",
  27. "",
  28. "{% for master in masters %}",
  29. " {% if master.tags.operator %}",
  30. " {% set color = '#' ~ master.tags.operator|md5|slice(0, 6) %}",
  31. " {% endif %}",
  32. " {% if master.tags.ref %}",
  33. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  34. " {% endif %}",
  35. "{% endfor %}",
  36. "",
  37. "{% set refs = refs|unique|natsort({ insensitive: true }) %}"
  38. ],
  39. "body": [
  40. "<h4>Routes</h4>",
  41. "<ul>",
  42. "{% for master in masters %}",
  43. " {% set _color = '#' ~ master.tags.operator|default('')|md5|slice(0, 6) %}",
  44. " <li data-object=\"{{ master.id }}\" style='list-style: none;'>",
  45. " <span class='markerParent'><div class='marker'>{{ markerLine({ width: 4, color: _color })|raw }}</div></span>",
  46. " <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>",
  47. " <span class='description'>{{ master.tags.operator }}</span>",
  48. " </li>",
  49. "{% endfor %}",
  50. "</ul>"
  51. ],
  52. "listExclude": "1",
  53. "style": {
  54. "color": "{{ color }}",
  55. "width": 4,
  56. "opacity": 1,
  57. "text": "{{ refs|join(' · ') }} ",
  58. "textRepeat": "1",
  59. "textOffset": "12",
  60. "textFontWeight": "bold"
  61. }
  62. }
  63. }