Main categories of OpenStreetBrowser
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.

66 lines
2.7 KiB

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