Skip to content

Commit

Permalink
Remove icon opacity expression from oneway layer
Browse files Browse the repository at this point in the history
  • Loading branch information
claysmalley committed Jul 25, 2022
1 parent af56c56 commit ee8f903
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions src/layer/oneway.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@ const highwaySelector = ["match", ["get", "class"]];

const linkSelector = ["match", ["get", "ramp"], 1];

// Helper function to determine icon opacity
function iconOpacity(maxOpacity) {
return [
"interpolate",
["exponential", 2],
["zoom"],
15,
0,
16,
[
...highwaySelector,
["motorway", "trunk", "primary", "secondary", "tertiary"],
[...linkSelector, 0, maxOpacity],
0,
],
17,
maxOpacity,
];
}

export const surface = {
id: "road_oneway",
filter: ["all", ["==", "oneway", 1], ["!in", "brunnel", "bridge", "tunnel"]],
Expand Down Expand Up @@ -82,7 +62,7 @@ export const surface = {
"icon-rotation-alignment": "map",
},
paint: {
"icon-opacity": iconOpacity(0.5),
"icon-opacity": 0.5,
},
};

Expand All @@ -91,7 +71,7 @@ export const tunnel = {
id: "tunnel_oneway",
filter: ["all", ["==", "oneway", 1], ["==", "brunnel", "tunnel"]],
paint: {
"icon-opacity": iconOpacity(0.2),
"icon-opacity": 0.2,
},
};

Expand Down

0 comments on commit ee8f903

Please sign in to comment.