@reearth/core 0.0.7-alpha.2 → 0.0.7-alpha.21
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 +34414 -33038
- package/dist/core.umd.cjs +3867 -3825
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +70 -15
- package/package.json +27 -9
- package/src/Map/Layer/hooks.ts +6 -3
- package/src/Map/Layer/index.tsx +2 -0
- package/src/Map/Layers/hooks.ts +27 -0
- package/src/Map/Layers/index.tsx +12 -1
- package/src/Map/Layers/keys.ts +1 -0
- package/src/Map/Sketch/hooks.ts +412 -406
- package/src/Map/Sketch/index.tsx +65 -18
- package/src/Map/Sketch/sketchMachine.ts +359 -4
- package/src/Map/Sketch/sketchMachine.typegen.ts +58 -1
- package/src/Map/Sketch/types.ts +10 -20
- package/src/Map/Sketch/usePluginSketchLayer.ts +105 -0
- package/src/Map/Sketch/useSketch.ts +559 -0
- package/src/Map/Sketch/useSketchFeature.ts +198 -0
- package/src/Map/hooks.ts +32 -1
- package/src/Map/index.tsx +24 -0
- package/src/Map/ref.ts +10 -0
- package/src/Map/types/index.ts +28 -1
- package/src/Map/types/viewerProperty.ts +2 -0
- package/src/Visualizer/coreContext.tsx +2 -0
- package/src/Visualizer/hooks.ts +39 -2
- package/src/Visualizer/index.tsx +20 -0
- package/src/engines/Cesium/Feature/Resource/utils.ts +81 -97
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +52 -24
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
- package/src/engines/Cesium/Feature/context.ts +1 -0
- package/src/engines/Cesium/Feature/index.tsx +6 -2
- package/src/engines/Cesium/Feature/utils.tsx +9 -4
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +128 -24
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +70 -25
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +3 -1
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +14 -14
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +7 -4
- package/src/engines/Cesium/Sketch/SurfaceAddingPoints.tsx +60 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +125 -35
- package/src/engines/Cesium/Sketch/constants.ts +5 -0
- package/src/engines/Cesium/Sketch/index.tsx +68 -29
- package/src/engines/Cesium/common.ts +44 -11
- package/src/engines/Cesium/core/Globe.tsx +11 -2
- package/src/engines/Cesium/core/Imagery.tsx +7 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +8 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
- package/src/engines/Cesium/core/presets.ts +0 -11
- package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
- package/src/engines/Cesium/hooks/useEngineRef.ts +44 -0
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +1 -1
- package/src/engines/Cesium/hooks.ts +42 -5
- package/src/engines/Cesium/index.tsx +16 -3
- package/src/mantle/atoms/compute.ts +5 -1
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/types/appearance.ts +1 -2
- package/src/mantle/types/index.ts +3 -0
- package/src/utils/image.ts +1 -11
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +0 -1
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/cesium/Widgets/lighter.css +0 -237
- package/dist/cesium/Widgets/lighterShared.css +0 -46
- package/dist/cesium/Widgets/shared.css +0 -103
- package/dist/cesium/Widgets/widgets.css +0 -1346
- package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
- package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
- package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
- package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
- package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
- package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
- package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
- package/dist/cesium/Workers/combineGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createGeometry.js +0 -26
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/cesium/Workers/createWallGeometry.js +0 -26
- package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/decodeDraco.js +0 -26
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/cesium/Workers/decodeI3S.js +0 -26
- package/dist/cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
|
@@ -1,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
|
</>
|
|
@@ -35,8 +35,10 @@ import {
|
|
|
35
35
|
Plane,
|
|
36
36
|
CameraEventType,
|
|
37
37
|
KeyboardEventModifier,
|
|
38
|
+
CreditDisplay,
|
|
39
|
+
Credit as CesiumCredit,
|
|
38
40
|
} from "cesium";
|
|
39
|
-
import {
|
|
41
|
+
import { MutableRefObject, useMemo } from "react";
|
|
40
42
|
|
|
41
43
|
import type { Camera, Clock } from "..";
|
|
42
44
|
import { ClassificationType } from "../../mantle";
|
|
@@ -48,7 +50,7 @@ import type {
|
|
|
48
50
|
OverideKeyboardEventModifier,
|
|
49
51
|
ScreenSpaceCameraControllerOptions,
|
|
50
52
|
} from "../../types";
|
|
51
|
-
import { tweenInterval,
|
|
53
|
+
import { tweenInterval, useImage, LatLngHeight } from "../../utils";
|
|
52
54
|
|
|
53
55
|
import { DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS } from "./constants";
|
|
54
56
|
|
|
@@ -56,8 +58,7 @@ export const layerIdField = `__reearth_layer_id`;
|
|
|
56
58
|
|
|
57
59
|
const defaultImageSize = 50;
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
c: HTMLCanvasElement,
|
|
61
|
+
const drawIcon = (
|
|
61
62
|
image: HTMLImageElement | undefined,
|
|
62
63
|
w: number,
|
|
63
64
|
h: number,
|
|
@@ -68,6 +69,7 @@ export const drawIcon = (
|
|
|
68
69
|
shadowOffsetX = 0,
|
|
69
70
|
shadowOffsetY = 0,
|
|
70
71
|
) => {
|
|
72
|
+
const c = document.createElement("canvas");
|
|
71
73
|
const ctx = c.getContext("2d");
|
|
72
74
|
if (!image || !ctx) return;
|
|
73
75
|
|
|
@@ -104,6 +106,7 @@ export const drawIcon = (
|
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
ctx.restore();
|
|
109
|
+
return c.toDataURL();
|
|
107
110
|
};
|
|
108
111
|
|
|
109
112
|
export const useIcon = ({
|
|
@@ -138,13 +141,11 @@ export const useIcon = ({
|
|
|
138
141
|
? Math.floor(img.height * imageSize)
|
|
139
142
|
: Math.floor((w / img.width) * img.height);
|
|
140
143
|
|
|
141
|
-
const
|
|
142
|
-
(
|
|
143
|
-
drawIcon(can, img, w, h, crop, shadow, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY),
|
|
144
|
+
const canvas = useMemo(
|
|
145
|
+
() => drawIcon(img, w, h, crop, shadow, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY),
|
|
144
146
|
[crop, h, img, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, w],
|
|
145
147
|
);
|
|
146
|
-
|
|
147
|
-
return [canvas, w, h];
|
|
148
|
+
return [canvas ?? "", w, h];
|
|
148
149
|
};
|
|
149
150
|
|
|
150
151
|
export const ho = (o: "left" | "center" | "right" | undefined): HorizontalOrigin | undefined =>
|
|
@@ -545,7 +546,7 @@ export const colorBlendMode = (colorBlendMode?: "highlight" | "replace" | "mix"
|
|
|
545
546
|
)[colorBlendMode || ""];
|
|
546
547
|
|
|
547
548
|
export const colorBlendModeFor3DTile = (
|
|
548
|
-
colorBlendMode
|
|
549
|
+
colorBlendMode: "highlight" | "replace" | "mix" = "highlight",
|
|
549
550
|
) =>
|
|
550
551
|
(
|
|
551
552
|
({
|
|
@@ -553,7 +554,7 @@ export const colorBlendModeFor3DTile = (
|
|
|
553
554
|
replace: Cesium3DTileColorBlendMode.REPLACE,
|
|
554
555
|
mix: Cesium3DTileColorBlendMode.MIX,
|
|
555
556
|
}) as { [key in string]?: Cesium3DTileColorBlendMode }
|
|
556
|
-
)[colorBlendMode
|
|
557
|
+
)[colorBlendMode]
|
|
557
558
|
|
|
558
559
|
export const heightReference = (
|
|
559
560
|
heightReference?: "none" | "clamp" | "relative",
|
|
@@ -899,3 +900,35 @@ export function getExtrudedHeight(
|
|
|
899
900
|
}
|
|
900
901
|
return;
|
|
901
902
|
}
|
|
903
|
+
|
|
904
|
+
export function getCredits(viewer: Viewer) {
|
|
905
|
+
if (!viewer) return;
|
|
906
|
+
const creditDisplay = viewer.creditDisplay as
|
|
907
|
+
| (CreditDisplay & {
|
|
908
|
+
_currentFrameCredits: {
|
|
909
|
+
lightboxCredits: { _array: { credit?: CesiumCredit }[] };
|
|
910
|
+
screenCredits: { _array: { credit?: CesiumCredit }[] };
|
|
911
|
+
};
|
|
912
|
+
_currentCesiumCredit: CesiumCredit;
|
|
913
|
+
})
|
|
914
|
+
| undefined;
|
|
915
|
+
|
|
916
|
+
if (!creditDisplay) return;
|
|
917
|
+
|
|
918
|
+
const { lightboxCredits, screenCredits } = creditDisplay?._currentFrameCredits || {};
|
|
919
|
+
const cesiumCredits = creditDisplay._currentCesiumCredit;
|
|
920
|
+
|
|
921
|
+
const credits: {
|
|
922
|
+
html?: string;
|
|
923
|
+
}[] = [
|
|
924
|
+
...(cesiumCredits?.html ? [{ html: cesiumCredits.html }] : []),
|
|
925
|
+
...Array.from(lightboxCredits?._array ?? []).map(c => ({
|
|
926
|
+
html: c?.credit?.html,
|
|
927
|
+
})),
|
|
928
|
+
...Array.from(screenCredits?._array ?? []).map(c => ({
|
|
929
|
+
html: c?.credit?.html,
|
|
930
|
+
})),
|
|
931
|
+
];
|
|
932
|
+
|
|
933
|
+
return credits;
|
|
934
|
+
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
IonResource,
|
|
6
6
|
TerrainProvider,
|
|
7
7
|
} from "cesium";
|
|
8
|
-
import { useMemo } from "react";
|
|
8
|
+
import { useEffect, useMemo } from "react";
|
|
9
9
|
import { Globe as CesiumGlobe } from "resium";
|
|
10
10
|
|
|
11
11
|
import type { ViewerProperty, TerrainProperty } from "../..";
|
|
@@ -15,9 +15,14 @@ import { toColor } from "../common";
|
|
|
15
15
|
export type Props = {
|
|
16
16
|
property?: ViewerProperty;
|
|
17
17
|
cesiumIonAccessToken?: string;
|
|
18
|
+
onTerrainProviderChange?: () => void;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
export default function Globe({
|
|
21
|
+
export default function Globe({
|
|
22
|
+
property,
|
|
23
|
+
cesiumIonAccessToken,
|
|
24
|
+
onTerrainProviderChange,
|
|
25
|
+
}: Props): JSX.Element | null {
|
|
21
26
|
const terrainProperty = useMemo(
|
|
22
27
|
(): TerrainProperty => ({
|
|
23
28
|
...property?.terrain,
|
|
@@ -51,6 +56,10 @@ export default function Globe({ property, cesiumIonAccessToken }: Props): JSX.El
|
|
|
51
56
|
[property?.globe?.baseColor],
|
|
52
57
|
);
|
|
53
58
|
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
onTerrainProviderChange?.();
|
|
61
|
+
}, [terrainProvider, onTerrainProviderChange]);
|
|
62
|
+
|
|
54
63
|
return (
|
|
55
64
|
<CesiumGlobe
|
|
56
65
|
baseColor={baseColor}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TextureMinificationFilter,
|
|
6
6
|
} from "cesium";
|
|
7
7
|
import { isEqual } from "lodash-es";
|
|
8
|
-
import { useCallback, useMemo, useRef, useLayoutEffect, useState } from "react";
|
|
8
|
+
import { useCallback, useMemo, useRef, useLayoutEffect, useState, useEffect } from "react";
|
|
9
9
|
import { ImageryLayer } from "resium";
|
|
10
10
|
|
|
11
11
|
import { tiles as tilePresets } from "./presets";
|
|
@@ -31,9 +31,10 @@ export type Tile = {
|
|
|
31
31
|
export type Props = {
|
|
32
32
|
tiles?: Tile[];
|
|
33
33
|
cesiumIonAccessToken?: string;
|
|
34
|
+
onTilesChange?: () => void;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
export default function ImageryLayers({ tiles, cesiumIonAccessToken }: Props) {
|
|
37
|
+
export default function ImageryLayers({ tiles, cesiumIonAccessToken, onTilesChange }: Props) {
|
|
37
38
|
const { providers, updated } = useImageryProviders({
|
|
38
39
|
tiles,
|
|
39
40
|
cesiumIonAccessToken,
|
|
@@ -47,6 +48,10 @@ export default function ImageryLayers({ tiles, cesiumIonAccessToken }: Props) {
|
|
|
47
48
|
if (updated) setCounter(c => c + 1);
|
|
48
49
|
}, [providers, updated]);
|
|
49
50
|
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
onTilesChange?.();
|
|
53
|
+
}, [tiles, counter, onTilesChange]);
|
|
54
|
+
|
|
50
55
|
return (
|
|
51
56
|
<>
|
|
52
57
|
{tiles
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type Ellipsoid,
|
|
13
13
|
type Label,
|
|
14
14
|
} from "@cesium/engine";
|
|
15
|
+
import { DistanceDisplayCondition } from "cesium";
|
|
15
16
|
import { merge, omit } from "lodash-es";
|
|
16
17
|
import { type Feature } from "protomaps";
|
|
17
18
|
import { memo, useCallback, useEffect, useMemo, useRef, type FC } from "react";
|
|
@@ -170,6 +171,8 @@ export interface JapanGSIOptimalBVmapLabelImageryProps {
|
|
|
170
171
|
height?: number;
|
|
171
172
|
style?: AnnotationStyle;
|
|
172
173
|
labelCollection?: LabelCollection;
|
|
174
|
+
near?: number;
|
|
175
|
+
far?: number;
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImageryProps> = memo(
|
|
@@ -180,6 +183,8 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
180
183
|
height = 50,
|
|
181
184
|
style = defaultStyle,
|
|
182
185
|
labelCollection,
|
|
186
|
+
near,
|
|
187
|
+
far,
|
|
183
188
|
}) => {
|
|
184
189
|
const cesiumContext = useCesium();
|
|
185
190
|
|
|
@@ -282,6 +287,8 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
282
287
|
horizontalOrigin: HorizontalOrigin.CENTER,
|
|
283
288
|
verticalOrigin: VerticalOrigin.BOTTOM,
|
|
284
289
|
heightReference: HeightReference.CLAMP_TO_GROUND,
|
|
290
|
+
distanceDisplayCondition:
|
|
291
|
+
near || far ? new DistanceDisplayCondition(near, far) : undefined,
|
|
285
292
|
disableDepthTestDistance: Infinity,
|
|
286
293
|
...styleOptions,
|
|
287
294
|
};
|
|
@@ -308,7 +315,7 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
308
315
|
scene?.postRender.addEventListener(removeLabels);
|
|
309
316
|
}
|
|
310
317
|
};
|
|
311
|
-
}, [style, annotations, scene, labelCollection]);
|
|
318
|
+
}, [style, annotations, scene, labelCollection, near, far]);
|
|
312
319
|
|
|
313
320
|
useEffect(() => {
|
|
314
321
|
updateVisibility();
|
|
@@ -143,7 +143,9 @@ const LabelImageryCollection: FC<{
|
|
|
143
143
|
imageriesAtom: Atom<KeyedImagery[]>;
|
|
144
144
|
style?: AnnotationStyle;
|
|
145
145
|
labelCollection?: LabelCollection;
|
|
146
|
-
|
|
146
|
+
near?: number;
|
|
147
|
+
far?: number;
|
|
148
|
+
}> = ({ imageryProvider, imageriesAtom, style, labelCollection, near, far }) => {
|
|
147
149
|
const imageries = useAtomValue(imageriesAtom);
|
|
148
150
|
return (
|
|
149
151
|
<>
|
|
@@ -155,6 +157,8 @@ const LabelImageryCollection: FC<{
|
|
|
155
157
|
descendants={imagery.descendants}
|
|
156
158
|
style={style}
|
|
157
159
|
labelCollection={labelCollection}
|
|
160
|
+
near={near}
|
|
161
|
+
far={far}
|
|
158
162
|
/>
|
|
159
163
|
</Suspense>
|
|
160
164
|
))}
|
|
@@ -164,9 +168,15 @@ const LabelImageryCollection: FC<{
|
|
|
164
168
|
|
|
165
169
|
export interface VectorMapLabelProps {
|
|
166
170
|
style?: Record<string, any>;
|
|
171
|
+
near?: number;
|
|
172
|
+
far?: number;
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({
|
|
175
|
+
export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({
|
|
176
|
+
style,
|
|
177
|
+
near,
|
|
178
|
+
far,
|
|
179
|
+
}) => {
|
|
170
180
|
const [imageryProvider, setImageryProvider] =
|
|
171
181
|
useState<JapanGSIOptimalBVmapLabelImageryProvider>();
|
|
172
182
|
const setRef = useCallback((handle: CesiumComponentRef<CesiumImageryLayer> | null) => {
|
|
@@ -251,6 +261,8 @@ export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({ st
|
|
|
251
261
|
imageriesAtom={imageriesAtom}
|
|
252
262
|
style={style}
|
|
253
263
|
labelCollection={labels}
|
|
264
|
+
near={near}
|
|
265
|
+
far={far}
|
|
254
266
|
/>
|
|
255
267
|
)}
|
|
256
268
|
</>
|
|
@@ -8,6 +8,8 @@ export interface TileLabelConfig {
|
|
|
8
8
|
labelType: "japan_gsi_optimal_bvmap";
|
|
9
9
|
fillColor?: string;
|
|
10
10
|
outlineColor?: string;
|
|
11
|
+
near?: number;
|
|
12
|
+
far?: number;
|
|
11
13
|
style: Record<string, any>;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -23,7 +25,14 @@ const LabelImageryLayers = memo(
|
|
|
23
25
|
if (!label) return null;
|
|
24
26
|
switch (label.labelType) {
|
|
25
27
|
case "japan_gsi_optimal_bvmap":
|
|
26
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
<JapanGSIOptimalBVmapVectorMapLabel
|
|
30
|
+
key={label.id}
|
|
31
|
+
style={label.style}
|
|
32
|
+
near={label.near}
|
|
33
|
+
far={label.far}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
27
36
|
default:
|
|
28
37
|
return null;
|
|
29
38
|
}
|
|
@@ -24,17 +24,6 @@ export const tiles = {
|
|
|
24
24
|
IonImageryProvider.fromAssetId(IonWorldImageryStyle.ROAD, {
|
|
25
25
|
accessToken: cesiumIonAccessToken,
|
|
26
26
|
}).catch(console.error),
|
|
27
|
-
stamen_watercolor: () =>
|
|
28
|
-
new OpenStreetMapImageryProvider({
|
|
29
|
-
url: "https://stamen-tiles.a.ssl.fastly.net/watercolor/",
|
|
30
|
-
credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",
|
|
31
|
-
fileExtension: "jpg",
|
|
32
|
-
}),
|
|
33
|
-
stamen_toner: () =>
|
|
34
|
-
new OpenStreetMapImageryProvider({
|
|
35
|
-
url: "https://stamen-tiles.a.ssl.fastly.net/toner/",
|
|
36
|
-
credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",
|
|
37
|
-
}),
|
|
38
27
|
open_street_map: () =>
|
|
39
28
|
new OpenStreetMapImageryProvider({
|
|
40
29
|
url: "https://a.tile.openstreetmap.org/",
|