@reearth/core 0.0.7-alpha.4 → 0.0.7-alpha.41
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 +44858 -39524
- 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 +10 -27
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CallbackProperty,
|
|
3
3
|
ClassificationType,
|
|
4
|
+
Color,
|
|
4
5
|
ColorMaterialProperty,
|
|
5
6
|
HeightReference,
|
|
6
7
|
ShadowMode,
|
|
7
|
-
type Color,
|
|
8
8
|
type PolygonHierarchy,
|
|
9
9
|
} from "@cesium/engine";
|
|
10
10
|
import { useMemo, useRef, type FC } from "react";
|
|
@@ -12,60 +12,60 @@ import { useMemo, useRef, type FC } from "react";
|
|
|
12
12
|
import { useConstant } from "../../../utils";
|
|
13
13
|
import { useContext } from "../Feature/context";
|
|
14
14
|
|
|
15
|
+
import { DEFAULT_EDIT_COLOR } from "./constants";
|
|
15
16
|
import { Entity, type EntityProps } from "./Entity";
|
|
16
17
|
|
|
17
18
|
export interface ExtrudedPolygonEntityProps {
|
|
18
|
-
dynamic?: boolean;
|
|
19
19
|
id?: string;
|
|
20
20
|
hierarchy: PolygonHierarchy;
|
|
21
21
|
extrudedHeight: number;
|
|
22
22
|
color?: Color;
|
|
23
23
|
disableShadow?: boolean;
|
|
24
|
-
|
|
24
|
+
isEditing?: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const ExtrudedPolygonEntity: FC<ExtrudedPolygonEntityProps> = ({
|
|
28
|
-
dynamic = false,
|
|
29
28
|
id,
|
|
30
29
|
hierarchy: hierarchyProp,
|
|
31
30
|
extrudedHeight: extrudedHeightProp,
|
|
32
31
|
color,
|
|
33
32
|
disableShadow = false,
|
|
34
|
-
|
|
33
|
+
isEditing,
|
|
35
34
|
}) => {
|
|
36
35
|
const hierarchyRef = useRef(hierarchyProp);
|
|
37
36
|
hierarchyRef.current = hierarchyProp;
|
|
38
37
|
const hierarchyProperty = useConstant(
|
|
39
38
|
() => new CallbackProperty(() => hierarchyRef.current, false),
|
|
40
39
|
);
|
|
41
|
-
const hierarchy =
|
|
40
|
+
const hierarchy = hierarchyProperty;
|
|
42
41
|
|
|
43
42
|
const extrudedHeightRef = useRef(extrudedHeightProp);
|
|
44
43
|
extrudedHeightRef.current = extrudedHeightProp;
|
|
45
44
|
const extrudedHeightProperty = useConstant(
|
|
46
45
|
() => new CallbackProperty(() => extrudedHeightRef.current, false),
|
|
47
46
|
);
|
|
48
|
-
const extrudedHeight =
|
|
47
|
+
const extrudedHeight = extrudedHeightProperty;
|
|
49
48
|
|
|
50
49
|
const options = useMemo(
|
|
51
50
|
(): EntityProps => ({
|
|
52
51
|
polygon: {
|
|
53
52
|
hierarchy,
|
|
53
|
+
heightReference: HeightReference.RELATIVE_TO_TERRAIN,
|
|
54
54
|
extrudedHeight,
|
|
55
|
-
extrudedHeightReference: HeightReference.
|
|
55
|
+
extrudedHeightReference: HeightReference.RELATIVE_TO_TERRAIN,
|
|
56
|
+
// extrudedHeightReference: HeightReference.NONE,
|
|
56
57
|
fill: true,
|
|
57
58
|
outline: true,
|
|
58
59
|
outlineWidth: 1,
|
|
59
|
-
outlineColor:
|
|
60
|
-
|
|
60
|
+
outlineColor: isEditing
|
|
61
|
+
? Color.fromCssColorString(DEFAULT_EDIT_COLOR)
|
|
62
|
+
: color?.withAlpha(1),
|
|
63
|
+
material: new ColorMaterialProperty(isEditing ? color?.withAlpha(0.2) : color),
|
|
61
64
|
classificationType: ClassificationType.TERRAIN,
|
|
62
65
|
shadows: disableShadow ? ShadowMode.DISABLED : ShadowMode.ENABLED,
|
|
63
|
-
...(enableRelativeHeight
|
|
64
|
-
? { height: 0, heightReference: HeightReference.RELATIVE_TO_GROUND }
|
|
65
|
-
: undefined),
|
|
66
66
|
},
|
|
67
67
|
}),
|
|
68
|
-
[extrudedHeight, disableShadow, hierarchy, color,
|
|
68
|
+
[extrudedHeight, disableShadow, hierarchy, color, isEditing],
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
const { requestRender } = useContext();
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { CallbackProperty, ClassificationType,
|
|
1
|
+
import { CallbackProperty, ClassificationType, Color, type Cartesian3 } from "@cesium/engine";
|
|
2
2
|
import { useMemo, useRef, type FC } from "react";
|
|
3
3
|
|
|
4
4
|
import { useConstant } from "../../../utils";
|
|
5
5
|
import { useContext } from "../Feature/context";
|
|
6
6
|
|
|
7
|
+
import { DEFAULT_EDIT_COLOR } from "./constants";
|
|
7
8
|
import { Entity, type EntityProps } from "./Entity";
|
|
8
9
|
|
|
9
10
|
export interface PolylineEntityProps {
|
|
10
11
|
dynamic?: boolean;
|
|
11
12
|
positions: Cartesian3[];
|
|
12
13
|
color?: Color;
|
|
14
|
+
isEditing?: boolean;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export const PolylineEntity: FC<PolylineEntityProps> = ({
|
|
16
18
|
dynamic = false,
|
|
17
19
|
positions: positionsProp,
|
|
18
20
|
color,
|
|
21
|
+
isEditing,
|
|
19
22
|
}) => {
|
|
20
23
|
const positionsRef = useRef(positionsProp);
|
|
21
24
|
positionsRef.current = positionsProp;
|
|
@@ -28,13 +31,13 @@ export const PolylineEntity: FC<PolylineEntityProps> = ({
|
|
|
28
31
|
(): EntityProps => ({
|
|
29
32
|
polyline: {
|
|
30
33
|
positions,
|
|
31
|
-
width: 1.5,
|
|
32
|
-
material: color,
|
|
34
|
+
width: isEditing ? 1.5 : 1.5,
|
|
35
|
+
material: isEditing ? Color.fromCssColorString(DEFAULT_EDIT_COLOR) : color,
|
|
33
36
|
classificationType: ClassificationType.TERRAIN,
|
|
34
37
|
clampToGround: true,
|
|
35
38
|
},
|
|
36
39
|
}),
|
|
37
|
-
[color, positions],
|
|
40
|
+
[color, positions, isEditing],
|
|
38
41
|
);
|
|
39
42
|
|
|
40
43
|
const { requestRender } = useContext();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Cartesian3 } from "@cesium/engine";
|
|
2
|
+
import { memo, type FC } from "react";
|
|
3
|
+
|
|
4
|
+
import { Position3d } from "../../../types";
|
|
5
|
+
|
|
6
|
+
import { ControlPoint } from "./ControlPoint";
|
|
7
|
+
import { type GeometryOptions } from "./createGeometry";
|
|
8
|
+
|
|
9
|
+
export interface SurfaceAddingPointsProps {
|
|
10
|
+
geometryOptions: GeometryOptions;
|
|
11
|
+
isEditing?: boolean;
|
|
12
|
+
handleAddControlPoint?: (position: Position3d, index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const cartesianScratch1 = new Cartesian3();
|
|
16
|
+
|
|
17
|
+
const SurfaceAddingPoints: FC<SurfaceAddingPointsProps> = memo(
|
|
18
|
+
({ geometryOptions: { type, controlPoints }, isEditing, handleAddControlPoint }) => {
|
|
19
|
+
if (!["polyline", "polygon", "extrudedPolygon"].includes(type)) return null;
|
|
20
|
+
|
|
21
|
+
const addingPoints = [];
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < controlPoints.length - 1; i++) {
|
|
24
|
+
const nextPoint = controlPoints[i + 1];
|
|
25
|
+
const midPoint = Cartesian3.midpoint(controlPoints[i], nextPoint, cartesianScratch1);
|
|
26
|
+
addingPoints.push(midPoint.clone());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (type === "polygon" || type === "extrudedPolygon") {
|
|
30
|
+
const midPoint = Cartesian3.midpoint(
|
|
31
|
+
controlPoints[controlPoints.length - 1],
|
|
32
|
+
controlPoints[0],
|
|
33
|
+
cartesianScratch1,
|
|
34
|
+
);
|
|
35
|
+
addingPoints.push(midPoint.clone());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
{addingPoints.map((addingPoint, index) => (
|
|
41
|
+
<ControlPoint
|
|
42
|
+
key={index}
|
|
43
|
+
position={addingPoint}
|
|
44
|
+
isAddingPoint
|
|
45
|
+
index={index}
|
|
46
|
+
clampToGround
|
|
47
|
+
isEditing={isEditing}
|
|
48
|
+
handleControlPointMouseEvent={() =>
|
|
49
|
+
handleAddControlPoint?.([addingPoint.x, addingPoint.y, addingPoint.z], index)
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
))}
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
SurfaceAddingPoints.displayName = "SurfaceAddingPoints";
|
|
59
|
+
|
|
60
|
+
export default SurfaceAddingPoints;
|
|
@@ -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";
|