@@ -40,38 +40,31 @@ const defaultProps = {
4040const MlHexagonLayer = ( props : MlHexagonMapProps ) => {
4141 const deckGlHook = useDeckGl ( ) ;
4242
43- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
44- // @ts -expect-error
45- props = {
46- ...defaultProps ,
47- ...props ,
48- } ;
49-
50- const { mapId, ...HexagonLayerProps } = props ;
51-
5243 const mapHook = useMap ( {
53- mapId : mapId ,
54- waitForLayer : HexagonLayerProps . beforeId ,
44+ mapId : props . mapId ,
45+ waitForLayer : props . beforeId ,
5546 } ) ;
5647
5748 // create deck.gl HexagonLayer once when its props change
5849 const hexagonLayer = useMemo ( ( ) => {
50+ const { mapId : _mapId , ...HexagonLayerProps } = props ;
5951 if ( ! HexagonLayerProps . data ) return null ;
6052 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6153 // @ts -ignore
6254 return new HexagonLayer ( {
55+ ...defaultProps ,
6356 ...HexagonLayerProps ,
6457 } as unknown as HexagonLayerProps ) ;
6558 } , [
66- HexagonLayerProps . beforeId ,
67- HexagonLayerProps . data ,
68- HexagonLayerProps . elevationScale ,
69- HexagonLayerProps . extruded ,
70- HexagonLayerProps . coverage ,
71- HexagonLayerProps . autoHighlight ,
72- HexagonLayerProps . material ,
73- HexagonLayerProps . radius ,
74- HexagonLayerProps . transitions ,
59+ props . beforeId ,
60+ props . data ,
61+ props . elevationScale ,
62+ props . extruded ,
63+ props . coverage ,
64+ props . autoHighlight ,
65+ props . material ,
66+ props . radius ,
67+ props . transitions ,
7568 ] ) ;
7669
7770 // add/remove the memoized layer
0 commit comments