Skip to content

Commit

Permalink
Add click buffer to outline layers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Mcgrady committed Dec 20, 2024
1 parent 14bf9ec commit 91c3ee2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions site/src/ThemeTypeLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@ const ThemeTypeLayer = ({
{...(minzoom ? { minzoom } : {})}
/>
) : null}
{outline ? (
<Layer
filter={["==", ["geometry-type"], "Polygon"]}
id={`${theme}_${type}_outline_click_buffer`}
type="line"
source={theme}
source-layer={type}
paint={{
"line-opacity": 0,
"line-color": "black",
"line-width": ["interpolate", ["linear"], ["zoom"], 12, 6, 13, 9],
}}
layout={{ visibility: visible ? "visible" : "none" }}
{...(minzoom ? { minzoom } : {})}
/>
) : null}
{label && line ? (
<Layer
filter={["==", ["geometry-type"], "LineString"]}
Expand Down

0 comments on commit 91c3ee2

Please sign in to comment.