-
Notifications
You must be signed in to change notification settings - Fork 22
Deck gl package upgrade #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…gonLayer import path
…or custom color and hight profile
…Layer and MlScenegraphLayer components
Moving Deckglcontext in MapContextDecorator.tsx
| tile3dLayer && deckGlHook.removeLayer(tile3dLayer); | ||
| initializedRef.current = false; | ||
| }; | ||
| }, [mapHook.map]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tile3dLayer is missing in the dependency array. This will prevent the Layer from being updated if props change.
| const mapHook = useMap({ mapId: mapId }); | ||
| const deckGlHook = useDeckGl(); | ||
|
|
||
| const initializedRef = useRef(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializedRef can be removed. In general this (initializedRef) pattern should be avoided if possible.
| ]); | ||
|
|
||
| useEffect(() => { | ||
| if (!mapHook.map || initializedRef.current) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave if tile3dLayer is null.
| waitForLayer: HexagonLayerProps.beforeId, | ||
| }); | ||
|
|
||
| const initializedRef = useRef(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove initializedRef.
| data: station_features, | ||
| getPosition: (d: any) => d.geometry.coordinates, | ||
| getOrientation: (d: any) => [0, d.properties.rotation, 90], | ||
| scenegraph: '/assets/3D/train.glb', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need attribution (author, source, license) for the 3D models in the storybook demo.
| } | ||
|
|
||
| const MlScenegraphLayer = (props: MlScenegraphLayerProps) => { | ||
| const initializedRef = useRef(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove initializedRef.
| scenegraphLayer && deckGlHook.removeLayer(scenegraphLayer); | ||
| initializedRef.current = false; | ||
| }; | ||
| }, [mapHook.map]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scenegraphLayer is missing in the dependency array.
No description provided.