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.

64 lines
2.7 KiB

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