Skip to content

Conversation

@JannikBrack
Copy link
Collaborator

No description provided.

@JannikBrack JannikBrack requested a review from cioddi January 13, 2026 13:34
tile3dLayer && deckGlHook.removeLayer(tile3dLayer);
initializedRef.current = false;
};
}, [mapHook.map]);
Copy link
Member

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);
Copy link
Member

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;
Copy link
Member

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);
Copy link
Member

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',
Copy link
Member

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);
Copy link
Member

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]);
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants