@reearth/core 0.0.7-alpha.0 → 0.0.7-alpha.10
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 +34320 -34354
- package/dist/core.umd.cjs +3868 -3826
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +217 -212
- package/package.json +8 -8
- package/src/Map/ClusteredLayers/index.tsx +2 -2
- package/src/Map/Layer/index.tsx +3 -3
- package/src/Map/Layers/hooks.ts +10 -0
- package/src/Map/Layers/index.tsx +2 -2
- package/src/Map/Sketch/hooks.ts +52 -72
- package/src/Map/Sketch/index.tsx +2 -24
- package/src/Map/Sketch/preset.ts +2 -0
- package/src/Map/Sketch/types.ts +31 -0
- package/src/Map/hooks.ts +0 -4
- package/src/Map/index.tsx +8 -5
- package/src/Map/ref.ts +4 -7
- package/src/Map/types/index.ts +34 -216
- package/src/Map/types/viewerProperty.ts +215 -0
- package/src/Map/useTimelineManager.ts +5 -3
- package/src/Map/utils.ts +1 -43
- package/src/Visualizer/coreContext.tsx +1 -8
- package/src/Visualizer/hooks.ts +20 -77
- package/src/Visualizer/index.stories.tsx +4 -48
- package/src/Visualizer/index.tsx +8 -6
- package/src/Visualizer/useCoreAPI.ts +30 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.tsx +10 -9
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +8 -6
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +2 -2
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +12 -11
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/index.tsx +4 -4
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
- package/src/engines/Cesium/Feature/index.tsx +5 -4
- package/src/engines/Cesium/Feature/utils.tsx +3 -2
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
- package/src/engines/Cesium/core/Globe.tsx +36 -68
- package/src/engines/Cesium/core/Imagery.test.ts +9 -9
- package/src/engines/Cesium/core/Imagery.tsx +17 -19
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +8 -8
- package/src/engines/Cesium/hooks/useCamera.ts +135 -0
- package/src/engines/Cesium/{cameraLimiter.ts → hooks/useCameraLimiter.ts} +22 -45
- package/src/engines/Cesium/{useEngineRef.test.tsx → hooks/useEngineRef.test.tsx} +38 -34
- package/src/engines/Cesium/{useEngineRef.ts → hooks/useEngineRef.ts} +43 -41
- package/src/engines/Cesium/hooks/useExplicitRender.ts +65 -0
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +77 -0
- package/src/engines/Cesium/{VertexTerrainElevationMaterial.ts → hooks/useOverrideGlobeShader/VertexTerrainElevationMaterial.ts} +3 -2
- package/src/engines/Cesium/{useOverrideGlobeShader.ts → hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts} +20 -17
- package/src/engines/Cesium/hooks/useViewerProperty.ts +90 -0
- package/src/engines/Cesium/hooks.ts +129 -366
- package/src/engines/Cesium/index.stories.tsx +1 -1
- package/src/engines/Cesium/index.tsx +60 -62
- package/src/engines/index.ts +1 -1
- package/src/mantle/atoms/compute.ts +5 -1
- package/src/mantle/compat/types.ts +7 -7
- package/src/mantle/data/geojson.ts +53 -22
- 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/{JapanSeaLevelEllipsoid.ts → hooks/useOverrideGlobeShader/JapanSeaLevelEllipsoid.ts} +0 -0
- /package/src/engines/Cesium/{vertexTerrainElevationMaterial.glsl → hooks/useOverrideGlobeShader/vertexTerrainElevationMaterial.glsl} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reearth/core",
|
|
3
|
-
"version": "0.0.7-alpha.
|
|
3
|
+
"version": "0.0.7-alpha.10",
|
|
4
4
|
"author": "Re:Earth contributors <community@reearth.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "A library that abstracts a map engine as one common API.",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"node": ">=20"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
+
"cesium": "1.118.x",
|
|
30
31
|
"react": "^18.2.0",
|
|
31
|
-
"react-dom": "^18.2.0"
|
|
32
|
-
"cesium": "1.x"
|
|
32
|
+
"react-dom": "^18.2.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@reearth/cesium-mvt-imagery-provider": "1.5.4",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-error-boundary": "4.0.11",
|
|
62
62
|
"react-nl2br": "1.0.4",
|
|
63
63
|
"react-use": "17.5.0",
|
|
64
|
-
"resium": "1.
|
|
64
|
+
"resium": "1.18.1",
|
|
65
65
|
"suspend-react": "0.1.3",
|
|
66
66
|
"tiny-invariant": "1.3.3",
|
|
67
67
|
"use-callback-ref": "1.3.2",
|
|
@@ -89,13 +89,13 @@
|
|
|
89
89
|
"@types/lodash-es": "4.17.12",
|
|
90
90
|
"@types/node": "20.12.7",
|
|
91
91
|
"@types/pbf": "3.0.5",
|
|
92
|
-
"@types/react": "18.
|
|
93
|
-
"@types/react-dom": "18.
|
|
92
|
+
"@types/react": "18.3.0",
|
|
93
|
+
"@types/react-dom": "18.3.0",
|
|
94
94
|
"@types/uuid": "9.0.8",
|
|
95
95
|
"@typescript-eslint/eslint-plugin": "7.2.0",
|
|
96
96
|
"@typescript-eslint/parser": "7.2.0",
|
|
97
97
|
"@vitejs/plugin-react": "4.2.1",
|
|
98
|
-
"cesium": "1.
|
|
98
|
+
"cesium": "1.118.0",
|
|
99
99
|
"eslint": "8.57.0",
|
|
100
100
|
"eslint-config-reearth": "0.3.0",
|
|
101
101
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"storybook": "8.0.8",
|
|
109
109
|
"typescript": "5.2.2",
|
|
110
110
|
"vite": "5.0.8",
|
|
111
|
-
"vite-plugin-cesium": "1.2.
|
|
111
|
+
"vite-plugin-cesium": "1.2.23",
|
|
112
112
|
"vite-plugin-dts": "3.8.1",
|
|
113
113
|
"vite-plugin-svgr": "4.2.0",
|
|
114
114
|
"vite-tsconfig-paths": "^4.3.2",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType, useMemo, useCallback, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
import LayerComponent, { type CommonProps, type Props as LayerProps } from "../Layer";
|
|
4
|
-
import type { Layer, Atom, Typography, DataType } from "../types";
|
|
4
|
+
import type { Layer, Atom, Typography, DataType, ViewerProperty } from "../types";
|
|
5
5
|
|
|
6
6
|
export type Props = {
|
|
7
7
|
layers?: Layer[];
|
|
@@ -14,7 +14,7 @@ export type Props = {
|
|
|
14
14
|
isHidden?: (id: string) => boolean;
|
|
15
15
|
clusters?: Cluster[];
|
|
16
16
|
delegatedDataTypes?: DataType[];
|
|
17
|
-
|
|
17
|
+
viewerProperty?: ViewerProperty;
|
|
18
18
|
clusterComponent?: ClusterComponentType;
|
|
19
19
|
Feature?: LayerProps["Feature"];
|
|
20
20
|
} & Omit<CommonProps, "isSelected" | "isHidden" | "selectedFeatureId">;
|
package/src/Map/Layer/index.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ComputedFeature,
|
|
10
10
|
LayerSimple,
|
|
11
11
|
} from "../../mantle";
|
|
12
|
-
import {
|
|
12
|
+
import { ViewerProperty } from "../types";
|
|
13
13
|
|
|
14
14
|
import useHooks, { type Atom, type EvalFeature } from "./hooks";
|
|
15
15
|
|
|
@@ -29,7 +29,7 @@ export type CommonProps = {
|
|
|
29
29
|
|
|
30
30
|
export type FeatureComponentProps = {
|
|
31
31
|
layer: ComputedLayer;
|
|
32
|
-
|
|
32
|
+
viewerProperty?: ViewerProperty;
|
|
33
33
|
onFeatureRequest?: (range: DataRange) => void;
|
|
34
34
|
onLayerFetch?: (value: Partial<Pick<LayerSimple, "properties">>) => void;
|
|
35
35
|
onFeatureFetch?: (features: Feature[]) => void;
|
|
@@ -44,7 +44,7 @@ export type Props = {
|
|
|
44
44
|
atom?: Atom;
|
|
45
45
|
overrides?: Record<string, any>;
|
|
46
46
|
delegatedDataTypes?: DataType[];
|
|
47
|
-
|
|
47
|
+
viewerProperty?: ViewerProperty;
|
|
48
48
|
selectedFeatureId?: string;
|
|
49
49
|
/** Feature component should be injected by a map engine. */
|
|
50
50
|
Feature?: ComponentType<FeatureComponentProps>;
|
package/src/Map/Layers/hooks.ts
CHANGED
|
@@ -52,6 +52,7 @@ export type Ref = {
|
|
|
52
52
|
override: (id: string, layer?: (Partial<Layer> & { property?: any }) | null) => void;
|
|
53
53
|
deleteLayer: (...ids: string[]) => void;
|
|
54
54
|
isLayer: (obj: any) => obj is LazyLayer;
|
|
55
|
+
isComputedLayer: (obj: any) => obj is ComputedLayer;
|
|
55
56
|
layers: () => LazyLayer[];
|
|
56
57
|
walk: <T>(
|
|
57
58
|
fn: (layer: LazyLayer, index: number, parents: LazyLayer[]) => T | void,
|
|
@@ -455,6 +456,13 @@ export default function useHooks({
|
|
|
455
456
|
[lazyLayerPrototype],
|
|
456
457
|
);
|
|
457
458
|
|
|
459
|
+
const isComputedLayer = useCallback(
|
|
460
|
+
(obj: any): obj is ComputedLayer => {
|
|
461
|
+
return typeof obj === "object" && Object.getPrototypeOf(obj) === lazyComputedLayerPrototype;
|
|
462
|
+
},
|
|
463
|
+
[lazyComputedLayerPrototype],
|
|
464
|
+
);
|
|
465
|
+
|
|
458
466
|
const rootLayers = useCallback(() => {
|
|
459
467
|
return [...(layersRef() ?? []), ...tempLayersRef.current]
|
|
460
468
|
.map(l => findById(l.id))
|
|
@@ -551,6 +559,7 @@ export default function useHooks({
|
|
|
551
559
|
deleteLayer,
|
|
552
560
|
findByIds,
|
|
553
561
|
isLayer,
|
|
562
|
+
isComputedLayer,
|
|
554
563
|
layers: rootLayers,
|
|
555
564
|
walk,
|
|
556
565
|
find,
|
|
@@ -575,6 +584,7 @@ export default function useHooks({
|
|
|
575
584
|
deleteLayer,
|
|
576
585
|
findByIds,
|
|
577
586
|
isLayer,
|
|
587
|
+
isComputedLayer,
|
|
578
588
|
rootLayers,
|
|
579
589
|
walk,
|
|
580
590
|
find,
|
package/src/Map/Layers/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { forwardRef, RefObject, type ForwardRefRenderFunction, type MutableRefOb
|
|
|
2
2
|
|
|
3
3
|
import { SelectedFeatureInfo } from "../../mantle";
|
|
4
4
|
import ClusteredLayers, { type Props as ClusteredLayerProps } from "../ClusteredLayers";
|
|
5
|
-
import type { ComputedLayer, EngineRef, RequestingRenderMode } from "../types";
|
|
5
|
+
import type { ComputedLayer, EngineRef, RequestingRenderMode, ViewerProperty } from "../types";
|
|
6
6
|
|
|
7
7
|
import useHooks, { LayerSelectionReason, type Ref } from "./hooks";
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ export type Props = Omit<ClusteredLayerProps, "atomMap" | "isHidden" | "selected
|
|
|
36
36
|
reason?: LayerSelectionReason;
|
|
37
37
|
};
|
|
38
38
|
hiddenLayers?: string[];
|
|
39
|
-
|
|
39
|
+
viewerProperty?: ViewerProperty;
|
|
40
40
|
requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
|
|
41
41
|
engineRef?: RefObject<EngineRef>;
|
|
42
42
|
onLayerSelect?: (
|
package/src/Map/Sketch/hooks.ts
CHANGED
|
@@ -24,15 +24,16 @@ import {
|
|
|
24
24
|
MouseEventProps,
|
|
25
25
|
SketchRef,
|
|
26
26
|
} from "../types";
|
|
27
|
+
import { useGet } from "../utils";
|
|
27
28
|
|
|
28
|
-
import { PRESET_APPEARANCE } from "./preset";
|
|
29
|
+
import { PRESET_APPEARANCE, PRESET_COLOR } from "./preset";
|
|
29
30
|
import { Position3d, createSketchMachine } from "./sketchMachine";
|
|
30
31
|
import {
|
|
31
32
|
GeometryOptionsXYZ,
|
|
32
33
|
SketchType,
|
|
33
34
|
SketchFeature,
|
|
34
|
-
SketchAppearance,
|
|
35
35
|
SketchEventProps,
|
|
36
|
+
SketchOptions,
|
|
36
37
|
} from "./types";
|
|
37
38
|
import { useWindowEvent } from "./utils";
|
|
38
39
|
|
|
@@ -73,16 +74,25 @@ export default function useHooks({
|
|
|
73
74
|
const [state, send] = useMachine(sketchMachine);
|
|
74
75
|
const [type, updateType] = useState<SketchType | undefined>();
|
|
75
76
|
const [from, updateFrom] = useState<"editor" | "plugin">("editor");
|
|
76
|
-
const [color, updateColor] = useState<string>();
|
|
77
|
-
const [disableShadow, updateDisableShadow] = useState(false);
|
|
78
|
-
const [enableRelativeHeight, updateEnableRelativeHeight] = useState(false);
|
|
79
77
|
const [disableInteraction, setDisableInteraction] = useState(false);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
|
|
79
|
+
const [sketchOptions, setSketchOptions] = useState<SketchOptions>({
|
|
80
|
+
color: PRESET_COLOR,
|
|
81
|
+
appearance: PRESET_APPEARANCE,
|
|
82
|
+
dataOnly: false,
|
|
83
|
+
disableShadow: false,
|
|
84
|
+
enableRelativeHeight: false,
|
|
85
|
+
rightClickToAbort: true,
|
|
86
|
+
autoResetInteractionMode: true,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const overrideOptions = useCallback((options: SketchOptions) => {
|
|
90
|
+
setSketchOptions(prev => ({
|
|
91
|
+
...prev,
|
|
92
|
+
...options,
|
|
93
|
+
appearance: merge(cloneDeep(prev.appearance), options.appearance),
|
|
94
|
+
}));
|
|
95
|
+
}, []);
|
|
86
96
|
|
|
87
97
|
const [geometryOptions, setGeometryOptions] = useState<GeometryOptionsXYZ | null>(null);
|
|
88
98
|
const [extrudedHeight, setExtrudedHeight] = useState(0);
|
|
@@ -94,34 +104,6 @@ export default function useHooks({
|
|
|
94
104
|
updateFrom(from ?? "editor");
|
|
95
105
|
}, []);
|
|
96
106
|
|
|
97
|
-
const setColor = useCallback((color: string) => {
|
|
98
|
-
updateColor(color);
|
|
99
|
-
}, []);
|
|
100
|
-
|
|
101
|
-
const setDisableShadow = useCallback((disable: boolean) => {
|
|
102
|
-
updateDisableShadow(!!disable);
|
|
103
|
-
}, []);
|
|
104
|
-
|
|
105
|
-
const setEnableRelativeHeight = useCallback((enable: boolean) => {
|
|
106
|
-
updateEnableRelativeHeight(!!enable);
|
|
107
|
-
}, []);
|
|
108
|
-
|
|
109
|
-
const setDefaultAppearance = useCallback((appearance: SketchAppearance) => {
|
|
110
|
-
updateDefaultAppearance(merge(cloneDeep(PRESET_APPEARANCE), appearance));
|
|
111
|
-
}, []);
|
|
112
|
-
|
|
113
|
-
const createDataOnly = useCallback((dataOnly: boolean) => {
|
|
114
|
-
createDataOnlyForPluginEnabledRef.current = !!dataOnly;
|
|
115
|
-
}, []);
|
|
116
|
-
|
|
117
|
-
const allowRightClickToAbort = useCallback((allow: boolean) => {
|
|
118
|
-
allowRightClickToAbortEnabledRef.current = !!allow;
|
|
119
|
-
}, []);
|
|
120
|
-
|
|
121
|
-
const allowAutoResetInteractionMode = useCallback((allow: boolean) => {
|
|
122
|
-
allowAutoResetInteractionModeRef.current = !!allow;
|
|
123
|
-
}, []);
|
|
124
|
-
|
|
125
107
|
const createFeature = useCallback(() => {
|
|
126
108
|
const geoOptions = type === "marker" ? markerGeometryRef.current : geometryOptions;
|
|
127
109
|
if (geoOptions == null) {
|
|
@@ -169,11 +151,11 @@ export default function useHooks({
|
|
|
169
151
|
features: [{ ...feature, id: feature.properties.id }],
|
|
170
152
|
},
|
|
171
153
|
},
|
|
172
|
-
...
|
|
154
|
+
...sketchOptions.appearance,
|
|
173
155
|
});
|
|
174
156
|
return { layerId: newLayer?.id, featureId: feature.properties.id };
|
|
175
157
|
},
|
|
176
|
-
[layersRef,
|
|
158
|
+
[layersRef, sketchOptions.appearance],
|
|
177
159
|
);
|
|
178
160
|
|
|
179
161
|
const pluginSketchLayerFeatureAdd = useCallback(
|
|
@@ -220,13 +202,16 @@ export default function useHooks({
|
|
|
220
202
|
|
|
221
203
|
const handleFeatureCreate = useCallback(
|
|
222
204
|
(feature: SketchFeature) => {
|
|
223
|
-
|
|
205
|
+
if (sketchOptions.autoResetInteractionMode) {
|
|
206
|
+
updateType(undefined);
|
|
207
|
+
}
|
|
208
|
+
|
|
224
209
|
if (from === "editor") {
|
|
225
210
|
onSketchFeatureCreate?.(feature);
|
|
226
211
|
return;
|
|
227
212
|
}
|
|
228
213
|
|
|
229
|
-
if (!
|
|
214
|
+
if (!sketchOptions.dataOnly) {
|
|
230
215
|
const selectedLayer = layersRef.current?.selectedLayer();
|
|
231
216
|
const { layerId, featureId } =
|
|
232
217
|
selectedLayer?.id?.length !== PLUGIN_LAYER_ID_LENGTH ||
|
|
@@ -262,6 +247,8 @@ export default function useHooks({
|
|
|
262
247
|
[
|
|
263
248
|
layersRef,
|
|
264
249
|
from,
|
|
250
|
+
sketchOptions.dataOnly,
|
|
251
|
+
sketchOptions.autoResetInteractionMode,
|
|
265
252
|
pluginSketchLayerCreate,
|
|
266
253
|
pluginSketchLayerFeatureAdd,
|
|
267
254
|
onSketchFeatureCreate,
|
|
@@ -481,7 +468,7 @@ export default function useHooks({
|
|
|
481
468
|
);
|
|
482
469
|
|
|
483
470
|
const handleRightClick = useCallback(() => {
|
|
484
|
-
if (!
|
|
471
|
+
if (!sketchOptions.rightClickToAbort) {
|
|
485
472
|
return;
|
|
486
473
|
}
|
|
487
474
|
if (type !== undefined) {
|
|
@@ -490,7 +477,7 @@ export default function useHooks({
|
|
|
490
477
|
if (state.matches("idle")) return;
|
|
491
478
|
send({ type: "ABORT" });
|
|
492
479
|
updateGeometryOptions(undefined);
|
|
493
|
-
}, [type, state, send, updateGeometryOptions]);
|
|
480
|
+
}, [type, state, sketchOptions.rightClickToAbort, send, updateGeometryOptions]);
|
|
494
481
|
|
|
495
482
|
const mouseDownEventRef = useRef<MouseEventCallback>(handleLeftDown);
|
|
496
483
|
mouseDownEventRef.current = handleLeftDown;
|
|
@@ -583,47 +570,40 @@ export default function useHooks({
|
|
|
583
570
|
}
|
|
584
571
|
}, [type, send, updateGeometryOptions]);
|
|
585
572
|
|
|
573
|
+
const fromRef = useRef(from);
|
|
574
|
+
fromRef.current = from;
|
|
575
|
+
const overrideInteractionModeRef = useRef(overrideInteractionMode);
|
|
576
|
+
overrideInteractionModeRef.current = overrideInteractionMode;
|
|
577
|
+
const onSketchTypeChangeRef = useRef(onSketchTypeChange);
|
|
578
|
+
onSketchTypeChangeRef.current = onSketchTypeChange;
|
|
579
|
+
|
|
586
580
|
useEffect(() => {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
overrideInteractionMode?.("default");
|
|
591
|
-
}
|
|
581
|
+
overrideInteractionModeRef.current?.(type ? "sketch" : "default");
|
|
582
|
+
onSketchTypeChangeRef.current?.(type, fromRef.current);
|
|
583
|
+
}, [type]);
|
|
592
584
|
|
|
593
|
-
|
|
594
|
-
|
|
585
|
+
// API
|
|
586
|
+
const getType = useGet(type);
|
|
587
|
+
const getOptions = useGet(sketchOptions);
|
|
595
588
|
|
|
596
589
|
useImperativeHandle(
|
|
597
590
|
ref,
|
|
598
591
|
() => ({
|
|
592
|
+
getType,
|
|
599
593
|
setType,
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
createDataOnly,
|
|
603
|
-
disableShadow: setDisableShadow,
|
|
604
|
-
enableRelativeHeight: setEnableRelativeHeight,
|
|
605
|
-
allowRightClickToAbort,
|
|
606
|
-
allowAutoResetInteractionMode,
|
|
594
|
+
getOptions,
|
|
595
|
+
overrideOptions,
|
|
607
596
|
}),
|
|
608
|
-
[
|
|
609
|
-
setType,
|
|
610
|
-
setColor,
|
|
611
|
-
setDisableShadow,
|
|
612
|
-
setEnableRelativeHeight,
|
|
613
|
-
setDefaultAppearance,
|
|
614
|
-
createDataOnly,
|
|
615
|
-
allowRightClickToAbort,
|
|
616
|
-
allowAutoResetInteractionMode,
|
|
617
|
-
],
|
|
597
|
+
[getType, setType, getOptions, overrideOptions],
|
|
618
598
|
);
|
|
619
599
|
|
|
620
600
|
return {
|
|
621
601
|
state,
|
|
622
602
|
extrudedHeight,
|
|
623
603
|
geometryOptions,
|
|
624
|
-
color,
|
|
625
|
-
disableShadow,
|
|
626
|
-
enableRelativeHeight,
|
|
604
|
+
color: sketchOptions.color,
|
|
605
|
+
disableShadow: sketchOptions.disableShadow,
|
|
606
|
+
enableRelativeHeight: sketchOptions.enableRelativeHeight,
|
|
627
607
|
} as any;
|
|
628
608
|
}
|
|
629
609
|
|
package/src/Map/Sketch/index.tsx
CHANGED
|
@@ -1,38 +1,16 @@
|
|
|
1
1
|
// Reference: Sketch feature is basically referenced from https://github.com/takram-design-engineering/plateau-view/blob/main/libs/sketch/src/SketchTool.tsx
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { ComponentType, ForwardRefRenderFunction, RefObject, forwardRef } from "react";
|
|
5
|
-
import { RequireExactlyOne } from "type-fest";
|
|
3
|
+
import { ForwardRefRenderFunction, RefObject, forwardRef } from "react";
|
|
6
4
|
|
|
7
5
|
import { ComputedLayer, SelectedFeatureInfo } from "../../mantle";
|
|
8
|
-
import { Position3d } from "../../types";
|
|
9
6
|
import { InteractionModeType } from "../../Visualizer/interactionMode";
|
|
10
7
|
import { EngineRef, Feature, LayerSelectionReason, LayersRef, SketchRef } from "../types";
|
|
11
8
|
|
|
12
9
|
import useHooks from "./hooks";
|
|
13
|
-
import { SketchEventProps, SketchFeature, SketchType } from "./types";
|
|
10
|
+
import { SketchComponentType, SketchEventProps, SketchFeature, SketchType } from "./types";
|
|
14
11
|
|
|
15
12
|
export * from "./types";
|
|
16
13
|
|
|
17
|
-
export type SketchComponentType = ComponentType<SketchComponentProps>;
|
|
18
|
-
|
|
19
|
-
type GeometryOptions = {
|
|
20
|
-
type: SketchType;
|
|
21
|
-
controlPoints: readonly Position3d[];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
type SketchComponentProps = RequireExactlyOne<
|
|
25
|
-
{
|
|
26
|
-
geometry?: LineString | Polygon | MultiPolygon | null;
|
|
27
|
-
geometryOptions?: GeometryOptions | null;
|
|
28
|
-
extrudedHeight?: number;
|
|
29
|
-
disableShadow?: boolean;
|
|
30
|
-
enableRelativeHeight?: boolean;
|
|
31
|
-
color?: string;
|
|
32
|
-
},
|
|
33
|
-
"geometry" | "geometryOptions"
|
|
34
|
-
>;
|
|
35
|
-
|
|
36
14
|
export type OnLayerSelectType = (
|
|
37
15
|
layerId: string | undefined,
|
|
38
16
|
featureId: string | undefined,
|
package/src/Map/Sketch/preset.ts
CHANGED
package/src/Map/Sketch/types.ts
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { Feature as GeojsonFeature, MultiPolygon, Polygon, Point, LineString } from "geojson";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
|
+
import { RequireExactlyOne } from "type-fest";
|
|
2
4
|
|
|
3
5
|
import { LayerAppearanceTypes } from "../../mantle";
|
|
4
6
|
import { Position3d } from "../../types";
|
|
5
7
|
|
|
8
|
+
type GeometryOptions = {
|
|
9
|
+
type: SketchType;
|
|
10
|
+
controlPoints: readonly Position3d[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type SketchComponentProps = RequireExactlyOne<
|
|
14
|
+
{
|
|
15
|
+
geometry?: LineString | Polygon | MultiPolygon | null;
|
|
16
|
+
geometryOptions?: GeometryOptions | null;
|
|
17
|
+
extrudedHeight?: number;
|
|
18
|
+
disableShadow?: boolean;
|
|
19
|
+
enableRelativeHeight?: boolean;
|
|
20
|
+
color?: string;
|
|
21
|
+
},
|
|
22
|
+
"geometry" | "geometryOptions"
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
export type SketchComponentType = ComponentType<SketchComponentProps>;
|
|
26
|
+
|
|
6
27
|
export type SketchType =
|
|
7
28
|
| "marker"
|
|
8
29
|
| "polyline"
|
|
@@ -13,6 +34,16 @@ export type SketchType =
|
|
|
13
34
|
| "extrudedRectangle"
|
|
14
35
|
| "extrudedPolygon";
|
|
15
36
|
|
|
37
|
+
export type SketchOptions = {
|
|
38
|
+
color?: string;
|
|
39
|
+
appearance?: SketchAppearance;
|
|
40
|
+
dataOnly?: boolean;
|
|
41
|
+
disableShadow?: boolean;
|
|
42
|
+
enableRelativeHeight?: boolean;
|
|
43
|
+
rightClickToAbort?: boolean;
|
|
44
|
+
autoResetInteractionMode?: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
16
47
|
export type GeometryOptionsXYZ = {
|
|
17
48
|
type: SketchType;
|
|
18
49
|
controlPoints: Position3d[];
|
package/src/Map/hooks.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
LayerSelectionReason,
|
|
10
10
|
ComputedLayer,
|
|
11
11
|
RequestingRenderMode,
|
|
12
|
-
SceneProperty,
|
|
13
12
|
SketchRef,
|
|
14
13
|
} from "./types";
|
|
15
14
|
import useTimelineManager, { TimelineManagerRef } from "./useTimelineManager";
|
|
@@ -24,13 +23,11 @@ export const REQUEST_RENDER_ONCE = 1;
|
|
|
24
23
|
|
|
25
24
|
export default function ({
|
|
26
25
|
ref,
|
|
27
|
-
sceneProperty,
|
|
28
26
|
timelineManagerRef,
|
|
29
27
|
cursor,
|
|
30
28
|
onLayerSelect,
|
|
31
29
|
}: {
|
|
32
30
|
ref: Ref<MapRef>;
|
|
33
|
-
sceneProperty?: SceneProperty;
|
|
34
31
|
timelineManagerRef?: TimelineManagerRef;
|
|
35
32
|
cursor?: CursorType;
|
|
36
33
|
onLayerSelect?: (
|
|
@@ -104,7 +101,6 @@ export default function ({
|
|
|
104
101
|
);
|
|
105
102
|
|
|
106
103
|
useTimelineManager({
|
|
107
|
-
init: sceneProperty?.timeline,
|
|
108
104
|
engineRef,
|
|
109
105
|
timelineManagerRef,
|
|
110
106
|
});
|
package/src/Map/index.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import Sketch, { SketchProps } from "./Sketch";
|
|
|
8
8
|
import type { Engine, EngineProps } from "./types";
|
|
9
9
|
|
|
10
10
|
export * from "./types";
|
|
11
|
-
export { useGet, type WrappedRef, type Undefinable
|
|
11
|
+
export { useGet, type WrappedRef, type Undefinable } from "./utils";
|
|
12
12
|
|
|
13
13
|
export type {
|
|
14
14
|
NaiveLayer,
|
|
@@ -36,7 +36,12 @@ export type Props = {
|
|
|
36
36
|
engine?: string;
|
|
37
37
|
} & Omit<
|
|
38
38
|
LayersProps,
|
|
39
|
-
|
|
39
|
+
| "Feature"
|
|
40
|
+
| "clusterComponent"
|
|
41
|
+
| "selectionReason"
|
|
42
|
+
| "delegatedDataTypes"
|
|
43
|
+
| "selectedLayerId"
|
|
44
|
+
| "viewerProperty"
|
|
40
45
|
> &
|
|
41
46
|
Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> &
|
|
42
47
|
Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"> & {
|
|
@@ -54,7 +59,6 @@ function MapFn(
|
|
|
54
59
|
layers,
|
|
55
60
|
overrides,
|
|
56
61
|
timelineManagerRef,
|
|
57
|
-
sceneProperty,
|
|
58
62
|
interactionMode,
|
|
59
63
|
selectedFeature,
|
|
60
64
|
cursor,
|
|
@@ -80,7 +84,6 @@ function MapFn(
|
|
|
80
84
|
handleEngineLayerSelect,
|
|
81
85
|
} = useHooks({
|
|
82
86
|
ref,
|
|
83
|
-
sceneProperty,
|
|
84
87
|
timelineManagerRef,
|
|
85
88
|
cursor,
|
|
86
89
|
onLayerSelect,
|
|
@@ -123,7 +126,7 @@ function MapFn(
|
|
|
123
126
|
clusterComponent={currentEngine?.clusterComponent}
|
|
124
127
|
delegatedDataTypes={currentEngine.delegatedDataTypes}
|
|
125
128
|
meta={props.meta}
|
|
126
|
-
|
|
129
|
+
viewerProperty={props.property}
|
|
127
130
|
requestingRenderMode={requestingRenderMode}
|
|
128
131
|
onLayerSelect={handleLayerSelect}
|
|
129
132
|
/>
|
package/src/Map/ref.ts
CHANGED
|
@@ -103,6 +103,7 @@ const layersRefKeys: FunctionKeys<LayersRef> = {
|
|
|
103
103
|
findByTags: 1,
|
|
104
104
|
hide: 1,
|
|
105
105
|
isLayer: 1,
|
|
106
|
+
isComputedLayer: 1,
|
|
106
107
|
layers: 1,
|
|
107
108
|
override: 1,
|
|
108
109
|
replace: 1,
|
|
@@ -117,14 +118,10 @@ const layersRefKeys: FunctionKeys<LayersRef> = {
|
|
|
117
118
|
};
|
|
118
119
|
|
|
119
120
|
const sketchRefKeys: FunctionKeys<SketchRef> = {
|
|
121
|
+
getType: 1,
|
|
120
122
|
setType: 1,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
createDataOnly: 1,
|
|
124
|
-
disableShadow: 1,
|
|
125
|
-
enableRelativeHeight: 1,
|
|
126
|
-
allowRightClickToAbort: 1,
|
|
127
|
-
allowAutoResetInteractionMode: 1,
|
|
123
|
+
getOptions: 1,
|
|
124
|
+
overrideOptions: 1,
|
|
128
125
|
};
|
|
129
126
|
|
|
130
127
|
export function mapRef({
|