@reearth/core 0.0.7-alpha.5 → 0.0.7-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +58676 -51066
- package/dist/core.umd.cjs +3959 -3915
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +150 -34
- package/package.json +55 -39
- package/src/Map/ClusteredLayers/index.tsx +1 -1
- package/src/Map/Geoid/index.tsx +68 -0
- package/src/Map/Geoid/types.ts +8 -0
- package/src/Map/Layer/hooks.ts +7 -4
- package/src/Map/Layer/index.tsx +3 -1
- package/src/Map/Layers/hooks.ts +19 -2
- package/src/Map/Layers/index.tsx +13 -2
- package/src/Map/Layers/keys.ts +1 -0
- package/src/Map/Sketch/hooks.ts +453 -410
- package/src/Map/Sketch/index.tsx +67 -20
- package/src/Map/Sketch/sketchMachine.ts +359 -4
- package/src/Map/Sketch/sketchMachine.typegen.ts +58 -1
- package/src/Map/Sketch/types.ts +10 -20
- package/src/Map/Sketch/usePluginSketchLayer.ts +105 -0
- package/src/Map/Sketch/useSketch.ts +559 -0
- package/src/Map/Sketch/useSketchFeature.ts +198 -0
- package/src/Map/SpatialId/constants.ts +21 -0
- package/src/Map/SpatialId/hooks.ts +448 -0
- package/src/Map/SpatialId/index.tsx +63 -0
- package/src/Map/SpatialId/types.ts +68 -0
- package/src/Map/SpatialId/utils.ts +65 -0
- package/src/Map/hooks.ts +54 -8
- package/src/Map/index.tsx +41 -8
- package/src/Map/ref.ts +32 -3
- package/src/Map/types/index.ts +39 -3
- package/src/Map/types/viewerProperty.ts +10 -0
- package/src/Map/useTimelineManager.ts +2 -2
- package/src/Map/utils.ts +1 -1
- package/src/Visualizer/context.tsx +5 -5
- package/src/Visualizer/coreContext.tsx +2 -0
- package/src/Visualizer/hooks.ts +54 -20
- package/src/Visualizer/index.tsx +22 -3
- package/src/Visualizer/interactionMode.ts +2 -1
- package/src/Visualizer/useViewport.ts +1 -1
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +4 -4
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +1 -1
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +3 -1
- package/src/engines/Cesium/Feature/Polygon/index.tsx +6 -4
- package/src/engines/Cesium/Feature/Raster/mvt.ts +2 -1
- package/src/engines/Cesium/Feature/Resource/utils.ts +86 -91
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +135 -70
- package/src/engines/Cesium/Feature/Tileset/index.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +2 -2
- package/src/engines/Cesium/Feature/context.ts +1 -0
- package/src/engines/Cesium/Feature/index.tsx +7 -3
- package/src/engines/Cesium/Feature/utils.tsx +18 -7
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +128 -24
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +70 -25
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +3 -1
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +14 -14
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +7 -4
- package/src/engines/Cesium/Sketch/SurfaceAddingPoints.tsx +60 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +125 -35
- package/src/engines/Cesium/Sketch/constants.ts +5 -0
- package/src/engines/Cesium/Sketch/index.tsx +68 -29
- package/src/engines/Cesium/SpatialId/CoordinateIndicator.tsx +28 -0
- package/src/engines/Cesium/SpatialId/SpatialIdSpace.tsx +33 -0
- package/src/engines/Cesium/SpatialId/VerticalSpaceIndicator.tsx +32 -0
- package/src/engines/Cesium/SpatialId/index.ts +3 -0
- package/src/engines/Cesium/common.ts +52 -16
- package/src/engines/Cesium/core/Clock.tsx +1 -1
- package/src/engines/Cesium/core/Globe/index.tsx +73 -0
- package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +79 -0
- package/src/engines/Cesium/core/Imagery.test.ts +29 -11
- package/src/engines/Cesium/core/Imagery.tsx +22 -6
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +1 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +9 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
- package/src/engines/Cesium/core/presets.ts +24 -28
- package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
- package/src/engines/Cesium/hooks/useCamera.ts +1 -1
- package/src/engines/Cesium/hooks/useCameraLimiter.ts +1 -1
- package/src/engines/Cesium/hooks/useEngineRef.ts +48 -3
- package/src/engines/Cesium/hooks/useExplicitRender.ts +2 -2
- package/src/engines/Cesium/hooks/useInstance.ts +1 -1
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +2 -2
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +1 -1
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +98 -52
- package/src/engines/Cesium/hooks/useViewerProperty.ts +1 -1
- package/src/engines/Cesium/hooks.ts +52 -10
- package/src/engines/Cesium/index.tsx +16 -3
- package/src/engines/Cesium/types.ts +1 -1
- package/src/mantle/atoms/compute.ts +8 -3
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/data/shapefile/parseZip.ts +1 -0
- package/src/mantle/evaluator/simple/expression/expression.test.ts +72 -0
- package/src/mantle/evaluator/simple/expression/node.ts +10 -12
- package/src/mantle/types/appearance.ts +4 -2
- package/src/mantle/types/index.ts +3 -0
- package/src/test/utils.tsx +1 -1
- package/src/utils/image.ts +2 -12
- package/src/utils/use-delayed-count.ts +1 -1
- package/src/utils/use-dnd/drop.ts +1 -1
- package/src/utils/util.ts +1 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +0 -1
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/cesium/Widgets/lighter.css +0 -237
- package/dist/cesium/Widgets/lighterShared.css +0 -46
- package/dist/cesium/Widgets/shared.css +0 -103
- package/dist/cesium/Widgets/widgets.css +0 -1346
- package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
- package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
- package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
- package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
- package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
- package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
- package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
- package/dist/cesium/Workers/combineGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createGeometry.js +0 -26
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/cesium/Workers/createWallGeometry.js +0 -26
- package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/decodeDraco.js +0 -26
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/cesium/Workers/decodeI3S.js +0 -26
- package/dist/cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
- package/src/engines/Cesium/core/Globe.tsx +0 -104
- /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { forwardRef, ForwardRefRenderFunction, RefObject } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CoordinateIndicator,
|
|
5
|
+
SpatialIdSpace,
|
|
6
|
+
VerticalSpaceIndicator,
|
|
7
|
+
} from "../../engines/Cesium/SpatialId";
|
|
8
|
+
import { InteractionModeType } from "../../Visualizer";
|
|
9
|
+
import { GeoidRef } from "../Geoid/types";
|
|
10
|
+
import { EngineRef } from "../types";
|
|
11
|
+
|
|
12
|
+
import useHooks from "./hooks";
|
|
13
|
+
import { SpatialIdRef } from "./types";
|
|
14
|
+
|
|
15
|
+
type SpatialIdProps = {
|
|
16
|
+
engineRef: RefObject<EngineRef | null>;
|
|
17
|
+
geoidRef: RefObject<GeoidRef | null>;
|
|
18
|
+
terrainEnabled?: boolean;
|
|
19
|
+
interactionMode?: InteractionModeType;
|
|
20
|
+
overrideInteractionMode?: (mode: InteractionModeType) => void;
|
|
21
|
+
onMount?: () => void;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const SpatialId: ForwardRefRenderFunction<SpatialIdRef, SpatialIdProps> = (
|
|
25
|
+
{ engineRef, geoidRef, terrainEnabled, interactionMode, overrideInteractionMode, onMount },
|
|
26
|
+
ref,
|
|
27
|
+
) => {
|
|
28
|
+
const {
|
|
29
|
+
spatialIdSpaces,
|
|
30
|
+
verticalSpaceIndicator,
|
|
31
|
+
coordinateSelector,
|
|
32
|
+
spaceSelector,
|
|
33
|
+
groundIndicators,
|
|
34
|
+
} = useHooks({
|
|
35
|
+
ref,
|
|
36
|
+
engineRef,
|
|
37
|
+
geoidRef,
|
|
38
|
+
terrainEnabled,
|
|
39
|
+
interactionMode,
|
|
40
|
+
overrideInteractionMode,
|
|
41
|
+
onMount,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
{spatialIdSpaces &&
|
|
47
|
+
spatialIdSpaces.length > 0 &&
|
|
48
|
+
spatialIdSpaces.map(space => <SpatialIdSpace key={space.id} space={space} />)}
|
|
49
|
+
{groundIndicators &&
|
|
50
|
+
groundIndicators.length > 0 &&
|
|
51
|
+
groundIndicators.map(indicator => (
|
|
52
|
+
<CoordinateIndicator key={indicator.id} wsen={indicator.wsen} color={indicator.color} />
|
|
53
|
+
))}
|
|
54
|
+
{verticalSpaceIndicator && <VerticalSpaceIndicator indicator={verticalSpaceIndicator} />}
|
|
55
|
+
{coordinateSelector && (
|
|
56
|
+
<CoordinateIndicator wsen={coordinateSelector.wsen} color={coordinateSelector.color} />
|
|
57
|
+
)}
|
|
58
|
+
{spaceSelector && <SpatialIdSpace space={spaceSelector} />}
|
|
59
|
+
</>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default forwardRef(SpatialId);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Space } from "@reearth/spatial-id-sdk";
|
|
2
|
+
|
|
3
|
+
export type SpatialIdSpaceType = {
|
|
4
|
+
id: string;
|
|
5
|
+
space: Space;
|
|
6
|
+
wsen: [number, number, number, number];
|
|
7
|
+
height: number;
|
|
8
|
+
extrudedHeight: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
outlineColor?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type VerticalSpaceIndicatorType = {
|
|
14
|
+
id: string;
|
|
15
|
+
wsen: [number, number, number, number];
|
|
16
|
+
height: number;
|
|
17
|
+
extrudedHeight: number;
|
|
18
|
+
color: string;
|
|
19
|
+
outlineColor: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type CoordinateSelectorType = {
|
|
23
|
+
id: string;
|
|
24
|
+
uid: string;
|
|
25
|
+
wsen: [number, number, number, number];
|
|
26
|
+
color: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type SpatialIdPickSpaceOptions = {
|
|
30
|
+
zoom?: number;
|
|
31
|
+
maxHeight?: number;
|
|
32
|
+
minHeight?: number;
|
|
33
|
+
dataOnly?: boolean;
|
|
34
|
+
rightClickToExit?: boolean;
|
|
35
|
+
color?: string;
|
|
36
|
+
outlineColor?: string;
|
|
37
|
+
groundIndicatorColor?: string;
|
|
38
|
+
selectorColor?: string;
|
|
39
|
+
selectorOutlineColor?: string;
|
|
40
|
+
verticalSpaceIndicatorColor?: string;
|
|
41
|
+
verticalSpaceIndicatorOutlineColor?: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type SpatialIdRef = {
|
|
45
|
+
pickSpace: (options?: SpatialIdPickSpaceOptions) => void;
|
|
46
|
+
exitPickSpace: () => void;
|
|
47
|
+
onSpacePick: (cb: (space: SpatialIdSpaceData) => void) => void;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type SpatialIdSpacePickingState = "idle" | "coordinate" | "fetchingGeoid" | "floor";
|
|
51
|
+
|
|
52
|
+
export type SpatialIdSpaceData = {
|
|
53
|
+
id: string;
|
|
54
|
+
center: { lat: number; lng: number; alt?: number };
|
|
55
|
+
alt: number;
|
|
56
|
+
zoom: number;
|
|
57
|
+
zfxy: {
|
|
58
|
+
z: number;
|
|
59
|
+
f: number;
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
};
|
|
63
|
+
zfxyStr: string;
|
|
64
|
+
tilehash: string;
|
|
65
|
+
hilbertTilehash: string;
|
|
66
|
+
hilbertIndex: string;
|
|
67
|
+
vertices: [number, number, number][];
|
|
68
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { v4 as uuid } from "uuid";
|
|
2
|
+
|
|
3
|
+
import { Space } from "@reearth/spatial-id-sdk";
|
|
4
|
+
|
|
5
|
+
import { SpatialIdSpaceType, SpatialIdSpaceData } from "./types";
|
|
6
|
+
|
|
7
|
+
const getRectangeParamsFromSpace = (space: Space) => {
|
|
8
|
+
const vertices = space.vertices3d();
|
|
9
|
+
const wsen: [number, number, number, number] = [
|
|
10
|
+
vertices[0][0],
|
|
11
|
+
vertices[1][1],
|
|
12
|
+
vertices[2][0],
|
|
13
|
+
vertices[3][1],
|
|
14
|
+
];
|
|
15
|
+
const height = vertices[0][2];
|
|
16
|
+
const extrudedHeight = vertices[4][2];
|
|
17
|
+
return { wsen, height, extrudedHeight };
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const createSpatialIdSpace = (
|
|
21
|
+
lng: number,
|
|
22
|
+
lat: number,
|
|
23
|
+
alt: number,
|
|
24
|
+
zoom: number,
|
|
25
|
+
geoidHeight: number,
|
|
26
|
+
): SpatialIdSpaceType => {
|
|
27
|
+
const space = new Space({ lat, lng, alt }, zoom);
|
|
28
|
+
const { wsen, height, extrudedHeight } = getRectangeParamsFromSpace(space);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
id: uuid(),
|
|
32
|
+
space,
|
|
33
|
+
wsen,
|
|
34
|
+
height: height + geoidHeight,
|
|
35
|
+
extrudedHeight: extrudedHeight + geoidHeight,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const getSpaceData = (space: Space): SpatialIdSpaceData => {
|
|
40
|
+
return {
|
|
41
|
+
id: space.id,
|
|
42
|
+
center: space.center,
|
|
43
|
+
alt: space.alt,
|
|
44
|
+
zoom: space.zoom,
|
|
45
|
+
zfxy: space.zfxy,
|
|
46
|
+
zfxyStr: space.zfxyStr,
|
|
47
|
+
tilehash: space.tilehash,
|
|
48
|
+
hilbertTilehash: space.hilbertTilehash,
|
|
49
|
+
hilbertIndex: space.hilbertIndex.toString(),
|
|
50
|
+
vertices: space.vertices3d(),
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const getVerticalLimits = (
|
|
55
|
+
maxHeigth: number,
|
|
56
|
+
minHeight: number,
|
|
57
|
+
zoom: number,
|
|
58
|
+
): { top: number; bottom: number } => {
|
|
59
|
+
// lat/lng doesn't matter
|
|
60
|
+
const topSpace = new Space({ lat: 0, lng: 0, alt: maxHeigth }, zoom);
|
|
61
|
+
const bottomSpace = new Space({ lat: 0, lng: 0, alt: minHeight }, zoom);
|
|
62
|
+
const { height } = getRectangeParamsFromSpace(topSpace);
|
|
63
|
+
const { extrudedHeight } = getRectangeParamsFromSpace(bottomSpace);
|
|
64
|
+
return { top: height, bottom: extrudedHeight };
|
|
65
|
+
};
|
package/src/Map/hooks.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { useImperativeHandle, useRef, type Ref, useState, useCallback, useEffect
|
|
|
2
2
|
|
|
3
3
|
import { SelectedFeatureInfo } from "../mantle";
|
|
4
4
|
|
|
5
|
+
import { GeoidRef } from "./Geoid/types";
|
|
5
6
|
import { type MapRef, mapRef } from "./ref";
|
|
7
|
+
import { SpatialIdRef } from "./SpatialId/types";
|
|
6
8
|
import type {
|
|
7
9
|
EngineRef,
|
|
8
10
|
LayersRef,
|
|
@@ -13,7 +15,7 @@ import type {
|
|
|
13
15
|
} from "./types";
|
|
14
16
|
import useTimelineManager, { TimelineManagerRef } from "./useTimelineManager";
|
|
15
17
|
|
|
16
|
-
import {
|
|
18
|
+
import { SketchEditingFeature } from ".";
|
|
17
19
|
|
|
18
20
|
export type { MapRef } from "./ref";
|
|
19
21
|
|
|
@@ -24,12 +26,12 @@ export const REQUEST_RENDER_ONCE = 1;
|
|
|
24
26
|
export default function ({
|
|
25
27
|
ref,
|
|
26
28
|
timelineManagerRef,
|
|
27
|
-
cursor,
|
|
28
29
|
onLayerSelect,
|
|
30
|
+
onMount,
|
|
31
|
+
onAPIReady,
|
|
29
32
|
}: {
|
|
30
33
|
ref: Ref<MapRef>;
|
|
31
34
|
timelineManagerRef?: TimelineManagerRef;
|
|
32
|
-
cursor?: CursorType;
|
|
33
35
|
onLayerSelect?: (
|
|
34
36
|
layerId: string | undefined,
|
|
35
37
|
featureId: string | undefined,
|
|
@@ -37,10 +39,20 @@ export default function ({
|
|
|
37
39
|
options?: LayerSelectionReason,
|
|
38
40
|
info?: SelectedFeatureInfo,
|
|
39
41
|
) => void;
|
|
42
|
+
onMount?: () => void;
|
|
43
|
+
onAPIReady?: () => void;
|
|
40
44
|
}) {
|
|
45
|
+
const [mapAPIReady, setMapAPIReady] = useState({
|
|
46
|
+
engine: false,
|
|
47
|
+
layers: false,
|
|
48
|
+
sketch: false,
|
|
49
|
+
spatialId: false,
|
|
50
|
+
});
|
|
41
51
|
const engineRef = useRef<EngineRef>(null);
|
|
42
52
|
const layersRef = useRef<LayersRef>(null);
|
|
43
53
|
const sketchRef = useRef<SketchRef>(null);
|
|
54
|
+
const spatialIdRef = useRef<SpatialIdRef>(null);
|
|
55
|
+
const geoidRef = useRef<GeoidRef>(null);
|
|
44
56
|
const requestingRenderMode = useRef<RequestingRenderMode>(NO_REQUEST_RENDER);
|
|
45
57
|
|
|
46
58
|
useImperativeHandle(
|
|
@@ -50,11 +62,25 @@ export default function ({
|
|
|
50
62
|
engineRef,
|
|
51
63
|
layersRef,
|
|
52
64
|
sketchRef,
|
|
65
|
+
spatialIdRef,
|
|
66
|
+
geoidRef,
|
|
53
67
|
timelineManagerRef,
|
|
54
68
|
}),
|
|
55
69
|
[timelineManagerRef],
|
|
56
70
|
);
|
|
57
71
|
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (
|
|
74
|
+
onAPIReady &&
|
|
75
|
+
mapAPIReady.engine &&
|
|
76
|
+
mapAPIReady.layers &&
|
|
77
|
+
mapAPIReady.sketch &&
|
|
78
|
+
mapAPIReady.spatialId
|
|
79
|
+
) {
|
|
80
|
+
onAPIReady?.();
|
|
81
|
+
}
|
|
82
|
+
}, [onAPIReady, mapAPIReady]);
|
|
83
|
+
|
|
58
84
|
// selectLayer logic
|
|
59
85
|
// 1. Map/hooks(here) is the source
|
|
60
86
|
// 1.2 State updates propagate up, through onLayerSelect, to update
|
|
@@ -105,19 +131,39 @@ export default function ({
|
|
|
105
131
|
timelineManagerRef,
|
|
106
132
|
});
|
|
107
133
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
134
|
+
const [sketchEditingFeature, setSketchEditingFeature] = useState<
|
|
135
|
+
SketchEditingFeature | undefined
|
|
136
|
+
>();
|
|
137
|
+
|
|
138
|
+
const handleEngineMount = useCallback(() => {
|
|
139
|
+
setMapAPIReady(s => ({ ...s, engine: true }));
|
|
140
|
+
onMount?.();
|
|
141
|
+
}, [onMount]);
|
|
142
|
+
const handleLayersMount = useCallback(() => {
|
|
143
|
+
setMapAPIReady(s => ({ ...s, layers: true }));
|
|
144
|
+
}, []);
|
|
145
|
+
const handleSketchMount = useCallback(() => {
|
|
146
|
+
setMapAPIReady(s => ({ ...s, sketch: true }));
|
|
147
|
+
}, []);
|
|
148
|
+
const handleSpatialIdMount = useCallback(() => {
|
|
149
|
+
setMapAPIReady(s => ({ ...s, spatialId: true }));
|
|
150
|
+
}, []);
|
|
113
151
|
|
|
114
152
|
return {
|
|
115
153
|
engineRef,
|
|
116
154
|
layersRef,
|
|
117
155
|
sketchRef,
|
|
156
|
+
spatialIdRef,
|
|
157
|
+
geoidRef,
|
|
118
158
|
selectedLayer,
|
|
119
159
|
requestingRenderMode,
|
|
120
160
|
handleLayerSelect,
|
|
121
161
|
handleEngineLayerSelect,
|
|
162
|
+
sketchEditingFeature,
|
|
163
|
+
setSketchEditingFeature,
|
|
164
|
+
handleEngineMount,
|
|
165
|
+
handleLayersMount,
|
|
166
|
+
handleSketchMount,
|
|
167
|
+
handleSpatialIdMount,
|
|
122
168
|
};
|
|
123
169
|
}
|
package/src/Map/index.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { forwardRef, useMemo, type Ref } from "react";
|
|
1
|
+
import { forwardRef, useMemo, type Ref, type JSX } from "react";
|
|
2
2
|
|
|
3
3
|
import { INTERACTION_MODES } from "../Visualizer/interactionMode";
|
|
4
4
|
|
|
5
|
+
import Geoid from "./Geoid";
|
|
5
6
|
import useHooks, { MapRef } from "./hooks";
|
|
6
7
|
import Layers, { type Props as LayersProps } from "./Layers";
|
|
7
8
|
import Sketch, { SketchProps } from "./Sketch";
|
|
9
|
+
import SpatialId from "./SpatialId";
|
|
8
10
|
import type { Engine, EngineProps } from "./types";
|
|
9
11
|
|
|
10
12
|
export * from "./types";
|
|
@@ -29,11 +31,10 @@ export type { TimelineCommitter, TimelineManagerRef } from "./useTimelineManager
|
|
|
29
31
|
|
|
30
32
|
export type { MapRef } from "./hooks";
|
|
31
33
|
|
|
32
|
-
export type CursorType = "auto" | "grab" | "crosshair";
|
|
33
|
-
|
|
34
34
|
export type Props = {
|
|
35
35
|
engines?: Record<string, Engine>;
|
|
36
36
|
engine?: string;
|
|
37
|
+
onAPIReady?: () => void;
|
|
37
38
|
} & Omit<
|
|
38
39
|
LayersProps,
|
|
39
40
|
| "Feature"
|
|
@@ -44,9 +45,7 @@ export type Props = {
|
|
|
44
45
|
| "viewerProperty"
|
|
45
46
|
> &
|
|
46
47
|
Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> &
|
|
47
|
-
Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"
|
|
48
|
-
cursor?: CursorType;
|
|
49
|
-
};
|
|
48
|
+
Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent">;
|
|
50
49
|
|
|
51
50
|
function MapFn(
|
|
52
51
|
{
|
|
@@ -61,13 +60,18 @@ function MapFn(
|
|
|
61
60
|
timelineManagerRef,
|
|
62
61
|
interactionMode,
|
|
63
62
|
selectedFeature,
|
|
64
|
-
cursor,
|
|
65
63
|
onLayerSelect,
|
|
66
64
|
overrideInteractionMode,
|
|
67
65
|
onSketchTypeChange,
|
|
68
66
|
onSketchFeatureCreate,
|
|
69
67
|
onSketchPluginFeatureCreate,
|
|
68
|
+
onSketchFeatureUpdate,
|
|
69
|
+
onSketchPluginFeatureUpdate,
|
|
70
|
+
onSketchFeatureDelete,
|
|
71
|
+
onSketchPluginFeatureDelete,
|
|
70
72
|
featureFlags = INTERACTION_MODES.default,
|
|
73
|
+
onMount,
|
|
74
|
+
onAPIReady,
|
|
71
75
|
...props
|
|
72
76
|
}: Props,
|
|
73
77
|
ref: Ref<MapRef>,
|
|
@@ -78,15 +82,24 @@ function MapFn(
|
|
|
78
82
|
engineRef,
|
|
79
83
|
layersRef,
|
|
80
84
|
sketchRef,
|
|
85
|
+
spatialIdRef,
|
|
86
|
+
geoidRef,
|
|
81
87
|
selectedLayer,
|
|
82
88
|
requestingRenderMode,
|
|
83
89
|
handleLayerSelect,
|
|
84
90
|
handleEngineLayerSelect,
|
|
91
|
+
sketchEditingFeature,
|
|
92
|
+
setSketchEditingFeature,
|
|
93
|
+
handleEngineMount,
|
|
94
|
+
handleLayersMount,
|
|
95
|
+
handleSketchMount,
|
|
96
|
+
handleSpatialIdMount,
|
|
85
97
|
} = useHooks({
|
|
86
98
|
ref,
|
|
87
99
|
timelineManagerRef,
|
|
88
|
-
cursor,
|
|
89
100
|
onLayerSelect,
|
|
101
|
+
onMount,
|
|
102
|
+
onAPIReady,
|
|
90
103
|
});
|
|
91
104
|
|
|
92
105
|
const selectedLayerIds = useMemo(
|
|
@@ -111,6 +124,7 @@ function MapFn(
|
|
|
111
124
|
timelineManagerRef={timelineManagerRef}
|
|
112
125
|
onLayerSelect={handleEngineLayerSelect}
|
|
113
126
|
featureFlags={featureFlags}
|
|
127
|
+
onMount={handleEngineMount}
|
|
114
128
|
{...props}>
|
|
115
129
|
<Layers
|
|
116
130
|
ref={layersRef}
|
|
@@ -128,7 +142,9 @@ function MapFn(
|
|
|
128
142
|
meta={props.meta}
|
|
129
143
|
viewerProperty={props.property}
|
|
130
144
|
requestingRenderMode={requestingRenderMode}
|
|
145
|
+
sketchEditingFeature={sketchEditingFeature}
|
|
131
146
|
onLayerSelect={handleLayerSelect}
|
|
147
|
+
onMount={handleLayersMount}
|
|
132
148
|
/>
|
|
133
149
|
<Sketch
|
|
134
150
|
ref={sketchRef}
|
|
@@ -142,7 +158,24 @@ function MapFn(
|
|
|
142
158
|
onSketchTypeChange={onSketchTypeChange}
|
|
143
159
|
onSketchFeatureCreate={onSketchFeatureCreate}
|
|
144
160
|
onSketchPluginFeatureCreate={onSketchPluginFeatureCreate}
|
|
161
|
+
onSketchFeatureUpdate={onSketchFeatureUpdate}
|
|
162
|
+
onSketchPluginFeatureUpdate={onSketchPluginFeatureUpdate}
|
|
163
|
+
onSketchFeatureDelete={onSketchFeatureDelete}
|
|
164
|
+
onSketchPluginFeatureDelete={onSketchPluginFeatureDelete}
|
|
165
|
+
sketchEditingFeature={sketchEditingFeature}
|
|
166
|
+
onSketchEditFeature={setSketchEditingFeature}
|
|
167
|
+
onMount={handleSketchMount}
|
|
168
|
+
/>
|
|
169
|
+
<SpatialId
|
|
170
|
+
ref={spatialIdRef}
|
|
171
|
+
engineRef={engineRef}
|
|
172
|
+
geoidRef={geoidRef}
|
|
173
|
+
interactionMode={interactionMode}
|
|
174
|
+
terrainEnabled={!!props.property?.terrain?.enabled}
|
|
175
|
+
overrideInteractionMode={overrideInteractionMode}
|
|
176
|
+
onMount={handleSpatialIdMount}
|
|
145
177
|
/>
|
|
178
|
+
<Geoid ref={geoidRef} geoidServer={props.property?.geoid?.server} />
|
|
146
179
|
</Engine>
|
|
147
180
|
) : null;
|
|
148
181
|
}
|
package/src/Map/ref.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
2
|
|
|
3
|
+
import { GeoidRef } from "./Geoid/types";
|
|
4
|
+
import { SpatialIdRef } from "./SpatialId/types";
|
|
3
5
|
import type { EngineRef, LayersRef, SketchRef } from "./types";
|
|
4
6
|
import { TimelineManagerRef } from "./useTimelineManager";
|
|
5
7
|
import { FunctionKeys, WrappedRef, wrapRef } from "./utils";
|
|
@@ -8,6 +10,8 @@ export type MapRef = {
|
|
|
8
10
|
engine: WrappedRef<EngineRef>;
|
|
9
11
|
layers: WrappedRef<LayersRef>;
|
|
10
12
|
sketch: WrappedRef<SketchRef>;
|
|
13
|
+
spatialId?: WrappedRef<SpatialIdRef>;
|
|
14
|
+
geoid: WrappedRef<GeoidRef>;
|
|
11
15
|
timeline?: TimelineManagerRef;
|
|
12
16
|
};
|
|
13
17
|
|
|
@@ -82,6 +86,7 @@ const engineRefKeys: FunctionKeys<EngineRef> = {
|
|
|
82
86
|
unselectFeatures: 1,
|
|
83
87
|
pickManyFromViewport: 1,
|
|
84
88
|
getExtrudedHeight: 1,
|
|
89
|
+
getExtrudedPoint: 1,
|
|
85
90
|
getSurfaceDistance: 1,
|
|
86
91
|
equalsEpsilon2d: 1,
|
|
87
92
|
equalsEpsilon3d: 1,
|
|
@@ -89,6 +94,8 @@ const engineRefKeys: FunctionKeys<EngineRef> = {
|
|
|
89
94
|
setCursor: 1,
|
|
90
95
|
bringToFront: 1,
|
|
91
96
|
sendToBack: 1,
|
|
97
|
+
calcRectangleControlPoint: 1,
|
|
98
|
+
getCredits: 1,
|
|
92
99
|
};
|
|
93
100
|
|
|
94
101
|
const layersRefKeys: FunctionKeys<LayersRef> = {
|
|
@@ -104,6 +111,7 @@ const layersRefKeys: FunctionKeys<LayersRef> = {
|
|
|
104
111
|
hide: 1,
|
|
105
112
|
isLayer: 1,
|
|
106
113
|
isComputedLayer: 1,
|
|
114
|
+
isTempLayer: 1,
|
|
107
115
|
layers: 1,
|
|
108
116
|
override: 1,
|
|
109
117
|
replace: 1,
|
|
@@ -122,23 +130,44 @@ const sketchRefKeys: FunctionKeys<SketchRef> = {
|
|
|
122
130
|
setType: 1,
|
|
123
131
|
getOptions: 1,
|
|
124
132
|
overrideOptions: 1,
|
|
133
|
+
editFeature: 1,
|
|
134
|
+
applyEdit: 1,
|
|
135
|
+
cancelEdit: 1,
|
|
136
|
+
deleteFeature: 1,
|
|
137
|
+
onEditFeatureChange: 1,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const spatialIdRefKeys: FunctionKeys<SpatialIdRef> = {
|
|
141
|
+
pickSpace: 1,
|
|
142
|
+
exitPickSpace: 1,
|
|
143
|
+
onSpacePick: 1,
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const geoidRefKeys: FunctionKeys<GeoidRef> = {
|
|
147
|
+
getGeoidHeight: 1,
|
|
125
148
|
};
|
|
126
149
|
|
|
127
150
|
export function mapRef({
|
|
128
151
|
engineRef,
|
|
129
152
|
layersRef,
|
|
130
153
|
sketchRef,
|
|
154
|
+
spatialIdRef,
|
|
155
|
+
geoidRef,
|
|
131
156
|
timelineManagerRef,
|
|
132
157
|
}: {
|
|
133
|
-
engineRef: RefObject<EngineRef>;
|
|
134
|
-
layersRef: RefObject<LayersRef>;
|
|
135
|
-
sketchRef: RefObject<SketchRef>;
|
|
158
|
+
engineRef: RefObject<EngineRef | null>;
|
|
159
|
+
layersRef: RefObject<LayersRef | null>;
|
|
160
|
+
sketchRef: RefObject<SketchRef | null>;
|
|
161
|
+
spatialIdRef: RefObject<SpatialIdRef | null>;
|
|
162
|
+
geoidRef: RefObject<GeoidRef | null>;
|
|
136
163
|
timelineManagerRef?: TimelineManagerRef;
|
|
137
164
|
}): MapRef {
|
|
138
165
|
return {
|
|
139
166
|
engine: wrapRef(engineRef, engineRefKeys),
|
|
140
167
|
layers: wrapRef(layersRef, layersRefKeys),
|
|
141
168
|
sketch: wrapRef(sketchRef, sketchRefKeys),
|
|
169
|
+
spatialId: wrapRef(spatialIdRef, spatialIdRefKeys),
|
|
170
|
+
geoid: wrapRef(geoidRef, geoidRefKeys),
|
|
142
171
|
timeline: timelineManagerRef,
|
|
143
172
|
};
|
|
144
173
|
}
|
package/src/Map/types/index.ts
CHANGED
|
@@ -38,7 +38,13 @@ import type {
|
|
|
38
38
|
LayerSelectionReason,
|
|
39
39
|
Ref as LayersRef,
|
|
40
40
|
} from "../Layers";
|
|
41
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
SketchType,
|
|
43
|
+
SketchOptions,
|
|
44
|
+
SketchComponentType,
|
|
45
|
+
SketchEditFeatureChangeCb,
|
|
46
|
+
SketchEditingFeature,
|
|
47
|
+
} from "../Sketch/types";
|
|
42
48
|
import type { TimelineManagerRef } from "../useTimelineManager";
|
|
43
49
|
|
|
44
50
|
import type { SceneMode, ViewerProperty } from "./viewerProperty";
|
|
@@ -113,7 +119,12 @@ export type EngineRef = {
|
|
|
113
119
|
getExtrudedHeight: (
|
|
114
120
|
position: [x: number, y: number, z: number],
|
|
115
121
|
windowPosition: [x: number, y: number],
|
|
122
|
+
allowNegative?: boolean,
|
|
116
123
|
) => number | undefined;
|
|
124
|
+
getExtrudedPoint: (
|
|
125
|
+
position: [x: number, y: number, z: number],
|
|
126
|
+
extrutedHeight: number,
|
|
127
|
+
) => Position3d | undefined;
|
|
117
128
|
getSurfaceDistance: (point1: Cartesian3, point2: Cartesian3) => number | undefined;
|
|
118
129
|
equalsEpsilon2d: (
|
|
119
130
|
point1: Position2d,
|
|
@@ -176,7 +187,7 @@ export type EngineRef = {
|
|
|
176
187
|
tick: () => Date | void;
|
|
177
188
|
inViewport: (location?: LatLng) => boolean;
|
|
178
189
|
onTick: TickEvent;
|
|
179
|
-
tickEventCallback?: RefObject<TickEventCallback[]>;
|
|
190
|
+
tickEventCallback?: RefObject<TickEventCallback[] | null>;
|
|
180
191
|
removeTickEventListener: TickEvent;
|
|
181
192
|
findFeatureById: (layerId: string, featureId: string) => Feature | undefined;
|
|
182
193
|
bringToFront: (layerId: string) => void;
|
|
@@ -196,6 +207,12 @@ export type EngineRef = {
|
|
|
196
207
|
// TODO: Get condition as expression for plugin
|
|
197
208
|
condition?: (f: PickedFeature) => boolean,
|
|
198
209
|
) => PickedFeature[] | undefined;
|
|
210
|
+
calcRectangleControlPoint: (
|
|
211
|
+
p1: Position3d,
|
|
212
|
+
p2: Position3d,
|
|
213
|
+
p3: Position3d,
|
|
214
|
+
) => [p1: Position3d, p2: Position3d, p3: Position3d];
|
|
215
|
+
getCredits: () => Credits | undefined;
|
|
199
216
|
} & MouseEventHandles;
|
|
200
217
|
|
|
201
218
|
export type EngineProps = {
|
|
@@ -220,7 +237,8 @@ export type EngineProps = {
|
|
|
220
237
|
isLayerDragging?: boolean;
|
|
221
238
|
shouldRender?: boolean;
|
|
222
239
|
meta?: Record<string, unknown>;
|
|
223
|
-
|
|
240
|
+
displayCredits?: boolean;
|
|
241
|
+
layersRef?: RefObject<LayersRef | null>;
|
|
224
242
|
requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
|
|
225
243
|
timelineManagerRef?: TimelineManagerRef;
|
|
226
244
|
onLayerSelect?: (
|
|
@@ -243,6 +261,7 @@ export type EngineProps = {
|
|
|
243
261
|
onLayerSelectWithRectStart?: (e: LayerSelectWithRectStart) => void;
|
|
244
262
|
onLayerSelectWithRectMove?: (e: LayerSelectWithRectMove) => void;
|
|
245
263
|
onLayerSelectWithRectEnd?: (e: LayerSelectWithRectEnd) => void;
|
|
264
|
+
onCreditsUpdate?: (credits?: Credits) => void;
|
|
246
265
|
};
|
|
247
266
|
|
|
248
267
|
export type LayerEditEvent = {
|
|
@@ -360,4 +379,21 @@ export type SketchRef = {
|
|
|
360
379
|
setType: (type: SketchType | undefined, from?: "editor" | "plugin") => void;
|
|
361
380
|
getOptions: () => SketchOptions;
|
|
362
381
|
overrideOptions: (options: SketchOptions) => void;
|
|
382
|
+
editFeature: (feature: SketchEditingFeature | undefined) => void;
|
|
383
|
+
cancelEdit: (ignoreAutoReSelect?: boolean) => void;
|
|
384
|
+
applyEdit: () => void;
|
|
385
|
+
deleteFeature: (layerId: string, featureId: string) => void;
|
|
386
|
+
onEditFeatureChange: (cb: SketchEditFeatureChangeCb) => void;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export type CreditItem = {
|
|
390
|
+
html?: string;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
export type Credits = {
|
|
394
|
+
engine: {
|
|
395
|
+
cesium?: CreditItem;
|
|
396
|
+
};
|
|
397
|
+
lightbox: CreditItem[];
|
|
398
|
+
screen: CreditItem[];
|
|
363
399
|
};
|
|
@@ -37,6 +37,7 @@ export type SceneMode = "3d" | "2d" | "columbus";
|
|
|
37
37
|
|
|
38
38
|
export type ViewerProperty = {
|
|
39
39
|
globe?: GlobeProperty;
|
|
40
|
+
geoid?: GeoidProperty;
|
|
40
41
|
terrain?: TerrainProperty;
|
|
41
42
|
scene?: SceneProperty;
|
|
42
43
|
tiles?: TileProperty[];
|
|
@@ -56,6 +57,13 @@ export type GlobeProperty = {
|
|
|
56
57
|
depthTestAgainstTerrain?: boolean;
|
|
57
58
|
};
|
|
58
59
|
|
|
60
|
+
export type GeoidProperty = {
|
|
61
|
+
server: {
|
|
62
|
+
url: string;
|
|
63
|
+
geoidProperty: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
59
67
|
export type GlobeAtmosphereProperty = {
|
|
60
68
|
enabled?: boolean;
|
|
61
69
|
lightIntensity?: number;
|
|
@@ -132,6 +140,8 @@ export type TileLabelProperty = {
|
|
|
132
140
|
id: string;
|
|
133
141
|
labelType: "japan_gsi_optimal_bvmap";
|
|
134
142
|
style: Record<string, any>;
|
|
143
|
+
near?: number;
|
|
144
|
+
far?: number;
|
|
135
145
|
};
|
|
136
146
|
|
|
137
147
|
export type SkyProperty = {
|
|
@@ -87,7 +87,7 @@ type Props = {
|
|
|
87
87
|
multiplier?: number;
|
|
88
88
|
rangeType?: "unbounded" | "clamped" | "bounced";
|
|
89
89
|
};
|
|
90
|
-
engineRef?: RefObject<EngineRef>;
|
|
90
|
+
engineRef?: RefObject<EngineRef | null>;
|
|
91
91
|
timelineManagerRef?: TimelineManagerRef;
|
|
92
92
|
};
|
|
93
93
|
|
|
@@ -112,7 +112,7 @@ export default ({ init, engineRef, timelineManagerRef }: Props) => {
|
|
|
112
112
|
const currentTime = current.getTime();
|
|
113
113
|
|
|
114
114
|
const convertedStartTime = startTime > currentTime ? currentTime : startTime;
|
|
115
|
-
const convertedStopTime = stopTime
|
|
115
|
+
const convertedStopTime = stopTime < currentTime ? currentTime + DEFAULT_RANGE : stopTime;
|
|
116
116
|
|
|
117
117
|
return {
|
|
118
118
|
start: new Date(convertedStartTime),
|
package/src/Map/utils.ts
CHANGED
|
@@ -6,7 +6,7 @@ export function useGet<T>(value: T): () => T {
|
|
|
6
6
|
return useCallback(() => ref.current, []);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function wrapRef<T>(ref: RefObject<T>, keys: FunctionKeys<T>): WrappedRef<T> {
|
|
9
|
+
export function wrapRef<T>(ref: RefObject<T | null>, keys: FunctionKeys<T>): WrappedRef<T> {
|
|
10
10
|
return Object.fromEntries(
|
|
11
11
|
(Object.keys(keys) as (keyof T)[]).map(k => {
|
|
12
12
|
return [k, (...args: any[]) => (ref.current?.[k] as any)?.(...args)];
|