From 0820c0ddf9feb43580dc568c5b11a685ddef6e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 4 Oct 2017 20:02:15 +0200 Subject: [PATCH] Bicycle Amenities: prioritize amenities --- cycle_amenities.json | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/cycle_amenities.json b/cycle_amenities.json index 0b1c8c8..70cd662 100644 --- a/cycle_amenities.json +++ b/cycle_amenities.json @@ -12,16 +12,38 @@ "pre": "{% if tags.shop in [ 'bicycle' ] %}\n {% set key = 'shop' %}\n {% set value = tags.shop %}\n{% elseif attribute(tags, \"monitoring:bicycle\") %}\n {% set key = 'man_made' %}\n {% set value = 'monitoring_station' %}\n{% elseif tags.vending in [ 'bicycle_tube' ] %}\n {% set key = 'vending' %}\n {% set value = tags.vending %}\n{% else %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% endif %}\n\n{% set constIndex = (key ~ \"=\" ~ value) %}", "description": "{{ tagTrans(key, value) }}", "body": "{% if tags.capacity %}\n {{ keyTrans('capacity') }}: {{ tags.capacity }}\n{% endif %}", - "markerSign": "{{ const[constIndex] }}", - "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}\n\n{% if tags.capacity %}({{ tags.capacity }}){% endif %}" + "markerSign": "{{ const[constIndex]['sign'] }}", + "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}\n\n{% if tags.capacity %}({{ tags.capacity }}){% endif %}", + "priority": "{% if const[constIndex] %}\n{{ const[constIndex]['priority'] }}\n{% else %}\n10\n{% endif %}" }, "const": { - "shop=bicycle": "🚲", - "amenity=bicycle_repair_station": "🔧", - "amenity=bicycle_parking": "🅿", - "amenity=bicycle_rental": "R", - "man_made=monitoring_station": "#", - "vending=bicycle_tube": "T", - "amenity=compressed_air": "A" + "shop=bicycle": { + "sign": "🚲", + "priority": 0 + }, + "amenity=bicycle_repair_station": { + "sign": "🔧", + "priority": 2 + }, + "amenity=bicycle_parking": { + "sign": "🅿", + "priority": 3 + }, + "amenity=bicycle_rental": { + "sign": "R", + "priority": 1 + }, + "man_made=monitoring_station": { + "sign": "#", + "priority": 4 + }, + "vending=bicycle_tube": { + "sign": "T", + "priority": 2 + }, + "amenity=compressed_air": { + "sign": "A", + "priority": 2 + } } }