From c4ff70ce656e941574a31120f3971375ecc7ba4c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 30 Jun 2023 16:59:42 +0200 Subject: [PATCH] Fix: metatagging of width theme --- assets/themes/width/width.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/themes/width/width.json b/assets/themes/width/width.json index 5f9adf3ae..6f16d225e 100644 --- a/assets/themes/width/width.json +++ b/assets/themes/width/width.json @@ -47,20 +47,20 @@ "_has_left_parking=(feat.properties['parking:lane:left'] ?? feat.properties['parking:lane:both']) === 'parallel'", "_has_right_parking=(feat.properties['parking:lane:right'] ?? feat.properties['parking:lane:both']) === 'parallel'", "_has_other_parking= ['parking:lane:left','parking:lane:right','parking:lane:both'].some(key => ['perpendicular','diagonal'].indexOf(feat.properties[key]) >= 0)", - "_parallel_parking_count=feat.get('_has_right_parking') + feat.get('_has_left_parking') /* in javascript logic: true + true == 2*/", - "_width:needed:parking=feat.get('_parallel_parking_count') * feat.get('_car_width')", + "_parallel_parking_count=get(feat)('_has_right_parking') + get(feat)('_has_left_parking') /* in javascript logic: true + true == 2*/", + "_width:needed:parking=get(feat)('_parallel_parking_count') * get(feat)('_car_width')", "_has_sidewalk_left=['left','both'].indexOf(feat.properties['sidewalk']) >= 0", "_has_sidewalk_right=['right','both'].indexOf(feat.properties['sidewalk']) >= 0", - "_pedestrian_flows_in_carriageway= 2 - feat.get('_has_sidewalk_left') - feat.get('_has_sidewalk_right')", - "_width:needed:pedestrians=feat.get('_pedestrianWidth') * feat.get('_pedestrian_flows_in_carriageway')", + "_pedestrian_flows_in_carriageway= 2 - get(feat)('_has_sidewalk_left') - get(feat)('_has_sidewalk_right')", + "_width:needed:pedestrians=get(feat)('_pedestrianWidth') * get(feat)('_pedestrian_flows_in_carriageway')", "_oneway_car=(feat.properties['oneway:motor_vehicle'] ?? feat.properties['oneway']) == 'yes'", - "_width:needed:cars=feat.get('_car_width') * (2 - feat.get('_oneway_car'))", + "_width:needed:cars=get(feat)('_car_width') * (2 - get(feat)('_oneway_car'))", "_cycling_allowed=feat.properties.bicycle != 'use_sidepath' && feat.properties.bicycle!='no'", "_oneway_bicycle=((feat.properties['oneway:bicycle'] ?? feat.properties['oneway']) == 'yes') && feat.properties['cycleway'] != 'opposite'", - "_width:needed:cyclists=feat.get('_cycling_allowed') ? (feat.get('_cyclistWidth') * (2 - feat.get('_oneway_bicycle'))) : 0", - "_width:needed:total:=feat.get('_width:needed:cars') + feat.get('_width:needed:parking') + feat.get('_width:needed:cyclists') + feat.get('_width:needed:pedestrians')", - "_width:difference:=feat.get('_width:needed:total') - feat.get('width:carriageway')", - "_width:difference:no_pedestrians:=feat.get('_width:difference') - feat.get('_width:needed:pedestrians')" + "_width:needed:cyclists=get(feat)('_cycling_allowed') ? (get(feat)('_cyclistWidth') * (2 - get(feat)('_oneway_bicycle'))) : 0", + "_width:needed:total:=get(feat)('_width:needed:cars') + get(feat)('_width:needed:parking') + get(feat)('_width:needed:cyclists') + get(feat)('_width:needed:pedestrians')", + "_width:difference:=get(feat)('_width:needed:total') - get(feat)('width:carriageway')", + "_width:difference:no_pedestrians:=get(feat)('_width:difference') - get(feat)('_width:needed:pedestrians')" ], "minzoom": 12, "source": { @@ -271,4 +271,4 @@ ] } ] -} \ No newline at end of file +}