Skip to content

Commit

Permalink
WIP of adding improved visibility for selected linestrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Mcgrady committed Dec 16, 2024
1 parent 043d005 commit 53f8776
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion site/src/ThemeTypeLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,27 @@ const ThemeTypeLayer = ({
</>
) : null}

{line ? (
<Layer
filter={["==", ["geometry-type"], "LineString"]}
id={`${theme}_${type}_line_highlight`}
type="line"
source={theme}
source-layer={type}
paint={{
"line-opacity": [
"case",
["boolean", ["feature-state", "selected"], false],
0.2,
0,
],
"line-color": "black",
"line-width": ["interpolate", ["linear"], ["zoom"], 12, 3, 13, 6],
}}
layout={{ visibility: visible ? "visible" : "none" }}
{...(minzoom ? { minzoom } : {})}
/>
) : null}
{line ? (
<Layer
filter={["==", ["geometry-type"], "LineString"]}
Expand All @@ -104,7 +125,7 @@ const ThemeTypeLayer = ({
{line ? (
<Layer
filter={["==", ["geometry-type"], "LineString"]}
id={`${theme}_${type}_line_buffer`}
id={`${theme}_${type}_line_click_buffer`}
type="line"
source={theme}
source-layer={type}
Expand Down

0 comments on commit 53f8776

Please sign in to comment.