@reearth/core 0.0.1
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/README.md +18 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- 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 +14 -0
- 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 +1 -0
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +1 -0
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +1 -0
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- 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 +1 -0
- package/dist/cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +124 -0
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- 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 +84 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- 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 +92 -0
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
- package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
- package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/cesium/Widgets/lighter.css +237 -0
- package/dist/cesium/Widgets/lighterShared.css +46 -0
- package/dist/cesium/Widgets/shared.css +103 -0
- package/dist/cesium/Widgets/widgets.css +1346 -0
- package/dist/cesium/Workers/chunk-2ED5WI77.js +26 -0
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +26 -0
- package/dist/cesium/Workers/chunk-3C74MLG3.js +26 -0
- package/dist/cesium/Workers/chunk-45U7TTT3.js +26 -0
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +26 -0
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +26 -0
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +26 -0
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +26 -0
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +26 -0
- package/dist/cesium/Workers/chunk-74N6MC2V.js +26 -0
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +26 -0
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +26 -0
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +27 -0
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +26 -0
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +26 -0
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +26 -0
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +26 -0
- package/dist/cesium/Workers/chunk-BOPB43LN.js +26 -0
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +26 -0
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +26 -0
- package/dist/cesium/Workers/chunk-CSISXEG7.js +26 -0
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +28 -0
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +30 -0
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +62 -0
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +26 -0
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +26 -0
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +26 -0
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +26 -0
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +26 -0
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +26 -0
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +26 -0
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +26 -0
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +26 -0
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +26 -0
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +26 -0
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +26 -0
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +26 -0
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +26 -0
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +26 -0
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +26 -0
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +26 -0
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +26 -0
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +28 -0
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +26 -0
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +26 -0
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +27 -0
- package/dist/cesium/Workers/chunk-VKV642QV.js +26 -0
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +26 -0
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +26 -0
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +26 -0
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +26 -0
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +26 -0
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +26 -0
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +26 -0
- package/dist/cesium/Workers/combineGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createGeometry.js +26 -0
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
- package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
- package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/createWallGeometry.js +26 -0
- package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/decodeDraco.js +26 -0
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/dist/cesium/Workers/decodeI3S.js +26 -0
- package/dist/cesium/Workers/transcodeKTX2.js +56 -0
- package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/dist/core.js +83397 -0
- package/dist/core.umd.cjs +6710 -0
- package/dist/index-DqatWUTw.js +3225 -0
- package/dist/index.d.ts +1760 -0
- package/package.json +115 -0
- package/src/Map/ClusteredLayers/index.tsx +106 -0
- package/src/Map/Layer/hooks.ts +180 -0
- package/src/Map/Layer/index.tsx +92 -0
- package/src/Map/Layers/hooks.test.ts +819 -0
- package/src/Map/Layers/hooks.ts +955 -0
- package/src/Map/Layers/index.test.tsx +188 -0
- package/src/Map/Layers/index.tsx +76 -0
- package/src/Map/Layers/keys.ts +51 -0
- package/src/Map/Layers/utils.test.ts +53 -0
- package/src/Map/Layers/utils.ts +37 -0
- package/src/Map/Sketch/hooks.ts +641 -0
- package/src/Map/Sketch/index.tsx +101 -0
- package/src/Map/Sketch/preset.ts +29 -0
- package/src/Map/Sketch/sketchMachine.ts +323 -0
- package/src/Map/Sketch/sketchMachine.typegen.ts +72 -0
- package/src/Map/Sketch/types.ts +52 -0
- package/src/Map/Sketch/utils.ts +24 -0
- package/src/Map/hooks.ts +127 -0
- package/src/Map/index.tsx +147 -0
- package/src/Map/ref.ts +147 -0
- package/src/Map/types/event.ts +104 -0
- package/src/Map/types/index.ts +545 -0
- package/src/Map/useTimelineManager.ts +215 -0
- package/src/Map/utils.test.ts +62 -0
- package/src/Map/utils.ts +71 -0
- package/src/Visualizer/DropHolder.tsx +41 -0
- package/src/Visualizer/Error.tsx +15 -0
- package/src/Visualizer/context.tsx +27 -0
- package/src/Visualizer/coreContext.tsx +47 -0
- package/src/Visualizer/engines.ts +7 -0
- package/src/Visualizer/featureFlags.ts +9 -0
- package/src/Visualizer/hooks.ts +403 -0
- package/src/Visualizer/index.stories.tsx +128 -0
- package/src/Visualizer/index.tsx +187 -0
- package/src/Visualizer/interactionMode.ts +25 -0
- package/src/Visualizer/useViewport.ts +74 -0
- package/src/e2eConfig.ts +20 -0
- package/src/engines/Cesium/Cluster.tsx +90 -0
- package/src/engines/Cesium/Event.tsx +15 -0
- package/src/engines/Cesium/Feature/Box/Edge.tsx +94 -0
- package/src/engines/Cesium/Feature/Box/ScalePoints.tsx +158 -0
- package/src/engines/Cesium/Feature/Box/Side.tsx +70 -0
- package/src/engines/Cesium/Feature/Box/constants.ts +63 -0
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +375 -0
- package/src/engines/Cesium/Feature/Box/hooks/edge.ts +112 -0
- package/src/engines/Cesium/Feature/Box/hooks/scalePoint.ts +174 -0
- package/src/engines/Cesium/Feature/Box/hooks/side.ts +72 -0
- package/src/engines/Cesium/Feature/Box/index.tsx +156 -0
- package/src/engines/Cesium/Feature/Box/utils.ts +168 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +48 -0
- package/src/engines/Cesium/Feature/Ellipse/index.tsx +91 -0
- package/src/engines/Cesium/Feature/Ellipsoid/index.tsx +84 -0
- package/src/engines/Cesium/Feature/Frustum/FrustumColorAppearance.ts +38 -0
- package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +23 -0
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +49 -0
- package/src/engines/Cesium/Feature/Frustum/index.tsx +163 -0
- package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.frag.glsl +31 -0
- package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.vert.glsl +29 -0
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +186 -0
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMeshMaterial.ts +81 -0
- package/src/engines/Cesium/Feature/HeatMap/colorMap.ts +47 -0
- package/src/engines/Cesium/Feature/HeatMap/constants.ts +781 -0
- package/src/engines/Cesium/Feature/HeatMap/createMeshImageData.ts +108 -0
- package/src/engines/Cesium/Feature/HeatMap/index.tsx +169 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/heatmapMeshMaterial.glsl +78 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/makeContour.glsl +13 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/sampleBicubic.glsl +57 -0
- package/src/engines/Cesium/Feature/Marker/index.tsx +296 -0
- package/src/engines/Cesium/Feature/Marker/marker.svg +3 -0
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +48 -0
- package/src/engines/Cesium/Feature/Model/index.tsx +223 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +98 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +163 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/primPhotoIcon.svg +3 -0
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +174 -0
- package/src/engines/Cesium/Feature/Polygon/index.tsx +182 -0
- package/src/engines/Cesium/Feature/Polyline/index.tsx +98 -0
- package/src/engines/Cesium/Feature/Raster/hooks.ts +52 -0
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +77 -0
- package/src/engines/Cesium/Feature/Raster/index.tsx +37 -0
- package/src/engines/Cesium/Feature/Raster/mvt.ts +33 -0
- package/src/engines/Cesium/Feature/Raster/tiles.ts +27 -0
- package/src/engines/Cesium/Feature/Raster/tms.ts +31 -0
- package/src/engines/Cesium/Feature/Raster/types.ts +5 -0
- package/src/engines/Cesium/Feature/Raster/utils.test.ts +14 -0
- package/src/engines/Cesium/Feature/Raster/utils.ts +10 -0
- package/src/engines/Cesium/Feature/Raster/wms.ts +28 -0
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +46 -0
- package/src/engines/Cesium/Feature/Resource/index.tsx +218 -0
- package/src/engines/Cesium/Feature/Resource/utils.test.ts +69 -0
- package/src/engines/Cesium/Feature/Resource/utils.ts +377 -0
- package/src/engines/Cesium/Feature/Tileset/DrawClippingPolygon/index.tsx +77 -0
- package/src/engines/Cesium/Feature/Tileset/TilesetFeatureIndex.ts +46 -0
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +793 -0
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +41 -0
- package/src/engines/Cesium/Feature/Tileset/index.tsx +127 -0
- package/src/engines/Cesium/Feature/Tileset/types.ts +5 -0
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +457 -0
- package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +200 -0
- package/src/engines/Cesium/Feature/context.ts +33 -0
- package/src/engines/Cesium/Feature/index.tsx +250 -0
- package/src/engines/Cesium/Feature/utils.test.tsx +30 -0
- package/src/engines/Cesium/Feature/utils.tsx +289 -0
- package/src/engines/Cesium/FeatureIndex.ts +15 -0
- package/src/engines/Cesium/JapanSeaLevelEllipsoid.ts +20 -0
- package/src/engines/Cesium/PostProcesses/README.md +1 -0
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +120 -0
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusionOutputType.ts +7 -0
- package/src/engines/Cesium/PostProcesses/hbao/README.md +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/config.ts +29 -0
- package/src/engines/Cesium/PostProcesses/hbao/createAmbientOcclusionStage.ts +173 -0
- package/src/engines/Cesium/PostProcesses/hbao/createCrossBilateralFilterStage.ts +94 -0
- package/src/engines/Cesium/PostProcesses/hbao/index.ts +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionGenerate.glsl +151 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionModulate.glsl +46 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/crossBilateralFilter.glsl +108 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/depth.glsl +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/globeDepth.glsl +15 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/highPassRandom.glsl +28 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/packing.glsl +7 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructNormal.glsl +109 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructPosition.glsl +10 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/turboColorMap.glsl +20 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/vogelDisk.glsl +13 -0
- package/src/engines/Cesium/Shaders/CustomShaders/NonPBRLightingShader.ts +66 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/Definitions.glsl +5 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/HeatmapForTerrain.glsl +13 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +57 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/README.md +13 -0
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +67 -0
- package/src/engines/Cesium/Sketch/Entity.tsx +43 -0
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +51 -0
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +70 -0
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +75 -0
- package/src/engines/Cesium/Sketch/MeasurementText.tsx +13 -0
- package/src/engines/Cesium/Sketch/PolygonEntity.tsx +48 -0
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +44 -0
- package/src/engines/Cesium/Sketch/ScreenSpaceElement.tsx +87 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +67 -0
- package/src/engines/Cesium/Sketch/SurfaceMeasurement.tsx +80 -0
- package/src/engines/Cesium/Sketch/createGeometry.ts +224 -0
- package/src/engines/Cesium/Sketch/index.tsx +119 -0
- package/src/engines/Cesium/Sketch/utils.ts +27 -0
- package/src/engines/Cesium/VertexTerrainElevationMaterial.ts +33 -0
- package/src/engines/Cesium/cameraLimiter.ts +256 -0
- package/src/engines/Cesium/common.test.ts +38 -0
- package/src/engines/Cesium/common.ts +901 -0
- package/src/engines/Cesium/constants.ts +25 -0
- package/src/engines/Cesium/core/Clock.tsx +58 -0
- package/src/engines/Cesium/core/Globe.tsx +136 -0
- package/src/engines/Cesium/core/Imagery.test.ts +102 -0
- package/src/engines/Cesium/core/Imagery.tsx +184 -0
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +141 -0
- package/src/engines/Cesium/core/Indicator/crosshair.svg +3 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +321 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +56 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +146 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +258 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/getAnnotationType.ts +117 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +24 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/index.ts +3 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/types.ts +26 -0
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +39 -0
- package/src/engines/Cesium/core/presets.ts +95 -0
- package/src/engines/Cesium/helpers/createUniforms.ts +64 -0
- package/src/engines/Cesium/helpers/sphericalHaromic.test.ts +33 -0
- package/src/engines/Cesium/helpers/sphericalHaromic.ts +27 -0
- package/src/engines/Cesium/hooks/useInstance.ts +98 -0
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +157 -0
- package/src/engines/Cesium/hooks/useSceneEvent.ts +47 -0
- package/src/engines/Cesium/hooks.ts +1004 -0
- package/src/engines/Cesium/index.stories.tsx +42 -0
- package/src/engines/Cesium/index.tsx +285 -0
- package/src/engines/Cesium/pickMany.ts +310 -0
- package/src/engines/Cesium/type.d.ts +47 -0
- package/src/engines/Cesium/types.ts +24 -0
- package/src/engines/Cesium/useEngineRef.test.tsx +627 -0
- package/src/engines/Cesium/useEngineRef.ts +945 -0
- package/src/engines/Cesium/useOverrideGlobeShader.ts +322 -0
- package/src/engines/Cesium/utils/mouse.ts +16 -0
- package/src/engines/Cesium/utils/polygon.ts +48 -0
- package/src/engines/Cesium/utils/utils.ts +446 -0
- package/src/engines/Cesium/vertexTerrainElevationMaterial.glsl +25 -0
- package/src/engines/index.ts +37 -0
- package/src/env.d.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useRefFunction.ts +10 -0
- package/src/hooks/useRefValue.ts +7 -0
- package/src/index.ts +4 -0
- package/src/mantle/README.md +7 -0
- package/src/mantle/atoms/cache.test.ts +61 -0
- package/src/mantle/atoms/cache.ts +55 -0
- package/src/mantle/atoms/compute.test.ts +794 -0
- package/src/mantle/atoms/compute.ts +344 -0
- package/src/mantle/atoms/data.test.ts +182 -0
- package/src/mantle/atoms/data.ts +114 -0
- package/src/mantle/atoms/index.ts +1 -0
- package/src/mantle/compat/backward.test.ts +368 -0
- package/src/mantle/compat/backward.ts +189 -0
- package/src/mantle/compat/forward.test.ts +688 -0
- package/src/mantle/compat/forward.ts +272 -0
- package/src/mantle/compat/index.ts +4 -0
- package/src/mantle/compat/types.ts +73 -0
- package/src/mantle/data/csv.test.ts +478 -0
- package/src/mantle/data/csv.ts +194 -0
- package/src/mantle/data/geojson.ts +72 -0
- package/src/mantle/data/georss.ts +172 -0
- package/src/mantle/data/gml.ts +244 -0
- package/src/mantle/data/gpx.test.ts +65 -0
- package/src/mantle/data/gpx.ts +551 -0
- package/src/mantle/data/gtfs.ts +116 -0
- package/src/mantle/data/gtfsReader.ts +454 -0
- package/src/mantle/data/index.test.ts +16 -0
- package/src/mantle/data/index.ts +73 -0
- package/src/mantle/data/shapefile.ts +232 -0
- package/src/mantle/data/utils.ts +21 -0
- package/src/mantle/evaluator/index.ts +40 -0
- package/src/mantle/evaluator/simple/conditionalExpression/index.ts +60 -0
- package/src/mantle/evaluator/simple/expression/constants.ts +204 -0
- package/src/mantle/evaluator/simple/expression/expression.test.ts +63 -0
- package/src/mantle/evaluator/simple/expression/expression.ts +116 -0
- package/src/mantle/evaluator/simple/expression/functions/binaryFunctions.ts +43 -0
- package/src/mantle/evaluator/simple/expression/functions/colors.ts +189 -0
- package/src/mantle/evaluator/simple/expression/functions/index.ts +3 -0
- package/src/mantle/evaluator/simple/expression/functions/unaryFunctions.ts +54 -0
- package/src/mantle/evaluator/simple/expression/index.ts +1 -0
- package/src/mantle/evaluator/simple/expression/node.ts +570 -0
- package/src/mantle/evaluator/simple/expression/runtime.ts +266 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.test.ts +54 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.ts +121 -0
- package/src/mantle/evaluator/simple/index.test.ts +656 -0
- package/src/mantle/evaluator/simple/index.ts +178 -0
- package/src/mantle/evaluator/simple/interval.test.ts +102 -0
- package/src/mantle/evaluator/simple/interval.ts +27 -0
- package/src/mantle/evaluator/simple/utils.test.ts +56 -0
- package/src/mantle/evaluator/simple/utils.ts +31 -0
- package/src/mantle/index.ts +6 -0
- package/src/mantle/types/appearance.ts +318 -0
- package/src/mantle/types/events.ts +16 -0
- package/src/mantle/types/expression.ts +9 -0
- package/src/mantle/types/index.ts +156 -0
- package/src/mantle/types/value.ts +153 -0
- package/src/mantle/utils.test.ts +74 -0
- package/src/mantle/utils.ts +53 -0
- package/src/reearthTypes.ts +64 -0
- package/src/setupTests.ts +1 -0
- package/src/test/setup.ts +40 -0
- package/src/test/utils.tsx +40 -0
- package/src/types.ts +66 -0
- package/src/utils/StringMatcher.test.ts +132 -0
- package/src/utils/StringMatcher.ts +104 -0
- package/src/utils/assertType.ts +1 -0
- package/src/utils/generate-random-string.ts +9 -0
- package/src/utils/idle.ts +22 -0
- package/src/utils/image.ts +35 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/object.ts +70 -0
- package/src/utils/raf.ts +58 -0
- package/src/utils/time.ts +18 -0
- package/src/utils/use-delayed-count.test.ts +139 -0
- package/src/utils/use-delayed-count.ts +65 -0
- package/src/utils/use-dnd/drag.ts +34 -0
- package/src/utils/use-dnd/drop.ts +93 -0
- package/src/utils/use-dnd/index.tsx +20 -0
- package/src/utils/use-dnd/types.ts +47 -0
- package/src/utils/util.ts +81 -0
- package/src/utils/value.ts +260 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
import { feature } from "@turf/helpers";
|
|
2
|
+
import { useMachine } from "@xstate/react";
|
|
3
|
+
import { Feature as GeojsonFeature, MultiPolygon, Polygon, Point, LineString } from "geojson";
|
|
4
|
+
import { cloneDeep, merge } from "lodash-es";
|
|
5
|
+
import {
|
|
6
|
+
ForwardedRef,
|
|
7
|
+
RefObject,
|
|
8
|
+
useCallback,
|
|
9
|
+
useEffect,
|
|
10
|
+
useImperativeHandle,
|
|
11
|
+
useRef,
|
|
12
|
+
useState,
|
|
13
|
+
} from "react";
|
|
14
|
+
import invariant from "tiny-invariant";
|
|
15
|
+
import { v4 as uuidv4 } from "uuid";
|
|
16
|
+
|
|
17
|
+
import { InteractionModeType } from "../../Visualizer/interactionMode";
|
|
18
|
+
import { LayerSimple, LazyLayer } from "../Layers";
|
|
19
|
+
import {
|
|
20
|
+
Feature,
|
|
21
|
+
EngineRef,
|
|
22
|
+
LayersRef,
|
|
23
|
+
MouseEventCallback,
|
|
24
|
+
MouseEventProps,
|
|
25
|
+
SketchRef,
|
|
26
|
+
} from "../types";
|
|
27
|
+
|
|
28
|
+
import { PRESET_APPEARANCE } from "./preset";
|
|
29
|
+
import { Position3d, createSketchMachine } from "./sketchMachine";
|
|
30
|
+
import {
|
|
31
|
+
GeometryOptionsXYZ,
|
|
32
|
+
SketchType,
|
|
33
|
+
SketchFeature,
|
|
34
|
+
SketchAppearance,
|
|
35
|
+
SketchEventProps,
|
|
36
|
+
} from "./types";
|
|
37
|
+
import { useWindowEvent } from "./utils";
|
|
38
|
+
|
|
39
|
+
import { OnLayerSelectType } from ".";
|
|
40
|
+
|
|
41
|
+
export type SketchFeatureCallback = (
|
|
42
|
+
feature: GeojsonFeature<Polygon | MultiPolygon | Point | LineString> | null,
|
|
43
|
+
) => void;
|
|
44
|
+
|
|
45
|
+
type Props = {
|
|
46
|
+
ref: ForwardedRef<SketchRef>;
|
|
47
|
+
layersRef: RefObject<LayersRef>;
|
|
48
|
+
engineRef: RefObject<EngineRef>;
|
|
49
|
+
interactionMode: InteractionModeType;
|
|
50
|
+
selectedFeature?: Feature;
|
|
51
|
+
overrideInteractionMode?: (mode: InteractionModeType) => void;
|
|
52
|
+
onSketchTypeChange?: (type: SketchType | undefined, from?: "editor" | "plugin") => void;
|
|
53
|
+
onSketchFeatureCreate?: (feature: SketchFeature | null) => void;
|
|
54
|
+
onSketchPluginFeatureCreate?: (props: SketchEventProps) => void;
|
|
55
|
+
onLayerSelect?: OnLayerSelectType;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const PLUGIN_LAYER_ID_LENGTH = 36;
|
|
59
|
+
|
|
60
|
+
const sketchMachine = createSketchMachine();
|
|
61
|
+
|
|
62
|
+
export default function useHooks({
|
|
63
|
+
ref,
|
|
64
|
+
engineRef,
|
|
65
|
+
layersRef,
|
|
66
|
+
selectedFeature,
|
|
67
|
+
overrideInteractionMode,
|
|
68
|
+
onSketchTypeChange,
|
|
69
|
+
onSketchFeatureCreate,
|
|
70
|
+
onSketchPluginFeatureCreate,
|
|
71
|
+
onLayerSelect,
|
|
72
|
+
}: Props) {
|
|
73
|
+
const [state, send] = useMachine(sketchMachine);
|
|
74
|
+
const [type, updateType] = useState<SketchType | undefined>();
|
|
75
|
+
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
|
+
const [disableInteraction, setDisableInteraction] = useState(false);
|
|
80
|
+
const [defaultAppearance, updateDefaultAppearance] = useState<SketchAppearance | undefined>(
|
|
81
|
+
PRESET_APPEARANCE,
|
|
82
|
+
);
|
|
83
|
+
const createDataOnlyForPluginEnabledRef = useRef(false);
|
|
84
|
+
const allowRightClickToAbortEnabledRef = useRef(true);
|
|
85
|
+
const allowAutoResetInteractionModeRef = useRef(true);
|
|
86
|
+
|
|
87
|
+
const [geometryOptions, setGeometryOptions] = useState<GeometryOptionsXYZ | null>(null);
|
|
88
|
+
const [extrudedHeight, setExtrudedHeight] = useState(0);
|
|
89
|
+
const markerGeometryRef = useRef<GeometryOptionsXYZ | null>(null);
|
|
90
|
+
const pointerLocationRef = useRef<[lng: number, lat: number, height: number]>();
|
|
91
|
+
|
|
92
|
+
const setType = useCallback((type: SketchType | undefined, from?: "editor" | "plugin") => {
|
|
93
|
+
updateType(type);
|
|
94
|
+
updateFrom(from ?? "editor");
|
|
95
|
+
}, []);
|
|
96
|
+
|
|
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
|
+
const createFeature = useCallback(() => {
|
|
126
|
+
const geoOptions = type === "marker" ? markerGeometryRef.current : geometryOptions;
|
|
127
|
+
if (geoOptions == null) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const geometry = engineRef.current?.createGeometry(geoOptions);
|
|
131
|
+
if (geometry == null || (type !== "polyline" && geometry.type === "LineString")) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
return feature(geometry, {
|
|
135
|
+
id: uuidv4(),
|
|
136
|
+
type: geoOptions.type,
|
|
137
|
+
positions: geoOptions.controlPoints,
|
|
138
|
+
extrudedHeight,
|
|
139
|
+
});
|
|
140
|
+
}, [extrudedHeight, geometryOptions, markerGeometryRef, type, engineRef]);
|
|
141
|
+
|
|
142
|
+
const updateGeometryOptions = useCallback(
|
|
143
|
+
(controlPoint?: Position3d) => {
|
|
144
|
+
setExtrudedHeight(0);
|
|
145
|
+
if (state.context.type == null || state.context.controlPoints == null) {
|
|
146
|
+
setGeometryOptions(null);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
setGeometryOptions({
|
|
150
|
+
type: state.context.type,
|
|
151
|
+
controlPoints:
|
|
152
|
+
controlPoint != null
|
|
153
|
+
? [...state.context.controlPoints, controlPoint]
|
|
154
|
+
: state.context.controlPoints,
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
[state, setGeometryOptions, setExtrudedHeight],
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
const pluginSketchLayerCreate = useCallback(
|
|
161
|
+
(feature: SketchFeature) => {
|
|
162
|
+
const newLayer = layersRef.current?.add({
|
|
163
|
+
type: "simple",
|
|
164
|
+
data: {
|
|
165
|
+
type: "geojson",
|
|
166
|
+
isSketchLayer: true,
|
|
167
|
+
value: {
|
|
168
|
+
type: "FeatureCollection",
|
|
169
|
+
features: [{ ...feature, id: feature.properties.id }],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
...defaultAppearance,
|
|
173
|
+
});
|
|
174
|
+
return { layerId: newLayer?.id, featureId: feature.properties.id };
|
|
175
|
+
},
|
|
176
|
+
[layersRef, defaultAppearance],
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const pluginSketchLayerFeatureAdd = useCallback(
|
|
180
|
+
(layer: LazyLayer, feature: SketchFeature) => {
|
|
181
|
+
if (layer.type !== "simple") return {};
|
|
182
|
+
layersRef.current?.override(layer.id, {
|
|
183
|
+
data: {
|
|
184
|
+
...layer.data,
|
|
185
|
+
type: "geojson",
|
|
186
|
+
value: {
|
|
187
|
+
type: "FeatureCollection",
|
|
188
|
+
features: [
|
|
189
|
+
...((layer.computed?.layer as LayerSimple)?.data?.value?.features ?? []),
|
|
190
|
+
{ ...feature, id: feature.properties.id },
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
return { layerId: layer.id, featureId: feature.properties.id };
|
|
196
|
+
},
|
|
197
|
+
[layersRef],
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
const pluginSketchLayerFeatureRemove = useCallback(
|
|
201
|
+
(layer: LazyLayer, featureId: string) => {
|
|
202
|
+
if (layer.type !== "simple" || layer.computed?.layer.type !== "simple") return;
|
|
203
|
+
layersRef.current?.override(layer.id, {
|
|
204
|
+
data: {
|
|
205
|
+
...layer.data,
|
|
206
|
+
type: "geojson",
|
|
207
|
+
value: {
|
|
208
|
+
type: "FeatureCollection",
|
|
209
|
+
features: [
|
|
210
|
+
...(layer.computed?.layer?.data?.value?.features ?? []).filter(
|
|
211
|
+
(feature: GeojsonFeature) => feature.id !== featureId,
|
|
212
|
+
),
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
[layersRef],
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
const handleFeatureCreate = useCallback(
|
|
222
|
+
(feature: SketchFeature) => {
|
|
223
|
+
updateType(undefined);
|
|
224
|
+
if (from === "editor") {
|
|
225
|
+
onSketchFeatureCreate?.(feature);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (!createDataOnlyForPluginEnabledRef.current) {
|
|
230
|
+
const selectedLayer = layersRef.current?.selectedLayer();
|
|
231
|
+
const { layerId, featureId } =
|
|
232
|
+
selectedLayer?.id?.length !== PLUGIN_LAYER_ID_LENGTH ||
|
|
233
|
+
selectedLayer.type !== "simple" ||
|
|
234
|
+
selectedLayer.computed?.layer.type !== "simple"
|
|
235
|
+
? pluginSketchLayerCreate(feature)
|
|
236
|
+
: pluginSketchLayerFeatureAdd(selectedLayer, feature);
|
|
237
|
+
|
|
238
|
+
if (layerId && featureId) {
|
|
239
|
+
requestAnimationFrame(() => {
|
|
240
|
+
onLayerSelect?.(
|
|
241
|
+
layerId,
|
|
242
|
+
featureId,
|
|
243
|
+
layerId
|
|
244
|
+
? () =>
|
|
245
|
+
new Promise(resolve => {
|
|
246
|
+
// Wait until computed feature is ready
|
|
247
|
+
queueMicrotask(() => {
|
|
248
|
+
resolve(layersRef.current?.findById?.(layerId)?.computed);
|
|
249
|
+
});
|
|
250
|
+
})
|
|
251
|
+
: undefined,
|
|
252
|
+
undefined,
|
|
253
|
+
undefined,
|
|
254
|
+
);
|
|
255
|
+
});
|
|
256
|
+
onSketchPluginFeatureCreate?.({ layerId, featureId, feature });
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
onSketchPluginFeatureCreate?.({ feature });
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
[
|
|
263
|
+
layersRef,
|
|
264
|
+
from,
|
|
265
|
+
pluginSketchLayerCreate,
|
|
266
|
+
pluginSketchLayerFeatureAdd,
|
|
267
|
+
onSketchFeatureCreate,
|
|
268
|
+
onSketchPluginFeatureCreate,
|
|
269
|
+
onLayerSelect,
|
|
270
|
+
],
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
const handleLeftDown = useCallback(
|
|
274
|
+
(props: MouseEventProps) => {
|
|
275
|
+
if (
|
|
276
|
+
disableInteraction ||
|
|
277
|
+
!type ||
|
|
278
|
+
props.lng === undefined ||
|
|
279
|
+
props.lat === undefined ||
|
|
280
|
+
props.height === undefined ||
|
|
281
|
+
props.x === undefined ||
|
|
282
|
+
props.y === undefined
|
|
283
|
+
) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (!state.matches("idle")) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
invariant(state.context.lastControlPoint == null);
|
|
290
|
+
const controlPoint = engineRef.current?.toXYZ(props.lng, props.lat, props.height);
|
|
291
|
+
if (controlPoint == null) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
send({
|
|
296
|
+
type: {
|
|
297
|
+
marker: "MARKER" as const,
|
|
298
|
+
polyline: "POLYLINE" as const,
|
|
299
|
+
circle: "CIRCLE" as const,
|
|
300
|
+
rectangle: "RECTANGLE" as const,
|
|
301
|
+
polygon: "POLYGON" as const,
|
|
302
|
+
extrudedCircle: "EXTRUDED_CIRCLE" as const,
|
|
303
|
+
extrudedRectangle: "EXTRUDED_RECTANGLE" as const,
|
|
304
|
+
extrudedPolygon: "EXTRUDED_POLYGON" as const,
|
|
305
|
+
}[type],
|
|
306
|
+
pointerPosition: [props.x, props.y],
|
|
307
|
+
controlPoint,
|
|
308
|
+
});
|
|
309
|
+
setGeometryOptions(null);
|
|
310
|
+
markerGeometryRef.current = null;
|
|
311
|
+
},
|
|
312
|
+
[state, disableInteraction, type, engineRef, send],
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
const handleMouseMove = useCallback(
|
|
316
|
+
(props: MouseEventProps) => {
|
|
317
|
+
if (
|
|
318
|
+
disableInteraction ||
|
|
319
|
+
props.lng === undefined ||
|
|
320
|
+
props.lat === undefined ||
|
|
321
|
+
props.height === undefined ||
|
|
322
|
+
props.x === undefined ||
|
|
323
|
+
props.y === undefined ||
|
|
324
|
+
!engineRef.current
|
|
325
|
+
) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
pointerLocationRef.current = [props.lng, props.lat, props.height];
|
|
329
|
+
if (state.matches("drawing")) {
|
|
330
|
+
invariant(state.context.type != null);
|
|
331
|
+
invariant(state.context.controlPoints != null);
|
|
332
|
+
const controlPoint = engineRef.current?.toXYZ(props.lng, props.lat, props.height);
|
|
333
|
+
if (
|
|
334
|
+
controlPoint == null ||
|
|
335
|
+
hasDuplicate(engineRef.current.equalsEpsilon3d, controlPoint, state.context.controlPoints)
|
|
336
|
+
) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
updateGeometryOptions(controlPoint);
|
|
340
|
+
} else if (state.matches("extruding")) {
|
|
341
|
+
invariant(state.context.lastControlPoint != null);
|
|
342
|
+
const extrudedHeight = engineRef.current?.getExtrudedHeight(
|
|
343
|
+
state.context.lastControlPoint,
|
|
344
|
+
[props.x, props.y],
|
|
345
|
+
);
|
|
346
|
+
if (extrudedHeight != null) {
|
|
347
|
+
setExtrudedHeight(extrudedHeight);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
[disableInteraction, state, engineRef, updateGeometryOptions, setExtrudedHeight],
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
const handleLeftUp = useCallback(
|
|
355
|
+
(props: MouseEventProps) => {
|
|
356
|
+
if (
|
|
357
|
+
disableInteraction ||
|
|
358
|
+
props.lng === undefined ||
|
|
359
|
+
props.lat === undefined ||
|
|
360
|
+
props.height === undefined ||
|
|
361
|
+
props.x === undefined ||
|
|
362
|
+
props.y === undefined ||
|
|
363
|
+
!engineRef.current
|
|
364
|
+
) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (
|
|
368
|
+
state.context.controlPoints?.length === 1 &&
|
|
369
|
+
state.context.lastPointerPosition != null &&
|
|
370
|
+
state.context.type !== "marker" &&
|
|
371
|
+
engineRef.current?.equalsEpsilon2d(
|
|
372
|
+
[props.x, props.y],
|
|
373
|
+
state.context.lastPointerPosition,
|
|
374
|
+
0,
|
|
375
|
+
5,
|
|
376
|
+
)
|
|
377
|
+
) {
|
|
378
|
+
return; // Too close to the first position user clicked.
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (state.matches("drawing")) {
|
|
382
|
+
const controlPoint = engineRef.current?.toXYZ(props.lng, props.lat, props.height);
|
|
383
|
+
if (controlPoint == null) return;
|
|
384
|
+
|
|
385
|
+
if (state.context.type === "marker") {
|
|
386
|
+
markerGeometryRef.current = {
|
|
387
|
+
type: state.context.type,
|
|
388
|
+
controlPoints: [controlPoint],
|
|
389
|
+
};
|
|
390
|
+
const feature = createFeature();
|
|
391
|
+
markerGeometryRef.current = null;
|
|
392
|
+
if (feature == null) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
handleFeatureCreate(feature);
|
|
396
|
+
send({ type: "CREATE" });
|
|
397
|
+
setGeometryOptions(null);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (
|
|
401
|
+
hasDuplicate(
|
|
402
|
+
engineRef.current?.equalsEpsilon3d,
|
|
403
|
+
controlPoint,
|
|
404
|
+
state.context.controlPoints,
|
|
405
|
+
)
|
|
406
|
+
) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (
|
|
410
|
+
state.context.type === "circle" ||
|
|
411
|
+
(state.context.type === "rectangle" && state.context.controlPoints?.length === 2)
|
|
412
|
+
) {
|
|
413
|
+
const feature = createFeature();
|
|
414
|
+
if (feature == null) {
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
handleFeatureCreate(feature);
|
|
418
|
+
send({ type: "CREATE" });
|
|
419
|
+
setGeometryOptions(null);
|
|
420
|
+
return;
|
|
421
|
+
} else {
|
|
422
|
+
if (props.x === undefined || props.y === undefined) return;
|
|
423
|
+
send({
|
|
424
|
+
type: "NEXT",
|
|
425
|
+
pointerPosition: [props.x, props.y],
|
|
426
|
+
controlPoint,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
} else if (state.matches("extruding")) {
|
|
430
|
+
const feature = createFeature();
|
|
431
|
+
if (feature == null) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
handleFeatureCreate(feature);
|
|
435
|
+
send({ type: "CREATE" });
|
|
436
|
+
setGeometryOptions(null);
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
[
|
|
440
|
+
disableInteraction,
|
|
441
|
+
state,
|
|
442
|
+
engineRef,
|
|
443
|
+
send,
|
|
444
|
+
setGeometryOptions,
|
|
445
|
+
createFeature,
|
|
446
|
+
handleFeatureCreate,
|
|
447
|
+
],
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
const handleDoubleClick = useCallback(
|
|
451
|
+
(props: MouseEventProps) => {
|
|
452
|
+
if (
|
|
453
|
+
disableInteraction ||
|
|
454
|
+
props.lng === undefined ||
|
|
455
|
+
props.lat === undefined ||
|
|
456
|
+
props.height === undefined ||
|
|
457
|
+
props.x === undefined ||
|
|
458
|
+
props.y === undefined
|
|
459
|
+
) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (state.matches("drawing.extrudedPolygon")) {
|
|
463
|
+
const controlPoint = engineRef.current?.toXYZ(props.lng, props.lat, props.height);
|
|
464
|
+
if (controlPoint == null) return;
|
|
465
|
+
send({
|
|
466
|
+
type: "EXTRUDE",
|
|
467
|
+
pointerPosition: [props.x, props.y],
|
|
468
|
+
controlPoint,
|
|
469
|
+
});
|
|
470
|
+
} else if (state.matches("drawing.polyline") || state.matches("drawing.polygon")) {
|
|
471
|
+
const feature = createFeature();
|
|
472
|
+
if (feature == null) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
handleFeatureCreate(feature);
|
|
476
|
+
send({ type: "CREATE" });
|
|
477
|
+
setGeometryOptions(null);
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
[disableInteraction, state, engineRef, send, handleFeatureCreate, createFeature],
|
|
481
|
+
);
|
|
482
|
+
|
|
483
|
+
const handleRightClick = useCallback(() => {
|
|
484
|
+
if (!allowRightClickToAbortEnabledRef.current) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
if (type !== undefined) {
|
|
488
|
+
updateType(undefined);
|
|
489
|
+
}
|
|
490
|
+
if (state.matches("idle")) return;
|
|
491
|
+
send({ type: "ABORT" });
|
|
492
|
+
updateGeometryOptions(undefined);
|
|
493
|
+
}, [type, state, send, updateGeometryOptions]);
|
|
494
|
+
|
|
495
|
+
const mouseDownEventRef = useRef<MouseEventCallback>(handleLeftDown);
|
|
496
|
+
mouseDownEventRef.current = handleLeftDown;
|
|
497
|
+
const mouseMoveEventRef = useRef<MouseEventCallback>(handleMouseMove);
|
|
498
|
+
mouseMoveEventRef.current = handleMouseMove;
|
|
499
|
+
const mouseUpEventRef = useRef<MouseEventCallback>(handleLeftUp);
|
|
500
|
+
mouseUpEventRef.current = handleLeftUp;
|
|
501
|
+
const mouseDoubleClickEventRef = useRef<MouseEventCallback>(handleDoubleClick);
|
|
502
|
+
mouseDoubleClickEventRef.current = handleDoubleClick;
|
|
503
|
+
const mouseRightClickEventRef = useRef<() => void>(handleRightClick);
|
|
504
|
+
mouseRightClickEventRef.current = handleRightClick;
|
|
505
|
+
|
|
506
|
+
const onMouseDown = useCallback(
|
|
507
|
+
(props: MouseEventProps) => {
|
|
508
|
+
mouseDownEventRef.current?.(props);
|
|
509
|
+
},
|
|
510
|
+
[mouseDownEventRef],
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
const onMouseMove = useCallback(
|
|
514
|
+
(props: MouseEventProps) => {
|
|
515
|
+
mouseMoveEventRef.current?.(props);
|
|
516
|
+
},
|
|
517
|
+
[mouseMoveEventRef],
|
|
518
|
+
);
|
|
519
|
+
|
|
520
|
+
const onMouseUp = useCallback(
|
|
521
|
+
(props: MouseEventProps) => {
|
|
522
|
+
mouseUpEventRef.current?.(props);
|
|
523
|
+
},
|
|
524
|
+
[mouseUpEventRef],
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
const onMouseDoubleClick = useCallback(
|
|
528
|
+
(props: MouseEventProps) => {
|
|
529
|
+
mouseDoubleClickEventRef.current?.(props);
|
|
530
|
+
},
|
|
531
|
+
[mouseDoubleClickEventRef],
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
const onMouseRightClick = useCallback(() => {
|
|
535
|
+
mouseRightClickEventRef.current?.();
|
|
536
|
+
}, [mouseRightClickEventRef]);
|
|
537
|
+
|
|
538
|
+
useEffect(() => {
|
|
539
|
+
engineRef.current?.onMouseDown(onMouseDown);
|
|
540
|
+
engineRef.current?.onMouseMove(onMouseMove);
|
|
541
|
+
engineRef.current?.onMouseUp(onMouseUp);
|
|
542
|
+
engineRef.current?.onDoubleClick(onMouseDoubleClick);
|
|
543
|
+
engineRef.current?.onRightClick(onMouseRightClick);
|
|
544
|
+
}, [engineRef, onMouseDown, onMouseMove, onMouseUp, onMouseDoubleClick, onMouseRightClick]);
|
|
545
|
+
|
|
546
|
+
useWindowEvent("keydown", event => {
|
|
547
|
+
if (type === undefined) return;
|
|
548
|
+
if (event.code === "Space") {
|
|
549
|
+
setDisableInteraction(true);
|
|
550
|
+
overrideInteractionMode?.("move");
|
|
551
|
+
} else {
|
|
552
|
+
if (disableInteraction) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (event.key === "Escape") {
|
|
556
|
+
send({ type: "CANCEL" });
|
|
557
|
+
const controlPoint =
|
|
558
|
+
pointerLocationRef.current != null
|
|
559
|
+
? engineRef.current?.toXYZ(...pointerLocationRef.current)
|
|
560
|
+
: undefined;
|
|
561
|
+
updateGeometryOptions(controlPoint);
|
|
562
|
+
} else if (event.key === "Delete" && state.matches("idle") && selectedFeature?.id) {
|
|
563
|
+
const selectedLayer = layersRef.current?.selectedLayer();
|
|
564
|
+
if (selectedLayer?.id?.length === PLUGIN_LAYER_ID_LENGTH) {
|
|
565
|
+
pluginSketchLayerFeatureRemove(selectedLayer, selectedFeature.id);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
useWindowEvent("keyup", event => {
|
|
572
|
+
if (type === undefined) return;
|
|
573
|
+
if (event.code === "Space") {
|
|
574
|
+
overrideInteractionMode?.("sketch");
|
|
575
|
+
setDisableInteraction(false);
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
useEffect(() => {
|
|
580
|
+
if (type === undefined) {
|
|
581
|
+
send({ type: "ABORT" });
|
|
582
|
+
updateGeometryOptions(undefined);
|
|
583
|
+
}
|
|
584
|
+
}, [type, send, updateGeometryOptions]);
|
|
585
|
+
|
|
586
|
+
useEffect(() => {
|
|
587
|
+
if (type) {
|
|
588
|
+
overrideInteractionMode?.("sketch");
|
|
589
|
+
} else if (allowAutoResetInteractionModeRef.current) {
|
|
590
|
+
overrideInteractionMode?.("default");
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
onSketchTypeChange?.(type, from);
|
|
594
|
+
}, [type, from, overrideInteractionMode, onSketchTypeChange]);
|
|
595
|
+
|
|
596
|
+
useImperativeHandle(
|
|
597
|
+
ref,
|
|
598
|
+
() => ({
|
|
599
|
+
setType,
|
|
600
|
+
setColor,
|
|
601
|
+
setDefaultAppearance,
|
|
602
|
+
createDataOnly,
|
|
603
|
+
disableShadow: setDisableShadow,
|
|
604
|
+
enableRelativeHeight: setEnableRelativeHeight,
|
|
605
|
+
allowRightClickToAbort,
|
|
606
|
+
allowAutoResetInteractionMode,
|
|
607
|
+
}),
|
|
608
|
+
[
|
|
609
|
+
setType,
|
|
610
|
+
setColor,
|
|
611
|
+
setDisableShadow,
|
|
612
|
+
setEnableRelativeHeight,
|
|
613
|
+
setDefaultAppearance,
|
|
614
|
+
createDataOnly,
|
|
615
|
+
allowRightClickToAbort,
|
|
616
|
+
allowAutoResetInteractionMode,
|
|
617
|
+
],
|
|
618
|
+
);
|
|
619
|
+
|
|
620
|
+
return {
|
|
621
|
+
state,
|
|
622
|
+
extrudedHeight,
|
|
623
|
+
geometryOptions,
|
|
624
|
+
color,
|
|
625
|
+
disableShadow,
|
|
626
|
+
enableRelativeHeight,
|
|
627
|
+
} as any;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function hasDuplicate(
|
|
631
|
+
equalFunction: (
|
|
632
|
+
point1: Position3d,
|
|
633
|
+
point2: Position3d,
|
|
634
|
+
relativeEpsilon: number | undefined,
|
|
635
|
+
absoluteEpsilon: number | undefined,
|
|
636
|
+
) => boolean,
|
|
637
|
+
controlPoint: Position3d,
|
|
638
|
+
controlPoints?: readonly Position3d[],
|
|
639
|
+
): boolean {
|
|
640
|
+
return controlPoints?.some(another => equalFunction(controlPoint, another, 0, 1e-7)) === true;
|
|
641
|
+
}
|