Skip to content
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

feat: map refactoring #1837

Merged
merged 8 commits into from
Dec 18, 2023
Merged

feat: map refactoring #1837

merged 8 commits into from
Dec 18, 2023

Commits on Dec 15, 2023

  1. 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 !
    w1nklr committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    9ac4cce View commit details
    Browse the repository at this point in the history
  2. Fix triggerHome, fix prettier and compilation

    Update story
    w1nklr committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    da2c97a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5d5aa6e View commit details
    Browse the repository at this point in the history
  4. Fix lint

    w1nklr committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    d7c90d9 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. Fix compilation

    w1nklr committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    b9a997e View commit details
    Browse the repository at this point in the history
  2. Fix eol

    w1nklr committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    4f3308e View commit details
    Browse the repository at this point in the history
  3. Fix test snapshots

    w1nklr committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    d631f95 View commit details
    Browse the repository at this point in the history
  4. Fix Map tests (both crash and snapshots).

    Add script to debug jest tests
    w1nklr committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    bf38d52 View commit details
    Browse the repository at this point in the history