@reearth/core 0.0.7-alpha.5 → 0.0.7-alpha.51
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,5 +1,5 @@
|
|
|
1
1
|
import LRUCache from "lru-cache";
|
|
2
|
-
import { useEffect, useMemo } from "react";
|
|
2
|
+
import { useEffect, useMemo, type JSX } from "react";
|
|
3
3
|
|
|
4
4
|
import type { AppearanceTypes, FeatureComponentProps, ComputedLayer } from "../..";
|
|
5
5
|
import { ComputedFeature, DataType, guessType } from "../../../mantle";
|
|
@@ -96,6 +96,7 @@ const FEATURE_DELEGATE_THRESHOLD = 6000;
|
|
|
96
96
|
export default function Feature({
|
|
97
97
|
layer,
|
|
98
98
|
isHidden,
|
|
99
|
+
sketchEditingFeature,
|
|
99
100
|
...props
|
|
100
101
|
}: FeatureComponentProps): JSX.Element | null {
|
|
101
102
|
const data = extractSimpleLayerData(layer);
|
|
@@ -131,7 +132,10 @@ export default function Feature({
|
|
|
131
132
|
const useSceneSpecularEnvironmentMaps =
|
|
132
133
|
!!props.viewerProperty?.scene?.imageBasedLighting?.specularEnvironmentMaps;
|
|
133
134
|
|
|
134
|
-
const isVisible =
|
|
135
|
+
const isVisible =
|
|
136
|
+
layer.layer.visible !== false &&
|
|
137
|
+
!isHidden &&
|
|
138
|
+
!(sketchEditingFeature?.layerId === layer.id && sketchEditingFeature?.feature?.id === f?.id);
|
|
135
139
|
|
|
136
140
|
const componentId =
|
|
137
141
|
urlMD5 +
|
|
@@ -140,7 +144,7 @@ export default function Feature({
|
|
|
140
144
|
f?.id ?? ""
|
|
141
145
|
}_${k}_${isVisible}_${useSceneSphericalHarmonicCoefficients}_${useSceneSpecularEnvironmentMaps}_${
|
|
142
146
|
JSON.stringify(f?.[k]) ?? ""
|
|
143
|
-
}_${JSON.stringify(layer.transition) ?? ""}`,
|
|
147
|
+
}_${JSON.stringify(layer.transition) ?? ""}_${JSON.stringify(f?.geometry) ?? ""}`,
|
|
144
148
|
);
|
|
145
149
|
|
|
146
150
|
if (cacheable) {
|
|
@@ -17,15 +17,16 @@ import {
|
|
|
17
17
|
GroundPrimitive,
|
|
18
18
|
} from "cesium";
|
|
19
19
|
import md5 from "js-md5";
|
|
20
|
-
import { pick } from "lodash-es";
|
|
20
|
+
import { cloneDeep, pick } from "lodash-es";
|
|
21
21
|
import {
|
|
22
22
|
ComponentProps,
|
|
23
23
|
ComponentType,
|
|
24
24
|
ForwardedRef,
|
|
25
25
|
forwardRef,
|
|
26
|
+
useCallback,
|
|
26
27
|
useLayoutEffect,
|
|
27
28
|
useMemo,
|
|
28
|
-
|
|
29
|
+
useState,
|
|
29
30
|
} from "react";
|
|
30
31
|
import { type CesiumComponentRef, Entity } from "resium";
|
|
31
32
|
|
|
@@ -86,10 +87,11 @@ function EntityExtComponent(
|
|
|
86
87
|
}: ComponentProps<typeof Entity> & Tag,
|
|
87
88
|
ref: ForwardedRef<CesiumComponentRef<CesiumEntity>>,
|
|
88
89
|
) {
|
|
89
|
-
const
|
|
90
|
+
const [entity, setEntity] = useState<CesiumComponentRef<CesiumEntity> | null>(null);
|
|
90
91
|
|
|
91
92
|
useLayoutEffect(() => {
|
|
92
|
-
|
|
93
|
+
if (!entity?.cesiumElement) return;
|
|
94
|
+
attachTag(entity.cesiumElement, {
|
|
93
95
|
layerId: layerId || props.id,
|
|
94
96
|
featureId,
|
|
95
97
|
draggable,
|
|
@@ -105,10 +107,12 @@ function EntityExtComponent(
|
|
|
105
107
|
props.id,
|
|
106
108
|
unselectable,
|
|
107
109
|
hideIndicator,
|
|
108
|
-
|
|
110
|
+
entity,
|
|
109
111
|
]);
|
|
110
112
|
|
|
111
|
-
|
|
113
|
+
const handleRef = useCallback((r: CesiumComponentRef<CesiumEntity>) => setEntity(r), []);
|
|
114
|
+
|
|
115
|
+
return <Entity ref={composeRefs(ref, handleRef)} {...props} />;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
export function attachTag(
|
|
@@ -232,13 +236,20 @@ export const extractSimpleLayer = (
|
|
|
232
236
|
if (l?.type !== "simple") {
|
|
233
237
|
return;
|
|
234
238
|
}
|
|
235
|
-
|
|
239
|
+
// Proxy object lead to issues when creating mvt imagery provider, so convert to plain object
|
|
240
|
+
// Not sure for other types, but to keep consistency, convert all simple layers here
|
|
241
|
+
// It should be okey since simple layer data is supposed to be simple enough and computed data should not be included
|
|
242
|
+
return toPlainObject(l);
|
|
236
243
|
};
|
|
237
244
|
|
|
238
245
|
export const extractSimpleLayerData = (layer: ComputedLayer | undefined): Data | undefined => {
|
|
239
246
|
return extractSimpleLayer(layer)?.data;
|
|
240
247
|
};
|
|
241
248
|
|
|
249
|
+
export const toPlainObject = <T,>(obj: T): T => {
|
|
250
|
+
return cloneDeep(obj);
|
|
251
|
+
};
|
|
252
|
+
|
|
242
253
|
export const toColor = (c?: string) => {
|
|
243
254
|
if (!c || typeof c !== "string") return undefined;
|
|
244
255
|
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
// https://github.com/CesiumGS/cesium/blob/1.106/packages/engine/Source/Shaders/Model/ImageBasedLightingStageFS.glsl
|
|
7
7
|
// Specular term was removed, as I never apply it on terrain.
|
|
8
8
|
vec3 reearth_imageBasedLightingStage(vec3 positionEC, vec3 normalEC,
|
|
9
|
-
vec3 lightDirectionEC,
|
|
10
|
-
czm_pbrParameters pbrParameters) {
|
|
9
|
+
vec3 lightDirectionEC, czm_modelMaterial material) {
|
|
11
10
|
vec3 v = -positionEC;
|
|
12
11
|
vec3 n = normalEC;
|
|
13
12
|
vec3 l = normalize(lightDirectionEC);
|
|
@@ -24,21 +23,18 @@ vec3 reearth_imageBasedLightingStage(vec3 positionEC, vec3 normalEC,
|
|
|
24
23
|
vec3 diffuseIrradiance =
|
|
25
24
|
czm_sphericalHarmonics(cubeDir, u_reearth_sphericalHarmonicCoefficients);
|
|
26
25
|
|
|
27
|
-
return
|
|
26
|
+
return material.diffuse * diffuseIrradiance;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
vec4 reearth_computeImageBasedLightingColor(vec4 color) {
|
|
31
30
|
if (u_reearth_globeImageBasedLighting) {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
czm_modelMaterial material;
|
|
32
|
+
material.diffuse = color.rgb;
|
|
34
33
|
|
|
35
34
|
vec3 normalEC = normalize(v_normalEC);
|
|
36
35
|
vec3 lighting =
|
|
37
|
-
czm_pbrLighting(v_positionEC, normalEC, czm_lightDirectionEC,
|
|
38
|
-
|
|
39
|
-
lighting += reearth_imageBasedLightingStage(
|
|
40
|
-
v_positionEC, normalEC, czm_lightDirectionEC,
|
|
41
|
-
czm_lightColorHdr, pbrParameters) *
|
|
36
|
+
czm_pbrLighting(v_positionEC, normalEC, czm_lightDirectionEC, material) * czm_lightColorHdr;
|
|
37
|
+
lighting += reearth_imageBasedLightingStage(v_positionEC, normalEC, czm_lightDirectionEC, material) *
|
|
42
38
|
u_vertexShadowDarkness;
|
|
43
39
|
|
|
44
40
|
#ifndef HDR
|
|
@@ -5,37 +5,42 @@ import {
|
|
|
5
5
|
type PositionProperty,
|
|
6
6
|
type Property,
|
|
7
7
|
} from "@cesium/engine";
|
|
8
|
-
import { useMemo, useRef, type FC } from "react";
|
|
8
|
+
import { useCallback, useMemo, useRef, type FC } from "react";
|
|
9
9
|
import { Entity } from "resium";
|
|
10
10
|
import invariant from "tiny-invariant";
|
|
11
11
|
|
|
12
12
|
import { useConstant } from "../../../utils";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
import { ADDING_POINT_COLOR, DEFAULT_EDIT_COLOR, SELECTED_EDIT_COLOR } from "./constants";
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
image.height = 16;
|
|
23
|
-
const context = image.getContext("2d");
|
|
24
|
-
invariant(context != null);
|
|
25
|
-
context.fillStyle = "white";
|
|
26
|
-
context.fillRect(3, 3, 10, 10);
|
|
27
|
-
context.strokeStyle = "black";
|
|
28
|
-
context.lineWidth = 2;
|
|
29
|
-
context.strokeRect(3, 3, 10, 10);
|
|
30
|
-
return image;
|
|
31
|
-
}
|
|
16
|
+
import { ControlPointMouseEventHandler } from ".";
|
|
17
|
+
|
|
18
|
+
let drawPointImage: HTMLCanvasElement | undefined;
|
|
19
|
+
let editPointImage: HTMLCanvasElement | undefined;
|
|
20
|
+
let selectedPointImage: HTMLCanvasElement | undefined;
|
|
21
|
+
let addingPointImage: HTMLCanvasElement | undefined;
|
|
32
22
|
|
|
33
23
|
export interface ControlPointProps {
|
|
34
24
|
position: Property | Cartesian3;
|
|
35
25
|
clampToGround?: boolean;
|
|
26
|
+
index: number;
|
|
27
|
+
isEditing?: boolean;
|
|
28
|
+
isSelected?: boolean;
|
|
29
|
+
isAddingPoint?: boolean;
|
|
30
|
+
isExtrudedControlPoint?: boolean;
|
|
31
|
+
handleControlPointMouseEvent?: ControlPointMouseEventHandler;
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
export const ControlPoint: FC<ControlPointProps> = ({
|
|
34
|
+
export const ControlPoint: FC<ControlPointProps> = ({
|
|
35
|
+
position,
|
|
36
|
+
clampToGround = false,
|
|
37
|
+
index,
|
|
38
|
+
isEditing,
|
|
39
|
+
isSelected,
|
|
40
|
+
isAddingPoint,
|
|
41
|
+
isExtrudedControlPoint,
|
|
42
|
+
handleControlPointMouseEvent,
|
|
43
|
+
}) => {
|
|
39
44
|
const positionRef = useRef(position);
|
|
40
45
|
positionRef.current = position;
|
|
41
46
|
const positionProperty = useConstant(
|
|
@@ -53,15 +58,114 @@ export const ControlPoint: FC<ControlPointProps> = ({ position, clampToGround =
|
|
|
53
58
|
() => ({
|
|
54
59
|
position: positionProperty,
|
|
55
60
|
billboard: {
|
|
56
|
-
image:
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
image: isEditing
|
|
62
|
+
? isAddingPoint
|
|
63
|
+
? getAddingPointImage()
|
|
64
|
+
: isSelected
|
|
65
|
+
? getSelectedPointImage()
|
|
66
|
+
: getEditPointImage()
|
|
67
|
+
: getDrawPointImage(),
|
|
68
|
+
width: isEditing ? 16 : 8,
|
|
69
|
+
height: isEditing ? 16 : 8,
|
|
59
70
|
heightReference: clampToGround ? HeightReference.CLAMP_TO_GROUND : HeightReference.NONE,
|
|
60
71
|
disableDepthTestDistance: Infinity,
|
|
61
72
|
},
|
|
62
73
|
}),
|
|
63
|
-
[clampToGround, positionProperty],
|
|
74
|
+
[clampToGround, positionProperty, isAddingPoint, isEditing, isSelected],
|
|
64
75
|
);
|
|
65
76
|
|
|
66
|
-
|
|
77
|
+
const handleMouseDown = useCallback(() => {
|
|
78
|
+
handleControlPointMouseEvent?.(index, !!isExtrudedControlPoint, "mousedown");
|
|
79
|
+
}, [index, isExtrudedControlPoint, handleControlPointMouseEvent]);
|
|
80
|
+
|
|
81
|
+
const handleMouseClick = useCallback(() => {
|
|
82
|
+
handleControlPointMouseEvent?.(index, !!isExtrudedControlPoint, "click");
|
|
83
|
+
}, [index, isExtrudedControlPoint, handleControlPointMouseEvent]);
|
|
84
|
+
|
|
85
|
+
return <Entity {...options} onMouseDown={handleMouseDown} onClick={handleMouseClick} />;
|
|
67
86
|
};
|
|
87
|
+
|
|
88
|
+
function getDrawPointImage(): HTMLCanvasElement {
|
|
89
|
+
if (drawPointImage != null) {
|
|
90
|
+
return drawPointImage;
|
|
91
|
+
}
|
|
92
|
+
drawPointImage = document.createElement("canvas");
|
|
93
|
+
drawPointImage.width = 16;
|
|
94
|
+
drawPointImage.height = 16;
|
|
95
|
+
const ctx = drawPointImage.getContext("2d");
|
|
96
|
+
invariant(ctx != null);
|
|
97
|
+
ctx.fillStyle = "white";
|
|
98
|
+
ctx.fillRect(3, 3, 10, 10);
|
|
99
|
+
ctx.strokeStyle = "black";
|
|
100
|
+
ctx.lineWidth = 2;
|
|
101
|
+
ctx.strokeRect(3, 3, 10, 10);
|
|
102
|
+
return drawPointImage;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function getEditPointImage(): HTMLCanvasElement {
|
|
106
|
+
return getImage(editPointImage, {
|
|
107
|
+
size: 32,
|
|
108
|
+
color: "white",
|
|
109
|
+
strokeColor: DEFAULT_EDIT_COLOR,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function getSelectedPointImage(): HTMLCanvasElement {
|
|
114
|
+
return getImage(selectedPointImage, {
|
|
115
|
+
size: 32,
|
|
116
|
+
color: "white",
|
|
117
|
+
strokeColor: SELECTED_EDIT_COLOR,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function getAddingPointImage(): HTMLCanvasElement {
|
|
122
|
+
if (addingPointImage != null) {
|
|
123
|
+
return addingPointImage;
|
|
124
|
+
}
|
|
125
|
+
addingPointImage = document.createElement("canvas");
|
|
126
|
+
addingPointImage.width = 32;
|
|
127
|
+
addingPointImage.height = 32;
|
|
128
|
+
const ctx = addingPointImage.getContext("2d");
|
|
129
|
+
invariant(ctx != null);
|
|
130
|
+
ctx.beginPath();
|
|
131
|
+
ctx.arc(16, 16, 12, 0, 2 * Math.PI);
|
|
132
|
+
ctx.fillStyle = "white";
|
|
133
|
+
ctx.fill();
|
|
134
|
+
ctx.strokeStyle = ADDING_POINT_COLOR;
|
|
135
|
+
ctx.lineWidth = 4;
|
|
136
|
+
ctx.stroke();
|
|
137
|
+
ctx.beginPath();
|
|
138
|
+
ctx.moveTo(16, 8);
|
|
139
|
+
ctx.lineTo(16, 24);
|
|
140
|
+
ctx.stroke();
|
|
141
|
+
ctx.moveTo(8, 16);
|
|
142
|
+
ctx.lineTo(24, 16);
|
|
143
|
+
ctx.stroke();
|
|
144
|
+
return addingPointImage;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function getImage(
|
|
148
|
+
canvas: HTMLCanvasElement | undefined,
|
|
149
|
+
options: {
|
|
150
|
+
size: number;
|
|
151
|
+
color: string;
|
|
152
|
+
strokeColor: string;
|
|
153
|
+
},
|
|
154
|
+
): HTMLCanvasElement {
|
|
155
|
+
if (canvas != null) {
|
|
156
|
+
return canvas;
|
|
157
|
+
}
|
|
158
|
+
canvas = document.createElement("canvas");
|
|
159
|
+
canvas.width = options.size;
|
|
160
|
+
canvas.height = options.size;
|
|
161
|
+
const ctx = canvas.getContext("2d");
|
|
162
|
+
invariant(ctx != null);
|
|
163
|
+
ctx.beginPath();
|
|
164
|
+
ctx.arc(options.size / 2, options.size / 2, options.size / 2 - 4, 0, 2 * Math.PI);
|
|
165
|
+
ctx.fillStyle = options.color;
|
|
166
|
+
ctx.fill();
|
|
167
|
+
ctx.strokeStyle = options.strokeColor;
|
|
168
|
+
ctx.lineWidth = 4;
|
|
169
|
+
ctx.stroke();
|
|
170
|
+
return canvas;
|
|
171
|
+
}
|
|
@@ -1,46 +1,91 @@
|
|
|
1
|
-
import { Cartesian3,
|
|
1
|
+
import { Cartesian3, Color } from "@cesium/engine";
|
|
2
2
|
import { memo, type FC } from "react";
|
|
3
|
-
import { useCesium } from "resium";
|
|
4
|
-
import invariant from "tiny-invariant";
|
|
5
3
|
|
|
4
|
+
import { Position3d } from "../../../types";
|
|
5
|
+
|
|
6
|
+
import { DEFAULT_EDIT_COLOR } from "./constants";
|
|
6
7
|
import { ControlPoint } from "./ControlPoint";
|
|
7
8
|
import { type GeometryOptions } from "./createGeometry";
|
|
8
9
|
import { ExtrudedMeasurement } from "./ExtrudedMeasurement";
|
|
9
10
|
|
|
11
|
+
import { ControlPointMouseEventHandler } from ".";
|
|
12
|
+
|
|
10
13
|
export interface ExtrudedControlPointsProps {
|
|
11
14
|
geometryOptions: GeometryOptions;
|
|
12
15
|
extrudedHeight: number;
|
|
16
|
+
extrudedPoint?: Position3d;
|
|
17
|
+
centroidBasePoint?: Position3d;
|
|
18
|
+
centroidExtrudedPoint?: Position3d;
|
|
19
|
+
catchedExtrudedPoint?: boolean;
|
|
13
20
|
color?: Color;
|
|
21
|
+
isEditing?: boolean;
|
|
22
|
+
handleControlPointMouseEvent?: ControlPointMouseEventHandler;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
|
-
const cartesianScratch = new Cartesian3();
|
|
17
|
-
|
|
18
25
|
const ExtrudedControlPoints: FC<ExtrudedControlPointsProps> = memo(
|
|
19
|
-
({
|
|
20
|
-
|
|
26
|
+
({
|
|
27
|
+
geometryOptions: { controlPoints, type },
|
|
28
|
+
extrudedHeight,
|
|
29
|
+
color,
|
|
30
|
+
isEditing,
|
|
31
|
+
extrudedPoint: extrudedPointPosition,
|
|
32
|
+
centroidBasePoint: extrudeBasePointPosition,
|
|
33
|
+
centroidExtrudedPoint: extrudeControlPointPosition,
|
|
34
|
+
catchedExtrudedPoint,
|
|
35
|
+
handleControlPointMouseEvent,
|
|
36
|
+
}) => {
|
|
21
37
|
const controlPoint = controlPoints[controlPoints.length - 1];
|
|
22
|
-
const normal = viewer?.scene?.globe.ellipsoid.geodeticSurfaceNormal(
|
|
23
|
-
controlPoint,
|
|
24
|
-
cartesianScratch,
|
|
25
|
-
);
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
const extrudedPoint = extrudedPointPosition
|
|
40
|
+
? new Cartesian3(...extrudedPointPosition)
|
|
41
|
+
: undefined;
|
|
42
|
+
|
|
43
|
+
const heightBasePoint = extrudeBasePointPosition
|
|
44
|
+
? new Cartesian3(...extrudeBasePointPosition)
|
|
45
|
+
: undefined;
|
|
46
|
+
|
|
47
|
+
const centroidExtrudedPoint = extrudeControlPointPosition
|
|
48
|
+
? new Cartesian3(...extrudeControlPointPosition)
|
|
49
|
+
: undefined;
|
|
33
50
|
|
|
34
51
|
return (
|
|
35
52
|
<>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
{extrudedPoint && (
|
|
54
|
+
<>
|
|
55
|
+
<ControlPoint
|
|
56
|
+
index={-1}
|
|
57
|
+
position={extrudedPoint}
|
|
58
|
+
isEditing={isEditing}
|
|
59
|
+
isExtrudedControlPoint
|
|
60
|
+
handleControlPointMouseEvent={handleControlPointMouseEvent}
|
|
61
|
+
/>
|
|
62
|
+
{(!isEditing || catchedExtrudedPoint) && (
|
|
63
|
+
<ExtrudedMeasurement
|
|
64
|
+
a={controlPoint}
|
|
65
|
+
b={extrudedPoint}
|
|
66
|
+
extrudedHeight={extrudedHeight}
|
|
67
|
+
color={isEditing ? Color.fromCssColorString(DEFAULT_EDIT_COLOR) : color}
|
|
68
|
+
showLine={type !== "extrudedPolygon"}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
</>
|
|
72
|
+
)}
|
|
73
|
+
{heightBasePoint && (
|
|
74
|
+
<ControlPoint
|
|
75
|
+
index={-1}
|
|
76
|
+
position={heightBasePoint}
|
|
77
|
+
isEditing={isEditing}
|
|
78
|
+
isExtrudedControlPoint
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
{centroidExtrudedPoint && (
|
|
82
|
+
<ControlPoint
|
|
83
|
+
index={-1}
|
|
84
|
+
position={centroidExtrudedPoint}
|
|
85
|
+
isEditing={isEditing}
|
|
86
|
+
isExtrudedControlPoint
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
44
89
|
</>
|
|
45
90
|
);
|
|
46
91
|
},
|
|
@@ -46,6 +46,7 @@ export interface ExtrudedMeasurementProps {
|
|
|
46
46
|
b: Cartesian3;
|
|
47
47
|
extrudedHeight: number;
|
|
48
48
|
color?: Color;
|
|
49
|
+
showLine?: boolean;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export const ExtrudedMeasurement: FC<ExtrudedMeasurementProps> = ({
|
|
@@ -53,6 +54,7 @@ export const ExtrudedMeasurement: FC<ExtrudedMeasurementProps> = ({
|
|
|
53
54
|
b,
|
|
54
55
|
extrudedHeight,
|
|
55
56
|
color,
|
|
57
|
+
showLine,
|
|
56
58
|
}) => {
|
|
57
59
|
const position = useConstant(() => new Cartesian3());
|
|
58
60
|
return (
|
|
@@ -64,7 +66,7 @@ export const ExtrudedMeasurement: FC<ExtrudedMeasurementProps> = ({
|
|
|
64
66
|
: `${(extrudedHeight / 1000).toFixed(1)} km`}
|
|
65
67
|
</MeasurementText>
|
|
66
68
|
</ScreenSpaceElement>
|
|
67
|
-
<MeasurementLine a={a} b={b} color={color} />
|
|
69
|
+
{showLine && <MeasurementLine a={a} b={b} color={color} />}
|
|
68
70
|
</>
|
|
69
71
|
);
|
|
70
72
|
};
|
|
@@ -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;
|