why the line layer does not shown as invisible or deck? #240
Replies: 3 comments 2 replies
-
I only get a "Unable to access this workspace" message when I try to visit the codesandbox, and without that it's impossible to tell what is happening there. |
Beta Was this translation helpful? Give feedback.
-
sorry, codesandbox changed. I do not know how to fix that. I put it into stackblitz. here is the link. please try this. if it does not work, please let me know. Really appreciate your help. https://stackblitz.com/~/github.com/qiaoxin136/testgooglemaps |
Beta Was this translation helpful? Give feedback.
-
There was a missing effect cleanup function, so we were likely looking at an older version of the overlay that was never removed... const DeckGlOverlay = ({ layers }: DeckglOverlayProps) => {
const deck = useMemo(() => new GoogleMapsOverlay({ interleaved: true }), []);
const map = useMap();
useEffect(() => {
deck.setMap(map);
// this was missing:
return () => deck.setMap(null);
}, [deck, map]);
useEffect(() => {
deck.setProps({ layers });
}, [deck, layers]);
return null;
}; |
Beta Was this translation helpful? Give feedback.
-
I follow the example using GoogleMapsOverlay, i set up a checkbox to turn on and off the line layer. please the codesandbox,
https://codesandbox.io/p/github/qiaoxin136/testgooglemaps/main?file=%2Fsrc%2FApp.tsx&workspaceId=d68df01c-f46f-497c-bfee-4134267b36a9
i console out the deck, when i change the checkbox from "off" to "on" to "off", the consoled out deck is shown as "false", "true", "false", but the line layer, shown as "invisible", "visible", "visible". I need your help to understand why i can not turn on/off the line layer as i desired.
see the pic below,
Beta Was this translation helpful? Give feedback.
All reactions