Skip to content

Commit

Permalink
fixed layer changing
Browse files Browse the repository at this point in the history
  • Loading branch information
unclFedor committed Nov 22, 2023
1 parent 4c3dccc commit cbe51c7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/arcgis-wrapper/arcgis-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -655,15 +655,11 @@ export const ArcgisWrapper = ({
const mapContainer = useRef<HTMLDivElement | null>(null);
const map = useArcgis(mapContainer, getViewState(), onViewStateChangeHandler);

useEffect(() => {
if (!map) {
return;
}

if (map) {
const layers = renderLayers();
// @ts-expect-error @deck.gl/arcgis has no types
map.deck.set({ layers });
}, [map]);
}

return <StyledMapContainer ref={mapContainer} />;
};
Expand Down

0 comments on commit cbe51c7

Please sign in to comment.