Browse Source

Layouts: split details from description; remove 'unnamed'

master
parent
commit
3698c598f5
  1. 15
      buildings-height.json
  2. 3
      car_maxspeed.json
  3. 2
      car_routes.json
  4. 1
      communication.json
  5. 2
      cycle_amenities.json
  6. 2
      cycle_routes.json
  7. 4
      hiking_routes.json
  8. 2
      mtb-routes.json
  9. 5
      natural.json
  10. 2
      power_routes.json
  11. 2
      pt.json
  12. 1
      public.json
  13. 11
      railway-electrification.json
  14. 5
      railway-gauge.json
  15. 2
      railway-infrastructure.json
  16. 2
      railway-routes.json

15
buildings-height.json

@ -34,6 +34,21 @@
"{% endif %}"
],
"description": [
"{% if tags.building == 'yes' and tags.military %}",
"{{ tagTrans('building', 'military') }}",
"{% elseif tags.building == 'yes' %}",
"{{ keyTrans('building') }}",
"{% else %}",
"{{ tagTransList('building', tags.building) }}",
"{% endif %}",
"{% if tags.building == 'construction' and tags.construction %}",
"({{ tagTransList('building', tags.construction) }})",
"{% endif %}",
"{% if tags.building in [ 'yes', 'military' ] and tags.military %}",
"({{ tagTransList('military', tags.military) }})",
"{% endif %}"
],
"details": [
"{% if tags.height is defined %}",
" {% if tags.height|matches('(m|ft)$') %}{{ tags.height -}}",
" {% else %}{{ tags.height }} m",

3
car_maxspeed.json

@ -93,7 +93,8 @@
"{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
"{% endif %}"
],
"description": [
"description": "{{ tagTransList('highway', tags.highway) }}",
"details": [
"{% if maxspeedF or maxspeedB %}",
"<span style='color: {{ colorB }}'>{{ maxspeedB == 'other' ? attribute(tags, 'maxspeed:backward') : const.colorOther[maxspeedB] ? tagTrans('maxspeed', maxspeedB) : maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ maxspeedF == 'other' ? attribute(tags, 'maxspeed:forward') : const.colorOther[maxspeedF] ? tagTrans('maxspeed', maxspeedF) : maxspeedF|default(trans('unknown')) }}</span> {{ unit }}",
"{% elseif maxspeed %}",

2
car_routes.json

@ -13,7 +13,7 @@
"feature": {
"pre": "{% set color = '#' ~ tags.network|default('')|md5|slice(0, 6) %}",
"description": "{% if tags.network %}{{ tagTrans('network', tags.network) }}{% endif %}",
"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 %}",
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}",
"markerSymbol": "",
"styles": ""

1
communication.json

@ -46,7 +46,6 @@
" {% set value = tags.office %}",
"{% endif %}"
],
"title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) |default(tagTrans('amenity', tags.amenity)) }}",
"description": [
"{% if key == 'office' %}",
" {{ keyTrans('office') }} ({{ tagTrans('office', tags.office) }})",

2
cycle_amenities.json

@ -56,7 +56,7 @@
"{% set constIndex = (key ~ \"=\" ~ value) %}"
],
"title": [
"{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}",
"{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) }}",
"",
"{% if tags.capacity %}({{ tags.capacity }}){% endif %}"
],

2
cycle_routes.json

@ -16,7 +16,7 @@
},
"members": true,
"feature": {
"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 %}",
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"description": "{{ tagTrans('network', tags.network) }}",
"markerSymbol": "",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[tags.network].color|default(const[''].color) })|raw }}",

4
hiking_routes.json

