@reearth/core 0.0.7-alpha.5 → 0.0.7-alpha.50
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 +58676 -51066
- package/dist/core.umd.cjs +3959 -3915
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +150 -34
- package/package.json +55 -39
- package/src/Map/ClusteredLayers/index.tsx +1 -1
- package/src/Map/Geoid/index.tsx +68 -0
- package/src/Map/Geoid/types.ts +8 -0
- package/src/Map/Layer/hooks.ts +7 -4
- package/src/Map/Layer/index.tsx +3 -1
- package/src/Map/Layers/hooks.ts +19 -2
- package/src/Map/Layers/index.tsx +13 -2
- package/src/Map/Layers/keys.ts +1 -0
- package/src/Map/Sketch/hooks.ts +453 -410
- package/src/Map/Sketch/index.tsx +67 -20
- 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 +41 -8
- package/src/Map/ref.ts +32 -3
- package/src/Map/types/index.ts +39 -3
- package/src/Map/types/viewerProperty.ts +10 -0
- package/src/Map/useTimelineManager.ts +2 -2
- package/src/Map/utils.ts +1 -1
- package/src/Visualizer/context.tsx +5 -5
- package/src/Visualizer/coreContext.tsx +2 -0
- package/src/Visualizer/hooks.ts +54 -20
- package/src/Visualizer/index.tsx +22 -3
- package/src/Visualizer/interactionMode.ts +2 -1
- package/src/Visualizer/useViewport.ts +1 -1
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +4 -4
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +1 -1
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +3 -1
- 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 +135 -70
- package/src/engines/Cesium/Feature/Tileset/index.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +2 -2
- package/src/engines/Cesium/Feature/context.ts +1 -0
- package/src/engines/Cesium/Feature/index.tsx +7 -3
- package/src/engines/Cesium/Feature/utils.tsx +18 -7
- 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/Clock.tsx +1 -1
- package/src/engines/Cesium/core/Globe/index.tsx +73 -0
- package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +79 -0
- package/src/engines/Cesium/core/Imagery.test.ts +29 -11
- package/src/engines/Cesium/core/Imagery.tsx +22 -6
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +1 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +9 -2
- 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 +24 -28
- package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
- package/src/engines/Cesium/hooks/useCamera.ts +1 -1
- package/src/engines/Cesium/hooks/useCameraLimiter.ts +1 -1
- package/src/engines/Cesium/hooks/useEngineRef.ts +48 -3
- package/src/engines/Cesium/hooks/useExplicitRender.ts +2 -2
- package/src/engines/Cesium/hooks/useInstance.ts +1 -1
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +2 -2
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +1 -1
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +98 -52
- package/src/engines/Cesium/hooks/useViewerProperty.ts +1 -1
- package/src/engines/Cesium/hooks.ts +52 -10
- package/src/engines/Cesium/index.tsx +16 -3
- package/src/engines/Cesium/types.ts +1 -1
- package/src/mantle/atoms/compute.ts +8 -3
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/data/shapefile/parseZip.ts +1 -0
- 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 +4 -2
- package/src/mantle/types/index.ts +3 -0
- package/src/test/utils.tsx +1 -1
- package/src/utils/image.ts +2 -12
- package/src/utils/use-delayed-count.ts +1 -1
- package/src/utils/use-dnd/drop.ts +1 -1
- package/src/utils/util.ts +1 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +0 -1
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/cesium/Widgets/lighter.css +0 -237
- package/dist/cesium/Widgets/lighterShared.css +0 -46
- package/dist/cesium/Widgets/shared.css +0 -103
- package/dist/cesium/Widgets/widgets.css +0 -1346
- package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
- package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
- package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
- package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
- package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
- package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
- package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
- package/dist/cesium/Workers/combineGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createGeometry.js +0 -26
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/cesium/Workers/createWallGeometry.js +0 -26
- package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/decodeDraco.js +0 -26
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/cesium/Workers/decodeI3S.js +0 -26
- package/dist/cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
- package/src/engines/Cesium/core/Globe.tsx +0 -104
- /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
|
@@ -1,62 +1,152 @@
|
|
|
1
|
-
import { Cartesian3,
|
|
1
|
+
import { Cartesian3, Color } from "@cesium/engine";
|
|
2
2
|
import { memo, type FC } from "react";
|
|
3
3
|
|
|
4
|
+
import { DEFAULT_EDIT_COLOR } from "./constants";
|
|
4
5
|
import { ControlPoint } from "./ControlPoint";
|
|
5
6
|
import { type GeometryOptions } from "./createGeometry";
|
|
6
7
|
import { SurfaceMeasurement } from "./SurfaceMeasurement";
|
|
7
8
|
|
|
9
|
+
import { ControlPointMouseEventHandler } from ".";
|
|
10
|
+
|
|
8
11
|
export interface SurfaceControlPointsProps {
|
|
9
12
|
geometryOptions: GeometryOptions;
|
|
10
13
|
color?: Color;
|
|
14
|
+
isEditing?: boolean;
|
|
15
|
+
selectedControlPointIndex?: number;
|
|
16
|
+
catchedControlPointIndex?: number;
|
|
17
|
+
handleControlPointMouseEvent?: ControlPointMouseEventHandler;
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
const cartesianScratch1 = new Cartesian3();
|
|
14
|
-
const cartesianScratch2 = new Cartesian3();
|
|
15
21
|
|
|
16
22
|
const SurfaceControlPoints: FC<SurfaceControlPointsProps> = memo(
|
|
17
|
-
({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
({
|
|
24
|
+
geometryOptions: { type, controlPoints },
|
|
25
|
+
color,
|
|
26
|
+
isEditing,
|
|
27
|
+
catchedControlPointIndex,
|
|
28
|
+
selectedControlPointIndex,
|
|
29
|
+
handleControlPointMouseEvent,
|
|
30
|
+
}) => {
|
|
31
|
+
const measurements: { points: [Cartesian3, Cartesian3]; showLine: boolean }[] = [];
|
|
21
32
|
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
if (controlPoints.length >= 2) {
|
|
34
|
+
if (isEditing) {
|
|
35
|
+
if (catchedControlPointIndex !== undefined && catchedControlPointIndex !== -1) {
|
|
36
|
+
switch (type) {
|
|
37
|
+
case "polyline":
|
|
38
|
+
if (catchedControlPointIndex > 0) {
|
|
39
|
+
measurements.push({
|
|
40
|
+
points: [
|
|
41
|
+
controlPoints[catchedControlPointIndex - 1],
|
|
42
|
+
controlPoints[catchedControlPointIndex],
|
|
43
|
+
],
|
|
44
|
+
showLine: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (catchedControlPointIndex < controlPoints.length - 1) {
|
|
48
|
+
measurements.push({
|
|
49
|
+
points: [
|
|
50
|
+
controlPoints[catchedControlPointIndex],
|
|
51
|
+
controlPoints[catchedControlPointIndex + 1],
|
|
52
|
+
],
|
|
53
|
+
showLine: false,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
case "circle":
|
|
58
|
+
case "extrudedCircle":
|
|
59
|
+
if (catchedControlPointIndex !== 2) {
|
|
60
|
+
measurements.push({
|
|
61
|
+
points: [controlPoints[0], controlPoints[1]],
|
|
62
|
+
showLine: true,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case "rectangle":
|
|
67
|
+
case "extrudedRectangle":
|
|
68
|
+
if (catchedControlPointIndex <= 1) {
|
|
69
|
+
measurements.push({
|
|
70
|
+
points: [controlPoints[0], controlPoints[1]],
|
|
71
|
+
showLine: false,
|
|
72
|
+
});
|
|
73
|
+
} else if (catchedControlPointIndex === 2) {
|
|
74
|
+
const [p1, p2, p3] = controlPoints;
|
|
75
|
+
const p4 = Cartesian3.midpoint(p1, p2, cartesianScratch1);
|
|
76
|
+
measurements.push({ points: [p4, p3], showLine: true });
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
case "polygon":
|
|
80
|
+
case "extrudedPolygon":
|
|
81
|
+
measurements.push({
|
|
82
|
+
points: [
|
|
83
|
+
controlPoints[catchedControlPointIndex],
|
|
84
|
+
catchedControlPointIndex === 0
|
|
85
|
+
? controlPoints[controlPoints.length - 1]
|
|
86
|
+
: controlPoints[catchedControlPointIndex - 1],
|
|
87
|
+
],
|
|
88
|
+
showLine: false,
|
|
89
|
+
});
|
|
90
|
+
measurements.push({
|
|
91
|
+
points: [
|
|
92
|
+
controlPoints[catchedControlPointIndex],
|
|
93
|
+
catchedControlPointIndex === controlPoints.length - 1
|
|
94
|
+
? controlPoints[0]
|
|
95
|
+
: controlPoints[catchedControlPointIndex + 1],
|
|
96
|
+
],
|
|
97
|
+
showLine: false,
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
default:
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
switch (type) {
|
|
106
|
+
case "rectangle" || "extrudedRectangle":
|
|
107
|
+
if (controlPoints.length === 2) {
|
|
108
|
+
measurements.push({
|
|
109
|
+
points: controlPoints as [Cartesian3, Cartesian3],
|
|
110
|
+
showLine: true,
|
|
111
|
+
});
|
|
112
|
+
} else if (controlPoints.length === 3) {
|
|
113
|
+
const [p1, p2, p3] = controlPoints;
|
|
114
|
+
const p4 = Cartesian3.midpoint(p1, p2, cartesianScratch1);
|
|
115
|
+
measurements.push({ points: [p4, p3], showLine: true });
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
default:
|
|
119
|
+
measurements.push({
|
|
120
|
+
points: controlPoints.slice(-2) as [Cartesian3, Cartesian3],
|
|
121
|
+
showLine: type === "circle",
|
|
122
|
+
});
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
45
126
|
}
|
|
46
127
|
|
|
47
128
|
return (
|
|
48
129
|
<>
|
|
49
130
|
{controlPoints.map((controlPoint, index) => (
|
|
50
|
-
<ControlPoint
|
|
131
|
+
<ControlPoint
|
|
132
|
+
key={index}
|
|
133
|
+
position={controlPoint}
|
|
134
|
+
index={index}
|
|
135
|
+
isSelected={selectedControlPointIndex === index}
|
|
136
|
+
clampToGround
|
|
137
|
+
isEditing={isEditing}
|
|
138
|
+
handleControlPointMouseEvent={handleControlPointMouseEvent}
|
|
139
|
+
/>
|
|
51
140
|
))}
|
|
52
|
-
{
|
|
141
|
+
{measurements.map(({ points, showLine }, index) => (
|
|
53
142
|
<SurfaceMeasurement
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
143
|
+
key={index}
|
|
144
|
+
a={points[0]}
|
|
145
|
+
b={points[1]}
|
|
146
|
+
color={isEditing ? Color.fromCssColorString(DEFAULT_EDIT_COLOR) : color}
|
|
57
147
|
showLine={showLine}
|
|
58
148
|
/>
|
|
59
|
-
)}
|
|
149
|
+
))}
|
|
60
150
|
</>
|
|
61
151
|
);
|
|
62
152
|
},
|
|
@@ -2,46 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
import { Color } from "@cesium/engine";
|
|
4
4
|
import { Cartesian3 } from "cesium";
|
|
5
|
-
import { type LineString, type MultiPolygon, type Polygon } from "geojson";
|
|
6
5
|
import { memo, useMemo, type FC } from "react";
|
|
7
|
-
import { type RequireExactlyOne } from "type-fest";
|
|
8
6
|
|
|
9
7
|
import { SketchType } from "../../../Map/Sketch/types";
|
|
10
8
|
import { Position3d } from "../../../types";
|
|
11
9
|
import { convertGeometryToPositionsArray, convertPolygonToHierarchyArray } from "../utils/polygon";
|
|
12
10
|
|
|
11
|
+
import { DEFAULT_SKETCH_COLOR } from "./constants";
|
|
13
12
|
import { createGeometry, GeometryOptions } from "./createGeometry";
|
|
14
13
|
import ExtrudedControlPoints from "./ExtrudedControlPoints";
|
|
15
14
|
import { ExtrudedPolygonEntity } from "./ExtrudedPolygonEntity";
|
|
16
15
|
import { PolygonEntity } from "./PolygonEntity";
|
|
17
16
|
import { PolylineEntity } from "./PolylineEntity";
|
|
17
|
+
import SurfaceAddingPoints from "./SurfaceAddingPoints";
|
|
18
18
|
import SurfaceControlPoints from "./SurfaceControlPoints";
|
|
19
19
|
|
|
20
|
-
export type SketchComponentProps =
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export type SketchComponentProps = {
|
|
21
|
+
geometryOptions?: {
|
|
22
|
+
type: SketchType;
|
|
23
|
+
controlPoints: readonly Position3d[];
|
|
24
|
+
} | null;
|
|
25
|
+
extrudedHeight?: number;
|
|
26
|
+
extrudedPoint?: Position3d;
|
|
27
|
+
centroidBasePoint?: Position3d;
|
|
28
|
+
centroidExtrudedPoint?: Position3d;
|
|
29
|
+
disableShadow?: boolean;
|
|
30
|
+
color?: string;
|
|
31
|
+
isEditing?: boolean;
|
|
32
|
+
catchedControlPointIndex?: number;
|
|
33
|
+
catchedExtrudedPoint?: boolean;
|
|
34
|
+
selectedControlPointIndex?: number;
|
|
35
|
+
handleControlPointMouseEvent?: ControlPointMouseEventHandler;
|
|
36
|
+
handleAddControlPoint?: (position: Position3d, index: number) => void;
|
|
37
|
+
};
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
export type ControlPointMouseEventHandler = (
|
|
40
|
+
index: number,
|
|
41
|
+
isExtrudedPoint: boolean,
|
|
42
|
+
type: "mousedown" | "click",
|
|
43
|
+
) => void;
|
|
36
44
|
|
|
37
45
|
const SketchComponent: FC<SketchComponentProps> = memo(
|
|
38
46
|
({
|
|
39
|
-
geometry,
|
|
40
47
|
geometryOptions,
|
|
41
48
|
extrudedHeight,
|
|
42
49
|
disableShadow,
|
|
43
50
|
color: stringColor,
|
|
44
|
-
|
|
51
|
+
isEditing,
|
|
52
|
+
extrudedPoint,
|
|
53
|
+
centroidBasePoint,
|
|
54
|
+
centroidExtrudedPoint,
|
|
55
|
+
catchedControlPointIndex,
|
|
56
|
+
catchedExtrudedPoint,
|
|
57
|
+
selectedControlPointIndex,
|
|
58
|
+
handleControlPointMouseEvent,
|
|
59
|
+
handleAddControlPoint,
|
|
45
60
|
}) => {
|
|
46
61
|
const cartesianGeometryOptions: GeometryOptions | null = useMemo(
|
|
47
62
|
() =>
|
|
@@ -55,9 +70,8 @@ const SketchComponent: FC<SketchComponentProps> = memo(
|
|
|
55
70
|
);
|
|
56
71
|
|
|
57
72
|
const g = useMemo(
|
|
58
|
-
() =>
|
|
59
|
-
|
|
60
|
-
[geometry, cartesianGeometryOptions],
|
|
73
|
+
() => (cartesianGeometryOptions ? createGeometry(cartesianGeometryOptions) : null),
|
|
74
|
+
[cartesianGeometryOptions],
|
|
61
75
|
);
|
|
62
76
|
|
|
63
77
|
const { positionsArray, hierarchyArray } = useMemo(() => {
|
|
@@ -82,31 +96,56 @@ const SketchComponent: FC<SketchComponentProps> = memo(
|
|
|
82
96
|
return (
|
|
83
97
|
<>
|
|
84
98
|
{positionsArray?.map((positions, index) => (
|
|
85
|
-
<PolylineEntity
|
|
99
|
+
<PolylineEntity
|
|
100
|
+
key={index}
|
|
101
|
+
dynamic
|
|
102
|
+
positions={positions}
|
|
103
|
+
color={color}
|
|
104
|
+
isEditing={isEditing}
|
|
105
|
+
/>
|
|
86
106
|
))}
|
|
87
107
|
{hierarchyArray?.map((hierarchy, index) => (
|
|
88
108
|
<PolygonEntity key={index} dynamic hierarchy={hierarchy} color={color} />
|
|
89
109
|
))}
|
|
90
|
-
{cartesianGeometryOptions != null && extrudedHeight
|
|
91
|
-
<SurfaceControlPoints
|
|
110
|
+
{cartesianGeometryOptions != null && (!extrudedHeight || isEditing) && (
|
|
111
|
+
<SurfaceControlPoints
|
|
112
|
+
geometryOptions={cartesianGeometryOptions}
|
|
113
|
+
color={color}
|
|
114
|
+
isEditing={isEditing}
|
|
115
|
+
catchedControlPointIndex={catchedControlPointIndex}
|
|
116
|
+
selectedControlPointIndex={selectedControlPointIndex}
|
|
117
|
+
handleControlPointMouseEvent={handleControlPointMouseEvent}
|
|
118
|
+
/>
|
|
119
|
+
)}
|
|
120
|
+
{cartesianGeometryOptions != null && isEditing && (
|
|
121
|
+
<SurfaceAddingPoints
|
|
122
|
+
geometryOptions={cartesianGeometryOptions}
|
|
123
|
+
isEditing={isEditing}
|
|
124
|
+
handleAddControlPoint={handleAddControlPoint}
|
|
125
|
+
/>
|
|
92
126
|
)}
|
|
93
|
-
{cartesianGeometryOptions != null && extrudedHeight
|
|
127
|
+
{cartesianGeometryOptions != null && extrudedHeight && (
|
|
94
128
|
<ExtrudedControlPoints
|
|
95
129
|
geometryOptions={cartesianGeometryOptions}
|
|
96
130
|
extrudedHeight={extrudedHeight}
|
|
131
|
+
extrudedPoint={extrudedPoint}
|
|
132
|
+
centroidBasePoint={centroidBasePoint}
|
|
133
|
+
centroidExtrudedPoint={centroidExtrudedPoint}
|
|
134
|
+
catchedExtrudedPoint={catchedExtrudedPoint}
|
|
97
135
|
color={color}
|
|
136
|
+
isEditing={isEditing}
|
|
137
|
+
handleControlPointMouseEvent={handleControlPointMouseEvent}
|
|
98
138
|
/>
|
|
99
139
|
)}
|
|
100
|
-
{extrudedHeight
|
|
140
|
+
{extrudedHeight &&
|
|
101
141
|
hierarchyArray?.map((hierarchy, index) => (
|
|
102
142
|
<ExtrudedPolygonEntity
|
|
103
143
|
key={index}
|
|
104
|
-
dynamic
|
|
105
144
|
hierarchy={hierarchy}
|
|
106
145
|
extrudedHeight={extrudedHeight}
|
|
107
146
|
disableShadow={disableShadow}
|
|
108
147
|
color={color}
|
|
109
|
-
|
|
148
|
+
isEditing={isEditing}
|
|
110
149
|
/>
|
|
111
150
|
))}
|
|
112
151
|
</>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ClassificationType, Color, Rectangle } from "cesium";
|
|
2
|
+
import { FC, memo, useMemo } from "react";
|
|
3
|
+
import { Entity } from "resium";
|
|
4
|
+
|
|
5
|
+
type SpatialIdComponentProps = {
|
|
6
|
+
wsen: [number, number, number, number];
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const CoordinateIndicator: FC<SpatialIdComponentProps> = memo(({ wsen, color }) => {
|
|
11
|
+
const options = useMemo(
|
|
12
|
+
() => ({
|
|
13
|
+
rectangle: {
|
|
14
|
+
coordinates: Rectangle.fromDegrees(...wsen),
|
|
15
|
+
clampToGround: true,
|
|
16
|
+
fill: true,
|
|
17
|
+
outline: false,
|
|
18
|
+
material: Color.fromCssColorString(color),
|
|
19
|
+
classificationType: ClassificationType.BOTH,
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
[wsen, color],
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return <Entity {...options} />;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
CoordinateIndicator.displayName = "SpatialIdSpace";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ClassificationType, Color, HeightReference, Rectangle } from "cesium";
|
|
2
|
+
import { FC, memo, useMemo } from "react";
|
|
3
|
+
import { Entity } from "resium";
|
|
4
|
+
|
|
5
|
+
import { SpatialIdSpaceType } from "../../../Map/SpatialId/types";
|
|
6
|
+
|
|
7
|
+
type SpatialIdComponentProps = {
|
|
8
|
+
space: SpatialIdSpaceType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SpatialIdSpace: FC<SpatialIdComponentProps> = memo(({ space }) => {
|
|
12
|
+
const options = useMemo(
|
|
13
|
+
() => ({
|
|
14
|
+
rectangle: {
|
|
15
|
+
coordinates: Rectangle.fromDegrees(...space.wsen),
|
|
16
|
+
height: space.height,
|
|
17
|
+
heightReference: HeightReference.NONE,
|
|
18
|
+
extrudedHeight: space.extrudedHeight,
|
|
19
|
+
clampToGround: false,
|
|
20
|
+
fill: true,
|
|
21
|
+
outline: true,
|
|
22
|
+
outlineColor: Color.fromCssColorString(space.outlineColor ?? ""),
|
|
23
|
+
material: Color.fromCssColorString(space.color ?? ""),
|
|
24
|
+
classificationType: ClassificationType.TERRAIN,
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
[space],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return <Entity id={space.id} {...options} />;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
SpatialIdSpace.displayName = "SpatialIdSpace";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ClassificationType, Color, Rectangle } from "cesium";
|
|
2
|
+
import { FC, memo, useMemo } from "react";
|
|
3
|
+
import { Entity } from "resium";
|
|
4
|
+
|
|
5
|
+
import { VerticalSpaceIndicatorType } from "../../../Map/SpatialId/types";
|
|
6
|
+
|
|
7
|
+
type VerticalSpaceIndicatorProps = {
|
|
8
|
+
indicator: VerticalSpaceIndicatorType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const VerticalSpaceIndicator: FC<VerticalSpaceIndicatorProps> = memo(({ indicator }) => {
|
|
12
|
+
const options = useMemo(
|
|
13
|
+
() => ({
|
|
14
|
+
rectangle: {
|
|
15
|
+
coordinates: Rectangle.fromDegrees(...indicator.wsen),
|
|
16
|
+
height: indicator.height,
|
|
17
|
+
extrudedHeight: indicator.extrudedHeight,
|
|
18
|
+
clampToGround: false,
|
|
19
|
+
fill: true,
|
|
20
|
+
outline: true,
|
|
21
|
+
outlineColor: Color.fromCssColorString(indicator.outlineColor),
|
|
22
|
+
material: Color.fromCssColorString(indicator.color),
|
|
23
|
+
classificationType: ClassificationType.TERRAIN,
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
[indicator],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return <Entity {...options} />;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
VerticalSpaceIndicator.displayName = "VerticalSpaceIndicator";
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Clock as CesiumClock, ClockRange, ClockStep, JulianDate } from "cesium";
|
|
2
|
-
import { useCallback, useMemo } from "react";
|
|
2
|
+
import { useCallback, useMemo, type JSX } from "react";
|
|
3
3
|
import { Clock } from "resium";
|
|
4
4
|
|
|
5
5
|
import { TimelineManagerRef } from "../../../Map/useTimelineManager";
|