A repository for testing purposes.
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.

209 lines
10 KiB

{
"type": "overpass",
"name": {
"de": "Linz - Radrouten"
},
"query": {
"6": "relation[type=route][cycle_network='AT:Linz:Hauptrouten']",
"12": "relation[type=route][cycle_network~'^AT:Linz:(Hauptrouten|Nebenrouten)$']"
},
"members": true,
"feature": {
"pre": [
"{% set prio = tags.cycle_network %}"
],
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"description": "{{ const[tags.cycle_network].title }}",
"markerSymbol": "",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[tags.cycle_network].color|default(const[''].color) })|raw }}",
"priority": "{{ const[tags.cycle_network].priority|default(4) }}",
"styles": "",
"style:hover": {
"width": "0"
},
"style:selected": {
"width": "0"
}
},
"memberFeature": {
"pre": [
"{% set priority = 4 %}",
"{% set network = '' %}",
"{% set refs = [] %}",
"{% set dirForward = false %}",
"{% set dirBackward = false %}",
"{% set hover = false %}",
"{% set selected = false %}",
"{% set proposedDirForward = false %}",
"{% set proposedDirBackward = false %}",
"{% set proposedPriority = 4 %}",
"",
"{% for master in masters if master.tags.route == 'bicycle' %}",
" {% set masterNetwork = '' %}",
" {% if master.tags.cycle_network|matches('^AT:Linz:') %}{% set masterNetwork = master.tags.cycle_network %}{% endif %}",
" {% set _p = const[masterNetwork].priority|default(4) %}",
" {% if _p < priority %}",
" {% set priority = _p %}",
" {% set network = masterNetwork %}",
" {% endif %}",
" {% if master.tags.ref %}",
" {% set refs = refs|merge([ master.tags.ref ]) %}",
" {% endif %}",
" {% if master.role == 'forward' %}{% set dirForward = true %}",
" {% elseif master.role == 'backward' %}{% set dirBackward = true %}",
" {% else %}{% set dirForward = true %}{% set dirBackward = true %}",
" {% endif %}",
" {% if master.flags.hover %}{% set hover = master.role|default('both') %}{% endif %}",
" {% if master.flags.selected %}{% set selected = master.role|default('both') %}{% endif %}",
"{% endfor %}",
"",
"{% for master in masters if master.tags.proposed == 'bicycle' %}",
" {% set masterNetwork = '' %}",
" {% if master.tags.cycle_network|matches('^AT:Linz:') %}{% set masterNetwork = master.tags.cycle_network %}{% endif %}",
" {% set _p = const[masterNetwork].priority|default(4) %}",
" {% if _p < proposedPriority %}",
" {% set proposedPriority = _p %}",
" {% set network = masterNetwork %}",
" {% endif %}",
" {% if master.role == 'forward' %}{% set proposedDirForward = true %}",
" {% elseif master.role == 'backward' %}{% set proposedDirBackward = true %}",
" {% else %}{% set proposedDirForward = true %}{% set proposedDirBackward = true %}",
" {% endif %}",
" {% if master.flags.hover %}{% set hover = master.role|default('both') %}{% endif %}",
" {% if master.flags.selected %}{% set selected = master.role|default('both') %}{% endif %}",
"{% endfor %}"
],
"title": "",
"body": [
"<h4>Routes</h4>",
"<ul class='overpass-layer-list'>",
"{% for master in masters %}",
" {% if master.tags.cycle_network %}",
" <li data-object=\"{{ master.id }}\"><a>",
" <div class='marker'>",
" <div class='symbol'>{{ markerLine({ width: 4, color: const[master.tags.cycle_network].color|default(const[''].color) })|raw }}</div>",
" </div>",
" <div class='content'>",
" <div class='description'>{{ tagTrans('', const[master.tags.cycle_network].title) }}</div>",
" <div 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 }}{% endif %}</div>",
" </div>",
" </a></li>",
" {% endif %}",
"{% endfor %}",
"</ul>"
],
"listExclude": "1",
"styles": "{% if proposedPriority < 4 %}proposed{% else %}default{% endif %}{% if hover %},hover{% endif %}{% if selected %},selected{% endif %}",
"style:proposed": {
"width": "{% if proposedPriority < 4 %}6{% else %}0{% endif %}",
"color": "{{ const[network].proposedColor }}",
"opacity": "1",
"lineCap": "{% if not proposedDirForward or not proposedDirBackward %}butt{% else %}round{% endif %}",
"dashArray": "{% if not proposedDirForward or not proposedDirBackward %}27,8{% endif %}",
"dashOffset": "{% if proposedDirBackward %}28{% else %}0{% endif %}",
"noClip": "{% if not proposedDirForward or not proposedDirBackward %}true{% else %}false{% endif %}",
"textRepeat": "1",
"textOffset": "12",
"pattern": "{% if proposedDirForward and proposedDirBackward %}{% else %}arrowHead{% endif %}",
"pattern-offset": "{% if proposedDirBackward %}4{% else %}30.5{% endif %}",
"pattern-repeat": "35",
"pattern-polygon": "true",
"pattern-pixelSize": "9",
"pattern-angleCorrection": "{% if proposedDirBackward %}180{% else %}0{% endif %}",
"pattern-path-width": "0",
"pattern-path-color": "{{ const[network].proposedColor }}",
"pattern-path-fillOpacity": "1",
"textFontWeight": "bold"
},
"style": {
"width": "{% if priority < 4 %}4{% else %}0{% endif %}",
"color": "{{ const[network].color }}",
"opacity": "1",
"lineCap": "{% if not dirForward or not dirBackward %}butt{% else %}round{% endif %}",
"dashArray": "{% if not dirForward or not dirBackward %}27,8{% endif %}",
"dashOffset": "{% if dirBackward %}28{% else %}0{% endif %}",
"noClip": "{% if not dirForward or not dirBackward %}true{% else %}false{% endif %}",
"text": "{{ refs|join(' · ') }} ",
"textRepeat": "1",
"textOffset": "12",
"pattern": "{% if priority < 4 and dirForward and dirBackward %}{% else %}arrowHead{% endif %}",
"pattern-offset": "{% if dirBackward %}4{% else %}30.5{% endif %}",
"pattern-repeat": "35",
"pattern-polygon": "true",
"pattern-pixelSize": "9",
"pattern-angleCorrection": "{% if dirBackward %}180{% else %}0{% endif %}",
"pattern-path-width": "0",
"pattern-path-color": "{{ const[network].color }}",
"pattern-path-fillOpacity": "1",
"textFontWeight": "bold"
},
"style:hover": {
"pane": "hover",
"width": "4",
"color": "black",
"lineCap": "{% if hover == 'forward' or hover == 'backward' %}butt{% else %}round{% endif %}",
"dashArray": "{% if hover == 'forward' or hover == 'backward' %}27,8{% endif %}",
"dashOffset": "{% if hover == 'backward' %}28{% else %}0{% endif %}",
"noClip": "{% if hover == 'forward' or hover == 'backward' %}true{% else %}false{% endif %}",
"pattern": "{% if hover == 'forward' or hover == 'backward' %}arrowHead{% endif %}",
"pattern-offset": "{% if hover == 'backward' %}4{% else %}30.5{% endif %}",
"pattern-repeat": "35",
"pattern-polygon": "true",
"pattern-pixelSize": "9",
"pattern-angleCorrection": "{% if hover == 'backward' %}180{% else %}0{% endif %}",
"pattern-path-width": "0",
"pattern-path-color": "black",
"pattern-path-fillOpacity": "1"
},
"style:selected": {
"pane": "selected",
"width": "4",
"color": "#3f3f3f",
"lineCap": "{% if selected == 'forward' or selected == 'backward' %}butt{% else %}round{% endif %}",
"dashArray": "{% if selected == 'forward' or selected == 'backward' %}27,8{% endif %}",
"dashOffset": "{% if selected == 'backward' %}28{% else %}0{% endif %}",
"noClip": "{% if selected == 'forward' or selected == 'backward' %}true{% else %}false{% endif %}",
"pattern": "{% if selected == 'forward' or selected == 'backward' %}arrowHead{% endif %}",
"pattern-offset": "{% if selected == 'backward' %}4{% else %}30.5{% endif %}",
"pattern-repeat": "35",
"pattern-polygon": "true",
"pattern-pixelSize": "9",
"pattern-angleCorrection": "{% if selected == 'backward' %}180{% else %}0{% endif %}",
"pattern-path-width": "0",
"pattern-path-color": "#3f3f3f",
"pattern-path-fillOpacity": "1"
}
},
"const": {
"AT:Linz:Hauptrouten": {
"title": "Hauptroute",
"color": "#0000ff",
"proposedColor": "#ff0000",
"priority": 1,
"zoom": 6
},
"AT:Linz:Nebenrouten": {
"title": "Nebenroute",
"color": "#0066ff",
"proposedColor": "#ff4400",
"priority": 2,
"zoom": 12
}
},
"info": [
"<table>",
"{% for value, data in const %}",
"{% if data.zoom <= map.zoom %}",
" <tr>",
" <td>{{ markerLine({ 'width': 4, color: data.color })|raw }}</td>",
" <td>{{ value }}</td>",
" </tr>",
" <tr>",
" <td>{{ markerLine({ 'width': 4, color: data.proposedColor })|raw }}</td>",
" <td>{{ value }} ({{ keyTrans('proposed') }})</td>",
" </tr>",
"{% endif %}",
"{% endfor %}",
"</table>"
]
}