@sl-utils/cesium 1.0.0 → 1.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/LICENSE copy +201 -0
- package/README.md +5 -0
- package/demo/App.vue +26 -0
- package/demo/main.ts +5 -0
- package/demo/style.css +3 -0
- package/index.cjs +12 -0
- package/index.html +13 -0
- package/package.json +31 -3
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/public/Assets/Images/bing_maps_credit.png +0 -0
- package/public/Assets/Images/cesium_credit.png +0 -0
- package/public/Assets/Images/google_earth_credit.png +0 -0
- package/public/Assets/Images/ion-credit.png +0 -0
- package/public/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/public/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/public/Assets/Textures/maki/airfield.png +0 -0
- package/public/Assets/Textures/maki/airport.png +0 -0
- package/public/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/public/Assets/Textures/maki/america-football.png +0 -0
- package/public/Assets/Textures/maki/art-gallery.png +0 -0
- package/public/Assets/Textures/maki/bakery.png +0 -0
- package/public/Assets/Textures/maki/bank.png +0 -0
- package/public/Assets/Textures/maki/bar.png +0 -0
- package/public/Assets/Textures/maki/baseball.png +0 -0
- package/public/Assets/Textures/maki/basketball.png +0 -0
- package/public/Assets/Textures/maki/beer.png +0 -0
- package/public/Assets/Textures/maki/bicycle.png +0 -0
- package/public/Assets/Textures/maki/building.png +0 -0
- package/public/Assets/Textures/maki/bus.png +0 -0
- package/public/Assets/Textures/maki/cafe.png +0 -0
- package/public/Assets/Textures/maki/camera.png +0 -0
- package/public/Assets/Textures/maki/campsite.png +0 -0
- package/public/Assets/Textures/maki/car.png +0 -0
- package/public/Assets/Textures/maki/cemetery.png +0 -0
- package/public/Assets/Textures/maki/cesium.png +0 -0
- package/public/Assets/Textures/maki/chemist.png +0 -0
- package/public/Assets/Textures/maki/cinema.png +0 -0
- package/public/Assets/Textures/maki/circle-stroked.png +0 -0
- package/public/Assets/Textures/maki/circle.png +0 -0
- package/public/Assets/Textures/maki/city.png +0 -0
- package/public/Assets/Textures/maki/clothing-store.png +0 -0
- package/public/Assets/Textures/maki/college.png +0 -0
- package/public/Assets/Textures/maki/commercial.png +0 -0
- package/public/Assets/Textures/maki/cricket.png +0 -0
- package/public/Assets/Textures/maki/cross.png +0 -0
- package/public/Assets/Textures/maki/dam.png +0 -0
- package/public/Assets/Textures/maki/danger.png +0 -0
- package/public/Assets/Textures/maki/disability.png +0 -0
- package/public/Assets/Textures/maki/dog-park.png +0 -0
- package/public/Assets/Textures/maki/embassy.png +0 -0
- package/public/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/public/Assets/Textures/maki/entrance.png +0 -0
- package/public/Assets/Textures/maki/farm.png +0 -0
- package/public/Assets/Textures/maki/fast-food.png +0 -0
- package/public/Assets/Textures/maki/ferry.png +0 -0
- package/public/Assets/Textures/maki/fire-station.png +0 -0
- package/public/Assets/Textures/maki/fuel.png +0 -0
- package/public/Assets/Textures/maki/garden.png +0 -0
- package/public/Assets/Textures/maki/gift.png +0 -0
- package/public/Assets/Textures/maki/golf.png +0 -0
- package/public/Assets/Textures/maki/grocery.png +0 -0
- package/public/Assets/Textures/maki/hairdresser.png +0 -0
- package/public/Assets/Textures/maki/harbor.png +0 -0
- package/public/Assets/Textures/maki/heart.png +0 -0
- package/public/Assets/Textures/maki/heliport.png +0 -0
- package/public/Assets/Textures/maki/hospital.png +0 -0
- package/public/Assets/Textures/maki/ice-cream.png +0 -0
- package/public/Assets/Textures/maki/industrial.png +0 -0
- package/public/Assets/Textures/maki/land-use.png +0 -0
- package/public/Assets/Textures/maki/laundry.png +0 -0
- package/public/Assets/Textures/maki/library.png +0 -0
- package/public/Assets/Textures/maki/lighthouse.png +0 -0
- package/public/Assets/Textures/maki/lodging.png +0 -0
- package/public/Assets/Textures/maki/logging.png +0 -0
- package/public/Assets/Textures/maki/london-underground.png +0 -0
- package/public/Assets/Textures/maki/marker-stroked.png +0 -0
- package/public/Assets/Textures/maki/marker.png +0 -0
- package/public/Assets/Textures/maki/minefield.png +0 -0
- package/public/Assets/Textures/maki/mobilephone.png +0 -0
- package/public/Assets/Textures/maki/monument.png +0 -0
- package/public/Assets/Textures/maki/museum.png +0 -0
- package/public/Assets/Textures/maki/music.png +0 -0
- package/public/Assets/Textures/maki/oil-well.png +0 -0
- package/public/Assets/Textures/maki/park.png +0 -0
- package/public/Assets/Textures/maki/park2.png +0 -0
- package/public/Assets/Textures/maki/parking-garage.png +0 -0
- package/public/Assets/Textures/maki/parking.png +0 -0
- package/public/Assets/Textures/maki/pharmacy.png +0 -0
- package/public/Assets/Textures/maki/pitch.png +0 -0
- package/public/Assets/Textures/maki/place-of-worship.png +0 -0
- package/public/Assets/Textures/maki/playground.png +0 -0
- package/public/Assets/Textures/maki/police.png +0 -0
- package/public/Assets/Textures/maki/polling-place.png +0 -0
- package/public/Assets/Textures/maki/post.png +0 -0
- package/public/Assets/Textures/maki/prison.png +0 -0
- package/public/Assets/Textures/maki/rail-above.png +0 -0
- package/public/Assets/Textures/maki/rail-light.png +0 -0
- package/public/Assets/Textures/maki/rail-metro.png +0 -0
- package/public/Assets/Textures/maki/rail-underground.png +0 -0
- package/public/Assets/Textures/maki/rail.png +0 -0
- package/public/Assets/Textures/maki/religious-christian.png +0 -0
- package/public/Assets/Textures/maki/religious-jewish.png +0 -0
- package/public/Assets/Textures/maki/religious-muslim.png +0 -0
- package/public/Assets/Textures/maki/restaurant.png +0 -0
- package/public/Assets/Textures/maki/roadblock.png +0 -0
- package/public/Assets/Textures/maki/rocket.png +0 -0
- package/public/Assets/Textures/maki/school.png +0 -0
- package/public/Assets/Textures/maki/scooter.png +0 -0
- package/public/Assets/Textures/maki/shop.png +0 -0
- package/public/Assets/Textures/maki/skiing.png +0 -0
- package/public/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/public/Assets/Textures/maki/soccer.png +0 -0
- package/public/Assets/Textures/maki/square-stroked.png +0 -0
- package/public/Assets/Textures/maki/square.png +0 -0
- package/public/Assets/Textures/maki/star-stroked.png +0 -0
- package/public/Assets/Textures/maki/star.png +0 -0
- package/public/Assets/Textures/maki/suitcase.png +0 -0
- package/public/Assets/Textures/maki/swimming.png +0 -0
- package/public/Assets/Textures/maki/telephone.png +0 -0
- package/public/Assets/Textures/maki/tennis.png +0 -0
- package/public/Assets/Textures/maki/theatre.png +0 -0
- package/public/Assets/Textures/maki/toilets.png +0 -0
- package/public/Assets/Textures/maki/town-hall.png +0 -0
- package/public/Assets/Textures/maki/town.png +0 -0
- package/public/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/public/Assets/Textures/maki/triangle.png +0 -0
- package/public/Assets/Textures/maki/village.png +0 -0
- package/public/Assets/Textures/maki/warehouse.png +0 -0
- package/public/Assets/Textures/maki/waste-basket.png +0 -0
- package/public/Assets/Textures/maki/water.png +0 -0
- package/public/Assets/Textures/maki/wetland.png +0 -0
- package/public/Assets/Textures/maki/zoo.png +0 -0
- package/public/Assets/Textures/moonSmall.jpg +0 -0
- package/public/Assets/Textures/pin.svg +1 -0
- package/public/Assets/Textures/waterNormals.jpg +0 -0
- package/public/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/public/Assets/approximateTerrainHeights.json +1 -0
- package/public/Cesium.js +16587 -0
- package/public/ThirdParty/Workers/package.json +1 -0
- package/public/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/public/ThirdParty/basis_transcoder.wasm +0 -0
- package/public/ThirdParty/draco_decoder.wasm +0 -0
- package/public/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/public/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/public/ThirdParty/zip-module.wasm +0 -0
- package/public/Widgets/Animation/Animation.css +127 -0
- package/public/Widgets/Animation/lighter.css +70 -0
- package/public/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/public/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/public/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/public/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/public/Widgets/CesiumWidget/CesiumWidget.css +119 -0
- package/public/Widgets/CesiumWidget/lighter.css +14 -0
- package/public/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/public/Widgets/Geocoder/Geocoder.css +70 -0
- package/public/Widgets/Geocoder/lighter.css +17 -0
- package/public/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/public/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
- package/public/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
- package/public/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/public/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/public/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/public/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/public/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleContour.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/public/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/public/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/public/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/public/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/public/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/public/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/public/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/public/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/public/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/public/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/public/Widgets/Images/TimelineIcons.png +0 -0
- package/public/Widgets/Images/info-loading.gif +0 -0
- package/public/Widgets/InfoBox/InfoBox.css +92 -0
- package/public/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/public/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/public/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/public/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/public/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/public/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/public/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/public/Widgets/Timeline/Timeline.css +103 -0
- package/public/Widgets/Timeline/lighter.css +23 -0
- package/public/Widgets/VRButton/VRButton.css +8 -0
- package/public/Widgets/Viewer/Viewer.css +107 -0
- package/public/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/public/Widgets/lighter.css +237 -0
- package/public/Widgets/lighterShared.css +46 -0
- package/public/Widgets/shared.css +103 -0
- package/public/Widgets/widgets.css +1342 -0
- package/public/Workers/chunk-3DKU5AMY.js +26 -0
- package/public/Workers/chunk-3MO6V622.js +26 -0
- package/public/Workers/chunk-3ULTL2FZ.js +26 -0
- package/public/Workers/chunk-43YDDN2L.js +26 -0
- package/public/Workers/chunk-453UE67U.js +26 -0
- package/public/Workers/chunk-5JJC62LP.js +26 -0
- package/public/Workers/chunk-65WPDQMK.js +26 -0
- package/public/Workers/chunk-6J7K26F7.js +26 -0
- package/public/Workers/chunk-A3G5ORRJ.js +26 -0
- package/public/Workers/chunk-AIXDAWPZ.js +26 -0
- package/public/Workers/chunk-ANKVUFZB.js +26 -0
- package/public/Workers/chunk-AZ67KQQB.js +26 -0
- package/public/Workers/chunk-C5F5JZAC.js +26 -0
- package/public/Workers/chunk-CK62LO4L.js +26 -0
- package/public/Workers/chunk-DXDIQEOK.js +26 -0
- package/public/Workers/chunk-E7ZPYMUI.js +26 -0
- package/public/Workers/chunk-GDE4VUE6.js +26 -0
- package/public/Workers/chunk-GGYRJCFH.js +29 -0
- package/public/Workers/chunk-HBIOVTO5.js +27 -0
- package/public/Workers/chunk-HJIURIT6.js +26 -0
- package/public/Workers/chunk-IDLM42AV.js +26 -0
- package/public/Workers/chunk-IFBNVX3N.js +26 -0
- package/public/Workers/chunk-IR47TAV5.js +26 -0
- package/public/Workers/chunk-ISGFCDPW.js +26 -0
- package/public/Workers/chunk-JJ24SU25.js +26 -0
- package/public/Workers/chunk-LAGV6F3C.js +29 -0
- package/public/Workers/chunk-LLCMCKFU.js +26 -0
- package/public/Workers/chunk-MSR5BKMH.js +26 -0
- package/public/Workers/chunk-MWVHSLYS.js +26 -0
- package/public/Workers/chunk-MYNU3I3W.js +26 -0
- package/public/Workers/chunk-NSDLDP72.js +26 -0
- package/public/Workers/chunk-NUY3PECV.js +26 -0
- package/public/Workers/chunk-OHMLE6SB.js +26 -0
- package/public/Workers/chunk-OJH7UFER.js +28 -0
- package/public/Workers/chunk-OUZ34R6R.js +26 -0
- package/public/Workers/chunk-OWJWRYGM.js +26 -0
- package/public/Workers/chunk-PAML32O3.js +26 -0
- package/public/Workers/chunk-PNKG35NX.js +26 -0
- package/public/Workers/chunk-Q6F3SO7I.js +26 -0
- package/public/Workers/chunk-QROIA2H7.js +26 -0
- package/public/Workers/chunk-RH6XN2ZV.js +28 -0
- package/public/Workers/chunk-SCMY6ELS.js +26 -0
- package/public/Workers/chunk-SP3AH7D2.js +26 -0
- package/public/Workers/chunk-SRXN2PE4.js +26 -0
- package/public/Workers/chunk-SUBLUDWJ.js +26 -0
- package/public/Workers/chunk-T4S74O3D.js +26 -0
- package/public/Workers/chunk-TITUTZNR.js +63 -0
- package/public/Workers/chunk-UWS7N7FB.js +26 -0
- package/public/Workers/chunk-V5C26K4F.js +26 -0
- package/public/Workers/chunk-VAPRBQYE.js +26 -0
- package/public/Workers/chunk-VBYW5FXW.js +26 -0
- package/public/Workers/chunk-VLPLGYXT.js +26 -0
- package/public/Workers/chunk-W5T7UWKW.js +26 -0
- package/public/Workers/chunk-XLJBHQML.js +26 -0
- package/public/Workers/chunk-XWXQVSYW.js +26 -0
- package/public/Workers/chunk-YSN2K4FT.js +27 -0
- package/public/Workers/chunk-ZTSD53QT.js +26 -0
- package/public/Workers/combineGeometry.js +26 -0
- package/public/Workers/createBoxGeometry.js +26 -0
- package/public/Workers/createBoxOutlineGeometry.js +26 -0
- package/public/Workers/createCircleGeometry.js +26 -0
- package/public/Workers/createCircleOutlineGeometry.js +26 -0
- package/public/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/public/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/public/Workers/createCorridorGeometry.js +26 -0
- package/public/Workers/createCorridorOutlineGeometry.js +26 -0
- package/public/Workers/createCylinderGeometry.js +26 -0
- package/public/Workers/createCylinderOutlineGeometry.js +26 -0
- package/public/Workers/createEllipseGeometry.js +26 -0
- package/public/Workers/createEllipseOutlineGeometry.js +26 -0
- package/public/Workers/createEllipsoidGeometry.js +26 -0
- package/public/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/public/Workers/createFrustumGeometry.js +26 -0
- package/public/Workers/createFrustumOutlineGeometry.js +26 -0
- package/public/Workers/createGeometry.js +26 -0
- package/public/Workers/createGroundPolylineGeometry.js +26 -0
- package/public/Workers/createPlaneGeometry.js +26 -0
- package/public/Workers/createPlaneOutlineGeometry.js +26 -0
- package/public/Workers/createPolygonGeometry.js +26 -0
- package/public/Workers/createPolygonOutlineGeometry.js +26 -0
- package/public/Workers/createPolylineGeometry.js +26 -0
- package/public/Workers/createPolylineVolumeGeometry.js +26 -0
- package/public/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/public/Workers/createRectangleGeometry.js +26 -0
- package/public/Workers/createRectangleOutlineGeometry.js +26 -0
- package/public/Workers/createSimplePolylineGeometry.js +26 -0
- package/public/Workers/createSphereGeometry.js +26 -0
- package/public/Workers/createSphereOutlineGeometry.js +26 -0
- package/public/Workers/createTaskProcessorWorker.js +26 -0
- package/public/Workers/createVectorTileClampedPolylines.js +26 -0
- package/public/Workers/createVectorTileGeometries.js +26 -0
- package/public/Workers/createVectorTilePoints.js +26 -0
- package/public/Workers/createVectorTilePolygons.js +26 -0
- package/public/Workers/createVectorTilePolylines.js +26 -0
- package/public/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
- package/public/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/public/Workers/createVerticesFromHeightmap.js +26 -0
- package/public/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/public/Workers/createWallGeometry.js +26 -0
- package/public/Workers/createWallOutlineGeometry.js +26 -0
- package/public/Workers/decodeDraco.js +26 -0
- package/public/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/public/Workers/decodeI3S.js +26 -0
- package/public/Workers/gaussianSplatSorter.js +26 -0
- package/public/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/public/Workers/incrementallyBuildTerrainPicker.js +26 -0
- package/public/Workers/transcodeKTX2.js +56 -0
- package/public/Workers/transferTypedArrayTest.js +26 -0
- package/public/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/public/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
- package/public/index.cjs +16587 -0
- package/public/index.js +16587 -0
- package/src/Assets/geojson/BaiYangDian.geojson +699 -0
- package/src/Assets/geojson/HeBei.geojson +97754 -0
- package/src/Assets/geojson//344/270/255/345/233/275_/347/234/201.geojson +1 -0
- package/src/Assets/images/BYD.png +0 -0
- package/src/Assets/images/BYH.png +0 -0
- package/src/Assets/images/CZD.png +0 -0
- package/src/Assets/images/bouys.png +0 -0
- package/src/Assets/images/hebei.ico +0 -0
- package/src/Assets/images/jinzhou.ico +0 -0
- package/src/Assets/images/map_bg.png +0 -0
- package/src/Assets/images/map_bridge.png +0 -0
- package/src/Assets/images/map_radar.png +0 -0
- package/src/Assets/images/map_vhf.png +0 -0
- package/src/Assets/images/shenlan.png +0 -0
- package/src/Assets/images/ship.png +0 -0
- package/src/Assets/images/ship_1.png +0 -0
- package/src/Assets/images/ship_1_e.png +0 -0
- package/src/Assets/images/ship_1_tv.png +0 -0
- package/src/Assets/images/ship_2.png +0 -0
- package/src/Assets/images/ship_2_e.png +0 -0
- package/src/Assets/images/ship_2_tv.png +0 -0
- package/src/Assets/images/ship_3.png +0 -0
- package/src/Assets/images/ship_3_e.png +0 -0
- package/src/Assets/images/ship_3_tv.png +0 -0
- package/src/Assets/images/ship_4.png +0 -0
- package/src/Assets/images/ship_4_e.png +0 -0
- package/src/Assets/images/ship_4_tv.png +0 -0
- package/src/Assets/images/ship_5.png +0 -0
- package/src/Assets/images/ship_5_e.png +0 -0
- package/src/Assets/images/ship_5_tv.png +0 -0
- package/src/Assets/images/snowflake_particle.png +0 -0
- package/src/Assets/models/fengche.gltf +2920 -0
- package/src/Assets/resource.ts +32 -0
- package/src/const/color.ts +10 -0
- package/src/const/config/camera.ts +16 -0
- package/src/const/config/index.ts +2 -0
- package/src/const/config/viewer.ts +42 -0
- package/src/const/index.ts +3 -0
- package/src/const/position.ts +34 -0
- package/src/core/cdk/compass.ts +24 -0
- package/src/core/cdk/index.ts +36 -0
- package/src/core/cdk/lnglat.ts +125 -0
- package/src/core/cdk/orbit.ts +118 -0
- package/src/core/cdk/overlay.ts +90 -0
- package/src/core/cdk/slider.ts +54 -0
- package/src/core/cdk/svg_compass.svg +33 -0
- package/src/core/index.ts +2 -0
- package/src/core/layers/baidu-map-layer.ts +117 -0
- package/src/core/libs/gui.ts +88 -0
- package/src/core/scene/camera.ts +211 -0
- package/src/core/scene/globe.ts +33 -0
- package/src/core/scene/index.ts +5 -0
- package/src/core/scene/layers.ts +240 -0
- package/src/core/scene/primitives.ts +55 -0
- package/src/core/scene/scene.ts +44 -0
- package/src/core/viewer/clock.ts +93 -0
- package/src/core/viewer/data.ts +17 -0
- package/src/core/viewer/element.ts +146 -0
- package/src/core/viewer/entities.ts +74 -0
- package/src/core/viewer/event.ts +155 -0
- package/src/core/viewer/index.ts +7 -0
- package/src/core/viewer/result.ts +7 -0
- package/src/core/viewer/terrain.ts +30 -0
- package/src/core/viewer/viewer.ts +255 -0
- package/src/entities/ellipse.ts +68 -0
- package/src/entities/geojson.ts +19 -0
- package/src/entities/image.ts +28 -0
- package/src/entities/index.ts +42 -0
- package/src/entities/label.ts +37 -0
- package/src/entities/point.ts +48 -0
- package/src/entities/polygon.ts +59 -0
- package/src/entities/polyline.ts +55 -0
- package/src/entities/radar.ts +18 -0
- package/src/entities/rectangle.ts +50 -0
- package/src/entities/trailing.ts +22 -0
- package/src/index.ts +10 -0
- package/src/plugins/bathymetry.ts +107 -0
- package/src/plugins/elevation.ts +146 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/post-process-snow.glsl +99 -0
- package/src/plugins/post-process-snow.ts +45 -0
- package/src/plugins/thunder.glsl +159 -0
- package/src/primitives/appearance/demo.ts +27 -0
- package/src/primitives/appearance/index.ts +1 -0
- package/src/primitives/area.ts +40 -0
- package/src/primitives/geometry/geometry.ts +44 -0
- package/src/primitives/image-2d.ts +73 -0
- package/src/primitives/index.ts +9 -0
- package/src/primitives/instance/instance.ts +58 -0
- package/src/primitives/material/image2d.ts +25 -0
- package/src/primitives/material/index.ts +8 -0
- package/src/primitives/material/ship2d.ts +55 -0
- package/src/primitives/particle.ts +47 -0
- package/src/primitives/shaders/EllipsoidSurfaceAppearanceFS.glsl +31 -0
- package/src/primitives/shaders/EllipsoidSurfaceAppearanceVS.glsl +19 -0
- package/src/primitives/shaders/imageFS.glsl +22 -0
- package/src/primitives/shaders/raedme.md +187 -0
- package/src/property/index.ts +1 -0
- package/src/property/material/core.ts +52 -0
- package/src/property/material/index.ts +5 -0
- package/src/property/material/radar.ts +41 -0
- package/src/property/material/road.ts +35 -0
- package/src/property/material/trailing.ts +31 -0
- package/src/property/material/wall.ts +31 -0
- package/src/scene/TJG/area.ts +37 -0
- package/src/scene/TJG/billboard.ts +89 -0
- package/src/scene/TJG/entityies.ts +131 -0
- package/src/scene/TJG/lines.ts +14 -0
- package/src/scene/TJG/maps.ts +16 -0
- package/src/scene/TJG/scene-tjg.ts +212 -0
- package/src/scene/TJG/ships.ts +32 -0
- package/src/scene/TJG/tileset.ts +144 -0
- package/src/scene/TJG/tjg.d.ts +14 -0
- package/src/scene/cdk/fog.ts +47 -0
- package/src/scene/cdk/index.ts +4 -0
- package/src/scene/cdk/measure.ts +108 -0
- package/src/scene/cdk/plot.ts +182 -0
- package/src/scene/cdk/source.ts +33 -0
- package/src/shaders/3d-tileset.ts +41 -0
- package/src/shaders/index.ts +1 -0
- package/src/shaders/material-property/a-readme.md +2 -0
- package/src/shaders/material-property/radarFS.glsl +25 -0
- package/src/shaders/material-property/roadFS.glsl +14 -0
- package/src/shaders/material-property/trailingFS.glsl +18 -0
- package/src/shaders/material-property/wallFS.glsl +31 -0
- package/src/shaders/raedme.md +187 -0
- package/src/shaders/ship/ShipVS.glsl +19 -0
- package/src/sl-utils-cesium.ts +1 -0
- package/src/types/cdk.d.ts +20 -0
- package/src/types/core.d.ts +6 -0
- package/src/types/entity.d.ts +628 -0
- package/src/types/event.d.ts +32 -0
- package/src/types/extend.Cesium.d.ts +28 -0
- package/src/types/geometry.d.ts +55 -0
- package/src/types/plugins.d.ts +34 -0
- package/src/types/primitive.d.ts +69 -0
- package/src/types/scene.d.ts +25 -0
- package/src/types/viewer.d.ts +114 -0
- package/src/utils/cesium.ts +189 -0
- package/src/utils/common.ts +87 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/map.ts +112 -0
- package/src/utils/types.ts +44 -0
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +34 -0
- package/types/billboard.d.ts +8 -0
- package/types/entities.d.ts +224 -0
- package/types/property.d.ts +12 -0
- package/types/resource.d.ts +26 -0
- package/types/sl-utils-cesium.d.ts +17 -0
- package/vite.config.ts +43 -0
- package/webpack.config.js +29 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**参考文献:https://mp.weixin.qq.com/s/QZ1ZJa92s8cKIb6czo2QhA */
|
|
2
|
+
import { BingMapsImageryProvider, BingMapsStyle, ImageryLayer, ImageryLayerCollection, ImageryProvider, IonImageryProvider, MapboxImageryProvider, UrlTemplateImageryProvider, WebMapServiceImageryProvider, WebMapTileServiceImageryProvider } from "cesium";
|
|
3
|
+
/**图层 */
|
|
4
|
+
export class CLayers {
|
|
5
|
+
constructor(layer: ImageryLayerCollection) {
|
|
6
|
+
this.layers = layer;
|
|
7
|
+
this.addImageryProvider = layer.addImageryProvider.bind(layer);
|
|
8
|
+
}
|
|
9
|
+
public readonly layers: ImageryLayerCollection;
|
|
10
|
+
/**添加图层 */
|
|
11
|
+
public readonly addImageryProvider: (imageryProvider: ImageryProvider, index?: number) => ImageryLayer
|
|
12
|
+
/**添加过的图层 */
|
|
13
|
+
private added: { [K: string]: ImageryLayer } = {};
|
|
14
|
+
/**从Ion资源库加载Imagery资源
|
|
15
|
+
* @param num 资源编号
|
|
16
|
+
* 2 ==> 必应地图航拍
|
|
17
|
+
* 3 ==> 必应地图航拍带标注
|
|
18
|
+
* 4 ==> 必应地图路网
|
|
19
|
+
* 2411391 ==> 必应地图路网标注
|
|
20
|
+
*/
|
|
21
|
+
public addIonImagery(num: number = 2) {
|
|
22
|
+
this.layers.add(ImageryLayer.fromProviderAsync(IonImageryProvider.fromAssetId(num), {}));
|
|
23
|
+
}
|
|
24
|
+
/**添加图层 */
|
|
25
|
+
public add(layer: ImageryLayer, index?: number) {
|
|
26
|
+
return this.layers.add(layer, index);;
|
|
27
|
+
}
|
|
28
|
+
/**使用指定图层 */
|
|
29
|
+
public use(layer: ImageryLayer) {
|
|
30
|
+
this.layers.removeAll();
|
|
31
|
+
this.layers.add(layer);
|
|
32
|
+
}
|
|
33
|
+
/**切换地图图层 */
|
|
34
|
+
public switchLayer(map: CONST_CESIUM_MAP | `${typeof CONST_CESIUM_MAP[keyof typeof CONST_CESIUM_MAP]}`) {
|
|
35
|
+
this.layers.removeAll();
|
|
36
|
+
// this.instance.add(new ImageryLayer(Bing_Satellite))
|
|
37
|
+
this.addLayer(map);
|
|
38
|
+
}
|
|
39
|
+
/**添加指定地图图层 */
|
|
40
|
+
public addLayer(map: CONST_CESIUM_MAP | `${typeof CONST_CESIUM_MAP[keyof typeof CONST_CESIUM_MAP]}`) {
|
|
41
|
+
/**获取地图名称、类型和模块(默认地图模块Map还有注释模块Annotion等) */
|
|
42
|
+
const parts = map.split("_"), name = parts[0], type = parts[1], mold = parts[2] || "Map";
|
|
43
|
+
/**根据名称从info中获取详细(子域subdomains、token值、以及url) */
|
|
44
|
+
const info = CONST_CESIUM_MAPINFO[name], subdomains = info.Subdomains, token = info.key;
|
|
45
|
+
/**获得地图地址以及增加token */
|
|
46
|
+
const address = info[type][mold], url = address.replace("{key}", token);
|
|
47
|
+
const layer = this.added[map] = this.added[map] || new ImageryLayer(new UrlTemplateImageryProvider({
|
|
48
|
+
url: url,
|
|
49
|
+
subdomains: subdomains,
|
|
50
|
+
minimumLevel: 0,
|
|
51
|
+
maximumLevel: 18,
|
|
52
|
+
}));
|
|
53
|
+
this.layers.add(layer);
|
|
54
|
+
return layer;
|
|
55
|
+
}
|
|
56
|
+
/**加载必应地图 */
|
|
57
|
+
public async loadBingMap() {
|
|
58
|
+
var bingStyle = [
|
|
59
|
+
BingMapsStyle.AERIAL_WITH_LABELS,
|
|
60
|
+
BingMapsStyle.COLLINS_BART,
|
|
61
|
+
BingMapsStyle.CANVAS_GRAY,
|
|
62
|
+
BingMapsStyle.CANVAS_LIGHT,
|
|
63
|
+
BingMapsStyle.CANVAS_DARK,
|
|
64
|
+
BingMapsStyle.ORDNANCE_SURVEY,
|
|
65
|
+
BingMapsStyle.ROAD,
|
|
66
|
+
BingMapsStyle.AERIAL,
|
|
67
|
+
];
|
|
68
|
+
var bingMapProvider = await BingMapsImageryProvider.fromUrl("https://dev.virtualearth.net",
|
|
69
|
+
{
|
|
70
|
+
key: "AmXdbd8UeUJtaRSn7yVwyXgQlBBUqliLbHpgn2c76DfuHwAXfRrgS5qwfHU6Rhm8",
|
|
71
|
+
mapStyle: bingStyle[2],
|
|
72
|
+
});
|
|
73
|
+
this.layers.addImageryProvider(bingMapProvider);
|
|
74
|
+
}
|
|
75
|
+
/**添加MapboxImageryProvider影像服务 */
|
|
76
|
+
public addMapboxImagery(index: number) {
|
|
77
|
+
//MapboxImageryProvider影像服务
|
|
78
|
+
const MapboxIds = [
|
|
79
|
+
"mapbox.streets",
|
|
80
|
+
"mapbox.light",
|
|
81
|
+
"mapbox.dark",
|
|
82
|
+
"mapbox.satellite",
|
|
83
|
+
"mapbox.streets-satellite",
|
|
84
|
+
"mapbox.wheatpaste",
|
|
85
|
+
"mapbox.streets-basic",
|
|
86
|
+
"mapbox.comic",
|
|
87
|
+
"mapbox.outdoors",
|
|
88
|
+
"mapbox.run-bike-hike",
|
|
89
|
+
"mapbox.pencil",
|
|
90
|
+
"mapbox.pirates",
|
|
91
|
+
"mapbox.emerald",
|
|
92
|
+
"mapbox.high-contrast"
|
|
93
|
+
];
|
|
94
|
+
const map = new MapboxImageryProvider({
|
|
95
|
+
mapId: MapboxIds[index],
|
|
96
|
+
accessToken: 'pk.eyJ1IjoibHM4NZAWNjEWMTEiLCJhIjoiY2tqYXZ1Z2]rMDI5bT]zcD]mdDNteGhsNy19.0wTn4B1ce904U5GnPso5iA'
|
|
97
|
+
})
|
|
98
|
+
this.layers.add(new ImageryLayer(map))
|
|
99
|
+
}
|
|
100
|
+
/**添加符合WMS规范的影像服务 */
|
|
101
|
+
public addWMSLayer() {
|
|
102
|
+
var provider = new WebMapServiceImageryProvider({
|
|
103
|
+
url:"https://nationalmap.gov.au/proxy/http://geoserver.nationalmap.nicta.com.au/geotopo_250k/ows",
|
|
104
|
+
layers: "Hydrography:bores",
|
|
105
|
+
parameters: {
|
|
106
|
+
transparent: true,
|
|
107
|
+
format: "image/png",
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
return this.addImageryProvider(provider);
|
|
111
|
+
}
|
|
112
|
+
/**添加符合WMTS1.0.0规范的影像服务 */
|
|
113
|
+
public addWMTSLayer() {
|
|
114
|
+
var shadedRelief1 = new WebMapTileServiceImageryProvider({
|
|
115
|
+
url: "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/WMTS",
|
|
116
|
+
layer: "World_Imagery",
|
|
117
|
+
style: "default",
|
|
118
|
+
format: "image/jpeg",
|
|
119
|
+
tileMatrixSetID: "default028mm",
|
|
120
|
+
maximumLevel: 23,
|
|
121
|
+
});
|
|
122
|
+
/**wmts格式卫星底图*/
|
|
123
|
+
const Tianditu_Satellite = new ImageryLayer(new WebMapTileServiceImageryProvider({
|
|
124
|
+
url: "https://t{s}.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&tk=5c3d18966556d9ef7f34d4f9b2c6a53e",
|
|
125
|
+
layer: "img",
|
|
126
|
+
style: 'default',
|
|
127
|
+
format: "tiles",
|
|
128
|
+
tileMatrixSetID: "Tianditu",
|
|
129
|
+
subdomains: ['0', '1', '2', '3', '4', '5', '6', '7']
|
|
130
|
+
}), {});
|
|
131
|
+
this.add(Tianditu_Satellite)
|
|
132
|
+
// return this.addImageryProvider(Tianditu_Satellite);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/**地图服务相关 */
|
|
139
|
+
export enum CONST_CESIUM_MAP {
|
|
140
|
+
/**天地图 */
|
|
141
|
+
Tianditu_Normal = "Tianditu_Normal",
|
|
142
|
+
Tianditu_Normal_Annotion = "Tianditu_Normal_Annotion",
|
|
143
|
+
Tianditu_Satellite = "Tianditu_Satellite",
|
|
144
|
+
Tianditu_Satellite_Annotion = "Tianditu_Satellite_Annotion",
|
|
145
|
+
Tianditu_Terrain = "Tianditu_Terrain",
|
|
146
|
+
Tianditu_Terrain_Annotion = "Tianditu_Terrain_Annotion",
|
|
147
|
+
/**高德地图 */
|
|
148
|
+
Gaode_Normal = "Gaode_Normal",
|
|
149
|
+
Gaode_Satellite = "Gaode_Satellite",
|
|
150
|
+
Gaode_Satellite_Annotion = "Gaode_Satellite_Annotion",
|
|
151
|
+
/**谷歌地图 */
|
|
152
|
+
Google_Normal = "Google_Normal",
|
|
153
|
+
Google_Satellite = "Google_Satellite",
|
|
154
|
+
Google_Satellite_Annotion = "Google_Satellite_Annotion",
|
|
155
|
+
/**Geoq地图 */
|
|
156
|
+
Geoq_Normal = "Geoq_Normal",
|
|
157
|
+
Geoq_Normal_PurplishBlue = "Geoq_Normal_PurplishBlue",
|
|
158
|
+
Geoq_Normal_Gray = "Geoq_Normal_Gray",
|
|
159
|
+
Geoq_Normal_Warm = "Geoq_Normal_Warm",
|
|
160
|
+
Geoq_Theme_Hydro = "Geoq_Theme_Hydro",
|
|
161
|
+
/**OSM地图 */
|
|
162
|
+
OSM_Normal = "OSM_Normal",
|
|
163
|
+
/**百度地图 */
|
|
164
|
+
}
|
|
165
|
+
/**地图相关的服务信息
|
|
166
|
+
* @param Normal 矢量地图 Satellite 卫星地图 Terrain 地形图
|
|
167
|
+
* @param Map 地图 Annotion 注记 Gray
|
|
168
|
+
*/
|
|
169
|
+
const CONST_CESIUM_MAPINFO: any = {
|
|
170
|
+
Tianditu: {
|
|
171
|
+
Normal: {
|
|
172
|
+
Map: "//t{s}.tianditu.com/DataServer?T=vec_w&X={x}&Y={y}&L={z}&tk={key}",
|
|
173
|
+
Annotion: "//t{s}.tianditu.com/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk={key}"
|
|
174
|
+
},
|
|
175
|
+
Satellite: {
|
|
176
|
+
Map: "//t{s}.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk={key}",
|
|
177
|
+
Annotion: "//t{s}.tianditu.com/DataServer?T=cia_w&X={x}&Y={y}&L={z}&tk={key}"
|
|
178
|
+
},
|
|
179
|
+
Terrain: {
|
|
180
|
+
Map: "//t{s}.tianditu.com/DataServer?T=ter_w&X={x}&Y={y}&L={z}&tk={key}",
|
|
181
|
+
Annotion: "//t{s}.tianditu.com/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}"
|
|
182
|
+
},
|
|
183
|
+
Subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
|
|
184
|
+
key: "a9e2dd65c94fab979c9d897ff7098a4c"
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
Gaode: {
|
|
188
|
+
Normal: {
|
|
189
|
+
Map: '//webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
|
|
190
|
+
},
|
|
191
|
+
Satellite: {
|
|
192
|
+
Map: '//webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
193
|
+
Annotion: '//webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}'
|
|
194
|
+
},
|
|
195
|
+
Subdomains: ["1", "2", "3", "4"]
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
Google: {
|
|
199
|
+
Normal: {
|
|
200
|
+
Map: "//www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}"
|
|
201
|
+
},
|
|
202
|
+
Satellite: {
|
|
203
|
+
Map: "//www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}",
|
|
204
|
+
Annotion: "//www.google.cn/maps/vt?lyrs=y@189&gl=cn&x={x}&y={y}&z={z}"
|
|
205
|
+
},
|
|
206
|
+
Subdomains: []
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
Geoq: {
|
|
210
|
+
Normal: {
|
|
211
|
+
Map: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}",
|
|
212
|
+
PurplishBlue: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}",
|
|
213
|
+
Gray: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}",
|
|
214
|
+
Warm: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}",
|
|
215
|
+
},
|
|
216
|
+
Theme: {
|
|
217
|
+
Hydro: "//thematic.geoq.cn/arcgis/rest/services/ThematicMaps/WorldHydroMap/MapServer/tile/{z}/{y}/{x}"
|
|
218
|
+
},
|
|
219
|
+
Subdomains: []
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
OSM: {
|
|
223
|
+
Normal: {
|
|
224
|
+
Map: "//{s}.tile.osm.org/{z}/{x}/{y}.png",
|
|
225
|
+
},
|
|
226
|
+
Subdomains: ['a', 'b', 'c']
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
Baidu: {
|
|
230
|
+
Normal: {
|
|
231
|
+
Map: '//online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1'
|
|
232
|
+
},
|
|
233
|
+
Satellite: {
|
|
234
|
+
Map: '//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46',
|
|
235
|
+
Annotion: '//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020'
|
|
236
|
+
},
|
|
237
|
+
Subdomains: '0123456789',
|
|
238
|
+
tms: true
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BillboardCollection, Cartesian3, Cesium3DTileStyle, Cesium3DTileset, Color, EllipseGeometry, GeometryInstance, HeadingPitchRoll, HorizontalOrigin, Model, Primitive, PrimitiveCollection, Transforms, createOsmBuildingsAsync } from "cesium";
|
|
2
|
+
import { PrimitiveImage2D } from "../../primitives";
|
|
3
|
+
|
|
4
|
+
/**Primitive(基元):轻量级图形对象,表示几何体和材质的组合。是Cesium底层渲染单元,用于高效地绘制大规模的图形。使用Primitive,你可以直接控制几何体的位置、旋转、缩放等属性。Primitive通常用于绘制地形、模型、点云等图形,以及自定义的几何形状。
|
|
5
|
+
* Primitive用于表示简单的图形对象,侧重于几何体和渲染
|
|
6
|
+
* 创建方式更接近渲染引擎底层,需要初始化很多对象,比如外观(Appearance)、几何形状(Geometry)等,使用相对繁琐
|
|
7
|
+
*/
|
|
8
|
+
export class CPrimitives {
|
|
9
|
+
constructor(primitive: PrimitiveCollection) {
|
|
10
|
+
this.instance = primitive;
|
|
11
|
+
this.ctx = document.createElement('canvas').getContext('2d') as CanvasRenderingContext2D;
|
|
12
|
+
}
|
|
13
|
+
public readonly instance: PrimitiveCollection;
|
|
14
|
+
/**用于裁剪图片的 */
|
|
15
|
+
private ctx: CanvasRenderingContext2D;
|
|
16
|
+
/**加载静态3D瓦片资源
|
|
17
|
+
* 96188 ==> Cesium OSM Buildings;从OpenStreetMap派生的3D建筑层覆盖了整个世界。它包含超过3.5亿栋建筑,每个特征都有名称、地址、建筑是商业还是住宅等数据。这些建筑使用铯世界地形数据来导出基准高程。
|
|
18
|
+
* 2275207 ==>Google Photorealistic 3D Tiles
|
|
19
|
+
* 2521176 ==>Cesium OSM Buildings for CWB
|
|
20
|
+
* 'OSM' ==>OpenStreetMap 3D Buildings
|
|
21
|
+
*/
|
|
22
|
+
public async addIon3DTile(id: 96188 | 2275207 | 2521176 | 'OSM' | string): Promise<Cesium3DTileset> {
|
|
23
|
+
let tiles: Cesium3DTileset;
|
|
24
|
+
if (id === 'OSM')
|
|
25
|
+
tiles = await createOsmBuildingsAsync();
|
|
26
|
+
else if (typeof id === 'number')
|
|
27
|
+
tiles = await Cesium3DTileset.fromIonAssetId(id)
|
|
28
|
+
else
|
|
29
|
+
tiles = await Cesium3DTileset.fromUrl(id)
|
|
30
|
+
tiles.style = new Cesium3DTileStyle({
|
|
31
|
+
show: "${feature['Height']} !== '广州塔'",
|
|
32
|
+
});
|
|
33
|
+
return this.instance.add(tiles);
|
|
34
|
+
}
|
|
35
|
+
/**添加基元 */
|
|
36
|
+
public add(primitive: Primitive, index?: number) {
|
|
37
|
+
return this.instance.add(primitive, index)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**图元图片的集合 */
|
|
41
|
+
private primitiveImages: { [K: string]: PrimitiveImage2D } = Object.create(null);
|
|
42
|
+
/**添加图元图片 */
|
|
43
|
+
public addPrimitiveImages(images: OptPrimitiveImage2D[]) {
|
|
44
|
+
const { primitiveImages } = this;
|
|
45
|
+
images.forEach(opt => {
|
|
46
|
+
const { image } = opt, primitive = primitiveImages[image];
|
|
47
|
+
if (primitive) {
|
|
48
|
+
primitive.addInstance([opt])
|
|
49
|
+
} else {
|
|
50
|
+
primitiveImages[image] = new PrimitiveImage2D(image, [opt]);
|
|
51
|
+
this.instance.add(primitiveImages[image])
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { JulianDate, PostProcessStageCollection, Scene } from "cesium";
|
|
2
|
+
import { CCamera } from "./camera";
|
|
3
|
+
import { CPrimitives } from "./primitives";
|
|
4
|
+
import { CGlobe } from "./globe";
|
|
5
|
+
import { SLCViewer } from "../viewer";
|
|
6
|
+
import { CLayers } from "./layers";
|
|
7
|
+
|
|
8
|
+
/**Viewer的场景中所有三维图形对象和状态的容器。一般来说,场景不会直接创建,而是由 CesiumWidget 隐式创建。 */
|
|
9
|
+
export class CScene {
|
|
10
|
+
constructor(cviewer: SLCViewer) {
|
|
11
|
+
const scene = this.scene = cviewer.viewer.scene;
|
|
12
|
+
this.cviewer = cviewer;
|
|
13
|
+
this.camera = new CCamera(cviewer);
|
|
14
|
+
this.cglobe = new CGlobe(scene.globe);
|
|
15
|
+
this.primitives = new CPrimitives(scene.primitives);
|
|
16
|
+
this.clayers = cviewer.clayers;
|
|
17
|
+
this.postProcessStages = scene.postProcessStages;
|
|
18
|
+
this.addEventListener(scene);
|
|
19
|
+
}
|
|
20
|
+
/**Viewer主类 */
|
|
21
|
+
private cviewer: SLCViewer;
|
|
22
|
+
/**场景 */
|
|
23
|
+
public readonly scene: Scene;
|
|
24
|
+
/**场景相机 */
|
|
25
|
+
public readonly camera: CCamera;
|
|
26
|
+
/**场景基元 */
|
|
27
|
+
public readonly primitives: CPrimitives;
|
|
28
|
+
/**场景地球 */
|
|
29
|
+
public readonly cglobe: CGlobe;
|
|
30
|
+
/**地图图层 */
|
|
31
|
+
public readonly clayers: CLayers;
|
|
32
|
+
/**后期处理效果
|
|
33
|
+
* 1、给某个对象添加后期处理效果index.html?src=Custom%20Per-Feature%20Post%20Process.html
|
|
34
|
+
* 2、给整个场景添加后期处理效果index.html?src=Custom%20Post%20Process.html
|
|
35
|
+
*/
|
|
36
|
+
public readonly postProcessStages: PostProcessStageCollection;
|
|
37
|
+
/**添加事件 */
|
|
38
|
+
private addEventListener(scene: Scene) {
|
|
39
|
+
scene.preUpdate.addEventListener((scene: Scene, time: JulianDate) => this.cviewer.trigger('PREUPDATE', [scene, time]))
|
|
40
|
+
scene.postUpdate.addEventListener((scene: Scene, time: JulianDate) => this.cviewer.trigger('POSTUPDATE', [scene, time]))
|
|
41
|
+
scene.preRender.addEventListener((scene: Scene, time: JulianDate) => this.cviewer.trigger('PRERENDER', [scene, time]))
|
|
42
|
+
scene.postRender.addEventListener((scene: Scene, time: JulianDate) => this.cviewer.trigger('POSTRENDER', [scene, time]))
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Clock } from "cesium";
|
|
2
|
+
import { SLCViewer } from ".";
|
|
3
|
+
export const FrameBacks: FrameAnimation[] = [];
|
|
4
|
+
interface FrameAnimation {
|
|
5
|
+
[k: string]: any;
|
|
6
|
+
/**要调整的目标对象 */
|
|
7
|
+
target: Object;
|
|
8
|
+
/**动画执行时间(秒) */
|
|
9
|
+
duration: number,
|
|
10
|
+
/**动画重复次数(-1无限重复) */
|
|
11
|
+
repeat: number,
|
|
12
|
+
/**动画执行函数 */
|
|
13
|
+
ease: 'none',
|
|
14
|
+
/**每次执行时写入的记录 */
|
|
15
|
+
_record?: {
|
|
16
|
+
/**动画开始的时间戳 */
|
|
17
|
+
_now: number;
|
|
18
|
+
/**执行动画的属性key */
|
|
19
|
+
_keys: string[];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class CClock {
|
|
24
|
+
constructor(cviewer: SLCViewer) {
|
|
25
|
+
this.cviewer = cviewer;
|
|
26
|
+
const clock = this.clock = cviewer.viewer.clock;
|
|
27
|
+
this.addEventListener(clock);
|
|
28
|
+
}
|
|
29
|
+
/**Viewer主类 */
|
|
30
|
+
private cviewer: SLCViewer;
|
|
31
|
+
/**原始时钟 */
|
|
32
|
+
public readonly clock: Clock;
|
|
33
|
+
/**与上一帧的间隔 */
|
|
34
|
+
private delta: number = 0;
|
|
35
|
+
/** */
|
|
36
|
+
private now: number = Date.now();
|
|
37
|
+
private addEventListener(clock: Clock) {
|
|
38
|
+
clock.onTick.addEventListener((clock: Clock) => {
|
|
39
|
+
this.callFrameBacks(clock)
|
|
40
|
+
// 每次时钟滴答时触发的事件
|
|
41
|
+
this.cviewer.trigger('TICK', [clock])
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
/**调用每帧回调函索 */
|
|
45
|
+
private callFrameBacks(clock: Clock) {
|
|
46
|
+
const delta = Date.now() - this.now;
|
|
47
|
+
this.now = Date.now();
|
|
48
|
+
this.delta = delta;
|
|
49
|
+
FrameBacks.forEach((frame) => {
|
|
50
|
+
const { target, duration, repeat, ease, _record } = frame;
|
|
51
|
+
if (_record === undefined) {
|
|
52
|
+
const record = frame._record = Object.create(null);
|
|
53
|
+
record._now = this.now;
|
|
54
|
+
record._keys = [];
|
|
55
|
+
for (const key in frame) {
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(frame, key)) {
|
|
57
|
+
if (['target', 'duration', 'repeat', 'ease'].includes(key)) return
|
|
58
|
+
record._keys.push(key);
|
|
59
|
+
/**记录该key的初始值 */
|
|
60
|
+
record[key] = target[key];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const record = frame._record;
|
|
65
|
+
const { _keys, _now } = record
|
|
66
|
+
if (_keys.length === 0) return;
|
|
67
|
+
// 计算当前时间在动画中的进度
|
|
68
|
+
const progress = (this.now - _now) / duration * 1000;
|
|
69
|
+
// 如果动画已完成,且重复次数为0,则不再执行
|
|
70
|
+
if (progress > 1 && repeat === 0) {
|
|
71
|
+
FrameBacks.splice(FrameBacks.indexOf(frame), 1);
|
|
72
|
+
_keys.forEach(key => {
|
|
73
|
+
target[key] = frame[key];
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// 如果动画已完成,且重复次数大于0,则重置动画
|
|
78
|
+
if (progress > 1 && repeat > 0) {
|
|
79
|
+
frame.repeat--;
|
|
80
|
+
record._now = this.now;
|
|
81
|
+
_keys.forEach(key => {
|
|
82
|
+
target[key] = record[key];
|
|
83
|
+
});
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// 计算当前时间在动画中的进度
|
|
87
|
+
_keys.forEach(key => {
|
|
88
|
+
target[key] = record[key] + (frame[key] - record[key]) * (progress % 1);
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Color, DataSource, DataSourceCollection, GeoJsonDataSource } from "cesium";
|
|
2
|
+
|
|
3
|
+
export class CDataSource {
|
|
4
|
+
constructor(data: DataSourceCollection) {
|
|
5
|
+
this.dataSources = data
|
|
6
|
+
}
|
|
7
|
+
public readonly dataSources: DataSourceCollection;
|
|
8
|
+
/**导入JSON */
|
|
9
|
+
public async loadJson(url: string): Promise<DataSource> {
|
|
10
|
+
let data = await GeoJsonDataSource.load(url, {
|
|
11
|
+
fill: Color.fromBytes(27, 138, 255, 255).withAlpha(1.0),
|
|
12
|
+
strokeWidth: 3,
|
|
13
|
+
stroke: Color.BLUE,
|
|
14
|
+
})
|
|
15
|
+
return this.dataSources.add(data)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Cartesian2, FeatureDetection, ScreenSpaceEventHandler, ScreenSpaceEventType, getTimestamp } from 'cesium';
|
|
2
|
+
import { CEvent } from './event';
|
|
3
|
+
|
|
4
|
+
/**键盘状态 */
|
|
5
|
+
const KEYSTATES: { readonly [K in KeyCode]: boolean } = Object.create(null)
|
|
6
|
+
/**3D视图HTML节点管理类
|
|
7
|
+
* @param position 鼠标当前位置
|
|
8
|
+
* @param positionStart 上一次鼠标当前位置
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export class CElement {
|
|
12
|
+
constructor(dom: HTMLElement = document.body, event: CEvent) {
|
|
13
|
+
this._ele = dom;
|
|
14
|
+
this.event = event;
|
|
15
|
+
this.genObserver();
|
|
16
|
+
this.registerListeners()
|
|
17
|
+
}
|
|
18
|
+
public readonly event: CEvent<UCEvent>;
|
|
19
|
+
/**事件监听执行者 */
|
|
20
|
+
private handler: ScreenSpaceEventHandler;
|
|
21
|
+
/**节点大小变化的观察对象 */
|
|
22
|
+
private resizeObserver: ResizeObserver;
|
|
23
|
+
/**所有的监听事件 */
|
|
24
|
+
private listeners: {
|
|
25
|
+
/**被监听的节点 */
|
|
26
|
+
ele: HTMLElement | Document,
|
|
27
|
+
/**监听的事件类型 */
|
|
28
|
+
type: keyof HTMLElementEventMap,
|
|
29
|
+
/**回调函数 */
|
|
30
|
+
cb: (this: HTMLElement, ev: any) => any,
|
|
31
|
+
/**参数 */
|
|
32
|
+
param?: any
|
|
33
|
+
}[] = [];
|
|
34
|
+
/**视口 */
|
|
35
|
+
public rect: DOMRect;
|
|
36
|
+
/**宽 */
|
|
37
|
+
public width: number;
|
|
38
|
+
/**高 */
|
|
39
|
+
public height: number;
|
|
40
|
+
/**挂载的节点 */
|
|
41
|
+
private _ele: HTMLElement;
|
|
42
|
+
public get ele() {
|
|
43
|
+
if (!this._ele) console.error('CElement没有初始化!')
|
|
44
|
+
return this._ele;
|
|
45
|
+
}
|
|
46
|
+
/**上次鼠标位置 */
|
|
47
|
+
public readonly positionStart: Cartesian2 = new Cartesian2();
|
|
48
|
+
/**当前鼠标位置 场景pick用*/
|
|
49
|
+
public readonly position: Cartesian2 = new Cartesian2();
|
|
50
|
+
/**屏幕中间的位置 */
|
|
51
|
+
public readonly center: Cartesian2 = new Cartesian2();
|
|
52
|
+
/**键盘按键状态 */
|
|
53
|
+
public readonly keyStates: {
|
|
54
|
+
readonly [K in KeyCode]: boolean
|
|
55
|
+
} = KEYSTATES;
|
|
56
|
+
/**销毁 */
|
|
57
|
+
public kill() {
|
|
58
|
+
this.resizeObserver.unobserve(this.ele);
|
|
59
|
+
this.listeners.forEach(e => {
|
|
60
|
+
const { ele, type, cb, param = {} } = e;
|
|
61
|
+
ele.removeEventListener(type, cb, param)
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
/**生成观察者,观察节点大小 */
|
|
65
|
+
private genObserver() {
|
|
66
|
+
const that = this, { ele, center } = that;
|
|
67
|
+
that.width = ele.clientWidth;
|
|
68
|
+
that.height = ele.clientHeight;
|
|
69
|
+
that.rect = ele.getBoundingClientRect();
|
|
70
|
+
// 创建 ResizeObserver 实例
|
|
71
|
+
const resizeObserver = this.resizeObserver = new ResizeObserver(entries => {
|
|
72
|
+
for (const entry of entries) {
|
|
73
|
+
const target = entry.target;
|
|
74
|
+
// 获取目标元素的新宽度和高度
|
|
75
|
+
that.width = target.clientWidth;
|
|
76
|
+
that.height = target.clientHeight;
|
|
77
|
+
that.rect = target.getBoundingClientRect();
|
|
78
|
+
center.x = that.rect.left + that.width / 2;
|
|
79
|
+
center.y = that.rect.top + that.height / 2;
|
|
80
|
+
// 在这里执行相应的操作,如更新布局、重新渲染等
|
|
81
|
+
console.log(`Element size changed: ${that.width}px x ${that.height}px`, that.rect);
|
|
82
|
+
that.event.trigger('RESIZE', [that])
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
// 开始观察元素大小变化
|
|
86
|
+
resizeObserver.observe(this.ele);
|
|
87
|
+
}
|
|
88
|
+
/**监听节点一系列事件并触发 */
|
|
89
|
+
private registerListeners() {
|
|
90
|
+
this.handler = new ScreenSpaceEventHandler(this._ele as any);
|
|
91
|
+
const { handler, event, listeners, position, positionStart } = this;
|
|
92
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
93
|
+
event.trigger('LEFT_DOWN')
|
|
94
|
+
}, ScreenSpaceEventType.LEFT_DOWN)
|
|
95
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
96
|
+
event.trigger('LEFT_UP')
|
|
97
|
+
}, ScreenSpaceEventType.LEFT_UP)
|
|
98
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
99
|
+
event.trigger('LEFT_CLICK')
|
|
100
|
+
}, ScreenSpaceEventType.LEFT_CLICK)
|
|
101
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
102
|
+
event.trigger('LEFT_DOUBLE_CLICK')
|
|
103
|
+
}, ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
|
|
104
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
105
|
+
event.trigger('RIGHT_DOWN')
|
|
106
|
+
}, ScreenSpaceEventType.RIGHT_DOWN)
|
|
107
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
108
|
+
event.trigger('RIGHT_UP')
|
|
109
|
+
}, ScreenSpaceEventType.RIGHT_UP)
|
|
110
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
111
|
+
event.trigger('RIGHT_CLICK')
|
|
112
|
+
}, ScreenSpaceEventType.RIGHT_CLICK)
|
|
113
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
114
|
+
event.trigger('MIDDLE_DOWN')
|
|
115
|
+
}, ScreenSpaceEventType.MIDDLE_DOWN)
|
|
116
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
117
|
+
event.trigger('MIDDLE_UP')
|
|
118
|
+
}, ScreenSpaceEventType.MIDDLE_UP)
|
|
119
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.PositionedEvent) => {
|
|
120
|
+
event.trigger('MIDDLE_CLICK')
|
|
121
|
+
}, ScreenSpaceEventType.MIDDLE_CLICK)
|
|
122
|
+
handler.setInputAction((e: ScreenSpaceEventHandler.MotionEvent) => {
|
|
123
|
+
e.endPosition.clone(position);
|
|
124
|
+
e.startPosition.clone(positionStart)
|
|
125
|
+
event.trigger('MOUSE_MOVE')
|
|
126
|
+
}, ScreenSpaceEventType.MOUSE_MOVE)
|
|
127
|
+
handler.setInputAction((e: number) => {
|
|
128
|
+
event.trigger('WHEEL')
|
|
129
|
+
}, ScreenSpaceEventType.WHEEL)
|
|
130
|
+
listeners.push({
|
|
131
|
+
ele: document, type: 'keydown', cb: (ev: KeyboardEvent) => {
|
|
132
|
+
KEYSTATES[ev.code] = true;
|
|
133
|
+
event.trigger('KEY_DOWN', [ev])
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
ele: document, type: 'keyup', cb: (ev: KeyboardEvent) => {
|
|
137
|
+
KEYSTATES[ev.code] = false;
|
|
138
|
+
event.trigger('KEY_UP', [ev])
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
listeners.forEach(e => {
|
|
142
|
+
const { ele, type, cb, param = {} } = e;
|
|
143
|
+
ele.addEventListener(type, cb, param)
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Cartesian3, Color, Entity, EntityCollection, HeadingPitchRoll, Model, Transforms, Math, DistanceDisplayCondition } from "cesium";
|
|
2
|
+
/**Entity(实体):表示场景中的实体或物体,如建筑物、车辆、航线、传感器等。Entity提供了更高级的抽象层,能够以更语义化的方式描述场景中的对象。它不仅包含几何体和材质信息,还提供了丰富的属性和行为,例如位置、方向、标签、描述、运动、关联的时间信息等。Entity还支持动态更新,可以根据需要更改其属性,并反映在场景中的实时变化。
|
|
3
|
+
* Entity用于表示更复杂的实体或物体,提供了更丰富的属性和行为
|
|
4
|
+
* Entity对象可以包含一个或多个Primitive对象,通过Entity的primitive属性可以添加和管理相关的Primitive。可以在一个高级的Entity对象中组合多个底层的Primitive,从而实现更复杂的场景表示。
|
|
5
|
+
*/
|
|
6
|
+
export class CEntities {
|
|
7
|
+
constructor(entity: EntityCollection) {
|
|
8
|
+
this.entities = entity;
|
|
9
|
+
}
|
|
10
|
+
public readonly entities: EntityCollection;
|
|
11
|
+
/**添加实体(已经添加的实体不会再次添加,避免报错) */
|
|
12
|
+
public add(entity: Entity | Entity.ConstructorOptions): Entity {
|
|
13
|
+
if (entity instanceof Entity && this.entities.contains(entity)) return entity;
|
|
14
|
+
return this.entities.add(entity)
|
|
15
|
+
}
|
|
16
|
+
/**移除实体 */
|
|
17
|
+
public remove(entity: Entity): boolean {
|
|
18
|
+
return this.entities.remove(entity)
|
|
19
|
+
}
|
|
20
|
+
/**导入精细的模型 */
|
|
21
|
+
public addModel(opt: EntityModelOpt | Entity): Entity {
|
|
22
|
+
if (opt instanceof Entity) return this.entities.add(opt);
|
|
23
|
+
let { position: [lng, lat, height] = [0, 0, 0], rotate: [X, Y, Z] = [0, 0, 0], url, scale = 1.0 } = opt;
|
|
24
|
+
/**模型位置 , 模型方向 */
|
|
25
|
+
/**模型位置 */
|
|
26
|
+
const address = Cartesian3.fromDegrees(lng, lat, height);
|
|
27
|
+
let orientation = Transforms.headingPitchRollQuaternion(
|
|
28
|
+
address,
|
|
29
|
+
new HeadingPitchRoll(Math.toRadians(Z), Math.toRadians(Y), Math.toRadians(X))
|
|
30
|
+
);
|
|
31
|
+
const entity = new Entity({
|
|
32
|
+
id: url,
|
|
33
|
+
name: url,
|
|
34
|
+
position: address,
|
|
35
|
+
orientation: orientation,
|
|
36
|
+
model: {
|
|
37
|
+
uri: url,
|
|
38
|
+
/**是否显示 */
|
|
39
|
+
show: true,
|
|
40
|
+
/**模型缩放比例 */
|
|
41
|
+
scale: scale,
|
|
42
|
+
/**模型最小刻度 */
|
|
43
|
+
minimumPixelSize: 16,
|
|
44
|
+
/**模型最大刻度 */
|
|
45
|
+
maximumScale: 20000,
|
|
46
|
+
/**模型颜色 */
|
|
47
|
+
color: Color.WHITE.withAlpha(1.0),
|
|
48
|
+
/**模型轮廓颜色 */
|
|
49
|
+
silhouetteColor: new Color(255, 255, 255, 0),
|
|
50
|
+
/**模型轮廓宽度 */
|
|
51
|
+
silhouetteSize: 2,
|
|
52
|
+
/**最大层级 */
|
|
53
|
+
distanceDisplayCondition: new DistanceDisplayCondition(0, 10000),
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
return this.entities.add(entity);
|
|
57
|
+
}
|
|
58
|
+
/**移除指定模型(模型不会被销毁,可再次添加) */
|
|
59
|
+
public removeModel(entity: Entity | string) {
|
|
60
|
+
if (typeof entity === 'string') entity = this.entities.getById(entity);
|
|
61
|
+
this.entities.remove(entity);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**模型配置 */
|
|
66
|
+
interface EntityModelOpt {
|
|
67
|
+
/**模型地址 */
|
|
68
|
+
url: string,
|
|
69
|
+
/**模型位置 [经度,纬度,高度] */
|
|
70
|
+
position: LnglatHeight,
|
|
71
|
+
/**绕轴旋转 +顺时针-逆时针 [X轴,Y轴,Z轴] 度 */
|
|
72
|
+
rotate: [number, number, number],
|
|
73
|
+
scale?: number
|
|
74
|
+
}
|