@reearth/core 0.0.7-alpha.7 → 0.0.7-alpha.70
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 +71433 -61051
- package/dist/core.umd.cjs +666 -680
- package/dist/{index-DqatWUTw.js → index-CUJ6HGQn.js} +1021 -908
- package/dist/index.d.ts +195 -73
- 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 +45 -12
- 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 +640 -237
- 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/customProvider.ts +32 -0
- package/src/Map/types/index.ts +42 -3
- package/src/Map/types/viewerProperty.ts +12 -1
- 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 +29 -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 +273 -87
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Tileset/index.tsx +7 -14
- 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 +3 -0
- package/src/engines/Cesium/Feature/index.tsx +27 -10
- 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 +69 -0
- package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +81 -0
- package/src/engines/Cesium/core/Imagery.test.ts +299 -42
- package/src/engines/Cesium/core/Imagery.tsx +282 -54
- 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 +122 -48
- 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 +68 -17
- package/src/engines/Cesium/index.stories.tsx +0 -1
- package/src/engines/Cesium/index.tsx +38 -8
- 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 +49 -26
- 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 +5 -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
|
@@ -41,28 +41,36 @@ const defaultMatcher = new StringMatcher()
|
|
|
41
41
|
initialColor = u_initialColor;
|
|
42
42
|
#endif
|
|
43
43
|
vec4 color = computeDayColor(initialColor`,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
);
|
|
45
|
+
// Note: Commented out erase() call as it's not needed for Cesium 1.118.x
|
|
46
|
+
// The replace() above already handles the material code modification
|
|
47
|
+
// .erase([
|
|
48
|
+
// "#ifdef APPLY_MATERIAL",
|
|
49
|
+
// "czm_materialInput materialInput;",
|
|
50
|
+
// "materialInput.st = v_textureCoordinates.st;",
|
|
51
|
+
// "materialInput.normalEC = normalize(v_normalEC);",
|
|
52
|
+
// "materialInput.positionToEyeEC = -v_positionEC;",
|
|
53
|
+
// "materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));",
|
|
54
|
+
// "materialInput.slope = v_slope;",
|
|
55
|
+
// "materialInput.height = v_height;",
|
|
56
|
+
// "materialInput.aspect = v_aspect;",
|
|
57
|
+
// "czm_material material = czm_getMaterial(materialInput);",
|
|
58
|
+
// "vec4 materialColor = vec4(material.diffuse, material.alpha);",
|
|
59
|
+
// "color = alphaBlend(materialColor, color);",
|
|
60
|
+
// "#endif",
|
|
61
|
+
// ]);
|
|
60
62
|
|
|
61
63
|
function makeGlobeShadersDirty(globe: Globe): void {
|
|
62
64
|
// Invoke the internal makeShadersDirty() by setting a material to globe to
|
|
63
65
|
// reset surface shader source to the initial state (assuming that we never
|
|
64
66
|
// use custom material on globe).
|
|
65
67
|
// ref: https://github.com/CesiumGS/cesium/blob/1.106/packages/engine/Source/Scene/Globe.js#L562-L572
|
|
68
|
+
|
|
69
|
+
// Safety check: ensure globe's internal properties exist before manipulation
|
|
70
|
+
if (!globe || globe.isDestroyed() || !(globe as any)._surface) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
const material = globe.material;
|
|
67
75
|
if (material == null) {
|
|
68
76
|
globe.material = Material.fromType("Color");
|
|
@@ -73,6 +81,18 @@ function makeGlobeShadersDirty(globe: Globe): void {
|
|
|
73
81
|
}
|
|
74
82
|
}
|
|
75
83
|
|
|
84
|
+
function withUniforms(globe: PrivateCesiumGlobe, add?: Record<string, () => any>) {
|
|
85
|
+
if (!globe._surface?._tileProvider) return;
|
|
86
|
+
const mm = (globe._surface._tileProvider as any)?.materialUniformMap ?? {};
|
|
87
|
+
(globe._surface._tileProvider as any).materialUniformMap = { ...mm, ...(add ?? {}) };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function removeUniforms(globe: PrivateCesiumGlobe, keys: string[]) {
|
|
91
|
+
const tp = globe._surface?._tileProvider as any;
|
|
92
|
+
if (!tp?.materialUniformMap) return;
|
|
93
|
+
for (const k of keys) delete tp.materialUniformMap[k];
|
|
94
|
+
}
|
|
95
|
+
|
|
76
96
|
const useIBL = ({
|
|
77
97
|
sphericalHarmonicCoefficients,
|
|
78
98
|
globeImageBasedLighting,
|
|
@@ -124,7 +144,7 @@ const useTerrainHeatmap = ({
|
|
|
124
144
|
cesium,
|
|
125
145
|
terrain,
|
|
126
146
|
}: {
|
|
127
|
-
cesium: RefObject<CesiumComponentRef<Viewer
|
|
147
|
+
cesium: RefObject<CesiumComponentRef<Viewer> | null>;
|
|
128
148
|
terrain: TerrainProperty | undefined;
|
|
129
149
|
}) => {
|
|
130
150
|
const {
|
|
@@ -184,6 +204,18 @@ const useTerrainHeatmap = ({
|
|
|
184
204
|
return { isCustomHeatmapEnabled, shaderForTerrainHeatmap };
|
|
185
205
|
};
|
|
186
206
|
|
|
207
|
+
async function waitTerrainReady(scene: any) {
|
|
208
|
+
const t = scene.terrain;
|
|
209
|
+
if (t?.ready) return;
|
|
210
|
+
await new Promise<void>(resolve => {
|
|
211
|
+
if (!t) return resolve();
|
|
212
|
+
const off = t.readyEvent.addEventListener(() => {
|
|
213
|
+
off();
|
|
214
|
+
resolve();
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
187
219
|
export const useOverrideGlobeShader = ({
|
|
188
220
|
cesium,
|
|
189
221
|
sphericalHarmonicCoefficients,
|
|
@@ -193,7 +225,7 @@ export const useOverrideGlobeShader = ({
|
|
|
193
225
|
enableLighting,
|
|
194
226
|
terrain,
|
|
195
227
|
}: {
|
|
196
|
-
cesium: RefObject<CesiumComponentRef<Viewer
|
|
228
|
+
cesium: RefObject<CesiumComponentRef<Viewer> | null>;
|
|
197
229
|
sphericalHarmonicCoefficients?: Cartesian3[];
|
|
198
230
|
globeShadowDarkness?: number;
|
|
199
231
|
globeImageBasedLighting?: boolean;
|
|
@@ -201,6 +233,8 @@ export const useOverrideGlobeShader = ({
|
|
|
201
233
|
enableLighting?: boolean;
|
|
202
234
|
terrain: TerrainProperty | undefined;
|
|
203
235
|
}) => {
|
|
236
|
+
const applyingRef = useRef(false);
|
|
237
|
+
|
|
204
238
|
const { uniformMapForIBL, isIBLEnabled, shaderForIBL } = useIBL({
|
|
205
239
|
sphericalHarmonicCoefficients,
|
|
206
240
|
globeImageBasedLighting,
|
|
@@ -223,75 +257,85 @@ export const useOverrideGlobeShader = ({
|
|
|
223
257
|
|
|
224
258
|
const needUpdateGlobeRef = useRef(false);
|
|
225
259
|
|
|
226
|
-
const handleGlobeShader = useCallback(() => {
|
|
260
|
+
const handleGlobeShader = useCallback(async () => {
|
|
227
261
|
// NOTE: Support the spherical harmonic coefficient only when the terrain normal is enabled.
|
|
228
262
|
// Because it's difficult to control the shader for the entire globe.
|
|
229
263
|
// ref: https://github.com/CesiumGS/cesium/blob/af4e2bebbef25259f049b05822adf2958fce11ff/packages/engine/Source/Shaders/GlobeFS.glsl#L408
|
|
230
264
|
if (!cesium.current?.cesiumElement || !needUpdateGlobeRef.current) return;
|
|
231
265
|
|
|
232
|
-
|
|
266
|
+
if (applyingRef.current) return;
|
|
267
|
+
applyingRef.current = true;
|
|
233
268
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
throw new Error("`globe._surfaceShaderSet` could not found");
|
|
238
|
-
}
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
269
|
+
try {
|
|
270
|
+
const { scene } = cesium.current.cesiumElement;
|
|
271
|
+
await waitTerrainReady(scene);
|
|
241
272
|
|
|
242
|
-
|
|
273
|
+
const globe = cesium.current.cesiumElement.scene.globe as PrivateCesiumGlobe;
|
|
243
274
|
|
|
244
|
-
|
|
275
|
+
// Reset shaders first so we patch the freshest base
|
|
276
|
+
makeGlobeShadersDirty(globe);
|
|
245
277
|
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
|
|
278
|
+
const surfaceShaderSet = globe._surfaceShaderSet;
|
|
279
|
+
if (!surfaceShaderSet) {
|
|
280
|
+
if (import.meta.env.DEV) {
|
|
281
|
+
throw new Error("`globe._surfaceShaderSet` could not found");
|
|
282
|
+
}
|
|
283
|
+
return;
|
|
249
284
|
}
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
285
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
matchers.push(shaderForIBL);
|
|
257
|
-
shaders.push(IBLFS);
|
|
258
|
-
}
|
|
286
|
+
const baseFragmentShaderSource = surfaceShaderSet.baseFragmentShaderSource;
|
|
287
|
+
const GlobeFS =
|
|
288
|
+
baseFragmentShaderSource?.sources[baseFragmentShaderSource.sources.length - 1];
|
|
259
289
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
290
|
+
if (!GlobeFS || !baseFragmentShaderSource) {
|
|
291
|
+
if (import.meta.env.DEV) {
|
|
292
|
+
throw new Error("GlobeFS could not find.");
|
|
293
|
+
}
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
266
296
|
|
|
267
|
-
|
|
268
|
-
|
|
297
|
+
const matchers: StringMatcher[] = [];
|
|
298
|
+
const shaders: string[] = [];
|
|
299
|
+
const terrainHasNormals = !!(globe.terrainProvider as any)?.hasVertexNormals;
|
|
269
300
|
|
|
270
|
-
|
|
301
|
+
if (isIBLEnabled && globe.enableLighting && terrainHasNormals) {
|
|
302
|
+
matchers.push(shaderForIBL);
|
|
303
|
+
shaders.push(IBLFS);
|
|
304
|
+
}
|
|
271
305
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
306
|
+
if (isCustomHeatmapEnabled && terrainHasNormals) {
|
|
307
|
+
// This will log the variables needed in the shader below.
|
|
308
|
+
// we need the minHeight, maxHeight and logarithmic
|
|
309
|
+
matchers.push(shaderForTerrainHeatmap);
|
|
310
|
+
shaders.push(HeatmapForTerrainFS);
|
|
275
311
|
}
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
312
|
|
|
279
|
-
|
|
313
|
+
// This means there is no overridden shader.
|
|
314
|
+
if (!matchers.length) return;
|
|
280
315
|
|
|
281
|
-
|
|
316
|
+
needUpdateGlobeRef.current = false;
|
|
282
317
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
318
|
+
if (!globe?._surface?._tileProvider) {
|
|
319
|
+
if (import.meta.env.DEV) {
|
|
320
|
+
throw new Error("`globe._surface._tileProvider.materialUniformMap` could not found");
|
|
321
|
+
}
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
287
324
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
325
|
+
const replacedGlobeFS = defaultMatcher.concat(...matchers).execute(GlobeFS);
|
|
326
|
+
|
|
327
|
+
withUniforms(globe, isIBLEnabled ? uniformMapForIBL : undefined);
|
|
328
|
+
|
|
329
|
+
surfaceShaderSet.baseFragmentShaderSource = new ShaderSource({
|
|
330
|
+
sources: [
|
|
331
|
+
...baseFragmentShaderSource.sources.slice(0, -1),
|
|
332
|
+
GlobeFSDefinitions + replacedGlobeFS + shaders.join(""),
|
|
333
|
+
],
|
|
334
|
+
defines: baseFragmentShaderSource.defines,
|
|
335
|
+
});
|
|
336
|
+
} finally {
|
|
337
|
+
applyingRef.current = false;
|
|
338
|
+
}
|
|
295
339
|
}, [
|
|
296
340
|
cesium,
|
|
297
341
|
isCustomHeatmapEnabled,
|
|
@@ -317,6 +361,10 @@ export const useOverrideGlobeShader = ({
|
|
|
317
361
|
|
|
318
362
|
return () => {
|
|
319
363
|
if (!globe.isDestroyed()) {
|
|
364
|
+
removeUniforms(globe, [
|
|
365
|
+
"u_reearth_sphericalHarmonicCoefficients",
|
|
366
|
+
"u_reearth_globeImageBasedLighting",
|
|
367
|
+
]);
|
|
320
368
|
// Reset customized shader to default
|
|
321
369
|
makeGlobeShadersDirty(globe);
|
|
322
370
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Entity,
|
|
3
3
|
Cesium3DTileFeature,
|
|
4
|
-
Ion,
|
|
5
4
|
Cesium3DTileset,
|
|
6
5
|
JulianDate,
|
|
7
6
|
Cesium3DTilePointFeature,
|
|
@@ -27,6 +26,8 @@ import type {
|
|
|
27
26
|
import { e2eAccessToken, setE2ECesiumViewer } from "../../e2eConfig";
|
|
28
27
|
import { ComputedFeature, DataType, SelectedFeatureInfo, LatLng, Camera } from "../../mantle";
|
|
29
28
|
import {
|
|
29
|
+
Credits,
|
|
30
|
+
CustomProviderConfig,
|
|
30
31
|
LayerLoadEvent,
|
|
31
32
|
LayerSelectWithRectEnd,
|
|
32
33
|
LayerSelectWithRectMove,
|
|
@@ -35,9 +36,9 @@ import {
|
|
|
35
36
|
RequestingRenderMode,
|
|
36
37
|
} from "../../Map";
|
|
37
38
|
import { TimelineManagerRef } from "../../Map/useTimelineManager";
|
|
38
|
-
import { FEATURE_FLAGS } from "../../
|
|
39
|
+
import { FEATURE_FLAGS } from "../../shared/featureFlags";
|
|
39
40
|
|
|
40
|
-
import { isSelectable } from "./common";
|
|
41
|
+
import { getCredits, isSelectable } from "./common";
|
|
41
42
|
import { getTag, type Context as FeatureContext } from "./Feature";
|
|
42
43
|
import { arrayToCartecian3 } from "./helpers/sphericalHaromic";
|
|
43
44
|
import useCamera from "./hooks/useCamera";
|
|
@@ -69,6 +70,7 @@ export default ({
|
|
|
69
70
|
selectedLayerId,
|
|
70
71
|
selectionReason,
|
|
71
72
|
meta,
|
|
73
|
+
customProvider,
|
|
72
74
|
layersRef,
|
|
73
75
|
featureFlags,
|
|
74
76
|
timelineManagerRef,
|
|
@@ -89,6 +91,7 @@ export default ({
|
|
|
89
91
|
onLayerLoad,
|
|
90
92
|
onCameraChange,
|
|
91
93
|
onMount,
|
|
94
|
+
onCreditsUpdate,
|
|
92
95
|
}: {
|
|
93
96
|
ref: React.ForwardedRef<EngineRef>;
|
|
94
97
|
property?: ViewerProperty;
|
|
@@ -97,9 +100,10 @@ export default ({
|
|
|
97
100
|
layerId?: string;
|
|
98
101
|
featureId?: string;
|
|
99
102
|
};
|
|
100
|
-
layersRef?: RefObject<LayersRef>;
|
|
103
|
+
layersRef?: RefObject<LayersRef | null>;
|
|
101
104
|
selectionReason?: LayerSelectionReason;
|
|
102
105
|
meta?: Record<string, unknown>;
|
|
106
|
+
customProvider?: CustomProviderConfig;
|
|
103
107
|
featureFlags: number;
|
|
104
108
|
timelineManagerRef?: TimelineManagerRef;
|
|
105
109
|
isLayerDraggable?: boolean;
|
|
@@ -128,13 +132,14 @@ export default ({
|
|
|
128
132
|
onLayerLoad?: (e: LayerLoadEvent) => void;
|
|
129
133
|
onCameraChange?: (camera: Camera) => void;
|
|
130
134
|
onMount?: () => void;
|
|
135
|
+
onCreditsUpdate?: (credits: Credits) => void;
|
|
131
136
|
}) => {
|
|
132
137
|
const cesium = useRef<CesiumComponentRef<CesiumViewer>>(null);
|
|
133
138
|
|
|
134
139
|
const cesiumIonAccessToken =
|
|
135
140
|
typeof meta?.cesiumIonAccessToken === "string" && meta.cesiumIonAccessToken
|
|
136
141
|
? meta.cesiumIonAccessToken
|
|
137
|
-
:
|
|
142
|
+
: undefined;
|
|
138
143
|
|
|
139
144
|
// expose ref
|
|
140
145
|
const engineAPI = useEngineRef(ref, cesium);
|
|
@@ -237,8 +242,8 @@ export default ({
|
|
|
237
242
|
| Primitive
|
|
238
243
|
| GroundPrimitive
|
|
239
244
|
| ImageryLayer
|
|
240
|
-
>();
|
|
241
|
-
const prevSelectedImageryFeatureId = useRef<string | undefined>();
|
|
245
|
+
>(undefined);
|
|
246
|
+
const prevSelectedImageryFeatureId = useRef<string | undefined>(undefined);
|
|
242
247
|
|
|
243
248
|
// manage layer selection
|
|
244
249
|
useEffect(() => {
|
|
@@ -334,8 +339,8 @@ export default ({
|
|
|
334
339
|
|
|
335
340
|
if (entity) {
|
|
336
341
|
const layer = tag?.layerId
|
|
337
|
-
? layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
338
|
-
layersRef?.current?.findById(tag.layerId)
|
|
342
|
+
? (layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
343
|
+
layersRef?.current?.findById(tag.layerId))
|
|
339
344
|
: undefined;
|
|
340
345
|
// Sometimes only featureId is specified, so we need to sync entity tag.
|
|
341
346
|
onLayerSelect?.(
|
|
@@ -462,8 +467,8 @@ export default ({
|
|
|
462
467
|
if (target && "id" in target && target.id instanceof Entity && isSelectable(target.id)) {
|
|
463
468
|
const tag = getTag(target.id);
|
|
464
469
|
const layer = tag?.layerId
|
|
465
|
-
? layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
466
|
-
layersRef?.current?.findById(tag.layerId)
|
|
470
|
+
? (layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
471
|
+
layersRef?.current?.findById(tag.layerId))
|
|
467
472
|
: undefined;
|
|
468
473
|
onLayerSelect?.(
|
|
469
474
|
tag?.layerId,
|
|
@@ -557,8 +562,11 @@ export default ({
|
|
|
557
562
|
if (pickRay) {
|
|
558
563
|
const l = await scene.imageryLayers.pickImageryLayerFeatures(pickRay, scene);
|
|
559
564
|
|
|
560
|
-
//
|
|
561
|
-
const f = l?.
|
|
565
|
+
// Find the topmost overlaid feature.
|
|
566
|
+
const f = l?.findLast(f => {
|
|
567
|
+
const appearanceType = f?.data?.appearanceType;
|
|
568
|
+
return appearanceType && f?.data?.feature?.[appearanceType]?.show !== false;
|
|
569
|
+
});
|
|
562
570
|
|
|
563
571
|
const appearanceType = f?.data?.appearanceType;
|
|
564
572
|
|
|
@@ -581,8 +589,8 @@ export default ({
|
|
|
581
589
|
}
|
|
582
590
|
|
|
583
591
|
const layer = tag?.layerId
|
|
584
|
-
? layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
585
|
-
layersRef?.current?.findById(tag.layerId)
|
|
592
|
+
? (layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
593
|
+
layersRef?.current?.findById(tag.layerId))
|
|
586
594
|
: undefined;
|
|
587
595
|
const content = getEntityContent(
|
|
588
596
|
f.data.feature ?? f,
|
|
@@ -648,10 +656,27 @@ export default ({
|
|
|
648
656
|
viewer.scene.requestRender();
|
|
649
657
|
}, []);
|
|
650
658
|
|
|
659
|
+
const onCreditsUpdateRef = useRef(onCreditsUpdate);
|
|
660
|
+
onCreditsUpdateRef.current = onCreditsUpdate;
|
|
661
|
+
const updateCredits = useCallback(() => {
|
|
662
|
+
if (!onCreditsUpdateRef.current) return;
|
|
663
|
+
// currently we don't have a proper way to get the credits update event
|
|
664
|
+
// wait for 3 seconds to get latest credits
|
|
665
|
+
// some internal property is been used here.
|
|
666
|
+
setTimeout(() => {
|
|
667
|
+
if (!onCreditsUpdateRef.current) return;
|
|
668
|
+
const viewer = cesium.current?.cesiumElement;
|
|
669
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
670
|
+
const credits = getCredits(viewer);
|
|
671
|
+
onCreditsUpdateRef.current(credits);
|
|
672
|
+
}, 3000);
|
|
673
|
+
}, []);
|
|
674
|
+
|
|
651
675
|
const context = useMemo<FeatureContext>(
|
|
652
676
|
() => ({
|
|
653
677
|
selectionReason,
|
|
654
678
|
timelineManagerRef,
|
|
679
|
+
customProvider,
|
|
655
680
|
flyTo: engineAPI.flyTo,
|
|
656
681
|
getCamera: engineAPI.getCamera,
|
|
657
682
|
onLayerEdit,
|
|
@@ -662,8 +687,18 @@ export default ({
|
|
|
662
687
|
toXYZ: engineAPI.toXYZ,
|
|
663
688
|
toWindowPosition: engineAPI.toWindowPosition,
|
|
664
689
|
isPositionVisible: engineAPI.isPositionVisible,
|
|
690
|
+
updateCredits,
|
|
665
691
|
}),
|
|
666
|
-
[
|
|
692
|
+
[
|
|
693
|
+
selectionReason,
|
|
694
|
+
timelineManagerRef,
|
|
695
|
+
customProvider,
|
|
696
|
+
engineAPI,
|
|
697
|
+
onLayerEdit,
|
|
698
|
+
onLayerVisibility,
|
|
699
|
+
onLayerLoad,
|
|
700
|
+
updateCredits,
|
|
701
|
+
],
|
|
667
702
|
);
|
|
668
703
|
|
|
669
704
|
useEffect(() => {
|
|
@@ -699,7 +734,13 @@ export default ({
|
|
|
699
734
|
|
|
700
735
|
useLayerDragDrop({ cesium, onLayerDrag, onLayerDrop, isLayerDraggable });
|
|
701
736
|
|
|
702
|
-
useExplicitRender({
|
|
737
|
+
useExplicitRender({
|
|
738
|
+
cesium,
|
|
739
|
+
requestingRenderMode,
|
|
740
|
+
isLayerDragging,
|
|
741
|
+
shouldRender,
|
|
742
|
+
property,
|
|
743
|
+
});
|
|
703
744
|
|
|
704
745
|
const {
|
|
705
746
|
cameraViewBoundaries,
|
|
@@ -728,6 +769,14 @@ export default ({
|
|
|
728
769
|
unmountCamera?.();
|
|
729
770
|
}, [unmountCamera]);
|
|
730
771
|
|
|
772
|
+
const handleTilesChange = useCallback(() => {
|
|
773
|
+
updateCredits();
|
|
774
|
+
}, [updateCredits]);
|
|
775
|
+
|
|
776
|
+
const handleTerrainProviderChange = useCallback(() => {
|
|
777
|
+
updateCredits();
|
|
778
|
+
}, [updateCredits]);
|
|
779
|
+
|
|
731
780
|
return {
|
|
732
781
|
cesium,
|
|
733
782
|
cesiumIonAccessToken,
|
|
@@ -747,6 +796,8 @@ export default ({
|
|
|
747
796
|
handleClick,
|
|
748
797
|
handleMount,
|
|
749
798
|
handleUnmount,
|
|
799
|
+
handleTilesChange,
|
|
800
|
+
handleTerrainProviderChange,
|
|
750
801
|
};
|
|
751
802
|
};
|
|
752
803
|
|
|
@@ -47,6 +47,8 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
47
47
|
shouldRender,
|
|
48
48
|
layerSelectionReason,
|
|
49
49
|
meta,
|
|
50
|
+
customProvider,
|
|
51
|
+
displayCredits,
|
|
50
52
|
layersRef,
|
|
51
53
|
featureFlags,
|
|
52
54
|
requestingRenderMode,
|
|
@@ -63,6 +65,7 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
63
65
|
onMount,
|
|
64
66
|
onLayerVisibility,
|
|
65
67
|
onLayerLoad,
|
|
68
|
+
onCreditsUpdate,
|
|
66
69
|
},
|
|
67
70
|
ref,
|
|
68
71
|
) => {
|
|
@@ -85,6 +88,8 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
85
88
|
handleClick,
|
|
86
89
|
handleMount,
|
|
87
90
|
handleUnmount,
|
|
91
|
+
handleTilesChange,
|
|
92
|
+
handleTerrainProviderChange,
|
|
88
93
|
} = useHooks({
|
|
89
94
|
ref,
|
|
90
95
|
property,
|
|
@@ -92,6 +97,7 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
92
97
|
selectedLayerId,
|
|
93
98
|
selectionReason: layerSelectionReason,
|
|
94
99
|
meta,
|
|
100
|
+
customProvider,
|
|
95
101
|
layersRef,
|
|
96
102
|
featureFlags,
|
|
97
103
|
timelineManagerRef,
|
|
@@ -112,8 +118,13 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
112
118
|
onLayerLoad,
|
|
113
119
|
onCameraChange,
|
|
114
120
|
onMount,
|
|
121
|
+
onCreditsUpdate,
|
|
115
122
|
});
|
|
116
123
|
|
|
124
|
+
const verticalExaggeration = property?.terrain?.enabled
|
|
125
|
+
? (property?.scene?.verticalExaggeration ?? 1)
|
|
126
|
+
: 1;
|
|
127
|
+
|
|
117
128
|
return (
|
|
118
129
|
<Viewer
|
|
119
130
|
ref={cesium}
|
|
@@ -133,7 +144,7 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
133
144
|
navigationHelpButton={false}
|
|
134
145
|
projectionPicker={false}
|
|
135
146
|
sceneModePicker={false}
|
|
136
|
-
creditContainer={creditContainer}
|
|
147
|
+
creditContainer={displayCredits ? undefined : creditContainer}
|
|
137
148
|
style={{
|
|
138
149
|
width: small ? "300px" : "auto",
|
|
139
150
|
height: small ? "300px" : "100%",
|
|
@@ -155,10 +166,16 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
155
166
|
onMouseMove={mouseEventHandles.mouseMove}
|
|
156
167
|
onMouseEnter={mouseEventHandles.mouseEnter}
|
|
157
168
|
onMouseLeave={mouseEventHandles.mouseLeave}
|
|
158
|
-
onWheel={mouseEventHandles.wheel}
|
|
169
|
+
onWheel={mouseEventHandles.wheel}
|
|
170
|
+
automaticallyTrackDataSourceClocks={false}>
|
|
159
171
|
<Event onMount={handleMount} onUnmount={handleUnmount} />
|
|
160
172
|
<Clock timelineManagerRef={timelineManagerRef} />
|
|
161
|
-
<ImageryLayers
|
|
173
|
+
<ImageryLayers
|
|
174
|
+
tiles={property?.tiles}
|
|
175
|
+
cesiumIonAccessToken={cesiumIonAccessToken}
|
|
176
|
+
customProvider={customProvider}
|
|
177
|
+
onTilesChange={handleTilesChange}
|
|
178
|
+
/>
|
|
162
179
|
<LabelImageryLayers tileLabels={property?.tileLabels} />
|
|
163
180
|
<Indicator property={property} timelineManagerRef={timelineManagerRef} />
|
|
164
181
|
<ScreenSpaceEventHandler useDefault>
|
|
@@ -201,7 +218,7 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
201
218
|
<ScreenSpaceCameraController
|
|
202
219
|
maximumZoomDistance={
|
|
203
220
|
property?.camera?.limiter?.enabled
|
|
204
|
-
? property.camera?.limiter?.targetArea?.height ?? Number.POSITIVE_INFINITY
|
|
221
|
+
? (property.camera?.limiter?.targetArea?.height ?? Number.POSITIVE_INFINITY)
|
|
205
222
|
: Number.POSITIVE_INFINITY
|
|
206
223
|
}
|
|
207
224
|
enableCollisionDetection={!property?.camera?.allowEnterGround}
|
|
@@ -236,11 +253,11 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
236
253
|
light={sceneLight}
|
|
237
254
|
mode={sceneMode}
|
|
238
255
|
msaaSamples={sceneMsaaSamples}
|
|
239
|
-
useDepthPicking={
|
|
256
|
+
useDepthPicking={true}
|
|
240
257
|
useWebVR={!!property?.scene?.vr || undefined} // NOTE: useWebVR={false} will crash Cesium
|
|
241
258
|
debugShowFramesPerSecond={!!property?.debug?.showFramesPerSecond}
|
|
242
259
|
verticalExaggerationRelativeHeight={property?.scene?.verticalExaggerationRelativeHeight}
|
|
243
|
-
verticalExaggeration={
|
|
260
|
+
verticalExaggeration={verticalExaggeration}
|
|
244
261
|
/>
|
|
245
262
|
<SkyBox show={property?.sky?.skyBox?.show ?? true} />
|
|
246
263
|
<Fog enabled={property?.sky?.fog?.enabled ?? true} density={property?.sky?.fog?.density} />
|
|
@@ -252,7 +269,11 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
|
|
|
252
269
|
saturationShift={property?.sky?.skyAtmosphere?.saturationShift}
|
|
253
270
|
brightnessShift={property?.sky?.skyAtmosphere?.brightnessShift}
|
|
254
271
|
/>
|
|
255
|
-
<Globe
|
|
272
|
+
<Globe
|
|
273
|
+
property={property}
|
|
274
|
+
cesiumIonAccessToken={cesiumIonAccessToken}
|
|
275
|
+
onTerrainProviderChange={handleTerrainProviderChange}
|
|
276
|
+
/>
|
|
256
277
|
<featureContext.Provider value={context}>{ready ? children : null}</featureContext.Provider>
|
|
257
278
|
<AmbientOcclusion
|
|
258
279
|
{...AMBIENT_OCCLUSION_QUALITY[property?.render?.ambientOcclusion?.quality || "low"]}
|
|
@@ -279,5 +300,14 @@ export const engine: Engine = {
|
|
|
279
300
|
featureComponent: Feature,
|
|
280
301
|
clusterComponent: Cluster,
|
|
281
302
|
sketchComponent: Sketch,
|
|
282
|
-
delegatedDataTypes: [
|
|
303
|
+
delegatedDataTypes: [
|
|
304
|
+
"czml",
|
|
305
|
+
"wms",
|
|
306
|
+
"mvt",
|
|
307
|
+
"3dtiles",
|
|
308
|
+
"osm-buildings",
|
|
309
|
+
"reearth-buildings",
|
|
310
|
+
"google-photorealistic",
|
|
311
|
+
"kml",
|
|
312
|
+
],
|
|
283
313
|
};
|
|
@@ -152,6 +152,8 @@ function getPickCullingVolume(
|
|
|
152
152
|
const camera = scene.camera;
|
|
153
153
|
const frustum = camera.frustum;
|
|
154
154
|
invariant(frustum instanceof PerspectiveFrustum);
|
|
155
|
+
invariant(frustum.fovy !== undefined);
|
|
156
|
+
invariant(frustum.aspectRatio !== undefined);
|
|
155
157
|
|
|
156
158
|
const near = frustum.near;
|
|
157
159
|
const tanPhi = Math.tan(frustum.fovy / 2);
|
|
@@ -10,7 +10,7 @@ export const makeMouseEventProps = (viewer: Viewer, e: CesiumMovementEvent) => {
|
|
|
10
10
|
const props: MouseEventProps = {
|
|
11
11
|
x: position?.x,
|
|
12
12
|
y: position?.y,
|
|
13
|
-
...(position ? getLocationFromScreen(viewer.scene, position.x, position.y, true) ?? {} : {}),
|
|
13
|
+
...(position ? (getLocationFromScreen(viewer.scene, position.x, position.y, true) ?? {}) : {}),
|
|
14
14
|
};
|
|
15
15
|
return props;
|
|
16
16
|
};
|
|
@@ -357,7 +357,7 @@ export const getEntityContent = (
|
|
|
357
357
|
},
|
|
358
358
|
};
|
|
359
359
|
|
|
360
|
-
return defaultContent ? content[defaultContent] : content.attributes ?? content.description;
|
|
360
|
+
return defaultContent ? content[defaultContent] : (content.attributes ?? content.description);
|
|
361
361
|
};
|
|
362
362
|
|
|
363
363
|
function propertiesToTableContent(properties: Record<string, any>): { key: string; value: any }[] {
|