Skip to content

Commit

Permalink
Fix some bugs with trail lens labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
quincylvania committed Sep 5, 2024
1 parent 4d953be commit 231ff49
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/mapController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -1620,8 +1621,7 @@ function getTrailLabelExpression(lens, travelMode) {
}).flat(1), ""],
}];
}

return getLabelExpression([
const trailLabelData = [
{
caseSelector: ['has', 'waterway'],
selector: ["any", ["has", "name"], ["has", "waterbody:name"]],
Expand All @@ -1633,7 +1633,9 @@ function getTrailLabelExpression(lens, travelMode) {
label: ["coalesce", ["get", "name"], ["get", "mtb:name"]],
sublabels: sublabels
}
]);
];

return getLabelExpression(trailLabelData);
}

const poiLabelData = [
Expand Down

0 comments on commit 231ff49

Please sign in to comment.