@reearth/core 0.0.7-alpha.6 → 0.0.7-alpha.61
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/LICENSE +177 -0
- package/dist/core.js +70991 -60887
- package/dist/core.umd.cjs +666 -680
- package/dist/{index-DqatWUTw.js → index-CUJ6HGQn.js} +1021 -908
- package/dist/index.d.ts +157 -71
- package/package.json +88 -74
- package/src/Map/ClusteredLayers/index.tsx +1 -1
- package/src/Map/Geoid/index.tsx +68 -0
- package/src/Map/Geoid/types.ts +8 -0
- package/src/Map/Layer/hooks.ts +7 -4
- package/src/Map/Layer/index.tsx +3 -1
- package/src/Map/Layers/hooks.ts +35 -8
- package/src/Map/Layers/index.tsx +13 -2
- package/src/Map/Layers/keys.ts +1 -0
- package/src/Map/Sketch/hooks.ts +454 -411
- package/src/Map/Sketch/index.tsx +68 -21
- package/src/Map/Sketch/sketchMachine.ts +427 -102
- package/src/Map/Sketch/sketchMachine.typegen.ts +58 -1
- package/src/Map/Sketch/types.ts +10 -20
- package/src/Map/Sketch/usePluginSketchLayer.ts +105 -0
- package/src/Map/Sketch/useSketch.ts +558 -0
- package/src/Map/Sketch/useSketchFeature.ts +198 -0
- package/src/Map/SpatialId/constants.ts +21 -0
- package/src/Map/SpatialId/hooks.ts +448 -0
- package/src/Map/SpatialId/index.tsx +63 -0
- package/src/Map/SpatialId/types.ts +68 -0
- package/src/Map/SpatialId/utils.ts +65 -0
- package/src/Map/hooks.ts +54 -8
- package/src/Map/index.tsx +42 -9
- package/src/Map/ref.ts +32 -3
- package/src/Map/types/index.ts +39 -3
- package/src/Map/types/viewerProperty.ts +10 -0
- package/src/Map/useTimelineManager.ts +4 -10
- package/src/Map/utils.ts +1 -1
- package/src/Visualizer/Error.tsx +4 -1
- package/src/Visualizer/context.tsx +5 -5
- package/src/Visualizer/coreContext.tsx +3 -1
- package/src/Visualizer/hooks.ts +56 -22
- package/src/Visualizer/index.stories.tsx +15 -0
- package/src/Visualizer/index.tsx +25 -6
- package/src/Visualizer/useViewport.ts +1 -1
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +4 -4
- package/src/engines/Cesium/Feature/Box/hooks/edge.ts +1 -1
- package/src/engines/Cesium/Feature/Box/hooks/side.ts +1 -1
- package/src/engines/Cesium/Feature/Box/utils.ts +6 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +2 -0
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +1 -1
- package/src/engines/Cesium/Feature/Marker/index.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -2
- package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +2 -2
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +3 -1
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Polygon/index.tsx +6 -4
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Raster/mvt.ts +2 -1
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Resource/index.tsx +1 -27
- package/src/engines/Cesium/Feature/Resource/utils.ts +86 -91
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +136 -71
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Tileset/index.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +2 -2
- package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +2 -2
- package/src/engines/Cesium/Feature/context.ts +1 -0
- package/src/engines/Cesium/Feature/index.tsx +9 -5
- package/src/engines/Cesium/Feature/utils.tsx +20 -12
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +7 -4
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +128 -24
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +70 -25
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +3 -1
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +14 -14
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +7 -4
- package/src/engines/Cesium/Sketch/SurfaceAddingPoints.tsx +60 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +126 -35
- package/src/engines/Cesium/Sketch/constants.ts +5 -0
- package/src/engines/Cesium/Sketch/index.tsx +68 -29
- package/src/engines/Cesium/SpatialId/CoordinateIndicator.tsx +28 -0
- package/src/engines/Cesium/SpatialId/SpatialIdSpace.tsx +33 -0
- package/src/engines/Cesium/SpatialId/VerticalSpaceIndicator.tsx +32 -0
- package/src/engines/Cesium/SpatialId/index.ts +3 -0
- package/src/engines/Cesium/common.ts +55 -18
- package/src/engines/Cesium/core/Clock.tsx +1 -1
- package/src/engines/Cesium/core/Globe/index.tsx +73 -0
- package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +79 -0
- package/src/engines/Cesium/core/Imagery.test.ts +29 -11
- package/src/engines/Cesium/core/Imagery.tsx +22 -6
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +2 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +13 -6
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +2 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +3 -4
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +1 -1
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
- package/src/engines/Cesium/core/presets.ts +24 -28
- package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
- package/src/engines/Cesium/hooks/useCamera.ts +2 -2
- package/src/engines/Cesium/hooks/useCameraLimiter.ts +1 -1
- package/src/engines/Cesium/hooks/useEngineRef.ts +52 -5
- package/src/engines/Cesium/hooks/useExplicitRender.ts +2 -2
- package/src/engines/Cesium/hooks/useInstance.ts +1 -1
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +3 -3
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +2 -2
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +115 -67
- package/src/engines/Cesium/hooks/useViewerProperty.ts +1 -1
- package/src/engines/Cesium/hooks.ts +55 -14
- package/src/engines/Cesium/index.stories.tsx +0 -1
- package/src/engines/Cesium/index.tsx +20 -6
- package/src/engines/Cesium/pickMany.ts +2 -0
- package/src/engines/Cesium/types.ts +1 -1
- package/src/engines/Cesium/utils/mouse.ts +1 -1
- package/src/engines/Cesium/utils/utils.ts +1 -1
- package/src/mantle/atoms/compute.test.ts +4 -4
- package/src/mantle/atoms/compute.ts +8 -4
- package/src/mantle/compat/forward.ts +1 -1
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/data/georss.ts +2 -2
- package/src/mantle/data/gml.ts +2 -2
- package/src/mantle/data/gpx.ts +2 -2
- package/src/mantle/data/shapefile/parseZip.ts +1 -0
- package/src/mantle/evaluator/simple/expression/README.md +392 -0
- package/src/mantle/evaluator/simple/expression/expression.test.ts +137 -0
- package/src/mantle/evaluator/simple/expression/node.ts +10 -12
- package/src/mantle/evaluator/simple/expression/variableReplacer.test.ts +178 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.ts +24 -11
- package/src/mantle/types/appearance.ts +4 -2
- package/src/mantle/types/index.ts +3 -0
- package/src/{Visualizer → shared}/interactionMode.ts +3 -2
- package/src/test/setup.ts +1 -1
- package/src/test/utils.tsx +1 -1
- package/src/types/modules.d.ts +96 -0
- package/src/utils/StringMatcher.ts +1 -1
- package/src/utils/image.ts +2 -12
- package/src/utils/use-delayed-count.ts +1 -1
- package/src/utils/use-dnd/drop.ts +1 -1
- package/src/utils/util.ts +1 -1
- package/src/utils/value.ts +2 -2
- 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-2YD5QWGR.js +0 -28
- package/dist/cesium/Workers/chunk-3T4KR75X.js +0 -26
- package/dist/cesium/Workers/chunk-46KFVW24.js +0 -26
- package/dist/cesium/Workers/chunk-4EI6PP43.js +0 -28
- package/dist/cesium/Workers/chunk-4RS52VIY.js +0 -26
- package/dist/cesium/Workers/chunk-4YLYA3DC.js +0 -26
- package/dist/cesium/Workers/chunk-5ENAGXBI.js +0 -26
- package/dist/cesium/Workers/chunk-5VIB3TI5.js +0 -26
- package/dist/cesium/Workers/chunk-6NGZLDFZ.js +0 -26
- package/dist/cesium/Workers/chunk-6RGNWVZ2.js +0 -27
- package/dist/cesium/Workers/chunk-7AZZVJ52.js +0 -26
- package/dist/cesium/Workers/chunk-AMXAQQEL.js +0 -26
- package/dist/cesium/Workers/chunk-AQW44ZPC.js +0 -26
- package/dist/cesium/Workers/chunk-CPCMDW6Z.js +0 -26
- package/dist/cesium/Workers/chunk-DNL2WDRL.js +0 -26
- package/dist/cesium/Workers/chunk-ERW7V247.js +0 -26
- package/dist/cesium/Workers/chunk-EYRIA4TP.js +0 -26
- package/dist/cesium/Workers/chunk-F7RQIJML.js +0 -26
- package/dist/cesium/Workers/chunk-FPZMU6QP.js +0 -26
- package/dist/cesium/Workers/chunk-FZDVQW7A.js +0 -26
- package/dist/cesium/Workers/chunk-GAZ2U4FO.js +0 -26
- package/dist/cesium/Workers/chunk-I44IOOT4.js +0 -26
- package/dist/cesium/Workers/chunk-IALXUAD4.js +0 -26
- package/dist/cesium/Workers/chunk-IXBUEUZL.js +0 -26
- package/dist/cesium/Workers/chunk-J3GCYV5K.js +0 -26
- package/dist/cesium/Workers/chunk-KGSZTFHZ.js +0 -26
- package/dist/cesium/Workers/chunk-KKKPU2CI.js +0 -26
- package/dist/cesium/Workers/chunk-KTEJE5KE.js +0 -26
- package/dist/cesium/Workers/chunk-KYZ3DYY6.js +0 -26
- package/dist/cesium/Workers/chunk-L2QG4MRI.js +0 -26
- package/dist/cesium/Workers/chunk-MCE3KFYN.js +0 -26
- package/dist/cesium/Workers/chunk-MMLDGXML.js +0 -26
- package/dist/cesium/Workers/chunk-MTBRPBDQ.js +0 -26
- package/dist/cesium/Workers/chunk-OKT6VBRK.js +0 -26
- package/dist/cesium/Workers/chunk-PHYDKLSY.js +0 -26
- package/dist/cesium/Workers/chunk-PWPX3224.js +0 -26
- package/dist/cesium/Workers/chunk-QHOVE6WG.js +0 -26
- package/dist/cesium/Workers/chunk-QJ6MBL22.js +0 -26
- package/dist/cesium/Workers/chunk-QKO6VIG2.js +0 -26
- package/dist/cesium/Workers/chunk-QVEE4QL2.js +0 -26
- package/dist/cesium/Workers/chunk-RXQOQZ7S.js +0 -26
- package/dist/cesium/Workers/chunk-S3ZKQKMM.js +0 -26
- package/dist/cesium/Workers/chunk-SFEUMZSK.js +0 -26
- package/dist/cesium/Workers/chunk-T75MW4X3.js +0 -26
- package/dist/cesium/Workers/chunk-TVO2A75R.js +0 -66
- package/dist/cesium/Workers/chunk-UHR36K45.js +0 -27
- package/dist/cesium/Workers/chunk-UKJCDZOR.js +0 -26
- package/dist/cesium/Workers/chunk-VKVIYER6.js +0 -26
- package/dist/cesium/Workers/chunk-VPIQWTRZ.js +0 -26
- package/dist/cesium/Workers/chunk-XSX5HRFC.js +0 -26
- package/dist/cesium/Workers/chunk-Z5WQQHSL.js +0 -26
- package/dist/cesium/Workers/chunk-Z7B2VEL5.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/core/Globe.tsx +0 -104
- /package/src/{Visualizer → shared}/featureFlags.ts +0 -0
- /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
|
@@ -15,13 +15,11 @@ import {
|
|
|
15
15
|
Cesium3DTileFeature,
|
|
16
16
|
Model,
|
|
17
17
|
Cesium3DTilePointFeature,
|
|
18
|
-
GoogleMaps as CesiumGoogleMaps,
|
|
19
|
-
Resource,
|
|
20
|
-
defaultValue,
|
|
21
18
|
ImageBasedLighting,
|
|
22
19
|
Cesium3DTileContent,
|
|
23
20
|
Color,
|
|
24
21
|
Viewer,
|
|
22
|
+
createGooglePhotorealistic3DTileset,
|
|
25
23
|
} from "cesium";
|
|
26
24
|
import { pick } from "lodash-es";
|
|
27
25
|
import { MutableRefObject, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -57,7 +55,6 @@ import {
|
|
|
57
55
|
} from "../utils";
|
|
58
56
|
|
|
59
57
|
import { TilesetFeatureIndex } from "./TilesetFeatureIndex";
|
|
60
|
-
import { GoogleMaps } from "./types";
|
|
61
58
|
import { useClippingBox } from "./useClippingBox";
|
|
62
59
|
import { useDrawClipping } from "./useDrawClipping";
|
|
63
60
|
|
|
@@ -77,6 +74,7 @@ const useData = (layer: ComputedLayer | undefined) => {
|
|
|
77
74
|
? data.layers.join(",")
|
|
78
75
|
: data?.layers
|
|
79
76
|
: undefined,
|
|
77
|
+
googleMapApiKey: data?.serviceTokens?.googleMapApiKey,
|
|
80
78
|
};
|
|
81
79
|
}, [layer]);
|
|
82
80
|
};
|
|
@@ -179,7 +177,7 @@ const convertStyle = (val: any, convert: StyleProperty["convert"]) => {
|
|
|
179
177
|
|
|
180
178
|
const useFeature = ({
|
|
181
179
|
id,
|
|
182
|
-
|
|
180
|
+
tilesetRef,
|
|
183
181
|
idProperty,
|
|
184
182
|
layer,
|
|
185
183
|
viewer,
|
|
@@ -189,9 +187,10 @@ const useFeature = ({
|
|
|
189
187
|
onComputedFeatureFetch,
|
|
190
188
|
shouldUseFeatureIndex,
|
|
191
189
|
isTilesetReady,
|
|
190
|
+
useExternalStyle,
|
|
192
191
|
}: {
|
|
193
192
|
id?: string;
|
|
194
|
-
|
|
193
|
+
tilesetRef: MutableRefObject<Cesium3DTileset | undefined>;
|
|
195
194
|
idProperty?: string;
|
|
196
195
|
layer?: ComputedLayer;
|
|
197
196
|
viewer?: Viewer;
|
|
@@ -201,6 +200,7 @@ const useFeature = ({
|
|
|
201
200
|
selectedFeatureIdsRef: MutableRefObject<string[]>;
|
|
202
201
|
shouldUseFeatureIndex?: boolean;
|
|
203
202
|
isTilesetReady: boolean;
|
|
203
|
+
useExternalStyle?: boolean;
|
|
204
204
|
}) => {
|
|
205
205
|
const cachedFeaturesRef = useRef<CachedFeature[]>([]);
|
|
206
206
|
const cachedCalculatedLayerRef = useRef(layer);
|
|
@@ -222,44 +222,51 @@ const useFeature = ({
|
|
|
222
222
|
|
|
223
223
|
const computedFeature = evalFeature(layer, { ...feature?.feature, properties });
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
if (!useExternalStyle) {
|
|
226
|
+
const style = computedFeature?.["3dtiles"];
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
if (name === "color") {
|
|
229
|
-
if (isFeatureSelected) {
|
|
230
|
-
raw.color =
|
|
231
|
-
typeof layer["3dtiles"]?.selectedFeatureColor === "string"
|
|
232
|
-
? toColor(layer["3dtiles"]?.selectedFeatureColor) ?? raw.color
|
|
233
|
-
: raw.color;
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
raw.color = DEFAULT_FEATURE_COLOR;
|
|
238
|
-
}
|
|
239
|
-
const val = convertStyle(style?.[name], convert);
|
|
240
|
-
if (val !== undefined) {
|
|
241
|
-
raw[name] = val;
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
if (raw instanceof Cesium3DTilePointFeature) {
|
|
246
|
-
POINT_STYLE_PROPERTIES.forEach(({ name, convert }) => {
|
|
228
|
+
COMMON_STYLE_PROPERTIES.forEach(({ name, convert }) => {
|
|
247
229
|
const val = convertStyle(style?.[name], convert);
|
|
248
|
-
|
|
249
|
-
|
|
230
|
+
|
|
231
|
+
if (name === "color") {
|
|
232
|
+
// Reset color to default so that new style could update all.
|
|
233
|
+
raw.color = DEFAULT_FEATURE_COLOR;
|
|
234
|
+
|
|
235
|
+
// Apply color from style.
|
|
236
|
+
if (val !== undefined) {
|
|
237
|
+
raw.color = val;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Apply color for selected feature.
|
|
241
|
+
if (isFeatureSelected && typeof layer["3dtiles"]?.selectedFeatureColor === "string") {
|
|
242
|
+
raw.color = toColor(layer["3dtiles"]?.selectedFeatureColor) ?? val;
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
if (val !== undefined) {
|
|
246
|
+
raw[name] = val;
|
|
247
|
+
}
|
|
250
248
|
}
|
|
251
249
|
});
|
|
252
|
-
}
|
|
253
250
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
251
|
+
if (raw instanceof Cesium3DTilePointFeature) {
|
|
252
|
+
POINT_STYLE_PROPERTIES.forEach(({ name, convert }) => {
|
|
253
|
+
const val = convertStyle(style?.[name], convert);
|
|
254
|
+
if (val !== undefined) {
|
|
255
|
+
raw[name] = val;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if ("style" in raw) {
|
|
261
|
+
raw.style = new Cesium3DTileStyle(
|
|
262
|
+
// TODO: Convert value if it's necessary
|
|
263
|
+
MODEL_STYLE_PROPERTIES.reduce((res, { name, convert }) => {
|
|
264
|
+
const val = convertStyle(style?.[name as keyof typeof style], convert);
|
|
265
|
+
if (val === undefined) return res;
|
|
266
|
+
return { ...res, [name]: val };
|
|
267
|
+
}, {}),
|
|
268
|
+
);
|
|
269
|
+
}
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
attachTag(feature.raw, {
|
|
@@ -273,7 +280,7 @@ const useFeature = ({
|
|
|
273
280
|
}
|
|
274
281
|
return;
|
|
275
282
|
},
|
|
276
|
-
[evalFeature, layerId, viewer, shouldUseFeatureIndex, selectedFeatureIdsRef],
|
|
283
|
+
[evalFeature, layerId, viewer, shouldUseFeatureIndex, selectedFeatureIdsRef, useExternalStyle],
|
|
277
284
|
);
|
|
278
285
|
|
|
279
286
|
const handleTilesetLoad = useCallback(
|
|
@@ -324,10 +331,10 @@ const useFeature = ({
|
|
|
324
331
|
handleTilesetLoadRef.current = handleTilesetLoad;
|
|
325
332
|
useEffect(
|
|
326
333
|
() =>
|
|
327
|
-
|
|
334
|
+
tilesetRef.current?.tileLoad.addEventListener((t: Cesium3DTile) =>
|
|
328
335
|
handleTilesetLoadRef.current(t),
|
|
329
336
|
),
|
|
330
|
-
[
|
|
337
|
+
[tilesetRef, isTilesetReady],
|
|
331
338
|
);
|
|
332
339
|
|
|
333
340
|
const handleTilesetUnload = useCallback(
|
|
@@ -343,10 +350,10 @@ const useFeature = ({
|
|
|
343
350
|
handleTilesetUnloadRef.current = handleTilesetUnload;
|
|
344
351
|
useEffect(
|
|
345
352
|
() =>
|
|
346
|
-
|
|
353
|
+
tilesetRef.current?.tileUnload.addEventListener((t: Cesium3DTile) =>
|
|
347
354
|
handleTilesetUnloadRef.current(t),
|
|
348
355
|
),
|
|
349
|
-
[
|
|
356
|
+
[tilesetRef, isTilesetReady],
|
|
350
357
|
);
|
|
351
358
|
|
|
352
359
|
useEffect(() => {
|
|
@@ -362,7 +369,7 @@ const useFeature = ({
|
|
|
362
369
|
|
|
363
370
|
// If styles are updated while features are calculating,
|
|
364
371
|
// we stop calculating features, and reassign styles.
|
|
365
|
-
const skippedComputingAt = useRef<number | null>();
|
|
372
|
+
const skippedComputingAt = useRef<number | null>(undefined);
|
|
366
373
|
useEffect(() => {
|
|
367
374
|
skippedComputingAt.current = Date.now();
|
|
368
375
|
}, [pickedAppearance, updateStyle]);
|
|
@@ -449,8 +456,8 @@ export const useHooks = ({
|
|
|
449
456
|
onLayerFetch?: (value: Partial<Pick<LayerSimple, "properties">>) => void;
|
|
450
457
|
}) => {
|
|
451
458
|
const { viewer } = useCesium();
|
|
452
|
-
const tilesetRef = useRef<Cesium3DTilesetType>();
|
|
453
|
-
const { onLayerLoad } = useContext();
|
|
459
|
+
const tilesetRef = useRef<Cesium3DTilesetType>(undefined);
|
|
460
|
+
const { onLayerLoad, updateCredits } = useContext();
|
|
454
461
|
const layerIdRef = useRef(layer?.id);
|
|
455
462
|
layerIdRef.current = layer?.id;
|
|
456
463
|
|
|
@@ -460,7 +467,6 @@ export const useHooks = ({
|
|
|
460
467
|
edgeColor,
|
|
461
468
|
edgeWidth,
|
|
462
469
|
experimental_clipping,
|
|
463
|
-
apiKey,
|
|
464
470
|
selectedFeatureColor,
|
|
465
471
|
disableIndexingFeature,
|
|
466
472
|
} = property ?? {};
|
|
@@ -481,10 +487,12 @@ export const useHooks = ({
|
|
|
481
487
|
} = useClippingBox({ clipping: experimental_clipping, boxId });
|
|
482
488
|
|
|
483
489
|
const [style, setStyle] = useState<Cesium3DTileStyle>();
|
|
484
|
-
const { url, type, idProperty } = useData(layer);
|
|
490
|
+
const { url, type, idProperty, googleMapApiKey } = useData(layer);
|
|
485
491
|
const shouldUseFeatureIndex = !disableIndexingFeature && !!idProperty;
|
|
486
492
|
|
|
487
493
|
const [isTilesetReady, setIsTilesetReady] = useState(false);
|
|
494
|
+
const [isTilesetCompReady, setIsTilesetCompReady] = useState(false);
|
|
495
|
+
const [isTilesetRefReady, setIsTilesetRefReady] = useState(false);
|
|
488
496
|
|
|
489
497
|
const prevPlanes = useRef(_planes);
|
|
490
498
|
const planes = useMemo(() => {
|
|
@@ -503,8 +511,9 @@ export const useHooks = ({
|
|
|
503
511
|
return prevPlanes.current;
|
|
504
512
|
}, [_planes]);
|
|
505
513
|
const clipDirection = direction === "inside" ? -1 : 1;
|
|
514
|
+
|
|
506
515
|
// Create immutable object
|
|
507
|
-
const [clippingPlanes] = useState(
|
|
516
|
+
const [clippingPlanes, setClippingPlanes] = useState<CesiumClippingPlaneCollection>(
|
|
508
517
|
() =>
|
|
509
518
|
new CesiumClippingPlaneCollection({
|
|
510
519
|
planes: planes?.map(
|
|
@@ -519,6 +528,27 @@ export const useHooks = ({
|
|
|
519
528
|
edgeColor: toColor(edgeColor),
|
|
520
529
|
}),
|
|
521
530
|
);
|
|
531
|
+
// Initialize clipping planes
|
|
532
|
+
// This is workaround to reinitialize ClippingPlanes in strict mode.
|
|
533
|
+
useEffect(
|
|
534
|
+
() => () => {
|
|
535
|
+
setClippingPlanes(
|
|
536
|
+
new CesiumClippingPlaneCollection({
|
|
537
|
+
planes: planes?.map(
|
|
538
|
+
plane =>
|
|
539
|
+
new ClippingPlane(
|
|
540
|
+
new Cartesian3(plane.normal?.x, plane.normal?.y, plane.normal?.z),
|
|
541
|
+
(plane.distance || 0) * clipDirection,
|
|
542
|
+
),
|
|
543
|
+
),
|
|
544
|
+
unionClippingRegions: direction === "outside",
|
|
545
|
+
edgeWidth: edgeWidth,
|
|
546
|
+
edgeColor: toColor(edgeColor),
|
|
547
|
+
}),
|
|
548
|
+
);
|
|
549
|
+
},
|
|
550
|
+
[], // eslint-disable-line react-hooks/exhaustive-deps
|
|
551
|
+
);
|
|
522
552
|
|
|
523
553
|
const { drawClippingEnabled, drawClippingEdgeProps } = useDrawClipping({
|
|
524
554
|
...experimental_clipping?.draw,
|
|
@@ -542,6 +572,7 @@ export const useHooks = ({
|
|
|
542
572
|
(tileset?.cesiumElement as any)[layerIdField] = layer.id;
|
|
543
573
|
}
|
|
544
574
|
tilesetRef.current = tileset?.cesiumElement;
|
|
575
|
+
setIsTilesetRefReady(!!tileset?.cesiumElement);
|
|
545
576
|
},
|
|
546
577
|
[id, layer?.id, featureIndex, shouldUseFeatureIndex],
|
|
547
578
|
);
|
|
@@ -578,7 +609,7 @@ export const useHooks = ({
|
|
|
578
609
|
|
|
579
610
|
useFeature({
|
|
580
611
|
id,
|
|
581
|
-
|
|
612
|
+
tilesetRef,
|
|
582
613
|
layer,
|
|
583
614
|
idProperty,
|
|
584
615
|
viewer,
|
|
@@ -588,6 +619,7 @@ export const useHooks = ({
|
|
|
588
619
|
selectedFeatureIdsRef,
|
|
589
620
|
shouldUseFeatureIndex,
|
|
590
621
|
isTilesetReady,
|
|
622
|
+
useExternalStyle: !!styleUrl,
|
|
591
623
|
});
|
|
592
624
|
|
|
593
625
|
const [terrainHeightEstimate, setTerrainHeightEstimate] = useState(0);
|
|
@@ -703,36 +735,57 @@ export const useHooks = ({
|
|
|
703
735
|
}
|
|
704
736
|
(async () => {
|
|
705
737
|
const res = await fetch(styleUrl);
|
|
706
|
-
if (!res.ok)
|
|
707
|
-
|
|
738
|
+
if (!res.ok) {
|
|
739
|
+
console.warn("Failed to fetch style from:", styleUrl);
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
const styleData = await res.json();
|
|
743
|
+
const newStyle = new Cesium3DTileStyle(styleData);
|
|
744
|
+
setStyle(newStyle);
|
|
708
745
|
})();
|
|
709
746
|
}, [styleUrl]);
|
|
710
747
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
748
|
+
// Apply style to tileset when both external style and tileset are ready
|
|
749
|
+
useEffect(() => {
|
|
750
|
+
if (style && tilesetRef.current && isTilesetReady) {
|
|
751
|
+
tilesetRef.current.style = style;
|
|
752
|
+
}
|
|
753
|
+
}, [style, isTilesetReady]);
|
|
754
|
+
|
|
755
|
+
const googleMapPhotorealisticResource = useMemo(() => {
|
|
756
|
+
if (type !== "google-photorealistic" || !isVisible) return null;
|
|
757
|
+
|
|
758
|
+
const loadTileset = async () => {
|
|
759
|
+
try {
|
|
760
|
+
if (googleMapApiKey) {
|
|
761
|
+
const tileset = await createGooglePhotorealistic3DTileset({ key: googleMapApiKey });
|
|
762
|
+
return tileset.resource;
|
|
763
|
+
} else {
|
|
764
|
+
const resource = IonResource.fromAssetId(2275207, {
|
|
765
|
+
accessToken: meta?.cesiumIonAccessToken as string | undefined,
|
|
766
|
+
});
|
|
767
|
+
return resource;
|
|
768
|
+
}
|
|
769
|
+
} catch (error) {
|
|
770
|
+
console.error(`Error loading Photorealistic 3D Tiles tileset: ${error}`);
|
|
771
|
+
throw error;
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
return loadTileset();
|
|
776
|
+
}, [type, isVisible, googleMapApiKey, meta?.cesiumIonAccessToken]);
|
|
724
777
|
|
|
725
778
|
const tilesetUrl = useMemo(() => {
|
|
726
779
|
return type === "osm-buildings" && isVisible
|
|
727
780
|
? IonResource.fromAssetId(96188, {
|
|
728
781
|
accessToken: meta?.cesiumIonAccessToken as string | undefined,
|
|
729
782
|
}) // https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Scene/createOsmBuildings.js#L53
|
|
730
|
-
:
|
|
731
|
-
?
|
|
783
|
+
: googleMapPhotorealisticResource && isVisible
|
|
784
|
+
? googleMapPhotorealisticResource
|
|
732
785
|
: type === "3dtiles" && isVisible
|
|
733
|
-
? url ?? tileset
|
|
786
|
+
? (url ?? tileset)
|
|
734
787
|
: null;
|
|
735
|
-
}, [
|
|
788
|
+
}, [type, isVisible, meta?.cesiumIonAccessToken, googleMapPhotorealisticResource, url, tileset]);
|
|
736
789
|
|
|
737
790
|
const imageBasedLighting = useMemo(() => {
|
|
738
791
|
if (
|
|
@@ -773,13 +826,25 @@ export const useHooks = ({
|
|
|
773
826
|
|
|
774
827
|
const handleReady = useCallback(
|
|
775
828
|
(tileset: Cesium3DTileset) => {
|
|
776
|
-
|
|
829
|
+
setIsTilesetCompReady(true);
|
|
777
830
|
onLayerFetch?.({ properties: tileset.properties });
|
|
778
831
|
onLayerLoad?.({ layerId: layerIdRef.current });
|
|
779
832
|
},
|
|
780
833
|
[onLayerFetch, onLayerLoad],
|
|
781
834
|
);
|
|
782
835
|
|
|
836
|
+
useEffect(() => {
|
|
837
|
+
if (!isTilesetCompReady || !isTilesetRefReady) return;
|
|
838
|
+
setIsTilesetReady(true);
|
|
839
|
+
}, [isTilesetCompReady, isTilesetRefReady]);
|
|
840
|
+
|
|
841
|
+
useEffect(() => {
|
|
842
|
+
updateCredits?.();
|
|
843
|
+
return () => {
|
|
844
|
+
updateCredits?.();
|
|
845
|
+
};
|
|
846
|
+
}, [type, updateCredits]);
|
|
847
|
+
|
|
783
848
|
return {
|
|
784
849
|
tilesetUrl,
|
|
785
850
|
ref,
|
|
@@ -105,7 +105,7 @@ export const useClippingBox = ({
|
|
|
105
105
|
|
|
106
106
|
const isBoxClicked = useRef(false);
|
|
107
107
|
const isTopBottomSidePlaneClicked = useRef(false);
|
|
108
|
-
const currentCameraPosition = useRef<Camera | undefined>();
|
|
108
|
+
const currentCameraPosition = useRef<Camera | undefined>(undefined);
|
|
109
109
|
|
|
110
110
|
// Coordinates
|
|
111
111
|
const [coords, setCoords] = useState(coordinates);
|
|
@@ -349,7 +349,7 @@ export const useClippingBox = ({
|
|
|
349
349
|
[boxId, boxState.isEdgeClicked, boxState.isScalePointClicked, handleUpdateBoxState],
|
|
350
350
|
);
|
|
351
351
|
|
|
352
|
-
const hovered = useRef<any>();
|
|
352
|
+
const hovered = useRef<any>(undefined);
|
|
353
353
|
const handleRawMouseMove = useCallback(
|
|
354
354
|
(e: any) => {
|
|
355
355
|
const picked = viewer?.scene.pick(e.endPosition);
|
|
@@ -69,11 +69,11 @@ export const useDrawClipping = ({
|
|
|
69
69
|
const polygon = turf.polygon([surfacePoints.map(p => [p.lng, p.lat])]);
|
|
70
70
|
const center = turf.centroid(polygon);
|
|
71
71
|
const baseHeight = viewer?.scene
|
|
72
|
-
? (await sampleTerrainHeight(
|
|
72
|
+
? ((await sampleTerrainHeight(
|
|
73
73
|
viewer?.scene,
|
|
74
74
|
center.geometry.coordinates[0],
|
|
75
75
|
center.geometry.coordinates[1],
|
|
76
|
-
)) ?? 0
|
|
76
|
+
)) ?? 0)
|
|
77
77
|
: 0;
|
|
78
78
|
setBaseHeight(baseHeight);
|
|
79
79
|
|
|
@@ -26,6 +26,7 @@ export type Context = {
|
|
|
26
26
|
position: [x: number, y: number, z: number],
|
|
27
27
|
) => [x: number, y: number] | undefined;
|
|
28
28
|
isPositionVisible?: (position: [x: number, y: number, z: number]) => boolean;
|
|
29
|
+
updateCredits?: () => void;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
export const context = createContext<Context>({});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import LRUCache from "lru-cache";
|
|
2
|
-
import { useEffect, useMemo } from "react";
|
|
1
|
+
import { LRUCache } from "lru-cache";
|
|
2
|
+
import { useEffect, useMemo, type JSX } from "react";
|
|
3
3
|
|
|
4
4
|
import type { AppearanceTypes, FeatureComponentProps, ComputedLayer } from "../..";
|
|
5
5
|
import { ComputedFeature, DataType, guessType } from "../../../mantle";
|
|
@@ -96,6 +96,7 @@ const FEATURE_DELEGATE_THRESHOLD = 6000;
|
|
|
96
96
|
export default function Feature({
|
|
97
97
|
layer,
|
|
98
98
|
isHidden,
|
|
99
|
+
sketchEditingFeature,
|
|
99
100
|
...props
|
|
100
101
|
}: FeatureComponentProps): JSX.Element | null {
|
|
101
102
|
const data = extractSimpleLayerData(layer);
|
|
@@ -131,7 +132,10 @@ export default function Feature({
|
|
|
131
132
|
const useSceneSpecularEnvironmentMaps =
|
|
132
133
|
!!props.viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps;
|
|
133
134
|
|
|
134
|
-
const isVisible =
|
|
135
|
+
const isVisible =
|
|
136
|
+
layer.layer.visible !== false &&
|
|
137
|
+
!isHidden &&
|
|
138
|
+
!(sketchEditingFeature?.layerId === layer.id && sketchEditingFeature?.feature?.id === f?.id);
|
|
135
139
|
|
|
136
140
|
const componentId =
|
|
137
141
|
urlMD5 +
|
|
@@ -140,7 +144,7 @@ export default function Feature({
|
|
|
140
144
|
f?.id ?? ""
|
|
141
145
|
}_${k}_${isVisible}_${useSceneSphericalHarmonicCoefficients}_${useSceneSpecularEnvironmentMaps}_${
|
|
142
146
|
JSON.stringify(f?.[k]) ?? ""
|
|
143
|
-
}_${JSON.stringify(layer.transition) ?? ""}`,
|
|
147
|
+
}_${JSON.stringify(layer.transition) ?? ""}_${JSON.stringify(f?.geometry) ?? ""}`,
|
|
144
148
|
);
|
|
145
149
|
|
|
146
150
|
if (cacheable) {
|
|
@@ -172,7 +176,7 @@ export default function Feature({
|
|
|
172
176
|
<C
|
|
173
177
|
{...props}
|
|
174
178
|
key={!useTransition ? componentId : undefined}
|
|
175
|
-
id={!useTransition ? componentId : f?.id ?? layer.id}
|
|
179
|
+
id={!useTransition ? componentId : (f?.id ?? layer.id)}
|
|
176
180
|
property={f ? f[k] : layer[k] || pickProperty(k, layer)}
|
|
177
181
|
geometry={f?.geometry}
|
|
178
182
|
feature={f}
|
|
@@ -16,16 +16,17 @@ import {
|
|
|
16
16
|
Primitive,
|
|
17
17
|
GroundPrimitive,
|
|
18
18
|
} from "cesium";
|
|
19
|
-
import md5 from "js-md5";
|
|
20
|
-
import { pick } from "lodash-es";
|
|
19
|
+
import { md5 } from "js-md5";
|
|
20
|
+
import { cloneDeep, pick } from "lodash-es";
|
|
21
21
|
import {
|
|
22
22
|
ComponentProps,
|
|
23
23
|
ComponentType,
|
|
24
24
|
ForwardedRef,
|
|
25
25
|
forwardRef,
|
|
26
|
+
useCallback,
|
|
26
27
|
useLayoutEffect,
|
|
27
28
|
useMemo,
|
|
28
|
-
|
|
29
|
+
useState,
|
|
29
30
|
} from "react";
|
|
30
31
|
import { type CesiumComponentRef, Entity } from "resium";
|
|
31
32
|
|
|
@@ -86,10 +87,11 @@ function EntityExtComponent(
|
|
|
86
87
|
}: ComponentProps<typeof Entity> & Tag,
|
|
87
88
|
ref: ForwardedRef<CesiumComponentRef<CesiumEntity>>,
|
|
88
89
|
) {
|
|
89
|
-
const
|
|
90
|
+
const [entity, setEntity] = useState<CesiumComponentRef<CesiumEntity> | null>(null);
|
|
90
91
|
|
|
91
92
|
useLayoutEffect(() => {
|
|
92
|
-
|
|
93
|
+
if (!entity?.cesiumElement) return;
|
|
94
|
+
attachTag(entity.cesiumElement, {
|
|
93
95
|
layerId: layerId || props.id,
|
|
94
96
|
featureId,
|
|
95
97
|
draggable,
|
|
@@ -105,10 +107,12 @@ function EntityExtComponent(
|
|
|
105
107
|
props.id,
|
|
106
108
|
unselectable,
|
|
107
109
|
hideIndicator,
|
|
108
|
-
|
|
110
|
+
entity,
|
|
109
111
|
]);
|
|
110
112
|
|
|
111
|
-
|
|
113
|
+
const handleRef = useCallback((r: CesiumComponentRef<CesiumEntity>) => setEntity(r), []);
|
|
114
|
+
|
|
115
|
+
return <Entity ref={composeRefs(ref, handleRef)} {...props} />;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
export function attachTag(
|
|
@@ -232,13 +236,20 @@ export const extractSimpleLayer = (
|
|
|
232
236
|
if (l?.type !== "simple") {
|
|
233
237
|
return;
|
|
234
238
|
}
|
|
235
|
-
|
|
239
|
+
// Proxy object lead to issues when creating mvt imagery provider, so convert to plain object
|
|
240
|
+
// Not sure for other types, but to keep consistency, convert all simple layers here
|
|
241
|
+
// It should be okey since simple layer data is supposed to be simple enough and computed data should not be included
|
|
242
|
+
return toPlainObject(l);
|
|
236
243
|
};
|
|
237
244
|
|
|
238
245
|
export const extractSimpleLayerData = (layer: ComputedLayer | undefined): Data | undefined => {
|
|
239
246
|
return extractSimpleLayer(layer)?.data;
|
|
240
247
|
};
|
|
241
248
|
|
|
249
|
+
export const toPlainObject = <T,>(obj: T): T => {
|
|
250
|
+
return cloneDeep(obj);
|
|
251
|
+
};
|
|
252
|
+
|
|
242
253
|
export const toColor = (c?: string) => {
|
|
243
254
|
if (!c || typeof c !== "string") return undefined;
|
|
244
255
|
|
|
@@ -274,10 +285,7 @@ export const toDistanceDisplayCondition = (
|
|
|
274
285
|
};
|
|
275
286
|
|
|
276
287
|
export const generateIDWithMD5 = (id: string) => {
|
|
277
|
-
|
|
278
|
-
hash.update(id);
|
|
279
|
-
|
|
280
|
-
return hash.hex();
|
|
288
|
+
return md5(id);
|
|
281
289
|
};
|
|
282
290
|
|
|
283
291
|
export const usePick = <T extends object, U extends keyof T>(
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
} from "./createAmbientOcclusionStage";
|
|
13
13
|
|
|
14
14
|
export interface AmbientOcclusionProps
|
|
15
|
-
extends Omit<AmbientOcclusionStageOptions, "prefix">,
|
|
16
|
-
Partial<AmbientOcclusionStageUniforms> {
|
|
15
|
+
extends Omit<AmbientOcclusionStageOptions, "prefix">, Partial<AmbientOcclusionStageUniforms> {
|
|
17
16
|
enabled?: boolean;
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -83,7 +82,11 @@ export const AmbientOcclusionStage = ({
|
|
|
83
82
|
|
|
84
83
|
usePreRender(() => {
|
|
85
84
|
const frustum = scene?.camera.frustum;
|
|
86
|
-
if (
|
|
85
|
+
if (
|
|
86
|
+
frustum instanceof PerspectiveFrustum &&
|
|
87
|
+
frustum.fovy !== undefined &&
|
|
88
|
+
frustum.aspectRatio !== undefined
|
|
89
|
+
) {
|
|
87
90
|
const cotFovy = 1 / Math.tan(frustum.fovy / 2);
|
|
88
91
|
stage.uniforms.focalLength.x = cotFovy * frustum.aspectRatio;
|
|
89
92
|
stage.uniforms.focalLength.y = cotFovy;
|
|
@@ -111,7 +114,7 @@ export const AmbientOcclusion: FC<AmbientOcclusionProps> = props => {
|
|
|
111
114
|
// Screen-space camera controller should detect collision
|
|
112
115
|
const cameraHeight = scene.camera.positionCartographic.height - globeHeight;
|
|
113
116
|
const frustum = scene?.camera.frustum;
|
|
114
|
-
if (frustum instanceof PerspectiveFrustum) {
|
|
117
|
+
if (frustum instanceof PerspectiveFrustum && frustum.fov !== undefined) {
|
|
115
118
|
scene.camera.frustum.near =
|
|
116
119
|
CesiumMath.clamp(cameraHeight - 1, 1, 5) / Math.tan(frustum.fov / 2);
|
|
117
120
|
}
|