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.

53 lines
2.0 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Railway Routes"
  5. },
  6. "query": {
  7. "12": "relation[type=route][route=railway]"
  8. },
  9. "members": true,
  10. "feature": {
  11. "pre": "{% set color = '#' ~ tags.operator|default('')|md5|slice(0, 6) %}",
  12. "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}",
  13. "description": "{{ tags.operator }}",
  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. "styles": "",
  16. "markerSymbol": ""
  17. },
  18. "memberFeature": {
  19. "pre": [
  20. "{% set refs = [] %}",
  21. "{% set color = '#d41d8c' %}",
  22. "",
  23. "{% for master in masters %}",
  24. " {% if master.tags.operator %}",
  25. " {% set color = '#' ~ master.tags.operator|md5|slice(0, 6) %}",
  26. " {% endif %}",
  27. " {% if master.tags.ref %}",
  28. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  29. " {% endif %}",
  30. "{% endfor %}"
  31. ],
  32. "title": "",
  33. "body": [
  34. "<h4>Routes</h4>",
  35. "<ul>",
  36. "{% for master in masters %}",
  37. " {% set _color = '#' ~ master.tags.operator|default('')|md5|slice(0, 6) %}",
  38. " <li data-object=\"{{ master.id }}\" style='list-style: none;'>{{ markerLine({ width: 4, color: _color })|raw }}<b>{{ master.tags.name|default(master.tags.ref) }}</b>{% if master.tags.network %} <i>{{ master.tags.operator }}</i>{% endif %}</li>",
  39. "{% endfor %}",
  40. "</ul>"
  41. ],
  42. "listExclude": "1",
  43. "style": {
  44. "color": "{{ color }}",
  45. "width": 4,
  46. "opacity": 1,
  47. "text": "{{ refs|join(' ') }} ",
  48. "textRepeat": "1",
  49. "textOffset": "12",
  50. "textFontWeight": "bold"
  51. }
  52. }
  53. }