Browse Source

pt: different styles for stop, way, platform

pt
parent
commit
01997790e5
  1. 32
      pt.json

32
pt.json

@ -88,17 +88,27 @@
"memberFeature": { "memberFeature": {
"pre": [ "pre": [
"{% set stopName = '' %}", "{% set stopName = '' %}",
"{% set isStop = false %}",
"{% set isWay = false %}",
"{% set aRoute = null %}",
"{% for master in masters %}", "{% for master in masters %}",
" {% if master.tags.public_transport == 'stop_area' %}", " {% if master.tags.public_transport == 'stop_area' %}",
" {% set stopName = master.tags.name %}",
" {% set stopName = master.tags.name %}",
" {% else %}",
" {% if master.role|slice(-4) == 'stop' %}",
" {% set isStop = true %}",
" {% elseif master.role|matches('^(|forward|backward)$') %}",
" {% set isWay = true %}",
" {% endif %}",
" {% set aRoute = master %}",
" {% endif %}", " {% endif %}",
"{% endfor %}" "{% endfor %}"
], ],
"listStopsMarkerSymbol": "{{ markerCircle({})|raw }}", "listStopsMarkerSymbol": "{{ markerCircle({})|raw }}",
"style": {
"styles": "{% if isStop %}stop{% elseif isWay %}way{% else %}platform{% endif %}",
"style:way": {
"color": [ "color": [
"{% set master = masters[0] %}",
"{{ const[master.tags.route].color|default('#ff0000') }}"
"{{ const[aRoute.tags.route].color|default('#ff0000') }}"
], ],
"width": "3", "width": "3",
"text": "{% for master in masters %}{{ master.tags.ref }} {% endfor %} ", "text": "{% for master in masters %}{{ master.tags.ref }} {% endfor %} ",
@ -106,6 +116,17 @@
"textOffset": "12", "textOffset": "12",
"textFontWeight": "bold" "textFontWeight": "bold"
}, },
"style:stop": {
"color": [
"{{ const[aRoute.tags.route].color|default('#ff0000') }}"
],
"width": "5",
"radius": 3
},
"style:platform": {
"color": "#7f7f7f",
"width": "1"
},
"title": "{% if tags.public_transport == 'stop_position' %}{{ tags.name|default(stopName)|default(id) }}{% endif %}", "title": "{% if tags.public_transport == 'stop_position' %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
"listStopsTitle": "{{ tags.name|default(stopName)|default(id) }}", "listStopsTitle": "{{ tags.name|default(stopName)|default(id) }}",
"listStopsDescription": "{% for master in masters %}{{ master.tags.ref }} {% endfor %}", "listStopsDescription": "{% for master in masters %}{{ master.tags.ref }} {% endfor %}",
@ -116,11 +137,12 @@
" {% if master.tags.public_transport != 'stop_area' %}", " {% if master.tags.public_transport != 'stop_area' %}",
" <li data-object=\"{{ master.id }}\"><b>{{ master.tags.name|default(master.tags.ref) }}</li>", " <li data-object=\"{{ master.id }}\"><b>{{ master.tags.name|default(master.tags.ref) }}</li>",
" {% endif %}", " {% endif %}",
" {{ master.role }}",
"{% endfor %}", "{% endfor %}",
"</ul>" "</ul>"
], ],
"listRoutesExclude": "true", "listRoutesExclude": "true",
"listStopsExclude": "{% set isStop = 0 %}{% for master in masters %}{% if master.role|slice(-4) == 'stop' %}{% set isStop = 1 %}{% endif %}{% endfor %}{{ not isStop }}"
"listStopsExclude": "{{ not isStop }}"
}, },
"info": [ "info": [
"<table>", "<table>",

Loading…
Cancel
Save