From 231ff49b1751977e2eab6cd6206f6d7568529559 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:54:03 -0400 Subject: [PATCH] Fix some bugs with trail lens labeling --- js/mapController.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/mapController.js b/js/mapController.js index 5fb2879..804515b 100644 --- a/js/mapController.js +++ b/js/mapController.js @@ -793,8 +793,9 @@ function maxspeedKeysForTravelMode(travelMode) { function specifyingKeysForLens(lens, travelMode) { switch (lens) { case 'access': - let keys = accessHierarchy[travelMode].reverse(); + let keys = accessHierarchy[travelMode].slice().reverse(); if (travelMode === 'canoe') keys.push('portage'); + keys.push('access'); return keys; case 'name': switch (travelMode) { @@ -1620,8 +1621,7 @@ function getTrailLabelExpression(lens, travelMode) { }).flat(1), ""], }]; } - - return getLabelExpression([ + const trailLabelData = [ { caseSelector: ['has', 'waterway'], selector: ["any", ["has", "name"], ["has", "waterbody:name"]], @@ -1633,7 +1633,9 @@ function getTrailLabelExpression(lens, travelMode) { label: ["coalesce", ["get", "name"], ["get", "mtb:name"]], sublabels: sublabels } - ]); + ]; + + return getLabelExpression(trailLabelData); } const poiLabelData = [