@reearth/core 0.0.7-alpha.4 → 0.0.7-alpha.40
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 +44851 -39511
- package/dist/core.umd.cjs +3910 -3868
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +141 -24
- package/package.json +29 -9
- package/src/Map/Geoid/index.tsx +68 -0
- package/src/Map/Geoid/types.ts +8 -0
- 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 +450 -407
- 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/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 +40 -7
- package/src/Map/ref.ts +30 -0
- package/src/Map/types/index.ts +37 -1
- package/src/Map/types/viewerProperty.ts +10 -0
- package/src/Visualizer/coreContext.tsx +2 -0
- package/src/Visualizer/hooks.ts +46 -12
- package/src/Visualizer/index.tsx +22 -3
- package/src/Visualizer/interactionMode.ts +2 -1
- package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
- package/src/engines/Cesium/Feature/Polygon/index.tsx +6 -4
- package/src/engines/Cesium/Feature/Raster/mvt.ts +2 -1
- package/src/engines/Cesium/Feature/Resource/utils.ts +86 -91
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +75 -35
- 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 -5
- 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/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 +52 -16
- package/src/engines/Cesium/core/Globe.tsx +11 -2
- package/src/engines/Cesium/core/Imagery.tsx +16 -3
- 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 +46 -1
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +1 -1
- package/src/engines/Cesium/hooks.ts +45 -4
- package/src/engines/Cesium/index.tsx +16 -3
- package/src/engines/Cesium/types.ts +1 -1
- package/src/mantle/atoms/compute.ts +5 -1
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/evaluator/simple/expression/expression.test.ts +72 -0
- package/src/mantle/evaluator/simple/expression/node.ts +10 -12
- package/src/mantle/types/appearance.ts +12 -10
- 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
- /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
|
@@ -35,11 +35,14 @@ import {
|
|
|
35
35
|
Plane,
|
|
36
36
|
CameraEventType,
|
|
37
37
|
KeyboardEventModifier,
|
|
38
|
+
CreditDisplay,
|
|
39
|
+
Credit as CesiumCredit,
|
|
38
40
|
} from "cesium";
|
|
39
|
-
import {
|
|
41
|
+
import { MutableRefObject, useMemo } from "react";
|
|
40
42
|
|
|
41
43
|
import type { Camera, Clock } from "..";
|
|
42
44
|
import { ClassificationType } from "../../mantle";
|
|
45
|
+
import { Credits } from "../../Map";
|
|
43
46
|
import type {
|
|
44
47
|
CameraOptions,
|
|
45
48
|
FlyToDestination,
|
|
@@ -48,16 +51,16 @@ import type {
|
|
|
48
51
|
OverideKeyboardEventModifier,
|
|
49
52
|
ScreenSpaceCameraControllerOptions,
|
|
50
53
|
} from "../../types";
|
|
51
|
-
import { tweenInterval,
|
|
54
|
+
import { tweenInterval, useImage, LatLngHeight } from "../../utils";
|
|
52
55
|
|
|
53
56
|
import { DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS } from "./constants";
|
|
54
57
|
|
|
55
58
|
export const layerIdField = `__reearth_layer_id`;
|
|
56
59
|
|
|
57
60
|
const defaultImageSize = 50;
|
|
61
|
+
const emptyCredites: Credits = { engine: {}, lightbox: [], screen: [] };
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
c: HTMLCanvasElement,
|
|
63
|
+
const drawIcon = (
|
|
61
64
|
image: HTMLImageElement | undefined,
|
|
62
65
|
w: number,
|
|
63
66
|
h: number,
|
|
@@ -68,13 +71,14 @@ export const drawIcon = (
|
|
|
68
71
|
shadowOffsetX = 0,
|
|
69
72
|
shadowOffsetY = 0,
|
|
70
73
|
) => {
|
|
74
|
+
const c = document.createElement("canvas");
|
|
71
75
|
const ctx = c.getContext("2d");
|
|
72
76
|
if (!image || !ctx) return;
|
|
73
77
|
|
|
74
78
|
ctx.save();
|
|
75
79
|
|
|
76
|
-
c.width = w + shadowBlur;
|
|
77
|
-
c.height = h + shadowBlur;
|
|
80
|
+
c.width = w + shadowBlur * 2;
|
|
81
|
+
c.height = h + shadowBlur * 2;
|
|
78
82
|
ctx.shadowBlur = shadowBlur;
|
|
79
83
|
ctx.shadowOffsetX = shadowOffsetX;
|
|
80
84
|
ctx.shadowOffsetY = shadowOffsetY;
|
|
@@ -85,14 +89,14 @@ export const drawIcon = (
|
|
|
85
89
|
if (crop === "circle") {
|
|
86
90
|
ctx.fillStyle = "black";
|
|
87
91
|
ctx.globalCompositeOperation = "destination-in";
|
|
88
|
-
ctx.arc(
|
|
92
|
+
ctx.arc(c.width / 2, c.height / 2, Math.min(w, h) / 2, 0, 2 * Math.PI);
|
|
89
93
|
ctx.fill();
|
|
90
94
|
|
|
91
95
|
if (shadow) {
|
|
92
96
|
ctx.shadowColor = shadowColor;
|
|
93
97
|
ctx.globalCompositeOperation = "destination-over";
|
|
94
98
|
ctx.fillStyle = "black";
|
|
95
|
-
ctx.arc(
|
|
99
|
+
ctx.arc(c.width / 2, c.height / 2, Math.min(w, h) / 2, 0, 2 * Math.PI);
|
|
96
100
|
ctx.fill();
|
|
97
101
|
}
|
|
98
102
|
} else if (shadow) {
|
|
@@ -104,6 +108,7 @@ export const drawIcon = (
|
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
ctx.restore();
|
|
111
|
+
return c.toDataURL();
|
|
107
112
|
};
|
|
108
113
|
|
|
109
114
|
export const useIcon = ({
|
|
@@ -138,13 +143,11 @@ export const useIcon = ({
|
|
|
138
143
|
? Math.floor(img.height * imageSize)
|
|
139
144
|
: Math.floor((w / img.width) * img.height);
|
|
140
145
|
|
|
141
|
-
const
|
|
142
|
-
(
|
|
143
|
-
drawIcon(can, img, w, h, crop, shadow, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY),
|
|
146
|
+
const canvas = useMemo(
|
|
147
|
+
() => drawIcon(img, w, h, crop, shadow, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY),
|
|
144
148
|
[crop, h, img, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, w],
|
|
145
149
|
);
|
|
146
|
-
|
|
147
|
-
return [canvas, w, h];
|
|
150
|
+
return [canvas ?? "", w, h];
|
|
148
151
|
};
|
|
149
152
|
|
|
150
153
|
export const ho = (o: "left" | "center" | "right" | undefined): HorizontalOrigin | undefined =>
|
|
@@ -545,7 +548,7 @@ export const colorBlendMode = (colorBlendMode?: "highlight" | "replace" | "mix"
|
|
|
545
548
|
)[colorBlendMode || ""];
|
|
546
549
|
|
|
547
550
|
export const colorBlendModeFor3DTile = (
|
|
548
|
-
colorBlendMode
|
|
551
|
+
colorBlendMode: "highlight" | "replace" | "mix" = "highlight",
|
|
549
552
|
) =>
|
|
550
553
|
(
|
|
551
554
|
({
|
|
@@ -553,7 +556,7 @@ export const colorBlendModeFor3DTile = (
|
|
|
553
556
|
replace: Cesium3DTileColorBlendMode.REPLACE,
|
|
554
557
|
mix: Cesium3DTileColorBlendMode.MIX,
|
|
555
558
|
}) as { [key in string]?: Cesium3DTileColorBlendMode }
|
|
556
|
-
)[colorBlendMode
|
|
559
|
+
)[colorBlendMode];
|
|
557
560
|
|
|
558
561
|
export const heightReference = (
|
|
559
562
|
heightReference?: "none" | "clamp" | "relative",
|
|
@@ -852,6 +855,7 @@ export function getExtrudedHeight(
|
|
|
852
855
|
scene: Scene,
|
|
853
856
|
position: Cartesian3,
|
|
854
857
|
windowPosition: Cartesian2,
|
|
858
|
+
allowNegative = false,
|
|
855
859
|
): number | undefined {
|
|
856
860
|
const cartesianScratch = new Cartesian3();
|
|
857
861
|
const normalScratch = new Cartesian3();
|
|
@@ -893,9 +897,41 @@ export function getExtrudedHeight(
|
|
|
893
897
|
scene.globe.ellipsoid,
|
|
894
898
|
cartographicScratch,
|
|
895
899
|
).height;
|
|
896
|
-
return Math.max(0, toHeight - fromHeight);
|
|
900
|
+
return allowNegative ? toHeight - fromHeight : Math.max(0, toHeight - fromHeight);
|
|
897
901
|
} catch (error) {
|
|
898
902
|
console.error(error);
|
|
899
903
|
}
|
|
900
904
|
return;
|
|
901
905
|
}
|
|
906
|
+
|
|
907
|
+
export function getCredits(viewer: Viewer) {
|
|
908
|
+
if (!viewer) return emptyCredites;
|
|
909
|
+
const creditDisplay = viewer.creditDisplay as
|
|
910
|
+
| (CreditDisplay & {
|
|
911
|
+
_currentFrameCredits: {
|
|
912
|
+
lightboxCredits: { _array: { credit?: CesiumCredit }[] };
|
|
913
|
+
screenCredits: { _array: { credit?: CesiumCredit }[] };
|
|
914
|
+
};
|
|
915
|
+
_currentCesiumCredit: CesiumCredit;
|
|
916
|
+
})
|
|
917
|
+
| undefined;
|
|
918
|
+
|
|
919
|
+
if (!creditDisplay) return emptyCredites;
|
|
920
|
+
|
|
921
|
+
const { lightboxCredits, screenCredits } = creditDisplay?._currentFrameCredits || {};
|
|
922
|
+
const cesiumCredits = creditDisplay._currentCesiumCredit;
|
|
923
|
+
|
|
924
|
+
const credits: Credits = {
|
|
925
|
+
engine: {
|
|
926
|
+
cesium: cesiumCredits?.html ? { html: cesiumCredits.html } : undefined,
|
|
927
|
+
},
|
|
928
|
+
lightbox: Array.from(lightboxCredits?._array ?? []).map(c => ({
|
|
929
|
+
html: c?.credit?.html,
|
|
930
|
+
})),
|
|
931
|
+
screen: Array.from(screenCredits?._array ?? []).map(c => ({
|
|
932
|
+
html: c?.credit?.html,
|
|
933
|
+
})),
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
return credits;
|
|
937
|
+
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
IonResource,
|
|
6
6
|
TerrainProvider,
|
|
7
7
|
} from "cesium";
|
|
8
|
-
import { useMemo } from "react";
|
|
8
|
+
import { useEffect, useMemo } from "react";
|
|
9
9
|
import { Globe as CesiumGlobe } from "resium";
|
|
10
10
|
|
|
11
11
|
import type { ViewerProperty, TerrainProperty } from "../..";
|
|
@@ -15,9 +15,14 @@ import { toColor } from "../common";
|
|
|
15
15
|
export type Props = {
|
|
16
16
|
property?: ViewerProperty;
|
|
17
17
|
cesiumIonAccessToken?: string;
|
|
18
|
+
onTerrainProviderChange?: () => void;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
export default function Globe({
|
|
21
|
+
export default function Globe({
|
|
22
|
+
property,
|
|
23
|
+
cesiumIonAccessToken,
|
|
24
|
+
onTerrainProviderChange,
|
|
25
|
+
}: Props): JSX.Element | null {
|
|
21
26
|
const terrainProperty = useMemo(
|
|
22
27
|
(): TerrainProperty => ({
|
|
23
28
|
...property?.terrain,
|
|
@@ -51,6 +56,10 @@ export default function Globe({ property, cesiumIonAccessToken }: Props): JSX.El
|
|
|
51
56
|
[property?.globe?.baseColor],
|
|
52
57
|
);
|
|
53
58
|
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
onTerrainProviderChange?.();
|
|
61
|
+
}, [terrainProvider, onTerrainProviderChange]);
|
|
62
|
+
|
|
54
63
|
return (
|
|
55
64
|
<CesiumGlobe
|
|
56
65
|
baseColor={baseColor}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TextureMinificationFilter,
|
|
6
6
|
} from "cesium";
|
|
7
7
|
import { isEqual } from "lodash-es";
|
|
8
|
-
import { useCallback, useMemo, useRef, useLayoutEffect, useState } from "react";
|
|
8
|
+
import { useCallback, useMemo, useRef, useLayoutEffect, useState, useEffect } from "react";
|
|
9
9
|
import { ImageryLayer } from "resium";
|
|
10
10
|
|
|
11
11
|
import { tiles as tilePresets } from "./presets";
|
|
@@ -31,9 +31,10 @@ export type Tile = {
|
|
|
31
31
|
export type Props = {
|
|
32
32
|
tiles?: Tile[];
|
|
33
33
|
cesiumIonAccessToken?: string;
|
|
34
|
+
onTilesChange?: () => void;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
export default function ImageryLayers({ tiles, cesiumIonAccessToken }: Props) {
|
|
37
|
+
export default function ImageryLayers({ tiles, cesiumIonAccessToken, onTilesChange }: Props) {
|
|
37
38
|
const { providers, updated } = useImageryProviders({
|
|
38
39
|
tiles,
|
|
39
40
|
cesiumIonAccessToken,
|
|
@@ -47,6 +48,10 @@ export default function ImageryLayers({ tiles, cesiumIonAccessToken }: Props) {
|
|
|
47
48
|
if (updated) setCounter(c => c + 1);
|
|
48
49
|
}, [providers, updated]);
|
|
49
50
|
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
onTilesChange?.();
|
|
53
|
+
}, [tiles, counter, onTilesChange]);
|
|
54
|
+
|
|
50
55
|
return (
|
|
51
56
|
<>
|
|
52
57
|
{tiles
|
|
@@ -108,6 +113,12 @@ export function useImageryProviders({
|
|
|
108
113
|
const tileKeys = tiles.map(t => t.id).join(",");
|
|
109
114
|
const prevTileKeys = useRef(tileKeys);
|
|
110
115
|
const prevProviders = useRef<Providers>({});
|
|
116
|
+
const zoomLevels = useMemo(() => tiles.map(t => {
|
|
117
|
+
if (t.id && t.zoomLevel) return { [t.id]: t.zoomLevel };
|
|
118
|
+
return
|
|
119
|
+
}),
|
|
120
|
+
[tiles]);
|
|
121
|
+
const prevZoomLevels = useRef(zoomLevels);
|
|
111
122
|
|
|
112
123
|
// Manage TileProviders so that TileProvider does not need to be recreated each time tiles are updated.
|
|
113
124
|
const { providers, updated } = useMemo(() => {
|
|
@@ -169,13 +180,15 @@ export function useImageryProviders({
|
|
|
169
180
|
!!added.length ||
|
|
170
181
|
!!isCesiumAccessTokenUpdated ||
|
|
171
182
|
!isEqual(prevTileKeys.current, tileKeys) ||
|
|
183
|
+
!isEqual(prevZoomLevels.current, zoomLevels) ||
|
|
172
184
|
rawProviders.some(p => p.tile && (p.prevType !== p.tile.type || p.prevUrl !== p.tile.url));
|
|
173
185
|
|
|
174
186
|
prevTileKeys.current = tileKeys;
|
|
187
|
+
prevZoomLevels.current = zoomLevels;
|
|
175
188
|
prevCesiumIonAccessToken.current = cesiumIonAccessToken;
|
|
176
189
|
|
|
177
190
|
return { providers, updated };
|
|
178
|
-
}, [cesiumIonAccessToken, tiles, tileKeys, newTile]);
|
|
191
|
+
}, [cesiumIonAccessToken, tiles, tileKeys, newTile, zoomLevels]);
|
|
179
192
|
|
|
180
193
|
prevProviders.current = providers;
|
|
181
194
|
return { providers, updated };
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type Ellipsoid,
|
|
13
13
|
type Label,
|
|
14
14
|
} from "@cesium/engine";
|
|
15
|
+
import { DistanceDisplayCondition } from "cesium";
|
|
15
16
|
import { merge, omit } from "lodash-es";
|
|
16
17
|
import { type Feature } from "protomaps";
|
|
17
18
|
import { memo, useCallback, useEffect, useMemo, useRef, type FC } from "react";
|
|
@@ -170,6 +171,8 @@ export interface JapanGSIOptimalBVmapLabelImageryProps {
|
|
|
170
171
|
height?: number;
|
|
171
172
|
style?: AnnotationStyle;
|
|
172
173
|
labelCollection?: LabelCollection;
|
|
174
|
+
near?: number;
|
|
175
|
+
far?: number;
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImageryProps> = memo(
|
|
@@ -180,6 +183,8 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
180
183
|
height = 50,
|
|
181
184
|
style = defaultStyle,
|
|
182
185
|
labelCollection,
|
|
186
|
+
near,
|
|
187
|
+
far,
|
|
183
188
|
}) => {
|
|
184
189
|
const cesiumContext = useCesium();
|
|
185
190
|
|
|
@@ -282,6 +287,8 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
282
287
|
horizontalOrigin: HorizontalOrigin.CENTER,
|
|
283
288
|
verticalOrigin: VerticalOrigin.BOTTOM,
|
|
284
289
|
heightReference: HeightReference.CLAMP_TO_GROUND,
|
|
290
|
+
distanceDisplayCondition:
|
|
291
|
+
near || far ? new DistanceDisplayCondition(near, far) : undefined,
|
|
285
292
|
disableDepthTestDistance: Infinity,
|
|
286
293
|
...styleOptions,
|
|
287
294
|
};
|
|
@@ -308,7 +315,7 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
308
315
|
scene?.postRender.addEventListener(removeLabels);
|
|
309
316
|
}
|
|
310
317
|
};
|
|
311
|
-
}, [style, annotations, scene, labelCollection]);
|
|
318
|
+
}, [style, annotations, scene, labelCollection, near, far]);
|
|
312
319
|
|
|
313
320
|
useEffect(() => {
|
|
314
321
|
updateVisibility();
|
|
@@ -143,7 +143,9 @@ const LabelImageryCollection: FC<{
|
|
|
143
143
|
imageriesAtom: Atom<KeyedImagery[]>;
|
|
144
144
|
style?: AnnotationStyle;
|
|
145
145
|
labelCollection?: LabelCollection;
|
|
146
|
-
|
|
146
|
+
near?: number;
|
|
147
|
+
far?: number;
|
|
148
|
+
}> = ({ imageryProvider, imageriesAtom, style, labelCollection, near, far }) => {
|
|
147
149
|
const imageries = useAtomValue(imageriesAtom);
|
|
148
150
|
return (
|
|
149
151
|
<>
|
|
@@ -155,6 +157,8 @@ const LabelImageryCollection: FC<{
|
|
|
155
157
|
descendants={imagery.descendants}
|
|
156
158
|
style={style}
|
|
157
159
|
labelCollection={labelCollection}
|
|
160
|
+
near={near}
|
|
161
|
+
far={far}
|
|
158
162
|
/>
|
|
159
163
|
</Suspense>
|
|
160
164
|
))}
|
|
@@ -164,9 +168,15 @@ const LabelImageryCollection: FC<{
|
|
|
164
168
|
|
|
165
169
|
export interface VectorMapLabelProps {
|
|
166
170
|
style?: Record<string, any>;
|
|
171
|
+
near?: number;
|
|
172
|
+
far?: number;
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({
|
|
175
|
+
export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({
|
|
176
|
+
style,
|
|
177
|
+
near,
|
|
178
|
+
far,
|
|
179
|
+
}) => {
|
|
170
180
|
const [imageryProvider, setImageryProvider] =
|
|
171
181
|
useState<JapanGSIOptimalBVmapLabelImageryProvider>();
|
|
172
182
|
const setRef = useCallback((handle: CesiumComponentRef<CesiumImageryLayer> | null) => {
|
|
@@ -251,6 +261,8 @@ export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({ st
|
|
|
251
261
|
imageriesAtom={imageriesAtom}
|
|
252
262
|
style={style}
|
|
253
263
|
labelCollection={labels}
|
|
264
|
+
near={near}
|
|
265
|
+
far={far}
|
|
254
266
|
/>
|
|
255
267
|
)}
|
|
256
268
|
</>
|
|
@@ -8,6 +8,8 @@ export interface TileLabelConfig {
|
|
|
8
8
|
labelType: "japan_gsi_optimal_bvmap";
|
|
9
9
|
fillColor?: string;
|
|
10
10
|
outlineColor?: string;
|
|
11
|
+
near?: number;
|
|
12
|
+
far?: number;
|
|
11
13
|
style: Record<string, any>;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -23,7 +25,14 @@ const LabelImageryLayers = memo(
|
|
|
23
25
|
if (!label) return null;
|
|
24
26
|
switch (label.labelType) {
|
|
25
27
|
case "japan_gsi_optimal_bvmap":
|
|
26
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
<JapanGSIOptimalBVmapVectorMapLabel
|
|
30
|
+
key={label.id}
|
|
31
|
+
style={label.style}
|
|
32
|
+
near={label.near}
|
|
33
|
+
far={label.far}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
27
36
|
default:
|
|
28
37
|
return null;
|
|
29
38
|
}
|
|
@@ -24,17 +24,6 @@ export const tiles = {
|
|
|
24
24
|
IonImageryProvider.fromAssetId(IonWorldImageryStyle.ROAD, {
|
|
25
25
|
accessToken: cesiumIonAccessToken,
|
|
26
26
|
}).catch(console.error),
|
|
27
|
-
stamen_watercolor: () =>
|
|
28
|
-
new OpenStreetMapImageryProvider({
|
|
29
|
-
url: "https://stamen-tiles.a.ssl.fastly.net/watercolor/",
|
|
30
|
-
credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",
|
|
31
|
-
fileExtension: "jpg",
|
|
32
|
-
}),
|
|
33
|
-
stamen_toner: () =>
|
|
34
|
-
new OpenStreetMapImageryProvider({
|
|
35
|
-
url: "https://stamen-tiles.a.ssl.fastly.net/toner/",
|
|
36
|
-
credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",
|
|
37
|
-
}),
|
|
38
27
|
open_street_map: () =>
|
|
39
28
|
new OpenStreetMapImageryProvider({
|
|
40
29
|
url: "https://a.tile.openstreetmap.org/",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Cartesian3, Entity, JulianDate, PolygonHierarchy } from "cesium";
|
|
2
|
+
|
|
3
|
+
import { Geometry } from "../../../mantle";
|
|
4
|
+
|
|
5
|
+
export function getMarkerCoordinates(
|
|
6
|
+
entity: Entity,
|
|
7
|
+
currentTime: JulianDate,
|
|
8
|
+
): [number, number, number] {
|
|
9
|
+
const position = entity.position?.getValue(currentTime) as Cartesian3 | undefined;
|
|
10
|
+
return [position?.x ?? 0, position?.y ?? 0, position?.z ?? 0];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function getGeometryFromEntity(currentTime: JulianDate, entity: Entity) {
|
|
14
|
+
if (entity.point || entity.billboard || entity.label) {
|
|
15
|
+
const coordinates = getMarkerCoordinates(entity, currentTime);
|
|
16
|
+
|
|
17
|
+
const geometry: Geometry = {
|
|
18
|
+
type: "Point",
|
|
19
|
+
coordinates,
|
|
20
|
+
};
|
|
21
|
+
return geometry;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (entity.polyline) {
|
|
25
|
+
const positions = entity.polyline?.positions?.getValue(currentTime) as Cartesian3[];
|
|
26
|
+
const coordinates = positions?.map(position => [
|
|
27
|
+
position?.x ?? 0,
|
|
28
|
+
position?.y ?? 0,
|
|
29
|
+
position?.z ?? 0,
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
const geometry: Geometry = {
|
|
33
|
+
type: "LineString",
|
|
34
|
+
coordinates,
|
|
35
|
+
};
|
|
36
|
+
return geometry;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (entity.polygon) {
|
|
40
|
+
const hierarchy = entity.polygon?.hierarchy?.getValue(currentTime) as PolygonHierarchy;
|
|
41
|
+
const coordinates = hierarchy?.positions?.map(position => [
|
|
42
|
+
position?.x ?? 0,
|
|
43
|
+
position?.y ?? 0,
|
|
44
|
+
position?.z ?? 0,
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
const geometry: Geometry = {
|
|
48
|
+
type: "Polygon",
|
|
49
|
+
coordinates: [coordinates],
|
|
50
|
+
};
|
|
51
|
+
return geometry;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
@@ -32,8 +32,10 @@ import {
|
|
|
32
32
|
cartesianToLatLngHeight,
|
|
33
33
|
getExtrudedHeight,
|
|
34
34
|
getOverriddenScreenSpaceCameraOptions,
|
|
35
|
+
getCredits,
|
|
35
36
|
} from "../common";
|
|
36
37
|
import { attachTag, getTag } from "../Feature";
|
|
38
|
+
import { getGeometryFromEntity } from "../helpers/getGeometryFromEntity";
|
|
37
39
|
import { PickedFeature, pickManyFromViewportAsFeature } from "../pickMany";
|
|
38
40
|
import { createGeometry } from "../Sketch/createGeometry";
|
|
39
41
|
import { CursorType } from "../types";
|
|
@@ -259,15 +261,31 @@ export default function useEngineRef(
|
|
|
259
261
|
}
|
|
260
262
|
return;
|
|
261
263
|
},
|
|
262
|
-
getExtrudedHeight: (position, windowPosition) => {
|
|
264
|
+
getExtrudedHeight: (position, windowPosition, allowNegative) => {
|
|
263
265
|
const viewer = cesium.current?.cesiumElement;
|
|
264
266
|
if (!viewer || viewer.isDestroyed()) return;
|
|
265
267
|
return getExtrudedHeight(
|
|
266
268
|
viewer.scene,
|
|
267
269
|
new Cesium.Cartesian3(position[0], position[1], position[2]),
|
|
268
270
|
new Cesium.Cartesian2(windowPosition[0], windowPosition[1]),
|
|
271
|
+
allowNegative,
|
|
269
272
|
);
|
|
270
273
|
},
|
|
274
|
+
getExtrudedPoint: (position, extrudedHeight) => {
|
|
275
|
+
if (!position || !extrudedHeight) return;
|
|
276
|
+
const viewer = cesium.current?.cesiumElement;
|
|
277
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
278
|
+
const point = new Cesium.Cartesian3(position[0], position[1], position[2]);
|
|
279
|
+
const cartesianScratch = new Cesium.Cartesian3();
|
|
280
|
+
const normal = viewer.scene?.globe.ellipsoid.geodeticSurfaceNormal(point, cartesianScratch);
|
|
281
|
+
if (!normal) return;
|
|
282
|
+
const extrudedPoint = Cesium.Cartesian3.add(
|
|
283
|
+
point,
|
|
284
|
+
Cesium.Cartesian3.multiplyByScalar(normal, extrudedHeight, cartesianScratch),
|
|
285
|
+
cartesianScratch,
|
|
286
|
+
);
|
|
287
|
+
return [extrudedPoint.x, extrudedPoint.y, extrudedPoint.z];
|
|
288
|
+
},
|
|
271
289
|
getSurfaceDistance: (point1, point2) => {
|
|
272
290
|
const viewer = cesium.current?.cesiumElement;
|
|
273
291
|
if (!viewer || viewer.isDestroyed()) return;
|
|
@@ -831,6 +849,7 @@ export default function useEngineRef(
|
|
|
831
849
|
tag.computedFeature ?? {
|
|
832
850
|
type: "computedFeature",
|
|
833
851
|
id: tag.featureId,
|
|
852
|
+
geometry: getGeometryFromEntity(viewer.clock.currentTime, entity),
|
|
834
853
|
properties: convertEntityProperties(viewer.clock.currentTime, entity),
|
|
835
854
|
metaData: {
|
|
836
855
|
description: convertEntityDescription(viewer.clock.currentTime, entity),
|
|
@@ -938,6 +957,32 @@ export default function useEngineRef(
|
|
|
938
957
|
tickEventCallback.current = tickEventCallback.current.filter(c => c !== cb) || [];
|
|
939
958
|
},
|
|
940
959
|
tickEventCallback,
|
|
960
|
+
calcRectangleControlPoint: (p1: Position3d, p2: Position3d, p3: Position3d) => {
|
|
961
|
+
const pp1 = new Cesium.Cartesian3(...p1);
|
|
962
|
+
const pp2 = new Cesium.Cartesian3(...p2);
|
|
963
|
+
const pp3 = new Cesium.Cartesian3(...p3);
|
|
964
|
+
const cartesianScratch1 = new Cesium.Cartesian3();
|
|
965
|
+
const cartesianScratch2 = new Cesium.Cartesian3();
|
|
966
|
+
const projection = Cesium.Cartesian3.projectVector(
|
|
967
|
+
Cesium.Cartesian3.subtract(pp3, pp1, cartesianScratch1),
|
|
968
|
+
Cesium.Cartesian3.subtract(pp2, pp1, cartesianScratch2),
|
|
969
|
+
cartesianScratch1,
|
|
970
|
+
);
|
|
971
|
+
const offset = Cesium.Cartesian3.subtract(
|
|
972
|
+
pp3,
|
|
973
|
+
Cesium.Cartesian3.add(pp1, projection, cartesianScratch1),
|
|
974
|
+
cartesianScratch2,
|
|
975
|
+
);
|
|
976
|
+
const pp4 = Cesium.Cartesian3.midpoint(pp1, pp2, cartesianScratch1);
|
|
977
|
+
const pp5 = Cesium.Cartesian3.add(pp4, offset, cartesianScratch2);
|
|
978
|
+
const p5 = [pp5.x, pp5.y, pp5.z] as Position3d;
|
|
979
|
+
return [p1, p2, p5];
|
|
980
|
+
},
|
|
981
|
+
getCredits: () => {
|
|
982
|
+
const viewer = cesium.current?.cesiumElement;
|
|
983
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
984
|
+
return getCredits(viewer);
|
|
985
|
+
},
|
|
941
986
|
};
|
|
942
987
|
}, [cesium]);
|
|
943
988
|
|
|
@@ -143,7 +143,7 @@ const useTerrainHeatmap = ({
|
|
|
143
143
|
[
|
|
144
144
|
"#ifdef APPLY_COLOR_TO_ALPHA",
|
|
145
145
|
"vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);",
|
|
146
|
-
"colorDiff.r =
|
|
146
|
+
"colorDiff.r = czm_maximumComponent(colorDiff);",
|
|
147
147
|
"alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);",
|
|
148
148
|
"#endif",
|
|
149
149
|
],
|
|
@@ -27,6 +27,7 @@ import type {
|
|
|
27
27
|
import { e2eAccessToken, setE2ECesiumViewer } from "../../e2eConfig";
|
|
28
28
|
import { ComputedFeature, DataType, SelectedFeatureInfo, LatLng, Camera } from "../../mantle";
|
|
29
29
|
import {
|
|
30
|
+
Credits,
|
|
30
31
|
LayerLoadEvent,
|
|
31
32
|
LayerSelectWithRectEnd,
|
|
32
33
|
LayerSelectWithRectMove,
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
import { TimelineManagerRef } from "../../Map/useTimelineManager";
|
|
38
39
|
import { FEATURE_FLAGS } from "../../Visualizer/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";
|
|
@@ -89,6 +90,7 @@ export default ({
|
|
|
89
90
|
onLayerLoad,
|
|
90
91
|
onCameraChange,
|
|
91
92
|
onMount,
|
|
93
|
+
onCreditsUpdate,
|
|
92
94
|
}: {
|
|
93
95
|
ref: React.ForwardedRef<EngineRef>;
|
|
94
96
|
property?: ViewerProperty;
|
|
@@ -128,6 +130,7 @@ export default ({
|
|
|
128
130
|
onLayerLoad?: (e: LayerLoadEvent) => void;
|
|
129
131
|
onCameraChange?: (camera: Camera) => void;
|
|
130
132
|
onMount?: () => void;
|
|
133
|
+
onCreditsUpdate?: (credits: Credits) => void;
|
|
131
134
|
}) => {
|
|
132
135
|
const cesium = useRef<CesiumComponentRef<CesiumViewer>>(null);
|
|
133
136
|
|
|
@@ -557,8 +560,11 @@ export default ({
|
|
|
557
560
|
if (pickRay) {
|
|
558
561
|
const l = await scene.imageryLayers.pickImageryLayerFeatures(pickRay, scene);
|
|
559
562
|
|
|
560
|
-
//
|
|
561
|
-
const f = l?.
|
|
563
|
+
// Find the topmost overlaid feature.
|
|
564
|
+
const f = l?.findLast(f => {
|
|
565
|
+
const appearanceType = f?.data?.appearanceType;
|
|
566
|
+
return appearanceType && f?.data?.feature?.[appearanceType]?.show !== false;
|
|
567
|
+
});
|
|
562
568
|
|
|
563
569
|
const appearanceType = f?.data?.appearanceType;
|
|
564
570
|
|
|
@@ -648,6 +654,22 @@ export default ({
|
|
|
648
654
|
viewer.scene.requestRender();
|
|
649
655
|
}, []);
|
|
650
656
|
|
|
657
|
+
const onCreditsUpdateRef = useRef(onCreditsUpdate);
|
|
658
|
+
onCreditsUpdateRef.current = onCreditsUpdate;
|
|
659
|
+
const updateCredits = useCallback(() => {
|
|
660
|
+
if (!onCreditsUpdateRef.current) return;
|
|
661
|
+
// currently we don't have a proper way to get the credits update event
|
|
662
|
+
// wait for 3 seconds to get latest credits
|
|
663
|
+
// some internal property is been used here.
|
|
664
|
+
setTimeout(() => {
|
|
665
|
+
if (!onCreditsUpdateRef.current) return;
|
|
666
|
+
const viewer = cesium.current?.cesiumElement;
|
|
667
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
668
|
+
const credits = getCredits(viewer);
|
|
669
|
+
onCreditsUpdateRef.current(credits);
|
|
670
|
+
}, 3000);
|
|
671
|
+
}, []);
|
|
672
|
+
|
|
651
673
|
const context = useMemo<FeatureContext>(
|
|
652
674
|
() => ({
|
|
653
675
|
selectionReason,
|
|
@@ -662,8 +684,17 @@ export default ({
|
|
|
662
684
|
toXYZ: engineAPI.toXYZ,
|
|
663
685
|
toWindowPosition: engineAPI.toWindowPosition,
|
|
664
686
|
isPositionVisible: engineAPI.isPositionVisible,
|
|
687
|
+
updateCredits,
|
|
665
688
|
}),
|
|
666
|
-
[
|
|
689
|
+
[
|
|
690
|
+
selectionReason,
|
|
691
|
+
engineAPI,
|
|
692
|
+
onLayerEdit,
|
|
693
|
+
onLayerVisibility,
|
|
694
|
+
onLayerLoad,
|
|
695
|
+
timelineManagerRef,
|
|
696
|
+
updateCredits,
|
|
697
|
+
],
|
|
667
698
|
);
|
|
668
699
|
|
|
669
700
|
useEffect(() => {
|
|
@@ -728,6 +759,14 @@ export default ({
|
|
|
728
759
|
unmountCamera?.();
|
|
729
760
|
}, [unmountCamera]);
|
|
730
761
|
|
|
762
|
+
const handleTilesChange = useCallback(() => {
|
|
763
|
+
updateCredits();
|
|
764
|
+
}, [updateCredits]);
|
|
765
|
+
|
|
766
|
+
const handleTerrainProviderChange = useCallback(() => {
|
|
767
|
+
updateCredits();
|
|
768
|
+
}, [updateCredits]);
|
|
769
|
+
|
|
731
770
|
return {
|
|
732
771
|
cesium,
|
|
733
772
|
cesiumIonAccessToken,
|
|
@@ -747,6 +786,8 @@ export default ({
|
|
|
747
786
|
handleClick,
|
|
748
787
|
handleMount,
|
|
749
788
|
handleUnmount,
|
|
789
|
+
handleTilesChange,
|
|
790
|
+
handleTerrainProviderChange,
|
|
750
791
|
};
|
|
751
792
|
};
|
|
752
793
|
|