@reearth/core 0.0.7-alpha.0 → 0.0.7-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +34320 -34354
- package/dist/core.umd.cjs +3868 -3826
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +217 -212
- package/package.json +8 -8
- package/src/Map/ClusteredLayers/index.tsx +2 -2
- package/src/Map/Layer/index.tsx +3 -3
- package/src/Map/Layers/hooks.ts +10 -0
- package/src/Map/Layers/index.tsx +2 -2
- package/src/Map/Sketch/hooks.ts +52 -72
- package/src/Map/Sketch/index.tsx +2 -24
- package/src/Map/Sketch/preset.ts +2 -0
- package/src/Map/Sketch/types.ts +31 -0
- package/src/Map/hooks.ts +0 -4
- package/src/Map/index.tsx +8 -5
- package/src/Map/ref.ts +4 -7
- package/src/Map/types/index.ts +34 -216
- package/src/Map/types/viewerProperty.ts +215 -0
- package/src/Map/useTimelineManager.ts +5 -3
- package/src/Map/utils.ts +1 -43
- package/src/Visualizer/coreContext.tsx +1 -8
- package/src/Visualizer/hooks.ts +20 -77
- package/src/Visualizer/index.stories.tsx +4 -48
- package/src/Visualizer/index.tsx +8 -6
- package/src/Visualizer/useCoreAPI.ts +30 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.tsx +10 -9
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +8 -6
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +2 -2
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +12 -11
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/index.tsx +4 -4
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
- package/src/engines/Cesium/Feature/index.tsx +5 -4
- package/src/engines/Cesium/Feature/utils.tsx +3 -2
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
- package/src/engines/Cesium/core/Globe.tsx +36 -68
- package/src/engines/Cesium/core/Imagery.test.ts +9 -9
- package/src/engines/Cesium/core/Imagery.tsx +17 -19
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +8 -8
- package/src/engines/Cesium/hooks/useCamera.ts +135 -0
- package/src/engines/Cesium/{cameraLimiter.ts → hooks/useCameraLimiter.ts} +22 -45
- package/src/engines/Cesium/{useEngineRef.test.tsx → hooks/useEngineRef.test.tsx} +38 -34
- package/src/engines/Cesium/{useEngineRef.ts → hooks/useEngineRef.ts} +43 -41
- package/src/engines/Cesium/hooks/useExplicitRender.ts +65 -0
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +77 -0
- package/src/engines/Cesium/{VertexTerrainElevationMaterial.ts → hooks/useOverrideGlobeShader/VertexTerrainElevationMaterial.ts} +3 -2
- package/src/engines/Cesium/{useOverrideGlobeShader.ts → hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts} +20 -17
- package/src/engines/Cesium/hooks/useViewerProperty.ts +90 -0
- package/src/engines/Cesium/hooks.ts +129 -366
- package/src/engines/Cesium/index.stories.tsx +1 -1
- package/src/engines/Cesium/index.tsx +60 -62
- package/src/engines/index.ts +1 -1
- package/src/mantle/atoms/compute.ts +5 -1
- package/src/mantle/compat/types.ts +7 -7
- package/src/mantle/data/geojson.ts +53 -22
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +0 -1
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/cesium/Widgets/lighter.css +0 -237
- package/dist/cesium/Widgets/lighterShared.css +0 -46
- package/dist/cesium/Widgets/shared.css +0 -103
- package/dist/cesium/Widgets/widgets.css +0 -1346
- package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
- package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
- package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
- package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
- package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
- package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
- package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
- package/dist/cesium/Workers/combineGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createGeometry.js +0 -26
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/cesium/Workers/createWallGeometry.js +0 -26
- package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/decodeDraco.js +0 -26
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/cesium/Workers/decodeI3S.js +0 -26
- package/dist/cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
- /package/src/engines/Cesium/{JapanSeaLevelEllipsoid.ts → hooks/useOverrideGlobeShader/JapanSeaLevelEllipsoid.ts} +0 -0
- /package/src/engines/Cesium/{vertexTerrainElevationMaterial.glsl → hooks/useOverrideGlobeShader/vertexTerrainElevationMaterial.glsl} +0 -0
package/src/Visualizer/hooks.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { clone } from "lodash-es";
|
|
2
1
|
import { Ref, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
3
2
|
|
|
4
3
|
import type { ComputedFeature, Feature, LatLng, SelectedFeatureInfo } from "../mantle";
|
|
@@ -7,7 +6,6 @@ import type {
|
|
|
7
6
|
LayerSelectionReason,
|
|
8
7
|
Camera,
|
|
9
8
|
ComputedLayer,
|
|
10
|
-
SceneProperty,
|
|
11
9
|
LayerEditEvent,
|
|
12
10
|
CursorType,
|
|
13
11
|
LayerVisibilityEvent,
|
|
@@ -15,21 +13,22 @@ import type {
|
|
|
15
13
|
LayerSelectWithRectStart,
|
|
16
14
|
LayerSelectWithRectMove,
|
|
17
15
|
LayerSelectWithRectEnd,
|
|
16
|
+
ViewerProperty,
|
|
18
17
|
} from "../Map";
|
|
19
|
-
import { useOverriddenProperty } from "../Map";
|
|
20
18
|
import { SketchEventCallback, SketchEventProps, SketchType } from "../Map/Sketch/types";
|
|
21
19
|
import { TimelineManagerRef } from "../Map/useTimelineManager";
|
|
22
20
|
|
|
23
21
|
import type { InteractionModeType } from "./interactionMode";
|
|
24
22
|
import { INTERACTION_MODES } from "./interactionMode";
|
|
23
|
+
import useCoreAPI from "./useCoreAPI";
|
|
25
24
|
import useViewport from "./useViewport";
|
|
26
25
|
|
|
27
26
|
export default function useHooks(
|
|
28
27
|
{
|
|
29
28
|
camera: initialCamera,
|
|
30
29
|
interactionMode: initialInteractionMode,
|
|
31
|
-
sceneProperty,
|
|
32
30
|
zoomedLayerId,
|
|
31
|
+
viewerProperty,
|
|
33
32
|
onLayerSelect,
|
|
34
33
|
onCameraChange,
|
|
35
34
|
onInteractionModeChange,
|
|
@@ -39,8 +38,8 @@ export default function useHooks(
|
|
|
39
38
|
}: {
|
|
40
39
|
camera?: Camera;
|
|
41
40
|
interactionMode?: InteractionModeType;
|
|
42
|
-
sceneProperty?: SceneProperty;
|
|
43
41
|
zoomedLayerId?: string;
|
|
42
|
+
viewerProperty?: ViewerProperty;
|
|
44
43
|
onLayerSelect?: (
|
|
45
44
|
layerId: string | undefined,
|
|
46
45
|
layer: (() => Promise<ComputedLayer | undefined>) | undefined,
|
|
@@ -83,12 +82,24 @@ export default function useHooks(
|
|
|
83
82
|
reason: LayerSelectionReason | undefined,
|
|
84
83
|
info: SelectedFeatureInfo | undefined,
|
|
85
84
|
) => {
|
|
86
|
-
|
|
85
|
+
const isSketchLayer =
|
|
86
|
+
selectedLayer.layer?.layer.type === "simple" &&
|
|
87
|
+
selectedLayer.layer?.layer?.data?.isSketchLayer;
|
|
88
|
+
// Sketch layer feature has a fixed featureId, we need to exclude it from the skip condition
|
|
89
|
+
if (
|
|
90
|
+
selectedLayer.layerId === layerId &&
|
|
91
|
+
selectedLayer.featureId === featureId &&
|
|
92
|
+
!isSketchLayer
|
|
93
|
+
)
|
|
94
|
+
return;
|
|
87
95
|
|
|
88
96
|
const computedLayer = await layer?.();
|
|
89
97
|
const computedFeature =
|
|
90
98
|
layerId && featureId
|
|
91
|
-
?
|
|
99
|
+
? (isSketchLayer
|
|
100
|
+
? computedLayer?.features?.find(f => f.id === featureId)
|
|
101
|
+
: mapRef.current?.engine.findComputedFeatureById?.(layerId, featureId)) ??
|
|
102
|
+
info?.feature
|
|
92
103
|
: undefined;
|
|
93
104
|
|
|
94
105
|
selectFeature(
|
|
@@ -111,70 +122,6 @@ export default function useHooks(
|
|
|
111
122
|
|
|
112
123
|
const timelineManagerRef: TimelineManagerRef = useRef();
|
|
113
124
|
|
|
114
|
-
// scene
|
|
115
|
-
const [overriddenSceneProperty, originalOverrideSceneProperty] =
|
|
116
|
-
useOverriddenProperty(sceneProperty);
|
|
117
|
-
|
|
118
|
-
const overrideSceneProperty = useCallback(
|
|
119
|
-
(pluginId: string, property: SceneProperty) => {
|
|
120
|
-
if (property.timeline) {
|
|
121
|
-
const filteredTimeline = clone(property.timeline);
|
|
122
|
-
delete filteredTimeline.visible;
|
|
123
|
-
if (Object.keys(filteredTimeline).length > 0) {
|
|
124
|
-
if (
|
|
125
|
-
filteredTimeline.current !== undefined ||
|
|
126
|
-
filteredTimeline.start !== undefined ||
|
|
127
|
-
filteredTimeline.stop !== undefined
|
|
128
|
-
) {
|
|
129
|
-
timelineManagerRef?.current?.commit({
|
|
130
|
-
cmd: "SET_TIME",
|
|
131
|
-
payload: {
|
|
132
|
-
start:
|
|
133
|
-
filteredTimeline.start ?? timelineManagerRef?.current?.computedTimeline.start,
|
|
134
|
-
stop: filteredTimeline.stop ?? timelineManagerRef?.current?.computedTimeline.stop,
|
|
135
|
-
current:
|
|
136
|
-
filteredTimeline.current ?? timelineManagerRef?.current?.computedTimeline.current,
|
|
137
|
-
},
|
|
138
|
-
committer: {
|
|
139
|
-
source: "overrideSceneProperty",
|
|
140
|
-
id: pluginId,
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
if (
|
|
145
|
-
filteredTimeline.multiplier !== undefined ||
|
|
146
|
-
filteredTimeline.stepType !== undefined ||
|
|
147
|
-
filteredTimeline.rangeType !== undefined
|
|
148
|
-
) {
|
|
149
|
-
timelineManagerRef?.current?.commit({
|
|
150
|
-
cmd: "SET_OPTIONS",
|
|
151
|
-
payload: {
|
|
152
|
-
stepType: filteredTimeline.stepType,
|
|
153
|
-
multiplier: filteredTimeline.multiplier,
|
|
154
|
-
rangeType: filteredTimeline.rangeType,
|
|
155
|
-
},
|
|
156
|
-
committer: {
|
|
157
|
-
source: "overrideSceneProperty",
|
|
158
|
-
id: pluginId,
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
if (filteredTimeline.animation !== undefined) {
|
|
163
|
-
timelineManagerRef?.current?.commit({
|
|
164
|
-
cmd: filteredTimeline.animation ? "PLAY" : "PAUSE",
|
|
165
|
-
committer: {
|
|
166
|
-
source: "overrideSceneProperty",
|
|
167
|
-
id: pluginId,
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
originalOverrideSceneProperty(pluginId, property);
|
|
174
|
-
},
|
|
175
|
-
[timelineManagerRef, originalOverrideSceneProperty],
|
|
176
|
-
);
|
|
177
|
-
|
|
178
125
|
// camera
|
|
179
126
|
const [camera, changeCamera] = useValue(initialCamera, onCameraChange);
|
|
180
127
|
|
|
@@ -306,8 +253,6 @@ export default function useHooks(
|
|
|
306
253
|
selectedLayer,
|
|
307
254
|
selectedComputedFeature,
|
|
308
255
|
viewport,
|
|
309
|
-
overriddenSceneProperty,
|
|
310
|
-
overrideSceneProperty,
|
|
311
256
|
handleCameraForceHorizontalRollChange,
|
|
312
257
|
handleInteractionModeChange: changeInteractionMode,
|
|
313
258
|
onSketchPluginFeatureCreate,
|
|
@@ -324,8 +269,6 @@ export default function useHooks(
|
|
|
324
269
|
selectedLayer,
|
|
325
270
|
selectedComputedFeature,
|
|
326
271
|
viewport,
|
|
327
|
-
overriddenSceneProperty,
|
|
328
|
-
overrideSceneProperty,
|
|
329
272
|
changeInteractionMode,
|
|
330
273
|
handleCameraForceHorizontalRollChange,
|
|
331
274
|
onLayerEdit,
|
|
@@ -349,20 +292,20 @@ export default function useHooks(
|
|
|
349
292
|
[],
|
|
350
293
|
);
|
|
351
294
|
|
|
295
|
+
useCoreAPI({ viewerProperty });
|
|
296
|
+
|
|
352
297
|
return {
|
|
353
298
|
mapRef,
|
|
354
299
|
wrapperRef,
|
|
355
300
|
selectedFeature,
|
|
356
301
|
camera,
|
|
357
302
|
featureFlags,
|
|
358
|
-
overriddenSceneProperty,
|
|
359
303
|
isLayerDragging,
|
|
360
304
|
timelineManagerRef,
|
|
361
305
|
cursor,
|
|
362
306
|
cameraForceHorizontalRoll,
|
|
363
307
|
coreContextValue,
|
|
364
308
|
containerStyle,
|
|
365
|
-
overrideSceneProperty,
|
|
366
309
|
handleLayerSelect,
|
|
367
310
|
handleLayerDrag,
|
|
368
311
|
handleLayerDrop,
|
|
@@ -15,11 +15,11 @@ export const Cesium: Story = {
|
|
|
15
15
|
args: {
|
|
16
16
|
ready: true,
|
|
17
17
|
engine: "cesium",
|
|
18
|
-
|
|
18
|
+
viewerProperty: {
|
|
19
19
|
tiles: [
|
|
20
20
|
{
|
|
21
21
|
id: "default",
|
|
22
|
-
|
|
22
|
+
type: "default",
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
},
|
|
@@ -72,57 +72,13 @@ export const API: Story = {
|
|
|
72
72
|
args: {
|
|
73
73
|
ready: true,
|
|
74
74
|
engine: "cesium",
|
|
75
|
-
|
|
75
|
+
viewerProperty: {
|
|
76
76
|
tiles: [
|
|
77
77
|
{
|
|
78
78
|
id: "default",
|
|
79
|
-
|
|
79
|
+
type: "default",
|
|
80
80
|
},
|
|
81
81
|
],
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
84
|
};
|
|
85
|
-
|
|
86
|
-
export const Plugin = {
|
|
87
|
-
args: {
|
|
88
|
-
ready: true,
|
|
89
|
-
engine: "cesium",
|
|
90
|
-
sceneProperty: {
|
|
91
|
-
tiles: [
|
|
92
|
-
{
|
|
93
|
-
id: "default",
|
|
94
|
-
tile_type: "default",
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
widgetAlignSystem: {
|
|
99
|
-
outer: {
|
|
100
|
-
left: {
|
|
101
|
-
top: {
|
|
102
|
-
align: "start",
|
|
103
|
-
widgets: [
|
|
104
|
-
{
|
|
105
|
-
id: "plugin",
|
|
106
|
-
pluginId: "plugin",
|
|
107
|
-
extensionId: "test",
|
|
108
|
-
...({
|
|
109
|
-
__REEARTH_SOURCECODE: `reearth.layers.add(${JSON.stringify({
|
|
110
|
-
id: "l",
|
|
111
|
-
type: "simple",
|
|
112
|
-
data: {
|
|
113
|
-
type: "geojson",
|
|
114
|
-
value: { type: "Feature", geometry: { type: "Point", coordinates: [0, 0] } },
|
|
115
|
-
},
|
|
116
|
-
marker: {
|
|
117
|
-
imageColor: "#fff",
|
|
118
|
-
},
|
|
119
|
-
})});`,
|
|
120
|
-
} as any),
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
package/src/Visualizer/index.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { ComputedFeature } from "../mantle";
|
|
|
5
5
|
import {
|
|
6
6
|
Map,
|
|
7
7
|
type MapRef,
|
|
8
|
-
type
|
|
8
|
+
type ViewerProperty,
|
|
9
9
|
type Layer,
|
|
10
10
|
type LayerSelectionReason,
|
|
11
11
|
type Camera,
|
|
@@ -33,9 +33,10 @@ export type CoreVisualizerProps = {
|
|
|
33
33
|
engine?: EngineType;
|
|
34
34
|
isBuilt?: boolean;
|
|
35
35
|
isEditable?: boolean;
|
|
36
|
-
|
|
36
|
+
viewerProperty?: ViewerProperty;
|
|
37
37
|
layers?: Layer[];
|
|
38
38
|
clusters?: Cluster[]; // TODO: remove completely from beta core
|
|
39
|
+
time?: string | Date;
|
|
39
40
|
camera?: Camera;
|
|
40
41
|
interactionMode?: InteractionModeType;
|
|
41
42
|
shouldRender?: boolean;
|
|
@@ -67,13 +68,14 @@ export const CoreVisualizer = memo(
|
|
|
67
68
|
engine,
|
|
68
69
|
isBuilt,
|
|
69
70
|
isEditable,
|
|
70
|
-
|
|
71
|
+
viewerProperty,
|
|
71
72
|
layers,
|
|
72
73
|
clusters,
|
|
73
74
|
small,
|
|
74
75
|
ready,
|
|
75
76
|
hiddenLayers,
|
|
76
77
|
camera: initialCamera,
|
|
78
|
+
time,
|
|
77
79
|
interactionMode,
|
|
78
80
|
shouldRender,
|
|
79
81
|
meta,
|
|
@@ -97,7 +99,6 @@ export const CoreVisualizer = memo(
|
|
|
97
99
|
selectedFeature,
|
|
98
100
|
camera,
|
|
99
101
|
featureFlags,
|
|
100
|
-
overriddenSceneProperty,
|
|
101
102
|
isLayerDragging,
|
|
102
103
|
timelineManagerRef,
|
|
103
104
|
cursor,
|
|
@@ -121,8 +122,8 @@ export const CoreVisualizer = memo(
|
|
|
121
122
|
{
|
|
122
123
|
camera: initialCamera,
|
|
123
124
|
interactionMode,
|
|
124
|
-
sceneProperty,
|
|
125
125
|
zoomedLayerId,
|
|
126
|
+
viewerProperty,
|
|
126
127
|
onLayerSelect,
|
|
127
128
|
onCameraChange,
|
|
128
129
|
onZoomToLayer,
|
|
@@ -154,7 +155,8 @@ export const CoreVisualizer = memo(
|
|
|
154
155
|
style={style}
|
|
155
156
|
featureFlags={featureFlags}
|
|
156
157
|
shouldRender={shouldRender}
|
|
157
|
-
property={
|
|
158
|
+
property={viewerProperty}
|
|
159
|
+
time={time}
|
|
158
160
|
small={small}
|
|
159
161
|
ready={ready}
|
|
160
162
|
timelineManagerRef={timelineManagerRef}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
import { version } from "../../package.json";
|
|
4
|
+
import { ViewerProperty } from "../engines";
|
|
5
|
+
|
|
6
|
+
interface CoreAPI {
|
|
7
|
+
readonly version: string;
|
|
8
|
+
readonly viewerProperty?: ViewerProperty;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default ({ viewerProperty }: { viewerProperty?: ViewerProperty }) => {
|
|
12
|
+
const viewerPropertyRef = useRef(viewerProperty);
|
|
13
|
+
viewerPropertyRef.current = viewerProperty;
|
|
14
|
+
|
|
15
|
+
const coreAPI: CoreAPI = useMemo(
|
|
16
|
+
() => ({
|
|
17
|
+
get version() {
|
|
18
|
+
return version;
|
|
19
|
+
},
|
|
20
|
+
get viewerProperty() {
|
|
21
|
+
return viewerPropertyRef.current;
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
[],
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
(window as any).reearth_core = coreAPI;
|
|
29
|
+
}, [coreAPI]);
|
|
30
|
+
};
|
|
@@ -39,7 +39,7 @@ export default function Model({
|
|
|
39
39
|
id,
|
|
40
40
|
isVisible,
|
|
41
41
|
property,
|
|
42
|
-
|
|
42
|
+
viewerProperty,
|
|
43
43
|
geometry,
|
|
44
44
|
layer,
|
|
45
45
|
feature,
|
|
@@ -120,18 +120,19 @@ export default function Model({
|
|
|
120
120
|
if (
|
|
121
121
|
!property?.specularEnvironmentMaps &&
|
|
122
122
|
!property?.sphericalHarmonicCoefficients &&
|
|
123
|
-
!
|
|
124
|
-
!
|
|
123
|
+
!viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps &&
|
|
124
|
+
!viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients
|
|
125
125
|
)
|
|
126
126
|
return ibl;
|
|
127
127
|
|
|
128
128
|
const specularEnvironmentMaps =
|
|
129
|
-
property?.specularEnvironmentMaps ??
|
|
129
|
+
property?.specularEnvironmentMaps ??
|
|
130
|
+
viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps;
|
|
130
131
|
const imageBasedLightIntensity =
|
|
131
|
-
property?.imageBasedLightIntensity ??
|
|
132
|
+
property?.imageBasedLightIntensity ?? viewerProperty?.scene?.imageBasedLighting?.intensity;
|
|
132
133
|
const sphericalHarmonicCoefficients = arrayToCartecian3(
|
|
133
134
|
property?.sphericalHarmonicCoefficients ??
|
|
134
|
-
|
|
135
|
+
viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients,
|
|
135
136
|
imageBasedLightIntensity,
|
|
136
137
|
);
|
|
137
138
|
|
|
@@ -146,9 +147,9 @@ export default function Model({
|
|
|
146
147
|
property?.specularEnvironmentMaps,
|
|
147
148
|
property?.sphericalHarmonicCoefficients,
|
|
148
149
|
property?.imageBasedLightIntensity,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps,
|
|
151
|
+
viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients,
|
|
152
|
+
viewerProperty?.scene?.imageBasedLighting?.intensity,
|
|
152
153
|
]);
|
|
153
154
|
|
|
154
155
|
const { viewer } = useCesium();
|
|
@@ -58,7 +58,7 @@ Basic.args = {
|
|
|
58
58
|
tiles: [
|
|
59
59
|
{
|
|
60
60
|
id: "default",
|
|
61
|
-
|
|
61
|
+
type: "default",
|
|
62
62
|
},
|
|
63
63
|
],
|
|
64
64
|
},
|
|
@@ -113,7 +113,7 @@ Excluded.args = {
|
|
|
113
113
|
tiles: [
|
|
114
114
|
{
|
|
115
115
|
id: "default",
|
|
116
|
-
|
|
116
|
+
type: "default",
|
|
117
117
|
},
|
|
118
118
|
],
|
|
119
119
|
},
|
|
@@ -162,13 +162,15 @@ ClampToGround.args = {
|
|
|
162
162
|
tiles: [
|
|
163
163
|
{
|
|
164
164
|
id: "default",
|
|
165
|
-
|
|
165
|
+
type: "default",
|
|
166
166
|
},
|
|
167
167
|
],
|
|
168
|
-
|
|
169
|
-
terrain: true,
|
|
170
|
-
terrainType: "cesium",
|
|
168
|
+
globe: {
|
|
171
169
|
depthTestAgainstTerrain: true,
|
|
172
170
|
},
|
|
171
|
+
terrain: {
|
|
172
|
+
enabled: true,
|
|
173
|
+
type: "cesium",
|
|
174
|
+
},
|
|
173
175
|
},
|
|
174
176
|
};
|
|
@@ -35,7 +35,7 @@ WMS.args = {
|
|
|
35
35
|
tiles: [
|
|
36
36
|
{
|
|
37
37
|
id: "default",
|
|
38
|
-
|
|
38
|
+
type: "default",
|
|
39
39
|
},
|
|
40
40
|
],
|
|
41
41
|
},
|
|
@@ -70,7 +70,7 @@ MVT.args = {
|
|
|
70
70
|
tiles: [
|
|
71
71
|
{
|
|
72
72
|
id: "default",
|
|
73
|
-
|
|
73
|
+
type: "default",
|
|
74
74
|
},
|
|
75
75
|
],
|
|
76
76
|
},
|
|
@@ -32,7 +32,7 @@ import type {
|
|
|
32
32
|
ComputedLayer,
|
|
33
33
|
Feature,
|
|
34
34
|
EvalFeature,
|
|
35
|
-
|
|
35
|
+
ViewerProperty,
|
|
36
36
|
Cesium3DTilesAppearance,
|
|
37
37
|
} from "../../..";
|
|
38
38
|
import { useRefValue } from "../../../../hooks";
|
|
@@ -429,7 +429,7 @@ export const useHooks = ({
|
|
|
429
429
|
boxId,
|
|
430
430
|
isVisible,
|
|
431
431
|
property,
|
|
432
|
-
|
|
432
|
+
viewerProperty,
|
|
433
433
|
layer,
|
|
434
434
|
meta,
|
|
435
435
|
evalFeature,
|
|
@@ -440,7 +440,7 @@ export const useHooks = ({
|
|
|
440
440
|
boxId: string;
|
|
441
441
|
isVisible?: boolean;
|
|
442
442
|
property?: Property;
|
|
443
|
-
|
|
443
|
+
viewerProperty?: ViewerProperty;
|
|
444
444
|
layer?: ComputedLayer;
|
|
445
445
|
feature?: ComputedFeature;
|
|
446
446
|
meta?: Record<string, unknown>;
|
|
@@ -738,19 +738,20 @@ export const useHooks = ({
|
|
|
738
738
|
if (
|
|
739
739
|
!property?.specularEnvironmentMaps &&
|
|
740
740
|
!property?.sphericalHarmonicCoefficients &&
|
|
741
|
-
!
|
|
742
|
-
!
|
|
741
|
+
!viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps &&
|
|
742
|
+
!viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients
|
|
743
743
|
)
|
|
744
744
|
return;
|
|
745
745
|
|
|
746
746
|
const ibl = new ImageBasedLighting();
|
|
747
747
|
const specularEnvironmentMaps =
|
|
748
|
-
property?.specularEnvironmentMaps ??
|
|
748
|
+
property?.specularEnvironmentMaps ??
|
|
749
|
+
viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps;
|
|
749
750
|
const imageBasedLightIntensity =
|
|
750
|
-
property?.imageBasedLightIntensity ??
|
|
751
|
+
property?.imageBasedLightIntensity ?? viewerProperty?.scene?.imageBasedLighting?.intensity;
|
|
751
752
|
const sphericalHarmonicCoefficients = arrayToCartecian3(
|
|
752
753
|
property?.sphericalHarmonicCoefficients ??
|
|
753
|
-
|
|
754
|
+
viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients,
|
|
754
755
|
imageBasedLightIntensity,
|
|
755
756
|
);
|
|
756
757
|
|
|
@@ -765,9 +766,9 @@ export const useHooks = ({
|
|
|
765
766
|
property?.specularEnvironmentMaps,
|
|
766
767
|
property?.sphericalHarmonicCoefficients,
|
|
767
768
|
property?.imageBasedLightIntensity,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
769
|
+
viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps,
|
|
770
|
+
viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients,
|
|
771
|
+
viewerProperty?.scene?.imageBasedLighting?.intensity,
|
|
771
772
|
]);
|
|
772
773
|
|
|
773
774
|
const handleReady = useCallback(
|
|
@@ -26,7 +26,7 @@ function Tileset({
|
|
|
26
26
|
property,
|
|
27
27
|
layer,
|
|
28
28
|
feature,
|
|
29
|
-
|
|
29
|
+
viewerProperty,
|
|
30
30
|
meta,
|
|
31
31
|
evalFeature,
|
|
32
32
|
onComputedFeatureFetch,
|
|
@@ -53,7 +53,7 @@ function Tileset({
|
|
|
53
53
|
layer,
|
|
54
54
|
feature,
|
|
55
55
|
property,
|
|
56
|
-
|
|
56
|
+
viewerProperty,
|
|
57
57
|
meta,
|
|
58
58
|
evalFeature,
|
|
59
59
|
onComputedFeatureFetch,
|
|
@@ -95,7 +95,7 @@ function Tileset({
|
|
|
95
95
|
<Box
|
|
96
96
|
{...props}
|
|
97
97
|
id={boxId}
|
|
98
|
-
|
|
98
|
+
viewerProperty={viewerProperty}
|
|
99
99
|
property={boxProperty as any}
|
|
100
100
|
geometry={builtinBoxProps.geometry}
|
|
101
101
|
feature={feature}
|
|
@@ -117,7 +117,7 @@ export default memo(
|
|
|
117
117
|
prev.isVisible === next.isVisible &&
|
|
118
118
|
prev.property === next.property &&
|
|
119
119
|
prev.layer?.layer === next.layer?.layer &&
|
|
120
|
-
prev.
|
|
120
|
+
prev.viewerProperty === next.viewerProperty &&
|
|
121
121
|
prev.meta === next.meta &&
|
|
122
122
|
prev.evalFeature === next.evalFeature &&
|
|
123
123
|
prev.onComputedFeatureFetch === next.onComputedFeatureFetch &&
|
|
@@ -411,7 +411,16 @@ export const useClippingBox = ({
|
|
|
411
411
|
eventHandler.setInputAction(handleMouseUp, ScreenSpaceEventType.LEFT_UP);
|
|
412
412
|
}, [eventHandler, handleMouseDown, handleRawMouseMove, handleMouseUp]);
|
|
413
413
|
|
|
414
|
-
useEffect(
|
|
414
|
+
useEffect(
|
|
415
|
+
() => () => {
|
|
416
|
+
requestAnimationFrame(() => {
|
|
417
|
+
if (!eventHandler.isDestroyed()) {
|
|
418
|
+
eventHandler.destroy();
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
[eventHandler],
|
|
423
|
+
);
|
|
415
424
|
|
|
416
425
|
const boxProperty = useMemo(
|
|
417
426
|
() => ({ ...boxState, ...dimensions, allowEnterGround }),
|
|
@@ -127,8 +127,9 @@ export default function Feature({
|
|
|
127
127
|
if (!isRenderableAppearance(k)) return null;
|
|
128
128
|
|
|
129
129
|
const useSceneSphericalHarmonicCoefficients =
|
|
130
|
-
!!props.
|
|
131
|
-
const useSceneSpecularEnvironmentMaps =
|
|
130
|
+
!!props.viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients;
|
|
131
|
+
const useSceneSpecularEnvironmentMaps =
|
|
132
|
+
!!props.viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps;
|
|
132
133
|
|
|
133
134
|
const isVisible = layer.layer.visible !== false && !isHidden;
|
|
134
135
|
|
|
@@ -205,9 +206,9 @@ export default function Feature({
|
|
|
205
206
|
const isVisible = layer.layer.visible !== false && !isHidden;
|
|
206
207
|
// NOTE: IBL for 3dtiles is not updated unless Tileset feature component is re-created.
|
|
207
208
|
const useSceneSphericalHarmonicCoefficients =
|
|
208
|
-
!!props.
|
|
209
|
+
!!props.viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients;
|
|
209
210
|
const useSceneSpecularEnvironmentMaps =
|
|
210
|
-
!!props.
|
|
211
|
+
!!props.viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps;
|
|
211
212
|
const use3dtilesSphericalHarmonicCoefficients =
|
|
212
213
|
layer?.layer?.type === "simple" &&
|
|
213
214
|
!!layer?.layer?.["3dtiles"]?.sphericalHarmonicCoefficients;
|
|
@@ -35,7 +35,7 @@ import type {
|
|
|
35
35
|
ComputedLayer,
|
|
36
36
|
FeatureComponentProps,
|
|
37
37
|
Geometry,
|
|
38
|
-
|
|
38
|
+
ViewerProperty,
|
|
39
39
|
} from "../..";
|
|
40
40
|
import { Data, Layer, LayerSimple, TimeInterval } from "../../../mantle";
|
|
41
41
|
import { FeatureIndex } from "../FeatureIndex";
|
|
@@ -48,7 +48,7 @@ export type FeatureProps<P = any> = {
|
|
|
48
48
|
layer?: ComputedLayer;
|
|
49
49
|
feature?: ComputedFeature;
|
|
50
50
|
geometry?: Geometry;
|
|
51
|
-
|
|
51
|
+
viewerProperty?: ViewerProperty;
|
|
52
52
|
} & Omit<FeatureComponentProps, "layer">;
|
|
53
53
|
|
|
54
54
|
export type FeatureComponent = ComponentType<FeatureProps>;
|
|
@@ -105,6 +105,7 @@ function EntityExtComponent(
|
|
|
105
105
|
props.id,
|
|
106
106
|
unselectable,
|
|
107
107
|
hideIndicator,
|
|
108
|
+
r.current?.cesiumElement,
|
|
108
109
|
]);
|
|
109
110
|
|
|
110
111
|
return <Entity ref={composeRefs(ref, r)} {...props} />;
|