@ -19,7 +19,7 @@
"priority": "{{ const[tags.network].priority|default(4) }}",
"description": "{% if tags.network %}{{ tagTrans('network', tags.network) }}{% endif %}",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[tags.network|default('')].color|default(const[''].color) })|raw }}",
"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 %}",
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"styles": "",
"markerSymbol": ""
},
@ -46,7 +46,7 @@
"{% for master in masters %}",
" <li data-object=\"{{ master.id }}\">",
" <span class='markerParent'><div class='marker'>{{ markerLine({ width: 4, color: const[master.tags.network].color|default(const[''].color) })|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='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 %}</span>",
" <span class='description'>{{ tagTrans('network', master.tags.network) }}</span>",
" </li>",
"{% endfor %}",

2
mtb-routes.json

@ -13,7 +13,7 @@
"feature": {
"description": "{{ tagTrans('route', 'mtb') }}",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': '#007fff' })|raw }}",
"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 %}",
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"styles": "",
"markerSymbol": ""
},

5
natural.json

@ -39,10 +39,7 @@
]
},
"feature": {
"title": [
"{{ localizedTag(tags, 'name') | default(trans('unnamed')) }}",
"{% if tags.natural == 'peak' and tags.ele %}({{ tags.ele }}m){% endif %}"
],
"details": "{% if tags.natural == 'peak' and tags.ele %}{{ tags.ele }}m{% endif %}",
"description": "{{ tagTrans('natural', tags.natural) }}",
"style": {
"color": "{{ const[tags.natural].color|default('#f2756a') }}"

2
power_routes.json

@ -13,7 +13,7 @@
"feature": {
"pre": "{% set color = '#' ~ tags.operator|default('')|md5|slice(0, 6) %}",
"description": "{% if tags.operator %}{{ tags.operator }}{% endif %}",
"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 %}",
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}",
"markerSymbol": "",
"styles": ""

2
pt.json

@ -54,7 +54,7 @@
"title": [
"{% if tags.ref %}{{ tags.ref }} - {% endif %}",
"",
"{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}"
"{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) }}"
],
"description": "{{ tagTrans('route', tags.route) }}",
"body": [

1
public.json

@ -53,7 +53,6 @@
"{% set value = tags.office %}",
"{% endif %}"
],
"title": "{{ tags.name|default(tags.operator)|default(tagTrans('amenity', value)) }}",
"description": [
"{% if key == 'office' %}",
" {{ keyTrans('office') }} ({{ tagTrans('office', tags.office) }})",

11
railway-electrification.json

@ -44,14 +44,13 @@
" {% endif %}",
"{% endif %}"
],
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
"description": [
"{{ tagTrans('railway', tags.railway) }}",
"",
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator')) }}",
"description": "{{ tagTrans('railway', tags.railway) }}",
"details": [
"{% if tags.electrified == 'no' %}",
" - {{ tagTrans('electrified', 'no') }}",
"{{ tagTrans('electrified', 'no') }}",
"{% elseif tags.electrified %}",
" - {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
"{{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
"{% endif %}"
],
"body": [

5
railway-gauge.json

@ -12,8 +12,9 @@
"{% set gauges = tags.gauge|split(';')|sort|reverse %}",
"{% set width = max(3, 3 / map.metersPerPixel) %}"
],
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
"description": "{{ tags.gauge|default(trans('unknown'))|enumerate }}",
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator')) }}",
"description": "{{ tagTrans('railway', tags.railway) }}",
"details": "{{ tags.gauge|default(trans('unknown'))|enumerate }}",
"body": [
"{{ tagTrans('railway', tags.railway) }}<br/>",
"{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",

2
railway-infrastructure.json

@ -14,7 +14,7 @@
"17": "(node[railway];way[railway];)"
},
"feature": {
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator')) }}",
"description": [
"{{ tagTrans('railway', tags.railway) -}}",
"{%- if tags.usage %}",

2
railway-routes.json

@ -14,7 +14,7 @@
"pre": "{% set color = '#' ~ tags.operator|default('')|md5|slice(0, 6) %}",
"listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}",
"description": "{{ tags.operator }}",
"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 %}",
"title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}",
"styles": "",
"markerSymbol": ""
},

Loading…
Cancel
Save