@reearth/core 0.0.7-alpha.1 → 0.0.7-alpha.11
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 +32685 -32713
- package/dist/core.umd.cjs +3873 -3831
- package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
- package/dist/index.d.ts +45 -39
- package/package.json +8 -8
- package/src/Map/Layers/hooks.ts +10 -0
- 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/ref.ts +4 -7
- package/src/Map/types/index.ts +29 -34
- package/src/Map/types/viewerProperty.ts +3 -4
- package/src/Map/useTimelineManager.ts +3 -1
- package/src/Visualizer/hooks.ts +14 -2
- package/src/Visualizer/useCoreAPI.ts +2 -2
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
- package/src/engines/Cesium/Feature/utils.tsx +12 -1
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
- package/src/engines/Cesium/core/Globe.tsx +7 -7
- package/src/engines/Cesium/hooks/useCamera.ts +4 -13
- package/src/engines/Cesium/hooks/useEngineRef.test.tsx +24 -24
- package/src/engines/Cesium/hooks/useEngineRef.ts +26 -24
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +2 -2
- package/src/engines/Cesium/hooks.ts +14 -15
- package/src/engines/Cesium/index.tsx +12 -12
- 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/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare type Array_2 = any[];
|
|
|
54
54
|
export { Array_2 as Array }
|
|
55
55
|
|
|
56
56
|
export declare type AssetsCesiumProperty = {
|
|
57
|
-
|
|
57
|
+
terrain?: {
|
|
58
58
|
ionAccessToken?: string;
|
|
59
59
|
ionAsset?: string;
|
|
60
60
|
ionUrl?: string;
|
|
@@ -137,25 +137,24 @@ export declare type CameraOptions = {
|
|
|
137
137
|
/** Represents the camera position and state */
|
|
138
138
|
export declare type CameraPosition = {
|
|
139
139
|
/** degrees */
|
|
140
|
-
lat
|
|
140
|
+
lat?: number;
|
|
141
141
|
/** degrees */
|
|
142
|
-
lng
|
|
142
|
+
lng?: number;
|
|
143
143
|
/** meters */
|
|
144
|
-
height
|
|
144
|
+
height?: number;
|
|
145
145
|
/** radians */
|
|
146
|
-
heading
|
|
146
|
+
heading?: number;
|
|
147
147
|
/** radians */
|
|
148
|
-
pitch
|
|
148
|
+
pitch?: number;
|
|
149
149
|
/** radians */
|
|
150
|
-
roll
|
|
150
|
+
roll?: number;
|
|
151
151
|
/** Field of view expressed in radians */
|
|
152
|
-
fov
|
|
152
|
+
fov?: number;
|
|
153
153
|
/** Aspect ratio of frustum */
|
|
154
154
|
aspectRatio?: number;
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
export declare type CameraProperty = {
|
|
158
|
-
camera?: Camera;
|
|
159
158
|
allowEnterGround?: boolean;
|
|
160
159
|
limiter?: CameraLimiterProperty;
|
|
161
160
|
};
|
|
@@ -422,6 +421,14 @@ export declare type DefaultInfobox = {
|
|
|
422
421
|
};
|
|
423
422
|
};
|
|
424
423
|
|
|
424
|
+
export declare type ElevationHeatMapProperty = {
|
|
425
|
+
type?: "custom";
|
|
426
|
+
colorLUT?: LUT;
|
|
427
|
+
minHeight?: number;
|
|
428
|
+
maxHeight?: number;
|
|
429
|
+
logarithmic?: boolean;
|
|
430
|
+
};
|
|
431
|
+
|
|
425
432
|
export declare type EllipseAppearance = {
|
|
426
433
|
show?: boolean;
|
|
427
434
|
heightReference?: "none" | "clamp" | "relative";
|
|
@@ -513,7 +520,7 @@ export declare type EngineRef = {
|
|
|
513
520
|
getLocationFromScreen: (x: number, y: number, withTerrain?: boolean) => LatLngHeight | undefined;
|
|
514
521
|
sampleTerrainHeight: (lng: number, lat: number) => Promise<number | undefined>;
|
|
515
522
|
computeGlobeHeight: (lng: number, lat: number, height?: number) => number | undefined;
|
|
516
|
-
getGlobeHeight: () =>
|
|
523
|
+
getGlobeHeight: () => number | undefined;
|
|
517
524
|
toXYZ: (lng: number, lat: number, height: number, options?: {
|
|
518
525
|
useGlobeEllipsoid?: boolean;
|
|
519
526
|
}) => [x: number, y: number, z: number] | undefined;
|
|
@@ -797,14 +804,6 @@ export declare type HeatMapAppearance = {
|
|
|
797
804
|
logarithmic?: boolean;
|
|
798
805
|
};
|
|
799
806
|
|
|
800
|
-
export declare type HeightMapProperty = {
|
|
801
|
-
type?: "custom";
|
|
802
|
-
colorLUT?: LUT;
|
|
803
|
-
minHeight?: number;
|
|
804
|
-
maxHeight?: number;
|
|
805
|
-
logarithmic?: boolean;
|
|
806
|
-
};
|
|
807
|
-
|
|
808
807
|
export declare type ImageBasedLighting = {
|
|
809
808
|
enabled?: boolean;
|
|
810
809
|
intensity?: number;
|
|
@@ -955,6 +954,7 @@ export declare type LayersRef = {
|
|
|
955
954
|
}) | null) => void;
|
|
956
955
|
deleteLayer: (...ids: string[]) => void;
|
|
957
956
|
isLayer: (obj: any) => obj is LazyLayer;
|
|
957
|
+
isComputedLayer: (obj: any) => obj is ComputedLayer;
|
|
958
958
|
layers: () => LazyLayer[];
|
|
959
959
|
walk: <T>(fn: (layer: LazyLayer, index: number, parents: LazyLayer[]) => T | void) => T | undefined;
|
|
960
960
|
find: (fn: (layer: LazyLayer, index: number, parents: LazyLayer[]) => boolean) => LazyLayer | undefined;
|
|
@@ -1177,18 +1177,18 @@ export declare type MouseEventCallbacks = {
|
|
|
1177
1177
|
|
|
1178
1178
|
export declare type MouseEventHandles = {
|
|
1179
1179
|
onClick: (fn: MouseEvents["click"]) => void;
|
|
1180
|
-
onDoubleClick: (fn: MouseEvents["
|
|
1181
|
-
onMouseDown: (fn: MouseEvents["
|
|
1182
|
-
onMouseUp: (fn: MouseEvents["
|
|
1183
|
-
onRightClick: (fn: MouseEvents["
|
|
1184
|
-
onRightDown: (fn: MouseEvents["
|
|
1185
|
-
onRightUp: (fn: MouseEvents["
|
|
1186
|
-
onMiddleClick: (fn: MouseEvents["
|
|
1187
|
-
onMiddleDown: (fn: MouseEvents["
|
|
1188
|
-
onMiddleUp: (fn: MouseEvents["
|
|
1189
|
-
onMouseMove: (fn: MouseEvents["
|
|
1190
|
-
onMouseEnter: (fn: MouseEvents["
|
|
1191
|
-
onMouseLeave: (fn: MouseEvents["
|
|
1180
|
+
onDoubleClick: (fn: MouseEvents["doubleClick"]) => void;
|
|
1181
|
+
onMouseDown: (fn: MouseEvents["mouseDown"]) => void;
|
|
1182
|
+
onMouseUp: (fn: MouseEvents["mouseUp"]) => void;
|
|
1183
|
+
onRightClick: (fn: MouseEvents["rightClick"]) => void;
|
|
1184
|
+
onRightDown: (fn: MouseEvents["rightDown"]) => void;
|
|
1185
|
+
onRightUp: (fn: MouseEvents["rightUp"]) => void;
|
|
1186
|
+
onMiddleClick: (fn: MouseEvents["middleClick"]) => void;
|
|
1187
|
+
onMiddleDown: (fn: MouseEvents["middleDown"]) => void;
|
|
1188
|
+
onMiddleUp: (fn: MouseEvents["middleUp"]) => void;
|
|
1189
|
+
onMouseMove: (fn: MouseEvents["mouseMove"]) => void;
|
|
1190
|
+
onMouseEnter: (fn: MouseEvents["mouseEnter"]) => void;
|
|
1191
|
+
onMouseLeave: (fn: MouseEvents["mouseLeave"]) => void;
|
|
1192
1192
|
onWheel: (fn: MouseEvents["wheel"]) => void;
|
|
1193
1193
|
};
|
|
1194
1194
|
|
|
@@ -1208,7 +1208,7 @@ export declare type MouseEvents = {
|
|
|
1208
1208
|
wheel: MouseWheelEventCallback;
|
|
1209
1209
|
};
|
|
1210
1210
|
|
|
1211
|
-
export declare type MouseEventTypes = "click" | "
|
|
1211
|
+
export declare type MouseEventTypes = "click" | "doubleClick" | "mouseDown" | "mouseUp" | "rightClick" | "rightDown" | "rightUp" | "middleClick" | "middleDown" | "middleUp" | "mouseMove" | "mouseEnter" | "mouseLeave" | "wheel";
|
|
1212
1212
|
|
|
1213
1213
|
export declare type MouseWheelEventCallback = (props: MouseEventProps) => void;
|
|
1214
1214
|
|
|
@@ -1485,6 +1485,16 @@ export declare type SketchFeature = Feature_2<Polygon_2 | MultiPolygon | Point |
|
|
|
1485
1485
|
extrudedHeight: number;
|
|
1486
1486
|
}>;
|
|
1487
1487
|
|
|
1488
|
+
export declare type SketchOptions = {
|
|
1489
|
+
color?: string;
|
|
1490
|
+
appearance?: SketchAppearance;
|
|
1491
|
+
dataOnly?: boolean;
|
|
1492
|
+
disableShadow?: boolean;
|
|
1493
|
+
enableRelativeHeight?: boolean;
|
|
1494
|
+
rightClickToAbort?: boolean;
|
|
1495
|
+
autoResetInteractionMode?: boolean;
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1488
1498
|
export declare type SketchProps = {
|
|
1489
1499
|
layersRef: RefObject<LayersRef>;
|
|
1490
1500
|
engineRef: RefObject<EngineRef>;
|
|
@@ -1499,14 +1509,10 @@ export declare type SketchProps = {
|
|
|
1499
1509
|
};
|
|
1500
1510
|
|
|
1501
1511
|
export declare type SketchRef = {
|
|
1512
|
+
getType: () => SketchType | undefined;
|
|
1502
1513
|
setType: (type: SketchType | undefined, from?: "editor" | "plugin") => void;
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
disableShadow: (disable: boolean) => void;
|
|
1506
|
-
enableRelativeHeight: (enable: boolean) => void;
|
|
1507
|
-
createDataOnly: (dataOnly: boolean) => void;
|
|
1508
|
-
allowRightClickToAbort: (allow: boolean) => void;
|
|
1509
|
-
allowAutoResetInteractionMode: (allow: boolean) => void;
|
|
1514
|
+
getOptions: () => SketchOptions;
|
|
1515
|
+
overrideOptions: (options: SketchOptions) => void;
|
|
1510
1516
|
};
|
|
1511
1517
|
|
|
1512
1518
|
export declare type SketchType = "marker" | "polyline" | "circle" | "rectangle" | "polygon" | "extrudedCircle" | "extrudedRectangle" | "extrudedPolygon";
|
|
@@ -1554,7 +1560,7 @@ export declare type TerrainProperty = {
|
|
|
1554
1560
|
type?: "cesium" | "arcgis" | "cesiumion";
|
|
1555
1561
|
url?: string;
|
|
1556
1562
|
normal?: boolean;
|
|
1557
|
-
|
|
1563
|
+
elevationHeatMap?: ElevationHeatMapProperty;
|
|
1558
1564
|
};
|
|
1559
1565
|
|
|
1560
1566
|
export declare type TickEvent = (cb: TickEventCallback) => void;
|
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.11",
|
|
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",
|
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/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/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({
|