-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Map component to remove numerous useEffect Main motivation is to fix wrong view state computed when first rendering is done with hidden flag. First reproduced by application with tabbed layout where all the tabs are rendered using hidden flag. This use case has been added to the storybook to demonstrate the issue, along with a 'triggerHome' control (in a previous PR). The current PR brings: - onResize() function to handle resizing - use a React reducer to handle Z scaling Add support for PageUp/PageDown and Shift modifier - use a React reducer to compute the global 3D bounding box from the reportBoundingBox callback of the layers - introduce a ViewController class to generate the DeckGL views and viewState This brings all the computations in one place/one step by providing state change allowing to fine-tune the computations - use bounding box from the 'cameraPosition' (if set as zoom field) instead of the data bounding box Fixes: - initial viewState is correct, even when rendered with 'hidden' flag set to true - triggerHome now respects current zScale In the end, the final implementation drops down to 6 React useEffect, from the 16 initial ones ! Fix for #1820
- Loading branch information
Showing
9 changed files
with
1,011 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.