@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,1004 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Color,
|
|
3
|
+
Entity,
|
|
4
|
+
Cesium3DTileFeature,
|
|
5
|
+
Cartesian3,
|
|
6
|
+
Ion,
|
|
7
|
+
Cesium3DTileset,
|
|
8
|
+
JulianDate,
|
|
9
|
+
Cesium3DTilePointFeature,
|
|
10
|
+
Model,
|
|
11
|
+
Cartographic,
|
|
12
|
+
SunLight,
|
|
13
|
+
DirectionalLight,
|
|
14
|
+
Viewer as CesiumViewer,
|
|
15
|
+
Primitive,
|
|
16
|
+
GroundPrimitive,
|
|
17
|
+
ShadowMap,
|
|
18
|
+
ImageryLayer,
|
|
19
|
+
Scene,
|
|
20
|
+
Math as CesiumMath,
|
|
21
|
+
} from "cesium";
|
|
22
|
+
import CesiumDnD, { Context } from "cesium-dnd";
|
|
23
|
+
import { isEqual } from "lodash-es";
|
|
24
|
+
import { RefObject, useCallback, useEffect, useMemo, useRef } from "react";
|
|
25
|
+
import type { CesiumComponentRef, CesiumMovementEvent, RootEventTarget } from "resium";
|
|
26
|
+
import { useCustomCompareCallback } from "use-custom-compare";
|
|
27
|
+
|
|
28
|
+
import type {
|
|
29
|
+
Camera,
|
|
30
|
+
LatLng,
|
|
31
|
+
LayerSelectionReason,
|
|
32
|
+
EngineRef,
|
|
33
|
+
SceneProperty,
|
|
34
|
+
MouseEvents,
|
|
35
|
+
LayerEditEvent,
|
|
36
|
+
LayerVisibilityEvent,
|
|
37
|
+
} from "..";
|
|
38
|
+
import { e2eAccessToken, setE2ECesiumViewer } from "../../e2eConfig";
|
|
39
|
+
import { ComputedFeature, DataType, SelectedFeatureInfo } from "../../mantle";
|
|
40
|
+
import {
|
|
41
|
+
LayerLoadEvent,
|
|
42
|
+
LayerSelectWithRectEnd,
|
|
43
|
+
LayerSelectWithRectMove,
|
|
44
|
+
LayerSelectWithRectStart,
|
|
45
|
+
LayersRef,
|
|
46
|
+
RequestingRenderMode,
|
|
47
|
+
} from "../../Map";
|
|
48
|
+
import { FORCE_REQUEST_RENDER, NO_REQUEST_RENDER, REQUEST_RENDER_ONCE } from "../../Map/hooks";
|
|
49
|
+
import { TimelineManagerRef } from "../../Map/useTimelineManager";
|
|
50
|
+
import { FEATURE_FLAGS } from "../../Visualizer/featureFlags";
|
|
51
|
+
|
|
52
|
+
import { useCameraLimiter } from "./cameraLimiter";
|
|
53
|
+
import { getCamera, isDraggable, isSelectable } from "./common";
|
|
54
|
+
import { getTag, type Context as FeatureContext } from "./Feature";
|
|
55
|
+
import { arrayToCartecian3 } from "./helpers/sphericalHaromic";
|
|
56
|
+
import { useLayerSelectWithRect } from "./hooks/useLayerSelectWithRect";
|
|
57
|
+
import { InternalCesium3DTileFeature } from "./types";
|
|
58
|
+
import useEngineRef from "./useEngineRef";
|
|
59
|
+
import { useOverrideGlobeShader } from "./useOverrideGlobeShader";
|
|
60
|
+
import { makeMouseEventProps } from "./utils/mouse";
|
|
61
|
+
import { convertCartesian3ToPosition, findEntity, getEntityContent } from "./utils/utils";
|
|
62
|
+
|
|
63
|
+
interface CustomGlobeSurface {
|
|
64
|
+
tileProvider: {
|
|
65
|
+
_debug: {
|
|
66
|
+
wireframe: boolean;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type CesiumMouseEvent = (movement: CesiumMovementEvent, target: RootEventTarget) => void;
|
|
72
|
+
type CesiumMouseWheelEvent = (delta: number) => void;
|
|
73
|
+
|
|
74
|
+
export default ({
|
|
75
|
+
ref,
|
|
76
|
+
property,
|
|
77
|
+
camera,
|
|
78
|
+
selectedLayerId,
|
|
79
|
+
selectionReason,
|
|
80
|
+
isLayerDraggable,
|
|
81
|
+
isLayerDragging,
|
|
82
|
+
meta,
|
|
83
|
+
layersRef,
|
|
84
|
+
featureFlags,
|
|
85
|
+
requestingRenderMode,
|
|
86
|
+
shouldRender,
|
|
87
|
+
timelineManagerRef,
|
|
88
|
+
cameraForceHorizontalRoll = false,
|
|
89
|
+
onLayerSelect,
|
|
90
|
+
onCameraChange,
|
|
91
|
+
onLayerDrag,
|
|
92
|
+
onLayerDrop,
|
|
93
|
+
onLayerEdit,
|
|
94
|
+
onLayerSelectWithRectStart,
|
|
95
|
+
onLayerSelectWithRectMove,
|
|
96
|
+
onLayerSelectWithRectEnd,
|
|
97
|
+
onMount,
|
|
98
|
+
onLayerVisibility,
|
|
99
|
+
onLayerLoad,
|
|
100
|
+
}: {
|
|
101
|
+
ref: React.ForwardedRef<EngineRef>;
|
|
102
|
+
property?: SceneProperty;
|
|
103
|
+
camera?: Camera;
|
|
104
|
+
selectedLayerId?: {
|
|
105
|
+
layerId?: string;
|
|
106
|
+
featureId?: string;
|
|
107
|
+
};
|
|
108
|
+
layersRef?: RefObject<LayersRef>;
|
|
109
|
+
selectionReason?: LayerSelectionReason;
|
|
110
|
+
isLayerDraggable?: boolean;
|
|
111
|
+
isLayerDragging?: boolean;
|
|
112
|
+
meta?: Record<string, unknown>;
|
|
113
|
+
featureFlags: number;
|
|
114
|
+
requestingRenderMode?: React.MutableRefObject<RequestingRenderMode>;
|
|
115
|
+
shouldRender?: boolean;
|
|
116
|
+
timelineManagerRef?: TimelineManagerRef;
|
|
117
|
+
cameraForceHorizontalRoll?: boolean;
|
|
118
|
+
onLayerSelect?: (
|
|
119
|
+
layerId?: string,
|
|
120
|
+
featureId?: string,
|
|
121
|
+
options?: LayerSelectionReason,
|
|
122
|
+
info?: SelectedFeatureInfo,
|
|
123
|
+
) => void;
|
|
124
|
+
onCameraChange?: (camera: Camera) => void;
|
|
125
|
+
onLayerDrag?: (layerId: string, featureId: string | undefined, position: LatLng) => void;
|
|
126
|
+
onLayerDrop?: (
|
|
127
|
+
layerId: string,
|
|
128
|
+
featureId: string | undefined,
|
|
129
|
+
position: LatLng | undefined,
|
|
130
|
+
) => void;
|
|
131
|
+
onLayerEdit?: (e: LayerEditEvent) => void;
|
|
132
|
+
onLayerSelectWithRectStart?: (e: LayerSelectWithRectStart) => void;
|
|
133
|
+
onLayerSelectWithRectMove?: (e: LayerSelectWithRectMove) => void;
|
|
134
|
+
onLayerSelectWithRectEnd?: (e: LayerSelectWithRectEnd) => void;
|
|
135
|
+
onMount?: () => void;
|
|
136
|
+
onLayerVisibility?: (e: LayerVisibilityEvent) => void;
|
|
137
|
+
onLayerLoad?: (e: LayerLoadEvent) => void;
|
|
138
|
+
}) => {
|
|
139
|
+
const cesium = useRef<CesiumComponentRef<CesiumViewer>>(null);
|
|
140
|
+
const cesiumIonDefaultAccessToken =
|
|
141
|
+
typeof meta?.cesiumIonAccessToken === "string" && meta.cesiumIonAccessToken
|
|
142
|
+
? meta.cesiumIonAccessToken
|
|
143
|
+
: Ion.defaultAccessToken;
|
|
144
|
+
const cesiumIonAccessToken = property?.default?.ion || cesiumIonDefaultAccessToken;
|
|
145
|
+
|
|
146
|
+
// expose ref
|
|
147
|
+
const engineAPI = useEngineRef(ref, cesium);
|
|
148
|
+
|
|
149
|
+
const layerSelectWithRectEventHandlers = useLayerSelectWithRect({
|
|
150
|
+
cesium,
|
|
151
|
+
engineAPI,
|
|
152
|
+
onLayerSelectWithRectStart,
|
|
153
|
+
onLayerSelectWithRectMove,
|
|
154
|
+
onLayerSelectWithRectEnd,
|
|
155
|
+
featureFlags,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const backgroundColor = useMemo(
|
|
159
|
+
() =>
|
|
160
|
+
property?.default?.bgcolor ? Color.fromCssColorString(property.default.bgcolor) : undefined,
|
|
161
|
+
[property?.default?.bgcolor],
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
const light = useMemo(() => {
|
|
165
|
+
let light;
|
|
166
|
+
if (property?.light?.lightType === "sunLight") {
|
|
167
|
+
light = new SunLight({
|
|
168
|
+
color: property.light?.lightColor
|
|
169
|
+
? Color.fromCssColorString(property.light.lightColor)
|
|
170
|
+
: undefined,
|
|
171
|
+
intensity: property.light?.lightIntensity,
|
|
172
|
+
});
|
|
173
|
+
} else if (property?.light?.lightType === "directionalLight") {
|
|
174
|
+
light = new DirectionalLight({
|
|
175
|
+
direction: new Cartesian3(
|
|
176
|
+
property?.light?.lightDirectionX ?? 1,
|
|
177
|
+
property?.light?.lightDirectionY ?? 0,
|
|
178
|
+
property?.light?.lightDirectionZ ?? 0,
|
|
179
|
+
),
|
|
180
|
+
color: property.light?.lightColor
|
|
181
|
+
? Color.fromCssColorString(property.light.lightColor)
|
|
182
|
+
: undefined,
|
|
183
|
+
intensity: property.light?.lightIntensity,
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
light = cesium.current?.cesiumElement?.scene.light;
|
|
187
|
+
if (light) {
|
|
188
|
+
light.color = property?.light?.lightColor
|
|
189
|
+
? Color.fromCssColorString(property.light.lightColor)
|
|
190
|
+
: light.color;
|
|
191
|
+
light.intensity = property?.light?.lightIntensity
|
|
192
|
+
? property.light.lightIntensity
|
|
193
|
+
: light.intensity;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return light;
|
|
197
|
+
}, [
|
|
198
|
+
property?.light?.lightType,
|
|
199
|
+
property?.light?.lightColor,
|
|
200
|
+
property?.light?.lightDirectionX,
|
|
201
|
+
property?.light?.lightDirectionY,
|
|
202
|
+
property?.light?.lightDirectionZ,
|
|
203
|
+
property?.light?.lightIntensity,
|
|
204
|
+
]);
|
|
205
|
+
|
|
206
|
+
// shadow map
|
|
207
|
+
type ShadowMapBias = {
|
|
208
|
+
polygonOffsetFactor?: number;
|
|
209
|
+
polygonOffsetUnits?: number;
|
|
210
|
+
normalOffsetScale?: number;
|
|
211
|
+
normalShading?: boolean;
|
|
212
|
+
normalShadingSmooth?: number;
|
|
213
|
+
depthBias?: number;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
const shadowMap = cesium?.current?.cesiumElement?.shadowMap as
|
|
218
|
+
| (ShadowMap & {
|
|
219
|
+
_terrainBias?: ShadowMapBias;
|
|
220
|
+
_pointBias?: ShadowMapBias;
|
|
221
|
+
_primitiveBias?: ShadowMapBias;
|
|
222
|
+
})
|
|
223
|
+
| undefined;
|
|
224
|
+
if (!shadowMap) return;
|
|
225
|
+
shadowMap.softShadows = property?.atmosphere?.softShadow ?? false;
|
|
226
|
+
shadowMap.darkness = property?.atmosphere?.shadowDarkness ?? 0.3;
|
|
227
|
+
shadowMap.size = property?.atmosphere?.shadowResolution ?? 2048;
|
|
228
|
+
shadowMap.fadingEnabled = true;
|
|
229
|
+
shadowMap.maximumDistance = property?.atmosphere?.shadowMaximumDistance ?? 5000;
|
|
230
|
+
shadowMap.normalOffset = true;
|
|
231
|
+
|
|
232
|
+
// bias
|
|
233
|
+
const defaultTerrainBias: ShadowMapBias = {
|
|
234
|
+
polygonOffsetFactor: 1.1,
|
|
235
|
+
polygonOffsetUnits: 4.0,
|
|
236
|
+
normalOffsetScale: 0.5,
|
|
237
|
+
normalShading: true,
|
|
238
|
+
normalShadingSmooth: 0.3,
|
|
239
|
+
depthBias: 0.0001,
|
|
240
|
+
};
|
|
241
|
+
const defaultPrimitiveBias: ShadowMapBias = {
|
|
242
|
+
polygonOffsetFactor: 1.1,
|
|
243
|
+
polygonOffsetUnits: 4.0,
|
|
244
|
+
normalOffsetScale: 0.1 * 100,
|
|
245
|
+
normalShading: true,
|
|
246
|
+
normalShadingSmooth: 0.05,
|
|
247
|
+
depthBias: 0.00002 * 10,
|
|
248
|
+
};
|
|
249
|
+
const defaultPointBias: ShadowMapBias = {
|
|
250
|
+
polygonOffsetFactor: 1.1,
|
|
251
|
+
polygonOffsetUnits: 4.0,
|
|
252
|
+
normalOffsetScale: 0.0,
|
|
253
|
+
normalShading: true,
|
|
254
|
+
normalShadingSmooth: 0.1,
|
|
255
|
+
depthBias: 0.0005,
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
if (!shadowMap._terrainBias) {
|
|
259
|
+
if (import.meta.env.DEV) {
|
|
260
|
+
throw new Error("`shadowMap._terrainBias` could not found");
|
|
261
|
+
}
|
|
262
|
+
} else {
|
|
263
|
+
Object.assign(shadowMap._terrainBias, defaultTerrainBias);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (!shadowMap._primitiveBias) {
|
|
267
|
+
if (import.meta.env.DEV) {
|
|
268
|
+
throw new Error("`shadowMap._primitiveBias` could not found");
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
271
|
+
Object.assign(shadowMap._primitiveBias, defaultPrimitiveBias);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (!shadowMap._pointBias) {
|
|
275
|
+
if (import.meta.env.DEV) {
|
|
276
|
+
throw new Error("`shadowMap._pointBias` could not found");
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
Object.assign(shadowMap._pointBias, defaultPointBias);
|
|
280
|
+
}
|
|
281
|
+
}, [
|
|
282
|
+
property?.atmosphere?.softShadow,
|
|
283
|
+
property?.atmosphere?.shadowDarkness,
|
|
284
|
+
property?.atmosphere?.shadowResolution,
|
|
285
|
+
property?.atmosphere?.shadowMaximumDistance,
|
|
286
|
+
]);
|
|
287
|
+
|
|
288
|
+
useEffect(() => {
|
|
289
|
+
engineAPI.changeSceneMode(property?.default?.sceneMode, 0);
|
|
290
|
+
}, [property?.default?.sceneMode, engineAPI]);
|
|
291
|
+
|
|
292
|
+
// move to initial position at startup
|
|
293
|
+
const initialCameraFlight = useRef(false);
|
|
294
|
+
|
|
295
|
+
const handleMount = useCustomCompareCallback(
|
|
296
|
+
() => {
|
|
297
|
+
if (initialCameraFlight.current) return;
|
|
298
|
+
initialCameraFlight.current = true;
|
|
299
|
+
if (
|
|
300
|
+
property?.cameraLimiter?.cameraLimitterEnabled &&
|
|
301
|
+
property?.cameraLimiter?.cameraLimitterTargetArea
|
|
302
|
+
) {
|
|
303
|
+
engineAPI.flyTo(property?.cameraLimiter?.cameraLimitterTargetArea, { duration: 0 });
|
|
304
|
+
} else if (property?.default?.camera ?? property?.camera?.camera) {
|
|
305
|
+
const camera = property?.default?.camera ?? property?.camera?.camera;
|
|
306
|
+
engineAPI.flyTo(camera as Camera, { duration: 0 });
|
|
307
|
+
}
|
|
308
|
+
const camera = getCamera(cesium?.current?.cesiumElement);
|
|
309
|
+
if (camera) {
|
|
310
|
+
onCameraChange?.(camera);
|
|
311
|
+
}
|
|
312
|
+
onMount?.();
|
|
313
|
+
},
|
|
314
|
+
[
|
|
315
|
+
engineAPI,
|
|
316
|
+
property?.default?.camera,
|
|
317
|
+
property?.camera?.camera,
|
|
318
|
+
property?.cameraLimiter?.cameraLimitterEnabled,
|
|
319
|
+
onCameraChange,
|
|
320
|
+
onMount,
|
|
321
|
+
],
|
|
322
|
+
(prevDeps, nextDeps) =>
|
|
323
|
+
prevDeps[0] === nextDeps[0] &&
|
|
324
|
+
isEqual(prevDeps[1], nextDeps[1]) &&
|
|
325
|
+
isEqual(prevDeps[2], nextDeps[2]) &&
|
|
326
|
+
prevDeps[3] === nextDeps[3] &&
|
|
327
|
+
prevDeps[4] === nextDeps[4] &&
|
|
328
|
+
prevDeps[5] === nextDeps[5],
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
const handleUnmount = useCallback(() => {
|
|
332
|
+
initialCameraFlight.current = false;
|
|
333
|
+
}, []);
|
|
334
|
+
|
|
335
|
+
// cache the camera data emitted from viewer camera change
|
|
336
|
+
const emittedCamera = useRef<Camera[]>([]);
|
|
337
|
+
const updateCamera = useCallback(() => {
|
|
338
|
+
const viewer = cesium?.current?.cesiumElement;
|
|
339
|
+
if (!viewer || viewer.isDestroyed() || !onCameraChange) return;
|
|
340
|
+
|
|
341
|
+
const c = getCamera(viewer);
|
|
342
|
+
if (c && !isEqual(c, camera)) {
|
|
343
|
+
emittedCamera.current.push(c);
|
|
344
|
+
// The state change is not sync now. This number is how many state updates can actually happen to be merged within one re-render.
|
|
345
|
+
if (emittedCamera.current.length > 10) {
|
|
346
|
+
emittedCamera.current.shift();
|
|
347
|
+
}
|
|
348
|
+
onCameraChange?.(c);
|
|
349
|
+
}
|
|
350
|
+
}, [camera, onCameraChange]);
|
|
351
|
+
|
|
352
|
+
const handleCameraChange = useCallback(() => {
|
|
353
|
+
updateCamera();
|
|
354
|
+
}, [updateCamera]);
|
|
355
|
+
|
|
356
|
+
const handleCameraMoveEnd = useCallback(() => {
|
|
357
|
+
updateCamera();
|
|
358
|
+
}, [updateCamera]);
|
|
359
|
+
|
|
360
|
+
useEffect(() => {
|
|
361
|
+
if (camera && !emittedCamera.current.includes(camera)) {
|
|
362
|
+
engineAPI.flyTo(camera, { duration: 0 });
|
|
363
|
+
emittedCamera.current = [];
|
|
364
|
+
}
|
|
365
|
+
}, [camera, engineAPI]);
|
|
366
|
+
|
|
367
|
+
const prevSelectedEntity = useRef<
|
|
368
|
+
| Entity
|
|
369
|
+
| Cesium3DTileset
|
|
370
|
+
| InternalCesium3DTileFeature
|
|
371
|
+
| Primitive
|
|
372
|
+
| GroundPrimitive
|
|
373
|
+
| ImageryLayer
|
|
374
|
+
>();
|
|
375
|
+
// manage layer selection
|
|
376
|
+
useEffect(() => {
|
|
377
|
+
const viewer = cesium.current?.cesiumElement;
|
|
378
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
379
|
+
|
|
380
|
+
const prevTag = getTag(prevSelectedEntity.current);
|
|
381
|
+
if (
|
|
382
|
+
(!prevTag?.featureId &&
|
|
383
|
+
prevTag?.layerId &&
|
|
384
|
+
selectedLayerId?.layerId &&
|
|
385
|
+
prevTag?.layerId === selectedLayerId.layerId) ||
|
|
386
|
+
(prevTag?.featureId &&
|
|
387
|
+
selectedLayerId?.featureId &&
|
|
388
|
+
prevTag?.featureId === selectedLayerId.featureId)
|
|
389
|
+
)
|
|
390
|
+
return;
|
|
391
|
+
|
|
392
|
+
const entity =
|
|
393
|
+
findEntity(viewer, undefined, selectedLayerId?.featureId) ||
|
|
394
|
+
findEntity(viewer, selectedLayerId?.layerId);
|
|
395
|
+
|
|
396
|
+
if (prevSelectedEntity.current === entity) return;
|
|
397
|
+
|
|
398
|
+
const tag = getTag(entity);
|
|
399
|
+
if (entity instanceof Entity && !tag?.hideIndicator) {
|
|
400
|
+
viewer.selectedEntity = entity;
|
|
401
|
+
} else {
|
|
402
|
+
viewer.selectedEntity = undefined;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
prevSelectedEntity.current = entity;
|
|
406
|
+
|
|
407
|
+
// TODO: Support layers.selectFeature API for MVT
|
|
408
|
+
if (!entity && selectedLayerId?.featureId) {
|
|
409
|
+
// Find ImageryLayerFeature
|
|
410
|
+
const ImageryLayerDataTypes: DataType[] = [];
|
|
411
|
+
const layers = layersRef?.current?.findAll(
|
|
412
|
+
layer =>
|
|
413
|
+
layer.type === "simple" &&
|
|
414
|
+
!!layer.data?.type &&
|
|
415
|
+
ImageryLayerDataTypes.includes(layer.data?.type),
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
if (layers?.length) {
|
|
419
|
+
// TODO: Get ImageryLayerFeature from `viewer.imageryLayers`.(But currently didn't find the way)
|
|
420
|
+
const [feature, layerId] =
|
|
421
|
+
((): [ComputedFeature, string] | void => {
|
|
422
|
+
for (const layer of layers) {
|
|
423
|
+
const f = layer.computed?.features.find(
|
|
424
|
+
feature => feature.id !== selectedLayerId?.featureId,
|
|
425
|
+
);
|
|
426
|
+
if (f) {
|
|
427
|
+
return [f, layer.id];
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
})() || [];
|
|
431
|
+
onLayerSelect?.(layerId, feature?.id);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (tag?.unselectable) return;
|
|
436
|
+
|
|
437
|
+
if (entity && entity instanceof Cesium3DTileFeature) {
|
|
438
|
+
const tag = getTag(entity);
|
|
439
|
+
if (tag) {
|
|
440
|
+
const content = tileProperties(entity);
|
|
441
|
+
onLayerSelect?.(
|
|
442
|
+
tag.layerId,
|
|
443
|
+
String(tag.featureId),
|
|
444
|
+
content.length
|
|
445
|
+
? {
|
|
446
|
+
defaultInfobox: {
|
|
447
|
+
title: entity.getProperty("name"),
|
|
448
|
+
content: {
|
|
449
|
+
type: "table",
|
|
450
|
+
value: content,
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
}
|
|
454
|
+
: undefined,
|
|
455
|
+
{ feature: tag.computedFeature },
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (entity) {
|
|
462
|
+
const layer = tag?.layerId
|
|
463
|
+
? layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
464
|
+
layersRef?.current?.findById(tag.layerId)
|
|
465
|
+
: undefined;
|
|
466
|
+
// Sometimes only featureId is specified, so we need to sync entity tag.
|
|
467
|
+
onLayerSelect?.(
|
|
468
|
+
tag?.layerId,
|
|
469
|
+
tag?.featureId,
|
|
470
|
+
entity instanceof Entity && (entity.description || entity.properties)
|
|
471
|
+
? {
|
|
472
|
+
defaultInfobox: {
|
|
473
|
+
title: entity.name,
|
|
474
|
+
content: getEntityContent(
|
|
475
|
+
entity,
|
|
476
|
+
cesium.current?.cesiumElement?.clock.currentTime ?? new JulianDate(),
|
|
477
|
+
tag?.layerId ? layer?.infobox?.property?.defaultContent : undefined,
|
|
478
|
+
),
|
|
479
|
+
},
|
|
480
|
+
}
|
|
481
|
+
: undefined,
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
}, [cesium, selectedLayerId, onLayerSelect, layersRef, featureFlags]);
|
|
485
|
+
|
|
486
|
+
const sphericalHarmonicCoefficients = useMemo(
|
|
487
|
+
() =>
|
|
488
|
+
property?.light?.sphericalHarmonicCoefficients
|
|
489
|
+
? arrayToCartecian3(
|
|
490
|
+
property?.light?.sphericalHarmonicCoefficients,
|
|
491
|
+
property?.light?.imageBasedLightIntensity,
|
|
492
|
+
)
|
|
493
|
+
: undefined,
|
|
494
|
+
[property?.light?.sphericalHarmonicCoefficients, property?.light?.imageBasedLightIntensity],
|
|
495
|
+
);
|
|
496
|
+
|
|
497
|
+
useOverrideGlobeShader({
|
|
498
|
+
cesium,
|
|
499
|
+
sphericalHarmonicCoefficients,
|
|
500
|
+
globeShadowDarkness: property?.atmosphere?.globeShadowDarkness,
|
|
501
|
+
globeImageBasedLighting: property?.atmosphere?.globeImageBasedLighting,
|
|
502
|
+
enableLighting: property?.atmosphere?.enable_lighting ?? property?.globeLighting?.globeLighting,
|
|
503
|
+
hasVertexNormals: property?.terrain?.terrain && property.terrain.terrainNormal,
|
|
504
|
+
terrain: property?.terrain,
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
const handleMouseEvent = useCallback(
|
|
508
|
+
(type: keyof MouseEvents, e: CesiumMovementEvent, target: RootEventTarget) => {
|
|
509
|
+
if (engineAPI.mouseEventCallbacks[type]?.length > 0) {
|
|
510
|
+
const viewer = cesium.current?.cesiumElement;
|
|
511
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
512
|
+
const props = makeMouseEventProps(viewer, e);
|
|
513
|
+
if (!props) return;
|
|
514
|
+
const layerId = getLayerId(target);
|
|
515
|
+
if (layerId) props.layerId = layerId;
|
|
516
|
+
engineAPI.mouseEventCallbacks[type].forEach(cb => cb(props));
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
[engineAPI],
|
|
520
|
+
);
|
|
521
|
+
|
|
522
|
+
const handleMouseWheel = useCallback(
|
|
523
|
+
(delta: number) => {
|
|
524
|
+
if (engineAPI.mouseEventCallbacks.wheel.length > 0) {
|
|
525
|
+
engineAPI.mouseEventCallbacks.wheel.forEach(cb => cb({ delta }));
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
[engineAPI],
|
|
529
|
+
);
|
|
530
|
+
|
|
531
|
+
const mouseEventHandles = useMemo(() => {
|
|
532
|
+
const mouseEvents: {
|
|
533
|
+
[index in keyof Omit<MouseEvents, "wheel">]: undefined | CesiumMouseEvent;
|
|
534
|
+
} & {
|
|
535
|
+
wheel: CesiumMouseWheelEvent | undefined;
|
|
536
|
+
} = {
|
|
537
|
+
click: undefined,
|
|
538
|
+
doubleclick: undefined,
|
|
539
|
+
mousedown: undefined,
|
|
540
|
+
mouseup: undefined,
|
|
541
|
+
rightclick: undefined,
|
|
542
|
+
rightdown: undefined,
|
|
543
|
+
rightup: undefined,
|
|
544
|
+
middleclick: undefined,
|
|
545
|
+
middledown: undefined,
|
|
546
|
+
middleup: undefined,
|
|
547
|
+
mousemove: undefined,
|
|
548
|
+
mouseenter: undefined,
|
|
549
|
+
mouseleave: undefined,
|
|
550
|
+
wheel: (delta: number) => {
|
|
551
|
+
handleMouseWheel(delta);
|
|
552
|
+
},
|
|
553
|
+
};
|
|
554
|
+
(Object.keys(mouseEvents) as (keyof MouseEvents)[]).forEach(type => {
|
|
555
|
+
if (type !== "wheel")
|
|
556
|
+
mouseEvents[type] = (e: CesiumMovementEvent, target: RootEventTarget) => {
|
|
557
|
+
handleMouseEvent(type as keyof MouseEvents, e, target);
|
|
558
|
+
};
|
|
559
|
+
});
|
|
560
|
+
return mouseEvents;
|
|
561
|
+
}, [handleMouseEvent, handleMouseWheel]);
|
|
562
|
+
|
|
563
|
+
const handleClick = useCallback(
|
|
564
|
+
async (e: CesiumMovementEvent, target: RootEventTarget) => {
|
|
565
|
+
mouseEventHandles.click?.(e, target);
|
|
566
|
+
|
|
567
|
+
if (!(featureFlags & FEATURE_FLAGS.SINGLE_SELECTION)) return;
|
|
568
|
+
|
|
569
|
+
// Layer selection from here
|
|
570
|
+
|
|
571
|
+
const viewer = cesium.current?.cesiumElement;
|
|
572
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
573
|
+
|
|
574
|
+
const entity =
|
|
575
|
+
findEntity(viewer, undefined, selectedLayerId?.featureId) ||
|
|
576
|
+
findEntity(viewer, selectedLayerId?.layerId);
|
|
577
|
+
|
|
578
|
+
const tag = getTag(entity);
|
|
579
|
+
if (!entity || (entity instanceof Entity && tag?.hideIndicator)) {
|
|
580
|
+
viewer.selectedEntity = undefined;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if (target && "id" in target && target.id instanceof Entity && isSelectable(target.id)) {
|
|
584
|
+
const tag = getTag(target.id);
|
|
585
|
+
const layer = tag?.layerId
|
|
586
|
+
? layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
587
|
+
layersRef?.current?.findById(tag.layerId)
|
|
588
|
+
: undefined;
|
|
589
|
+
onLayerSelect?.(
|
|
590
|
+
tag?.layerId,
|
|
591
|
+
tag?.featureId,
|
|
592
|
+
!!target.id.description || !!target.id.properties
|
|
593
|
+
? {
|
|
594
|
+
defaultInfobox: {
|
|
595
|
+
title: layer?.title ?? target.id.name,
|
|
596
|
+
content: getEntityContent(
|
|
597
|
+
target.id,
|
|
598
|
+
viewer.clock.currentTime ?? new JulianDate(),
|
|
599
|
+
tag?.layerId ? layer?.infobox?.property?.defaultContent : undefined,
|
|
600
|
+
),
|
|
601
|
+
},
|
|
602
|
+
}
|
|
603
|
+
: undefined,
|
|
604
|
+
);
|
|
605
|
+
prevSelectedEntity.current = target.id;
|
|
606
|
+
if (target.id instanceof Entity && !tag?.hideIndicator) {
|
|
607
|
+
viewer.selectedEntity = target.id;
|
|
608
|
+
} else {
|
|
609
|
+
viewer.selectedEntity = undefined;
|
|
610
|
+
}
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
if (
|
|
615
|
+
target &&
|
|
616
|
+
(target instanceof Cesium3DTileFeature || target instanceof Cesium3DTilePointFeature)
|
|
617
|
+
) {
|
|
618
|
+
const tag = getTag(target);
|
|
619
|
+
if (tag) {
|
|
620
|
+
const content = tileProperties(target);
|
|
621
|
+
onLayerSelect?.(
|
|
622
|
+
tag.layerId,
|
|
623
|
+
String(tag.featureId),
|
|
624
|
+
content.length
|
|
625
|
+
? {
|
|
626
|
+
defaultInfobox: {
|
|
627
|
+
title: target.getProperty("name"),
|
|
628
|
+
content: {
|
|
629
|
+
type: "table",
|
|
630
|
+
value: tileProperties(target),
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
}
|
|
634
|
+
: undefined,
|
|
635
|
+
{ feature: tag.computedFeature },
|
|
636
|
+
);
|
|
637
|
+
prevSelectedEntity.current = target;
|
|
638
|
+
}
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
if (
|
|
643
|
+
target &&
|
|
644
|
+
"content" in target &&
|
|
645
|
+
target.content &&
|
|
646
|
+
typeof target.content === "object" &&
|
|
647
|
+
"_model" in target.content &&
|
|
648
|
+
target.content._model instanceof Model
|
|
649
|
+
) {
|
|
650
|
+
const model = target.content._model;
|
|
651
|
+
const tag = getTag(model);
|
|
652
|
+
if (tag) {
|
|
653
|
+
onLayerSelect?.(tag.layerId, String(tag.featureId));
|
|
654
|
+
prevSelectedEntity.current = model;
|
|
655
|
+
}
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (
|
|
660
|
+
target?.primitive &&
|
|
661
|
+
(target.primitive instanceof Primitive || target.primitive instanceof GroundPrimitive)
|
|
662
|
+
) {
|
|
663
|
+
const primitive = target.primitive;
|
|
664
|
+
const tag = getTag(primitive);
|
|
665
|
+
if (tag) {
|
|
666
|
+
onLayerSelect?.(tag.layerId, String(tag.featureId));
|
|
667
|
+
prevSelectedEntity.current = primitive;
|
|
668
|
+
}
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// Check imagery layer
|
|
673
|
+
// ref: https://github.com/CesiumGS/cesium/blob/96b978e0c53aba3bc4f1191111e0be61781ae9dd/packages/widgets/Source/Viewer/Viewer.js#L167
|
|
674
|
+
if (target === undefined && e.position) {
|
|
675
|
+
const scene = viewer.scene;
|
|
676
|
+
const pickRay = scene.camera.getPickRay(e.position);
|
|
677
|
+
|
|
678
|
+
if (pickRay) {
|
|
679
|
+
const l = await scene.imageryLayers.pickImageryLayerFeatures(pickRay, scene);
|
|
680
|
+
|
|
681
|
+
// NOTE: For now we only send the first selected feature to onLayerSelect instead of sending all of them: @pyshx
|
|
682
|
+
if (!l) return;
|
|
683
|
+
const f = l[0];
|
|
684
|
+
|
|
685
|
+
const appearanceType = f.data?.appearanceType;
|
|
686
|
+
if (appearanceType && f.data?.feature?.[appearanceType]?.show === false) {
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
const tag = getTag(f.imageryLayer);
|
|
691
|
+
|
|
692
|
+
const pos = f.position;
|
|
693
|
+
if (pos) {
|
|
694
|
+
// NOTE: Instantiate temporal Cesium.Entity to display indicator.
|
|
695
|
+
// Although we want to use `viewer.selectionIndicator.viewModel.position` and `animateAppear`, Cesium reset selection position if `viewer.selectedEntity` is not set.
|
|
696
|
+
// ref: https://github.com/CesiumGS/cesium/blob/9295450e64c3077d96ad579012068ea05f97842c/packages/widgets/Source/Viewer/Viewer.js#L1843-L1876
|
|
697
|
+
// issue: https://github.com/CesiumGS/cesium/issues/7965
|
|
698
|
+
requestAnimationFrame(() => {
|
|
699
|
+
if (!tag?.hideIndicator) {
|
|
700
|
+
viewer.selectedEntity = new Entity({
|
|
701
|
+
position: Cartographic.toCartesian(pos),
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
const layer = tag?.layerId
|
|
708
|
+
? layersRef?.current?.overriddenLayers().find(l => l.id === tag.layerId) ??
|
|
709
|
+
layersRef?.current?.findById(tag.layerId)
|
|
710
|
+
: undefined;
|
|
711
|
+
const content = getEntityContent(
|
|
712
|
+
f.data.feature ?? f,
|
|
713
|
+
viewer.clock.currentTime ?? new JulianDate(),
|
|
714
|
+
tag?.layerId ? layer?.infobox?.property?.defaultContent : undefined,
|
|
715
|
+
);
|
|
716
|
+
onLayerSelect?.(
|
|
717
|
+
f.data.layerId,
|
|
718
|
+
f.data.featureId,
|
|
719
|
+
content.value.length
|
|
720
|
+
? {
|
|
721
|
+
defaultInfobox: {
|
|
722
|
+
title: layer?.title ?? f.name,
|
|
723
|
+
content,
|
|
724
|
+
},
|
|
725
|
+
}
|
|
726
|
+
: undefined,
|
|
727
|
+
{
|
|
728
|
+
feature: f.data.feature,
|
|
729
|
+
},
|
|
730
|
+
);
|
|
731
|
+
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
if (!entity || (entity instanceof Entity && tag?.hideIndicator)) {
|
|
737
|
+
viewer.selectedEntity = undefined;
|
|
738
|
+
}
|
|
739
|
+
onLayerSelect?.();
|
|
740
|
+
},
|
|
741
|
+
[
|
|
742
|
+
onLayerSelect,
|
|
743
|
+
mouseEventHandles,
|
|
744
|
+
layersRef,
|
|
745
|
+
featureFlags,
|
|
746
|
+
selectedLayerId?.featureId,
|
|
747
|
+
selectedLayerId?.layerId,
|
|
748
|
+
],
|
|
749
|
+
);
|
|
750
|
+
|
|
751
|
+
// E2E test
|
|
752
|
+
useEffect(() => {
|
|
753
|
+
if (e2eAccessToken()) {
|
|
754
|
+
setE2ECesiumViewer(cesium.current?.cesiumElement);
|
|
755
|
+
return () => {
|
|
756
|
+
setE2ECesiumViewer(undefined);
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
return;
|
|
760
|
+
}, [cesium.current?.cesiumElement]);
|
|
761
|
+
|
|
762
|
+
// update
|
|
763
|
+
useEffect(() => {
|
|
764
|
+
const viewer = cesium.current?.cesiumElement;
|
|
765
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
766
|
+
viewer.scene.requestRender();
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
const handleUpdate = useCallback(() => {
|
|
770
|
+
const viewer = cesium.current?.cesiumElement;
|
|
771
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
772
|
+
viewer.scene.requestRender();
|
|
773
|
+
}, []);
|
|
774
|
+
|
|
775
|
+
// enable Drag and Drop Layers
|
|
776
|
+
const handleLayerDrag = useCallback(
|
|
777
|
+
(e: Entity, position: Cartesian3 | undefined, _context: Context): boolean | void => {
|
|
778
|
+
const viewer = cesium.current?.cesiumElement;
|
|
779
|
+
if (!viewer || viewer.isDestroyed() || !isSelectable(e) || !isDraggable(e)) return false;
|
|
780
|
+
|
|
781
|
+
const pos = convertCartesian3ToPosition(cesium.current?.cesiumElement, position);
|
|
782
|
+
if (!pos) return false;
|
|
783
|
+
|
|
784
|
+
const tag = getTag(e);
|
|
785
|
+
if (!tag) return false;
|
|
786
|
+
|
|
787
|
+
onLayerDrag?.(tag.layerId || "", tag.featureId, pos);
|
|
788
|
+
},
|
|
789
|
+
[onLayerDrag],
|
|
790
|
+
);
|
|
791
|
+
|
|
792
|
+
const handleLayerDrop = useCallback(
|
|
793
|
+
(e: Entity, position: Cartesian3 | undefined): boolean | void => {
|
|
794
|
+
const viewer = cesium.current?.cesiumElement;
|
|
795
|
+
if (!viewer || viewer.isDestroyed()) return false;
|
|
796
|
+
|
|
797
|
+
const tag = getTag(e);
|
|
798
|
+
const pos = convertCartesian3ToPosition(cesium.current?.cesiumElement, position);
|
|
799
|
+
onLayerDrop?.(tag?.layerId || "", tag?.featureId || "", pos);
|
|
800
|
+
|
|
801
|
+
return false; // let apollo-client handle optimistic updates
|
|
802
|
+
},
|
|
803
|
+
[onLayerDrop],
|
|
804
|
+
);
|
|
805
|
+
|
|
806
|
+
const cesiumDnD = useRef<CesiumDnD>();
|
|
807
|
+
useEffect(() => {
|
|
808
|
+
const viewer = cesium.current?.cesiumElement;
|
|
809
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
810
|
+
cesiumDnD.current = new CesiumDnD(viewer, {
|
|
811
|
+
onDrag: handleLayerDrag,
|
|
812
|
+
onDrop: handleLayerDrop,
|
|
813
|
+
dragDelay: 1000,
|
|
814
|
+
initialDisabled: !isLayerDraggable,
|
|
815
|
+
});
|
|
816
|
+
return () => {
|
|
817
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
818
|
+
cesiumDnD.current?.disable();
|
|
819
|
+
};
|
|
820
|
+
}, [handleLayerDrag, handleLayerDrop, isLayerDraggable]);
|
|
821
|
+
const { cameraViewBoundaries, cameraViewOuterBoundaries, cameraViewBoundariesMaterial } =
|
|
822
|
+
useCameraLimiter(cesium, camera, property?.cameraLimiter);
|
|
823
|
+
|
|
824
|
+
const context = useMemo<FeatureContext>(
|
|
825
|
+
() => ({
|
|
826
|
+
selectionReason,
|
|
827
|
+
timelineManagerRef,
|
|
828
|
+
flyTo: engineAPI.flyTo,
|
|
829
|
+
getCamera: engineAPI.getCamera,
|
|
830
|
+
onLayerEdit,
|
|
831
|
+
onLayerVisibility,
|
|
832
|
+
onLayerLoad,
|
|
833
|
+
requestRender: engineAPI.requestRender,
|
|
834
|
+
getSurfaceDistance: engineAPI.getSurfaceDistance,
|
|
835
|
+
toXYZ: engineAPI.toXYZ,
|
|
836
|
+
toWindowPosition: engineAPI.toWindowPosition,
|
|
837
|
+
isPositionVisible: engineAPI.isPositionVisible,
|
|
838
|
+
}),
|
|
839
|
+
[selectionReason, engineAPI, onLayerEdit, onLayerVisibility, onLayerLoad, timelineManagerRef],
|
|
840
|
+
);
|
|
841
|
+
|
|
842
|
+
useEffect(() => {
|
|
843
|
+
if (!cesium.current?.cesiumElement) return;
|
|
844
|
+
const allowCameraMove = !!(featureFlags & FEATURE_FLAGS.CAMERA_MOVE);
|
|
845
|
+
const allowCameraZoom = !!(featureFlags & FEATURE_FLAGS.CAMERA_ZOOM);
|
|
846
|
+
const allowCameraTilt = !!(featureFlags & FEATURE_FLAGS.CAMERA_TILT);
|
|
847
|
+
const allowCameraLook = !!(featureFlags & FEATURE_FLAGS.CAMERA_LOOK);
|
|
848
|
+
cesium.current.cesiumElement.scene.screenSpaceCameraController.enableTranslate =
|
|
849
|
+
allowCameraMove;
|
|
850
|
+
cesium.current.cesiumElement.scene.screenSpaceCameraController.enableRotate = allowCameraMove;
|
|
851
|
+
cesium.current.cesiumElement.scene.screenSpaceCameraController.enableLook = allowCameraLook;
|
|
852
|
+
cesium.current.cesiumElement.scene.screenSpaceCameraController.enableTilt = allowCameraTilt;
|
|
853
|
+
cesium.current.cesiumElement.scene.screenSpaceCameraController.enableZoom = allowCameraZoom;
|
|
854
|
+
}, [featureFlags]);
|
|
855
|
+
|
|
856
|
+
// Anti-aliasing
|
|
857
|
+
useEffect(() => {
|
|
858
|
+
const viewer = cesium.current?.cesiumElement;
|
|
859
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
860
|
+
// TODO: FXAA doesn't support alpha blending in Cesium, so we will enable FXAA when this is fixed.
|
|
861
|
+
// viewer.scene.postProcessStages.fxaa.enabled = property?.render?.antialias === "high";
|
|
862
|
+
viewer.scene.msaaSamples =
|
|
863
|
+
property?.render?.antialias === "extreme"
|
|
864
|
+
? 8
|
|
865
|
+
: property?.render?.antialias === "high"
|
|
866
|
+
? 6
|
|
867
|
+
: property?.render?.antialias === "medium"
|
|
868
|
+
? 4
|
|
869
|
+
: 1; // default as 1
|
|
870
|
+
}, [property?.render?.antialias]);
|
|
871
|
+
|
|
872
|
+
// explicit rendering
|
|
873
|
+
const explicitRender = useCallback(() => {
|
|
874
|
+
const viewer = cesium.current?.cesiumElement;
|
|
875
|
+
if (!requestingRenderMode?.current || !viewer || viewer.isDestroyed()) return;
|
|
876
|
+
viewer.scene.requestRender();
|
|
877
|
+
if (requestingRenderMode.current === REQUEST_RENDER_ONCE) {
|
|
878
|
+
requestingRenderMode.current = NO_REQUEST_RENDER;
|
|
879
|
+
}
|
|
880
|
+
}, [requestingRenderMode]);
|
|
881
|
+
|
|
882
|
+
const explicitRenderRef = useRef<() => void>();
|
|
883
|
+
|
|
884
|
+
useEffect(() => {
|
|
885
|
+
explicitRenderRef.current = explicitRender;
|
|
886
|
+
}, [explicitRender]);
|
|
887
|
+
|
|
888
|
+
useEffect(() => {
|
|
889
|
+
const viewer = cesium.current?.cesiumElement;
|
|
890
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
891
|
+
return viewer.scene.postUpdate.addEventListener(() => {
|
|
892
|
+
explicitRenderRef.current?.();
|
|
893
|
+
});
|
|
894
|
+
}, []);
|
|
895
|
+
|
|
896
|
+
// render one frame when scene property changes
|
|
897
|
+
useEffect(() => {
|
|
898
|
+
if (requestingRenderMode) {
|
|
899
|
+
requestingRenderMode.current = REQUEST_RENDER_ONCE;
|
|
900
|
+
}
|
|
901
|
+
}, [property, requestingRenderMode]);
|
|
902
|
+
|
|
903
|
+
// force render when timeline is animating or is shouldRender
|
|
904
|
+
useEffect(() => {
|
|
905
|
+
const viewer = cesium.current?.cesiumElement;
|
|
906
|
+
if (!viewer || viewer.isDestroyed()) return;
|
|
907
|
+
if (requestingRenderMode) {
|
|
908
|
+
requestingRenderMode.current =
|
|
909
|
+
isLayerDragging || shouldRender
|
|
910
|
+
? FORCE_REQUEST_RENDER
|
|
911
|
+
: requestingRenderMode.current === REQUEST_RENDER_ONCE
|
|
912
|
+
? REQUEST_RENDER_ONCE
|
|
913
|
+
: NO_REQUEST_RENDER;
|
|
914
|
+
}
|
|
915
|
+
}, [isLayerDragging, shouldRender, requestingRenderMode]);
|
|
916
|
+
|
|
917
|
+
// cesium timeline & animation widget
|
|
918
|
+
useEffect(() => {
|
|
919
|
+
const viewer = cesium.current?.cesiumElement;
|
|
920
|
+
if (!viewer) return;
|
|
921
|
+
if (viewer.animation?.container) {
|
|
922
|
+
(viewer.animation.container as HTMLDivElement).style.visibility = property?.timeline?.visible
|
|
923
|
+
? "visible"
|
|
924
|
+
: "hidden";
|
|
925
|
+
}
|
|
926
|
+
if (viewer.timeline?.container) {
|
|
927
|
+
(viewer.timeline.container as HTMLDivElement).style.visibility = property?.timeline?.visible
|
|
928
|
+
? "visible"
|
|
929
|
+
: "hidden";
|
|
930
|
+
}
|
|
931
|
+
viewer.forceResize();
|
|
932
|
+
}, [property]);
|
|
933
|
+
|
|
934
|
+
const globe = cesium.current?.cesiumElement?.scene.globe;
|
|
935
|
+
|
|
936
|
+
useEffect(() => {
|
|
937
|
+
if (globe) {
|
|
938
|
+
const surface = (globe as any)._surface as CustomGlobeSurface;
|
|
939
|
+
if (surface) {
|
|
940
|
+
surface.tileProvider._debug.wireframe = property?.render?.showWireframe ?? false;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}, [globe, property?.render?.showWireframe]);
|
|
944
|
+
|
|
945
|
+
const onPreRenderCallback = useCallback(
|
|
946
|
+
(scene: Scene) => {
|
|
947
|
+
if (!scene.camera || !cameraForceHorizontalRoll) return;
|
|
948
|
+
if (Math.abs(CesiumMath.negativePiToPi(scene.camera.roll)) > Math.PI / 86400) {
|
|
949
|
+
scene.camera.setView({
|
|
950
|
+
orientation: {
|
|
951
|
+
heading: scene.camera.heading,
|
|
952
|
+
pitch: scene.camera.pitch,
|
|
953
|
+
roll: 0,
|
|
954
|
+
},
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
[cameraForceHorizontalRoll],
|
|
959
|
+
);
|
|
960
|
+
|
|
961
|
+
useEffect(() => {
|
|
962
|
+
const viewer = cesium.current?.cesiumElement;
|
|
963
|
+
if (!viewer) return;
|
|
964
|
+
return viewer.scene.preRender.addEventListener(onPreRenderCallback);
|
|
965
|
+
}, [onPreRenderCallback]);
|
|
966
|
+
|
|
967
|
+
return {
|
|
968
|
+
backgroundColor,
|
|
969
|
+
cesium,
|
|
970
|
+
cameraViewBoundaries,
|
|
971
|
+
cameraViewOuterBoundaries,
|
|
972
|
+
cameraViewBoundariesMaterial,
|
|
973
|
+
cesiumIonAccessToken,
|
|
974
|
+
mouseEventHandles,
|
|
975
|
+
context,
|
|
976
|
+
light,
|
|
977
|
+
handleMount,
|
|
978
|
+
handleUnmount,
|
|
979
|
+
handleUpdate,
|
|
980
|
+
handleClick,
|
|
981
|
+
handleCameraChange,
|
|
982
|
+
handleCameraMoveEnd,
|
|
983
|
+
layerSelectWithRectEventHandlers,
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
function tileProperties(
|
|
988
|
+
t: Cesium3DTileFeature | Cesium3DTilePointFeature,
|
|
989
|
+
): { key: string; value: any }[] {
|
|
990
|
+
return t
|
|
991
|
+
.getPropertyIds()
|
|
992
|
+
.reduce<
|
|
993
|
+
{ key: string; value: any }[]
|
|
994
|
+
>((a, b) => [...a, { key: b, value: t.getProperty(b) }], []);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
function getLayerId(target: RootEventTarget): string | undefined {
|
|
998
|
+
if (target && "id" in target && target.id instanceof Entity) {
|
|
999
|
+
return getTag(target.id)?.layerId;
|
|
1000
|
+
} else if (target && target instanceof Cesium3DTileFeature) {
|
|
1001
|
+
return getTag(target.tileset)?.layerId;
|
|
1002
|
+
}
|
|
1003
|
+
return undefined;
|
|
1004
|
+
}
|