Skip to content

Commit

Permalink
fix layer is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Feb 27, 2024
1 parent 6284b4d commit a7b112e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/viewer/components/Layers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ function Layer({ node }) {
const icon = layer && layer.isVisible ? 'fas fa-eye' : 'fas fa-eye-slash';

const updateVisibility = () => {
map.setLayoutProperty(node.data.id, 'visibility', layer.isVisible ? 'none' : 'visible');
if (layer) {
map.setLayoutProperty(node.data.id, 'visibility', layer.isVisible ? 'none' : 'visible');
}
}

const legend = useMemo(() => {
Expand Down

0 comments on commit a7b112e

Please sign in to comment.