Skip to content

refactor: viewerProperty#19

Merged
airslice merged 25 commits into
alphafrom
refactor/scene-properties
Jun 24, 2024
Merged

refactor: viewerProperty#19
airslice merged 25 commits into
alphafrom
refactor/scene-properties

Conversation

@airslice

@airslice airslice commented Jun 3, 2024

Copy link
Copy Markdown
Contributor

Overview

This PR refactors the interface of viewerProperty (it was called sceneProperty).

ViewerProperty keeps the original idea as enable core user to config the map through props.
At the same time core context still provide the override function and overridden property.

New ViewerProperty is re-organized with these ideas:

  • Re-group with clearfied scopes.
  • Consistent naming convertions.
  • Simplify complex types.

This PR has some other refactor as well:

  • Override & overridden of scene property is removed.
  • Split some hooks for Cesium.
  • Expose a simple reearth_core to window, which contains a version and a property property to help developers check current running core version and setted viewer properties.

Breaking Changes

  • CoreVisualizer
    • Property sceneProperty is removed. Please use new viewerProperty instead.
    • Added one new property time.
  • CoreContext
    • Property overriddenSceneProperty is removed. Please use new overriddenViewerProperty instead.
    • Function overrideSceneProperty is removed. Please use new overrideViewerProperty instead.
  • ViewerProperty
    • Interface is different with the sceneProperty. Please refer the new structure.
    • timeline is removed. Please use CoreVisualizer's time to set the time, and use timelineManagerRef from visualizerRef to handle all the updates.

Todo

I didn't remove camera from viewerProperty but i think maybe we should do that as well.

@airslice airslice marked this pull request as ready for review June 7, 2024 09:41
Comment thread src/Map/types/viewerProperty.ts
Comment thread src/Map/types/viewerProperty.ts
Comment thread src/engines/Cesium/hooks/useCamera.ts Outdated
Comment thread src/engines/Cesium/hooks/useLayerDragDrop.ts
Comment thread src/engines/Cesium/hooks/useSceneEvent.ts Outdated
Comment thread src/engines/Cesium/hooks/useViewerProperty.ts
Comment thread src/engines/Cesium/index.tsx Outdated
@airslice airslice merged commit b1d585b into alpha Jun 24, 2024
@airslice airslice deleted the refactor/scene-properties branch June 24, 2024 00:56
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.

2 participants