Browse Source

pt: show directions in hover and selected

pedestrian
parent
commit
71ff4bfeb9
  1. 35
      pt.json

35
pt.json

@ -84,6 +84,8 @@
"{% set refs = [] %}",
"{% set dirForward = false %}",
"{% set dirBackward = false %}",
"{% set hover = false %}",
"{% set selected = false %}",
"{% for master in masters %}",
" {% if master.tags.public_transport == 'stop_area' %}",
" {% set stopName = master.tags.name %}",
@ -104,6 +106,9 @@
" {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
" {% endif %}",
" {% endif %}",
"",
" {% if master.flags.hover %}{% set hover = master.dir|default('both') %}{% endif %}",
" {% if master.flags.selected %}{% set selected = master.dir|default('both') %}{% endif %}",
"{% endfor %}",
"",
"{% set refs = refs|unique|natsort({ insensitive: true }) %}",
@ -118,20 +123,20 @@
" <li data-object=\"{{ master.id }}\">",
" <span class='markerParent'><div class='marker'>{{ markerCircle({fillColor:const[master.tags.route].color})|raw }}</div><div class='icon'>{{ const[master.tags.route].sign|raw }}</div></span>",
" <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>",
" <span class='description'>{{ tagTrans('route', master.tags.route) }}</span>",
" <span class='description'>{{ tagTrans('route', master.tags.route) }}{{ master.dir }}</span>",
" </li>",
" {% endif %}",
"{% endfor %}",
"</ul>"
],
"styles": "{% if isStop and stopCount > 0 %}{% elseif isWay %}way{% else %}{% endif %}",
"styles": "{% if isStop and stopCount > 0 %}{% elseif isWay %}way{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}{% endif %}",
"listStopsMarkerSign": null,
"listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
"listStopsExclude": "{{ not isStop or stopCount == 0 }}",
"listStopsTitle": "{% if tags %}{{ tags.name|default(stopName)|default(trans('unknown')) }}{% else %}<li>{{ trans('loading') }}</li>{% endif %}",
"listStopsDescription": "{{ refs|join(' · ') }}",
"listRoutesExclude": "true",
"markerSymbol": "{% if isStop and stopCount > 0 %}{{ markerCircle({ width: 0, fill: true, fillColor: color, fillOpacity: '1', radius: 5 })|raw }}{% endif %}",
"markerSymbol": "{% if isStop and stopCount > 0 %}{% if hover or selected %}{{ markerCircle({ width: 0, fill: true, fillColor: hover ? '#000000' : '#3f3f3f', fillOpacity: '1', radius: 7 })|raw }}{% else %}{{ markerCircle({ width: 0, fill: true, fillColor: color, fillOpacity: '1', radius: 5 })|raw }}{% endif %}{% endif %}",
"style:way": {
"width": "3",
"opacity": "{% if (dirForward and dirBackward) or (not dirForward and not dirBackward) %}1{% else %}0{% endif %}",
@ -147,6 +152,30 @@
"pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
"pattern-path-weight": "2",
"pattern-path-color": "{{ color|default('#ff0000') }}"
},
"style:hover": {
"pane": "hover",
"width": "{% if hover == 'forward' or hover == 'backward' %}0{% else %}4{% endif %}",
"color": "black",
"pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
"pattern-pixelSize": "4",
"pattern-repeat": "7",
"pattern-polygon": "",
"pattern-path-weight": "2",
"pattern-path-color": "black",
"pattern-path-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}"
},
"style:selected": {
"pane": "selected",
"width": "{% if selected == 'forward' or selected == 'backward' %}0{% else %}3{% endif %}",
"color": "#3f3f3f",
"pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
"pattern-pixelSize": "4",
"pattern-repeat": "7",
"pattern-polygon": "",
"pattern-path-weight": "2",
"pattern-path-color": "#3f3f3f",
"pattern-path-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}"
}
},
"info": [

Loading…
Cancel
Save