@reearth/core 0.0.7-alpha.2 → 0.0.7-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +34412 -33036
- package/dist/core.umd.cjs +3867 -3825
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +69 -14
- package/package.json +27 -9
- package/src/Map/Layer/hooks.ts +6 -3
- package/src/Map/Layer/index.tsx +2 -0
- package/src/Map/Layers/hooks.ts +27 -0
- package/src/Map/Layers/index.tsx +12 -1
- package/src/Map/Layers/keys.ts +1 -0
- package/src/Map/Sketch/hooks.ts +412 -406
- package/src/Map/Sketch/index.tsx +65 -18
- package/src/Map/Sketch/sketchMachine.ts +359 -4
- 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 +559 -0
- package/src/Map/Sketch/useSketchFeature.ts +198 -0
- package/src/Map/hooks.ts +32 -1
- package/src/Map/index.tsx +24 -0
- package/src/Map/ref.ts +10 -0
- package/src/Map/types/index.ts +28 -1
- package/src/Map/types/viewerProperty.ts +2 -0
- package/src/Visualizer/coreContext.tsx +2 -0
- package/src/Visualizer/hooks.ts +39 -2
- package/src/Visualizer/index.tsx +20 -0
- package/src/engines/Cesium/Feature/Resource/utils.ts +81 -97
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +52 -24
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
- package/src/engines/Cesium/Feature/context.ts +1 -0
- package/src/engines/Cesium/Feature/index.tsx +6 -2
- package/src/engines/Cesium/Feature/utils.tsx +9 -4
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
- 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 +125 -35
- package/src/engines/Cesium/Sketch/constants.ts +5 -0
- package/src/engines/Cesium/Sketch/index.tsx +68 -29
- package/src/engines/Cesium/common.ts +42 -9
- package/src/engines/Cesium/core/Globe.tsx +11 -2
- package/src/engines/Cesium/core/Imagery.tsx +7 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +8 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
- package/src/engines/Cesium/core/presets.ts +0 -11
- package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
- package/src/engines/Cesium/hooks/useEngineRef.ts +44 -0
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +1 -1
- package/src/engines/Cesium/hooks.ts +42 -5
- package/src/engines/Cesium/index.tsx +16 -3
- package/src/mantle/atoms/compute.ts +5 -1
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/types/appearance.ts +0 -1
- package/src/mantle/types/index.ts +3 -0
- package/src/utils/image.ts +1 -11
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +0 -1
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/cesium/Widgets/lighter.css +0 -237
- package/dist/cesium/Widgets/lighterShared.css +0 -46
- package/dist/cesium/Widgets/shared.css +0 -103
- package/dist/cesium/Widgets/widgets.css +0 -1346
- package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
- package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
- package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
- package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
- package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
- package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
- package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
- package/dist/cesium/Workers/combineGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createGeometry.js +0 -26
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/cesium/Workers/createWallGeometry.js +0 -26
- package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/decodeDraco.js +0 -26
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/cesium/Workers/decodeI3S.js +0 -26
- package/dist/cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Cartesian3,
|
|
4
|
-
PolygonHierarchy,
|
|
5
|
-
PointGraphics,
|
|
6
|
-
BillboardGraphics,
|
|
7
|
-
JulianDate,
|
|
8
|
-
} from "cesium";
|
|
1
|
+
import { Entity, PointGraphics, BillboardGraphics, JulianDate } from "cesium";
|
|
9
2
|
|
|
10
3
|
import { EvalFeature } from "../../..";
|
|
11
4
|
import { AppearanceTypes, ComputedFeature, ComputedLayer, Feature } from "../../../../mantle";
|
|
12
5
|
import { heightReference, shadowMode, toColor } from "../../common";
|
|
6
|
+
import { getMarkerCoordinates, getGeometryFromEntity } from "../../helpers/getGeometryFromEntity";
|
|
13
7
|
import { convertEntityDescription, convertEntityProperties } from "../../utils/utils";
|
|
14
8
|
import { attachTag, extractSimpleLayer, getTag, Tag } from "../utils";
|
|
15
9
|
|
|
@@ -132,16 +126,14 @@ export const attachStyle = (
|
|
|
132
126
|
const point = hasAppearance(layer, entity, ["marker", "point"]);
|
|
133
127
|
const billboard = hasAppearance(layer, entity, ["marker", "billboard"]);
|
|
134
128
|
const label = hasAppearance(layer, entity, ["marker", "label"]);
|
|
135
|
-
if (point || billboard || label) {
|
|
136
|
-
const
|
|
137
|
-
const
|
|
129
|
+
if (entity.point || entity.billboard || entity.label) {
|
|
130
|
+
const coordinates = getMarkerCoordinates(entity, currentTime);
|
|
131
|
+
const geometry = getGeometryFromEntity(currentTime, entity);
|
|
132
|
+
|
|
138
133
|
const feature: Feature = {
|
|
139
134
|
type: "feature",
|
|
140
135
|
id: makeFeatureId(entity),
|
|
141
|
-
geometry
|
|
142
|
-
type: "Point",
|
|
143
|
-
coordinates,
|
|
144
|
-
},
|
|
136
|
+
geometry,
|
|
145
137
|
properties: convertEntityProperties(currentTime, entity),
|
|
146
138
|
metaData: {
|
|
147
139
|
description: convertEntityDescription(currentTime, entity),
|
|
@@ -168,10 +160,10 @@ export const attachStyle = (
|
|
|
168
160
|
name: "show",
|
|
169
161
|
...(computedFeature?.marker?.style
|
|
170
162
|
? {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
163
|
+
override:
|
|
164
|
+
computedFeature?.marker?.style === "point" &&
|
|
165
|
+
(computedFeature?.marker.show ?? true),
|
|
166
|
+
}
|
|
175
167
|
: {}),
|
|
176
168
|
},
|
|
177
169
|
pixelSize: {
|
|
@@ -207,10 +199,10 @@ export const attachStyle = (
|
|
|
207
199
|
name: "show",
|
|
208
200
|
...(computedFeature?.marker?.style
|
|
209
201
|
? {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
202
|
+
override:
|
|
203
|
+
computedFeature?.marker?.style === "image" &&
|
|
204
|
+
(computedFeature?.marker.show ?? true),
|
|
205
|
+
}
|
|
214
206
|
: {}),
|
|
215
207
|
},
|
|
216
208
|
image: {
|
|
@@ -261,21 +253,14 @@ export const attachStyle = (
|
|
|
261
253
|
return [feature, computedFeature];
|
|
262
254
|
}
|
|
263
255
|
|
|
264
|
-
if (
|
|
256
|
+
if (entity.polyline) {
|
|
265
257
|
const entityPosition = entity.position?.getValue(currentTime);
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
position?.x ?? 0,
|
|
269
|
-
position?.y ?? 0,
|
|
270
|
-
position?.z ?? 0,
|
|
271
|
-
]);
|
|
258
|
+
const geometry = getGeometryFromEntity(currentTime, entity);
|
|
259
|
+
|
|
272
260
|
const feature: Feature = {
|
|
273
261
|
type: "feature",
|
|
274
262
|
id: makeFeatureId(entity),
|
|
275
|
-
geometry
|
|
276
|
-
type: "LineString",
|
|
277
|
-
coordinates,
|
|
278
|
-
},
|
|
263
|
+
geometry,
|
|
279
264
|
properties: convertEntityProperties(currentTime, entity),
|
|
280
265
|
metaData: {
|
|
281
266
|
description: convertEntityDescription(currentTime, entity),
|
|
@@ -290,42 +275,39 @@ export const attachStyle = (
|
|
|
290
275
|
if (!computedFeature) {
|
|
291
276
|
return;
|
|
292
277
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
278
|
+
if (hasAppearance(layer, entity, ["polyline", "polyline"])) {
|
|
279
|
+
attachProperties(entity, computedFeature, ["polyline", "polyline"], {
|
|
280
|
+
show: {
|
|
281
|
+
name: "show",
|
|
282
|
+
default: true,
|
|
283
|
+
},
|
|
284
|
+
width: {
|
|
285
|
+
name: "strokeWidth",
|
|
286
|
+
},
|
|
287
|
+
material: {
|
|
288
|
+
name: "strokeColor",
|
|
289
|
+
type: "color",
|
|
290
|
+
},
|
|
291
|
+
shadows: {
|
|
292
|
+
name: "shadows",
|
|
293
|
+
type: "shadows",
|
|
294
|
+
},
|
|
295
|
+
clampToGround: {
|
|
296
|
+
name: "clampToGround",
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
}
|
|
313
300
|
return [feature, computedFeature];
|
|
314
301
|
}
|
|
315
302
|
|
|
316
|
-
if (
|
|
303
|
+
if (entity.polygon) {
|
|
317
304
|
const entityPosition = entity.position?.getValue(currentTime);
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
hole.positions.map(position => [position?.x ?? 0, position?.y ?? 0, position?.z ?? 0]),
|
|
321
|
-
);
|
|
305
|
+
const geometry = getGeometryFromEntity(currentTime, entity);
|
|
306
|
+
|
|
322
307
|
const feature: Feature = {
|
|
323
308
|
type: "feature",
|
|
324
309
|
id: makeFeatureId(entity),
|
|
325
|
-
geometry
|
|
326
|
-
type: "Polygon",
|
|
327
|
-
coordinates,
|
|
328
|
-
},
|
|
310
|
+
geometry,
|
|
329
311
|
properties: convertEntityProperties(currentTime, entity),
|
|
330
312
|
metaData: {
|
|
331
313
|
description: convertEntityDescription(currentTime, entity),
|
|
@@ -340,40 +322,42 @@ export const attachStyle = (
|
|
|
340
322
|
if (!computedFeature) {
|
|
341
323
|
return;
|
|
342
324
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
325
|
+
if (hasAppearance(layer, entity, ["polygon", "polygon"])) {
|
|
326
|
+
attachProperties(entity, computedFeature, ["polygon", "polygon"], {
|
|
327
|
+
show: {
|
|
328
|
+
name: "show",
|
|
329
|
+
default: true,
|
|
330
|
+
},
|
|
331
|
+
fill: {
|
|
332
|
+
name: "fill",
|
|
333
|
+
},
|
|
334
|
+
material: {
|
|
335
|
+
name: "fillColor",
|
|
336
|
+
type: "color",
|
|
337
|
+
},
|
|
338
|
+
outline: {
|
|
339
|
+
name: "stroke",
|
|
340
|
+
},
|
|
341
|
+
outlineColor: {
|
|
342
|
+
name: "strokeColor",
|
|
343
|
+
type: "color",
|
|
344
|
+
},
|
|
345
|
+
outlineWidth: {
|
|
346
|
+
name: "strokeWidth",
|
|
347
|
+
},
|
|
348
|
+
shadows: {
|
|
349
|
+
name: "shadows",
|
|
350
|
+
type: "shadows",
|
|
351
|
+
},
|
|
352
|
+
heightReference: {
|
|
353
|
+
name: "heightReference",
|
|
354
|
+
type: "heightReference",
|
|
355
|
+
},
|
|
356
|
+
extrudedHeight: {
|
|
357
|
+
name: "extrudedHeight",
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
}
|
|
377
361
|
return [feature, computedFeature];
|
|
378
362
|
}
|
|
379
363
|
};
|
|
@@ -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
|
};
|
|
@@ -450,7 +448,7 @@ export const useHooks = ({
|
|
|
450
448
|
}) => {
|
|
451
449
|
const { viewer } = useCesium();
|
|
452
450
|
const tilesetRef = useRef<Cesium3DTilesetType>();
|
|
453
|
-
const { onLayerLoad } = useContext();
|
|
451
|
+
const { onLayerLoad, updateCredits } = useContext();
|
|
454
452
|
const layerIdRef = useRef(layer?.id);
|
|
455
453
|
layerIdRef.current = layer?.id;
|
|
456
454
|
|
|
@@ -460,7 +458,6 @@ export const useHooks = ({
|
|
|
460
458
|
edgeColor,
|
|
461
459
|
edgeWidth,
|
|
462
460
|
experimental_clipping,
|
|
463
|
-
apiKey,
|
|
464
461
|
selectedFeatureColor,
|
|
465
462
|
disableIndexingFeature,
|
|
466
463
|
} = property ?? {};
|
|
@@ -481,7 +478,7 @@ export const useHooks = ({
|
|
|
481
478
|
} = useClippingBox({ clipping: experimental_clipping, boxId });
|
|
482
479
|
|
|
483
480
|
const [style, setStyle] = useState<Cesium3DTileStyle>();
|
|
484
|
-
const { url, type, idProperty } = useData(layer);
|
|
481
|
+
const { url, type, idProperty, googleMapApiKey } = useData(layer);
|
|
485
482
|
const shouldUseFeatureIndex = !disableIndexingFeature && !!idProperty;
|
|
486
483
|
|
|
487
484
|
const [isTilesetReady, setIsTilesetReady] = useState(false);
|
|
@@ -503,8 +500,9 @@ export const useHooks = ({
|
|
|
503
500
|
return prevPlanes.current;
|
|
504
501
|
}, [_planes]);
|
|
505
502
|
const clipDirection = direction === "inside" ? -1 : 1;
|
|
503
|
+
|
|
506
504
|
// Create immutable object
|
|
507
|
-
const [clippingPlanes] = useState(
|
|
505
|
+
const [clippingPlanes, setClippingPlanes] = useState<CesiumClippingPlaneCollection>(
|
|
508
506
|
() =>
|
|
509
507
|
new CesiumClippingPlaneCollection({
|
|
510
508
|
planes: planes?.map(
|
|
@@ -519,6 +517,27 @@ export const useHooks = ({
|
|
|
519
517
|
edgeColor: toColor(edgeColor),
|
|
520
518
|
}),
|
|
521
519
|
);
|
|
520
|
+
// Initialize clipping planes
|
|
521
|
+
// This is workaround to reinitialize ClippingPlanes in strict mode.
|
|
522
|
+
useEffect(
|
|
523
|
+
() => () => {
|
|
524
|
+
setClippingPlanes(
|
|
525
|
+
new CesiumClippingPlaneCollection({
|
|
526
|
+
planes: planes?.map(
|
|
527
|
+
plane =>
|
|
528
|
+
new ClippingPlane(
|
|
529
|
+
new Cartesian3(plane.normal?.x, plane.normal?.y, plane.normal?.z),
|
|
530
|
+
(plane.distance || 0) * clipDirection,
|
|
531
|
+
),
|
|
532
|
+
),
|
|
533
|
+
unionClippingRegions: direction === "outside",
|
|
534
|
+
edgeWidth: edgeWidth,
|
|
535
|
+
edgeColor: toColor(edgeColor),
|
|
536
|
+
}),
|
|
537
|
+
);
|
|
538
|
+
},
|
|
539
|
+
[], // eslint-disable-line react-hooks/exhaustive-deps
|
|
540
|
+
);
|
|
522
541
|
|
|
523
542
|
const { drawClippingEnabled, drawClippingEdgeProps } = useDrawClipping({
|
|
524
543
|
...experimental_clipping?.draw,
|
|
@@ -708,31 +727,33 @@ export const useHooks = ({
|
|
|
708
727
|
})();
|
|
709
728
|
}, [styleUrl]);
|
|
710
729
|
|
|
711
|
-
const
|
|
712
|
-
if (type !== "google-photorealistic" || !isVisible) return;
|
|
713
|
-
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}
|
|
723
|
-
|
|
730
|
+
const googleMapPhotorealisticResource = useMemo(() => {
|
|
731
|
+
if (type !== "google-photorealistic" || !isVisible) return null;
|
|
732
|
+
|
|
733
|
+
const loadTileset = async () => {
|
|
734
|
+
try {
|
|
735
|
+
const tileset = await createGooglePhotorealistic3DTileset(googleMapApiKey);
|
|
736
|
+
return tileset.resource;
|
|
737
|
+
} catch (error) {
|
|
738
|
+
console.error(`Error loading Photorealistic 3D Tiles tileset: ${error}`);
|
|
739
|
+
throw error;
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
return loadTileset();
|
|
744
|
+
}, [type, isVisible, googleMapApiKey]);
|
|
724
745
|
|
|
725
746
|
const tilesetUrl = useMemo(() => {
|
|
726
747
|
return type === "osm-buildings" && isVisible
|
|
727
748
|
? IonResource.fromAssetId(96188, {
|
|
728
749
|
accessToken: meta?.cesiumIonAccessToken as string | undefined,
|
|
729
750
|
}) // https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Scene/createOsmBuildings.js#L53
|
|
730
|
-
:
|
|
731
|
-
?
|
|
751
|
+
: googleMapPhotorealisticResource && isVisible
|
|
752
|
+
? googleMapPhotorealisticResource
|
|
732
753
|
: type === "3dtiles" && isVisible
|
|
733
754
|
? url ?? tileset
|
|
734
755
|
: null;
|
|
735
|
-
}, [
|
|
756
|
+
}, [type, isVisible, meta?.cesiumIonAccessToken, googleMapPhotorealisticResource, url, tileset]);
|
|
736
757
|
|
|
737
758
|
const imageBasedLighting = useMemo(() => {
|
|
738
759
|
if (
|
|
@@ -780,6 +801,13 @@ export const useHooks = ({
|
|
|
780
801
|
[onLayerFetch, onLayerLoad],
|
|
781
802
|
);
|
|
782
803
|
|
|
804
|
+
useEffect(() => {
|
|
805
|
+
updateCredits?.();
|
|
806
|
+
return () => {
|
|
807
|
+
updateCredits?.();
|
|
808
|
+
};
|
|
809
|
+
}, [type, updateCredits]);
|
|
810
|
+
|
|
783
811
|
return {
|
|
784
812
|
tilesetUrl,
|
|
785
813
|
ref,
|
|
@@ -411,7 +411,16 @@ export const useClippingBox = ({
|
|
|
411
411
|
eventHandler.setInputAction(handleMouseUp, ScreenSpaceEventType.LEFT_UP);
|
|
412
412
|
}, [eventHandler, handleMouseDown, handleRawMouseMove, handleMouseUp]);
|
|
413
413
|
|
|
414
|
-
useEffect(
|
|
414
|
+
useEffect(
|
|
415
|
+
() => () => {
|
|
416
|
+
requestAnimationFrame(() => {
|
|
417
|
+
if (!eventHandler.isDestroyed()) {
|
|
418
|
+
eventHandler.destroy();
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
[eventHandler],
|
|
423
|
+
);
|
|
415
424
|
|
|
416
425
|
const boxProperty = useMemo(
|
|
417
426
|
() => ({ ...boxState, ...dimensions, allowEnterGround }),
|
|
@@ -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>({});
|
|
@@ -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) {
|
|
@@ -23,9 +23,10 @@ import {
|
|
|
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,9 +107,12 @@ function EntityExtComponent(
|
|
|
105
107
|
props.id,
|
|
106
108
|
unselectable,
|
|
107
109
|
hideIndicator,
|
|
110
|
+
entity,
|
|
108
111
|
]);
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
const handleRef = useCallback((r: CesiumComponentRef<CesiumEntity>) => setEntity(r), []);
|
|
114
|
+
|
|
115
|
+
return <Entity ref={composeRefs(ref, handleRef)} {...props} />;
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
export function attachTag(
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
// https://github.com/CesiumGS/cesium/blob/1.106/packages/engine/Source/Shaders/Model/ImageBasedLightingStageFS.glsl
|
|
7
7
|
// Specular term was removed, as I never apply it on terrain.
|
|
8
8
|
vec3 reearth_imageBasedLightingStage(vec3 positionEC, vec3 normalEC,
|
|
9
|
-
vec3 lightDirectionEC,
|
|
10
|
-
czm_pbrParameters pbrParameters) {
|
|
9
|
+
vec3 lightDirectionEC, czm_modelMaterial material) {
|
|
11
10
|
vec3 v = -positionEC;
|
|
12
11
|
vec3 n = normalEC;
|
|
13
12
|
vec3 l = normalize(lightDirectionEC);
|
|
@@ -24,21 +23,18 @@ vec3 reearth_imageBasedLightingStage(vec3 positionEC, vec3 normalEC,
|
|
|
24
23
|
vec3 diffuseIrradiance =
|
|
25
24
|
czm_sphericalHarmonics(cubeDir, u_reearth_sphericalHarmonicCoefficients);
|
|
26
25
|
|
|
27
|
-
return
|
|
26
|
+
return material.diffuse * diffuseIrradiance;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
vec4 reearth_computeImageBasedLightingColor(vec4 color) {
|
|
31
30
|
if (u_reearth_globeImageBasedLighting) {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
czm_modelMaterial material;
|
|
32
|
+
material.diffuse = color.rgb;
|
|
34
33
|
|
|
35
34
|
vec3 normalEC = normalize(v_normalEC);
|
|
36
35
|
vec3 lighting =
|
|
37
|
-
czm_pbrLighting(v_positionEC, normalEC, czm_lightDirectionEC,
|
|
38
|
-
|
|
39
|
-
lighting += reearth_imageBasedLightingStage(
|
|
40
|
-
v_positionEC, normalEC, czm_lightDirectionEC,
|
|
41
|
-
czm_lightColorHdr, pbrParameters) *
|
|
36
|
+
czm_pbrLighting(v_positionEC, normalEC, czm_lightDirectionEC, material) * czm_lightColorHdr;
|
|
37
|
+
lighting += reearth_imageBasedLightingStage(v_positionEC, normalEC, czm_lightDirectionEC, material) *
|
|
42
38
|
u_vertexShadowDarkness;
|
|
43
39
|
|
|
44
40
|
#ifndef HDR
|