@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,155 @@
|
|
|
1
|
+
/**事件核心类 */
|
|
2
|
+
export class CEvent<T extends string = string> {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.cbs._core = Object.create(null);
|
|
5
|
+
}
|
|
6
|
+
/**注册回调事件
|
|
7
|
+
* key: 事件名.空间名,/事件名.空间名,/事件名.空间名
|
|
8
|
+
*/
|
|
9
|
+
public cb = new Proxy(Object.create(null), {
|
|
10
|
+
get: (target, key: T | `${T}.${string}`, receiver) => {
|
|
11
|
+
return (arg: any[]) => {
|
|
12
|
+
this.trigger(key as T, arg)
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
set: (target, key: T | `${T}.${string}`, value, receiver) => {
|
|
16
|
+
this.on(key as T, value)
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
/**事件回调函数集合 */
|
|
21
|
+
private cbs: TEventCallback = Object.create(null);
|
|
22
|
+
/**执行后注销事件 */
|
|
23
|
+
private onces: Function[] = [];
|
|
24
|
+
/**销毁方法 */
|
|
25
|
+
public kill() {
|
|
26
|
+
this.cbs = Object.create(null)
|
|
27
|
+
this.cbs._core = Object.create(null)
|
|
28
|
+
}
|
|
29
|
+
/**注册事件
|
|
30
|
+
* @param name 事件名(申明特殊的事件空间用'事件名.事件空间',多个事件'事件名[.事件空间],/'分割),
|
|
31
|
+
* @param callback 事件回调函数
|
|
32
|
+
* @return @type Array<事件名[.事件空间]>
|
|
33
|
+
*/
|
|
34
|
+
public on(name: T | `${T}.${string}`, callback: Function, once: boolean = false): string[] {
|
|
35
|
+
if (typeof name === 'undefined' || name === '') {
|
|
36
|
+
console.warn('事件注册异常: 事件名未设置');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (typeof callback === 'undefined') {
|
|
40
|
+
console.warn('事件注册异常: 回调事件未设置')
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const that = this, { cbs, onces } = that, names = that.resolveNames(name);
|
|
44
|
+
if (once) onces.push(callback);
|
|
45
|
+
//注册事件
|
|
46
|
+
names.forEach((_name) => {
|
|
47
|
+
const res = that.resolveName(_name), { space, name } = res;
|
|
48
|
+
// Object.create(null) instanceof Object == false
|
|
49
|
+
if (!cbs[space])
|
|
50
|
+
cbs[space] = Object.create(null)
|
|
51
|
+
if (!(cbs[space][name] instanceof Array))
|
|
52
|
+
cbs[space][name] = []
|
|
53
|
+
cbs[space][name].push(callback)
|
|
54
|
+
})
|
|
55
|
+
return names;
|
|
56
|
+
}
|
|
57
|
+
/**关闭注销事件
|
|
58
|
+
* @param name 事件名(申明特殊的事件空间用'事件名.事件空间',多个事件'事件名[.事件空间],/'分割),
|
|
59
|
+
*/
|
|
60
|
+
public off(_names: T | `${T}.${string}` | `.${string}`) {
|
|
61
|
+
if (typeof _names === 'undefined' || _names === '') {
|
|
62
|
+
console.warn('事件注销异常: 事件名未设置');
|
|
63
|
+
return false
|
|
64
|
+
}
|
|
65
|
+
const that = this, names = that.resolveNames(_names);
|
|
66
|
+
//注销事件
|
|
67
|
+
names.forEach((_name) => {
|
|
68
|
+
const res = that.resolveName(_name), { space, name } = res, { cbs } = that;
|
|
69
|
+
if (space !== '_core' && name === '') {
|
|
70
|
+
Reflect.deleteProperty(cbs, space)
|
|
71
|
+
} else {
|
|
72
|
+
if (space === '_core') {
|
|
73
|
+
for (const space in cbs) {
|
|
74
|
+
if (cbs[space] instanceof Object) {
|
|
75
|
+
Reflect.deleteProperty(cbs[space], name)
|
|
76
|
+
if (Object.keys(cbs[space]).length === 0) Reflect.deleteProperty(cbs, space)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} else if (cbs[space] instanceof Object) {
|
|
80
|
+
Reflect.deleteProperty(cbs[space], name)
|
|
81
|
+
if (Object.keys(cbs[space]).length === 0) Reflect.deleteProperty(cbs, space)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
return this
|
|
86
|
+
}
|
|
87
|
+
/**触发指定事件
|
|
88
|
+
* Trigger
|
|
89
|
+
*/
|
|
90
|
+
public trigger(_name: T, _args: any[] = []): void {
|
|
91
|
+
if (typeof _name === 'undefined' || _name === '') {
|
|
92
|
+
console.warn('事件触发异常: 事件名未设置');
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
const that = this, { cbs } = that;
|
|
96
|
+
const args = !(_args instanceof Array) ? [_args] : _args;
|
|
97
|
+
const names = that.resolveNames(_name), { space, name } = that.resolveName(names[0])
|
|
98
|
+
//未指定事件名
|
|
99
|
+
if (name === '') {
|
|
100
|
+
console.warn('事件触发异常: 事件名未设置')
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
//未指定命名空间,触发所有该事件
|
|
104
|
+
if (space === '_core') {
|
|
105
|
+
for (const space in cbs) {
|
|
106
|
+
if (typeof cbs[space] == 'object' && cbs[space][name] instanceof Array) {
|
|
107
|
+
const callbacks = cbs[space][name];
|
|
108
|
+
callbacks.forEach((callback) => {
|
|
109
|
+
callback.apply(this, args)
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} else if (typeof cbs[space] == 'object' && cbs[space][name] instanceof Array) {
|
|
114
|
+
//只触发指定命名空间的事件
|
|
115
|
+
cbs[space][name].forEach((callback) => {
|
|
116
|
+
callback.apply(this, args)
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 解析事件名
|
|
122
|
+
*/
|
|
123
|
+
private resolveNames(_names: string): string[] {
|
|
124
|
+
_names = _names.replace(/[^a-zA-Z0-9 ,/.]/g, '')
|
|
125
|
+
_names = _names.replace(/[,/]+/g, ' ')
|
|
126
|
+
return _names.split(' ')
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 解析事件名和事件空间
|
|
130
|
+
*/
|
|
131
|
+
private resolveName(name: string): TEventSpace {
|
|
132
|
+
const parts = name.split('.')
|
|
133
|
+
return {
|
|
134
|
+
original: name,
|
|
135
|
+
name: parts[0],
|
|
136
|
+
space: parts[1] || '_core'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**事件空间 */
|
|
141
|
+
interface TEventSpace {
|
|
142
|
+
/**原始事件名 */
|
|
143
|
+
original: string;
|
|
144
|
+
/**事件名 */
|
|
145
|
+
name: string;
|
|
146
|
+
/**事件存放的空间(未申明时存放于_core) */
|
|
147
|
+
space: string;
|
|
148
|
+
}
|
|
149
|
+
/**事件回调函数 */
|
|
150
|
+
interface TEventCallback {
|
|
151
|
+
/**最基础的事件空间 */
|
|
152
|
+
_core: { [key: string]: Function[] }
|
|
153
|
+
/**特殊申明的事件空间 */
|
|
154
|
+
[key: string]: { [key: string]: Function[] };
|
|
155
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**地形数据 参考文献:https://mp.weixin.qq.com/s/ZC3GXEldnW2byw9Hlr6wfQ*/
|
|
2
|
+
|
|
3
|
+
import { CesiumTerrainProvider, IonResource, Terrain, Viewer } from "cesium";
|
|
4
|
+
|
|
5
|
+
/**加载标准地形 */
|
|
6
|
+
export class CTerrain {
|
|
7
|
+
constructor(viewer: Viewer) {
|
|
8
|
+
this.viewer = viewer;
|
|
9
|
+
}
|
|
10
|
+
private viewer: Viewer;
|
|
11
|
+
/**加载资源库地形(只有地形数据没有卫星图片数据)
|
|
12
|
+
* @param number 资源库编号 推荐使用1
|
|
13
|
+
* 1 ==> Cesium世界地形; 从几个数据源获取的高分辨率全球地形图集
|
|
14
|
+
* 3956 ==> ArcticDEM发布; ArcticDEM是NGA-NSF的一项公私合作项目,旨在利用光学立体图像、高性能计算和开源摄影测量软件自动生成高分辨率、高质量的北极数字地表模型(DSM)。
|
|
15
|
+
* 3957 ==> PAMap Terrain;美国宾夕法尼亚州的一处地形数据。由宾夕法尼亚州空间数据访问(PASDA)策划的宾夕法尼亚州高分辨率地形
|
|
16
|
+
* 2426648 ==> Cesium World Bathymetry;建立在GEBCO全球数据集上的全球测深和地形地形图集,并结合了高达1米分辨率的更高分辨率数据。
|
|
17
|
+
*
|
|
18
|
+
* @param opt 配置项
|
|
19
|
+
*/
|
|
20
|
+
public async addIonTerrain(number: 1 | 3956 | 3957 | 2426648 = 1, opt: CTerrainAssetOpt = {}) {
|
|
21
|
+
let { requestVertexNormals = true, requestWaterMask = true, requestMetadata, ellipsoid, credit } = opt;
|
|
22
|
+
this.viewer.terrainProvider = await CesiumTerrainProvider.fromIonAssetId(number, {
|
|
23
|
+
requestWaterMask,
|
|
24
|
+
requestVertexNormals,
|
|
25
|
+
requestMetadata,
|
|
26
|
+
ellipsoid,
|
|
27
|
+
credit
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { Ion, Viewer, Camera, Rectangle, Globe, ScreenSpaceEventHandler, createGuid, Cartesian3, ScreenSpaceEventType, defined, Entity, Scene, Clock, DataSourceCollection, EntityCollection, PrimitiveCollection, Cartesian2, CesiumWidget, Cartographic, sampleTerrainMostDetailed, Billboard } from "cesium";
|
|
2
|
+
import { CScene, CCamera, CPrimitives, CGlobe, CLayers } from "../scene";
|
|
3
|
+
import { CTerrain } from "./terrain";
|
|
4
|
+
import { CEntities } from "./entities";
|
|
5
|
+
import { CDataSource } from "./data";
|
|
6
|
+
import { CARTESIAN3_CONST_DEFAULT, CESIUM_CONST_BASE_URL, CESIUM_CONST_DEFAULT_VIEW_RECTANGLE, CESIUM_CONST_TOKEN, CESIUM_CONST_OPT_VIEWER_DEFAULT, CESIUM_CONST_DEFAULT_VIEW_FACTOR } from "../../const";
|
|
7
|
+
import { uc_getCartesian3, uc_getLnglat } from "../../utils";
|
|
8
|
+
import { CEvent } from "./event";
|
|
9
|
+
import { CElement } from "./element";
|
|
10
|
+
import { Gui } from "../libs/gui";
|
|
11
|
+
import { CClock } from "./clock";
|
|
12
|
+
const RESULT_Cartesian3 = new Cartesian3();
|
|
13
|
+
const RESULT_LNGLATHEIGHT: LnglatHeight = [, ,];
|
|
14
|
+
/**对Viewer(包含三维视图和二维地图的全功能小部件)进行扩展 */
|
|
15
|
+
export class SLCViewer<T extends string = null> extends CEvent<UCEvent | T> {
|
|
16
|
+
private static ifInit: boolean = false;
|
|
17
|
+
/**cesium项目初始化 */
|
|
18
|
+
private static initCesium() {
|
|
19
|
+
if (this.ifInit) return;
|
|
20
|
+
this.ifInit = true;
|
|
21
|
+
/**申明CESIUM静态资源根路径 */
|
|
22
|
+
(window as any).CESIUM_BASE_URL = CESIUM_CONST_BASE_URL;
|
|
23
|
+
/**整个token */
|
|
24
|
+
Ion.defaultAccessToken = CESIUM_CONST_TOKEN;
|
|
25
|
+
/**默认视角地址 */
|
|
26
|
+
Camera.DEFAULT_VIEW_RECTANGLE = CESIUM_CONST_DEFAULT_VIEW_RECTANGLE;
|
|
27
|
+
Camera.DEFAULT_VIEW_FACTOR = CESIUM_CONST_DEFAULT_VIEW_FACTOR;
|
|
28
|
+
}
|
|
29
|
+
constructor(html: HTMLElement | string, opt?: SLCViewerOpt) {
|
|
30
|
+
super()
|
|
31
|
+
SLCViewer.initCesium();
|
|
32
|
+
opt = Object.assign({}, CESIUM_CONST_OPT_VIEWER_DEFAULT, opt)
|
|
33
|
+
// const widget = new CesiumWidget(dom)
|
|
34
|
+
// const { imageryLayers, entities, scene, dataSources, container, scene: { canvas, camera, primitives }
|
|
35
|
+
// } = widget;
|
|
36
|
+
const viewer = this.viewer = new Viewer(html, opt);
|
|
37
|
+
const { imageryLayers, entities, scene, dataSources, container, scene: { canvas, camera, primitives }
|
|
38
|
+
} = viewer;
|
|
39
|
+
this.celement = new CElement(container as HTMLCanvasElement, this)
|
|
40
|
+
this.cclock = new CClock(this);
|
|
41
|
+
this.cdata = new CDataSource(dataSources);
|
|
42
|
+
this.clayers = new CLayers(imageryLayers);
|
|
43
|
+
this.centities = new CEntities(entities);
|
|
44
|
+
this.cterrain = new CTerrain(viewer);
|
|
45
|
+
this.cprimitives = new CPrimitives(primitives);
|
|
46
|
+
this.cscene = new CScene(this);
|
|
47
|
+
this.ccamera = this.cscene.camera;
|
|
48
|
+
/**隐藏Cesium图标 */
|
|
49
|
+
(viewer.cesiumWidget.creditContainer as HTMLElement).style.display = 'none';
|
|
50
|
+
viewer.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
|
51
|
+
this.removeEventListener();
|
|
52
|
+
this.addEventListener();
|
|
53
|
+
}
|
|
54
|
+
public gui = Gui;
|
|
55
|
+
public readonly id: string = createGuid();
|
|
56
|
+
/**鼠标位置 */
|
|
57
|
+
private _mouseC3: Cartesian3 = new Cartesian3();
|
|
58
|
+
private _mouseLnglat: LnglatHeight = [0, 0, 0];
|
|
59
|
+
/**鼠标位置物体id */
|
|
60
|
+
private _picked: string | Entity | undefined;
|
|
61
|
+
/**@param id 1、如果是图源primitive,会得到图元的id;
|
|
62
|
+
* 2、如果是实体会直接得到实体 */
|
|
63
|
+
public get picked() {
|
|
64
|
+
return this._picked
|
|
65
|
+
}
|
|
66
|
+
/**三维视图和二维地图的全功能小部件instance */
|
|
67
|
+
public readonly viewer: Viewer;
|
|
68
|
+
/**事件 */
|
|
69
|
+
public readonly cevent: CEvent<UCEvent | T> = this;
|
|
70
|
+
/**容器节点 更新鼠标位置以及视口的大小 */
|
|
71
|
+
public readonly celement: CElement;
|
|
72
|
+
/**时钟 */
|
|
73
|
+
public readonly cclock: CClock
|
|
74
|
+
/**图层 */
|
|
75
|
+
public readonly clayers: CLayers;
|
|
76
|
+
/**地形数据(具有海拔高度的效果) */
|
|
77
|
+
public readonly cterrain: CTerrain;
|
|
78
|
+
/**数据源 */
|
|
79
|
+
public readonly cdata: CDataSource;
|
|
80
|
+
/**实体 */
|
|
81
|
+
public readonly centities: CEntities;
|
|
82
|
+
/**场景 表示场景中的实体或物体,如建筑物、车辆、航线、传感器等*/
|
|
83
|
+
public readonly cscene: CScene;
|
|
84
|
+
/**场景相机 */
|
|
85
|
+
public readonly ccamera: CCamera;
|
|
86
|
+
/**基元 轻量级图形对象,表示几何体和材质的组合.是Cesium底层渲染单元,用于高效地绘制大规模的图形*/
|
|
87
|
+
public readonly cprimitives: CPrimitives;
|
|
88
|
+
/**场景 */
|
|
89
|
+
public get scene(): Scene {
|
|
90
|
+
return this.cscene.scene
|
|
91
|
+
}
|
|
92
|
+
/**地球 */
|
|
93
|
+
public get cglobe(): CGlobe {
|
|
94
|
+
return this.cscene.cglobe;
|
|
95
|
+
}
|
|
96
|
+
public get globe(): Globe {
|
|
97
|
+
return this.cglobe.globe;
|
|
98
|
+
}
|
|
99
|
+
public get clock(): Clock {
|
|
100
|
+
return this.cclock.clock;
|
|
101
|
+
}
|
|
102
|
+
public get camera(): Camera {
|
|
103
|
+
return this.ccamera.camera
|
|
104
|
+
}
|
|
105
|
+
public get dataSources(): DataSourceCollection {
|
|
106
|
+
return this.cdata.dataSources
|
|
107
|
+
}
|
|
108
|
+
public get entities(): EntityCollection {
|
|
109
|
+
return this.centities.entities
|
|
110
|
+
}
|
|
111
|
+
public get primitives(): PrimitiveCollection {
|
|
112
|
+
return this.cprimitives.instance
|
|
113
|
+
}
|
|
114
|
+
/**基础属性 */
|
|
115
|
+
/**当前鼠标c3位置 */
|
|
116
|
+
public get position(): Cartesian3 {
|
|
117
|
+
return this._mouseC3
|
|
118
|
+
}
|
|
119
|
+
public get lnglat(): LnglatHeight {
|
|
120
|
+
return this._mouseLnglat
|
|
121
|
+
}
|
|
122
|
+
/**触发事件的对象组 */
|
|
123
|
+
public readonly targets: any[] = [];
|
|
124
|
+
/**拾取到的物体信息 */
|
|
125
|
+
private pickeds: { id: string, primitive: any, lnglat: LnglatHeight }[] = []
|
|
126
|
+
/**注册了事件的对象 */
|
|
127
|
+
private eventsObjects: any[] = [];
|
|
128
|
+
/**注册事件 */
|
|
129
|
+
public addEventObject(object: any) {
|
|
130
|
+
if (object && !this.eventsObjects.includes(object)) {
|
|
131
|
+
this.eventsObjects.push(object);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**移除事件 */
|
|
135
|
+
public removeEventObject(object: any) {
|
|
136
|
+
const index = this.eventsObjects.indexOf(object);
|
|
137
|
+
if (index > -1) {
|
|
138
|
+
this.eventsObjects.splice(index, 1);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**注册几个基础事件,用于计算常用的功能 */
|
|
143
|
+
/**移除一些默认的事件 */
|
|
144
|
+
private removeEventListener() {
|
|
145
|
+
/**移除双击选中定位事件 */
|
|
146
|
+
this.viewer.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
|
147
|
+
/**移除单击选择事件*/
|
|
148
|
+
this.viewer.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);
|
|
149
|
+
}
|
|
150
|
+
/**添加事件 */
|
|
151
|
+
private addEventListener() {
|
|
152
|
+
const { scene, clock, ccamera, celement: { position, keyStates }, cevent } = this;
|
|
153
|
+
/**注册每帧事件 */
|
|
154
|
+
clock.onTick.addEventListener(() => {
|
|
155
|
+
this.trigger('TICK');
|
|
156
|
+
this.getMouseTargets();
|
|
157
|
+
// /**如果高度大于500米,则关闭雾化效果 */
|
|
158
|
+
// const postProcessStages = scene.postProcessStages;
|
|
159
|
+
// if (scene.camera.positionCartographic.height > 500) {
|
|
160
|
+
// Fog.enabled = false;
|
|
161
|
+
// } else if (!postProcessStages.contains(Fog)) {
|
|
162
|
+
// scene.postProcessStages.add(Fog)
|
|
163
|
+
// } else {
|
|
164
|
+
// Fog.enabled = true;
|
|
165
|
+
// }
|
|
166
|
+
})
|
|
167
|
+
/**鼠标左键点击事件 */
|
|
168
|
+
this.on('LEFT_CLICK', (ev) => {
|
|
169
|
+
this.getTerrainHeight()
|
|
170
|
+
this.parsePicked();
|
|
171
|
+
this.trigger('PICKED', [this.pickeds])
|
|
172
|
+
})
|
|
173
|
+
/**注册按键事件 */
|
|
174
|
+
this.on('KEY_DOWN', () => {
|
|
175
|
+
if (keyStates.Escape) ccamera.unlock()
|
|
176
|
+
if (keyStates.Tab) ccamera.onToggleCtr()
|
|
177
|
+
})
|
|
178
|
+
/**鼠标移动事件 */
|
|
179
|
+
this.on('MOUSE_MOVE', () => {
|
|
180
|
+
uc_getCartesian3(position, scene, this._mouseC3);
|
|
181
|
+
uc_getLnglat(position, scene, this._mouseLnglat);
|
|
182
|
+
})
|
|
183
|
+
/**场景pick初始完成方法 */
|
|
184
|
+
const pickInit = () => {
|
|
185
|
+
const defaultView = scene['defaultView'], { frustumCommandsList = [] } = defaultView || {};
|
|
186
|
+
if (frustumCommandsList.length === 0)
|
|
187
|
+
requestAnimationFrame(pickInit)
|
|
188
|
+
else {
|
|
189
|
+
requestAnimationFrame(() => this.trigger('INIT_PICK'))
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
pickInit()
|
|
193
|
+
}
|
|
194
|
+
/**返回要响应事件(点击、移入、移出)的对象 */
|
|
195
|
+
private getMouseTargets() {
|
|
196
|
+
/**获取指针拾取到的对象 */
|
|
197
|
+
const { eventsObjects, targets, scene, camera, viewer: { canvas }, celement: { position } } = this;
|
|
198
|
+
/**获取指针拾取到的对象 */
|
|
199
|
+
const picks = scene.drillPick(position);
|
|
200
|
+
/**清空触发事件的对象组 */
|
|
201
|
+
targets.length = 0;
|
|
202
|
+
if (defined(picks) && picks.length > 0) {
|
|
203
|
+
uc_getCartesian3(position, scene, RESULT_Cartesian3);
|
|
204
|
+
const distance = Cartesian3.distance(camera.position, RESULT_Cartesian3);
|
|
205
|
+
for (let i = 0; i < picks.length; i++) {
|
|
206
|
+
const picked = picks[i], primitive = picked.primitive, /**3DTiles会返回此类型*/type: string = picked?.detail?.model?.type || '';
|
|
207
|
+
if (type.toUpperCase() === 'B3DM') {
|
|
208
|
+
/**3DTiles不触发事件 */
|
|
209
|
+
// targets.push(picked)
|
|
210
|
+
} else if (eventsObjects.includes(primitive)) {
|
|
211
|
+
if (primitive instanceof Billboard) {
|
|
212
|
+
targets.push(picked)
|
|
213
|
+
} else if (distance < 10000) {
|
|
214
|
+
targets.push(picked)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
canvas.style.cursor = targets.length > 0 ? 'pointer' : 'default';
|
|
220
|
+
}
|
|
221
|
+
/**对拾取到的目标进行解析*/
|
|
222
|
+
private parsePicked() {
|
|
223
|
+
const { targets, pickeds } = this;
|
|
224
|
+
pickeds.length = 0;
|
|
225
|
+
if (targets.length > 0) {
|
|
226
|
+
for (let i = 0; i < targets.length; i++) {
|
|
227
|
+
const target = targets[i];
|
|
228
|
+
const { primitive, id } = target;
|
|
229
|
+
pickeds.push({ id, lnglat: RESULT_LNGLATHEIGHT, primitive })
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**获取地形高度和经纬度 */
|
|
234
|
+
private async getTerrainHeight(): Promise<LnglatHeight> {
|
|
235
|
+
const { celement: { position }, scene, viewer } = this;
|
|
236
|
+
const lnglat = uc_getLnglat(position, scene, RESULT_LNGLATHEIGHT);
|
|
237
|
+
if (!lnglat) return;
|
|
238
|
+
/**非太空区域获取经纬度 */
|
|
239
|
+
const positions = [Cartographic.fromDegrees(lnglat[0], lnglat[1])];
|
|
240
|
+
if (!viewer.terrainProvider) return lnglat;
|
|
241
|
+
try {
|
|
242
|
+
const sampledPositions = await sampleTerrainMostDetailed(
|
|
243
|
+
viewer.terrainProvider,
|
|
244
|
+
positions
|
|
245
|
+
);
|
|
246
|
+
const terrainHeight = sampledPositions[0].height; // 地形表面的高程
|
|
247
|
+
} catch (e) {
|
|
248
|
+
console.log(e)
|
|
249
|
+
}
|
|
250
|
+
lnglat[2] = 0;
|
|
251
|
+
const distance = this.ccamera.getDistance(lnglat)
|
|
252
|
+
console.log('点击位置经纬度为:', lnglat, ',相机到点击位置距离为:', distance)
|
|
253
|
+
return lnglat
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CallbackProperty, Cartesian3, ClassificationType, Color, ConstantPositionProperty, ConstantProperty, DeveloperError, DistanceDisplayCondition, EllipseGraphics, Entity, HeightReference, MaterialProperty, PositionProperty, Property, ShadowMode } from "cesium";
|
|
2
|
+
import { uc_getCartesian3, uc_tsIfCartesian3, uc_tsIfNumber, uc_tsIfProperty } from "../utils";
|
|
3
|
+
import { COLOR_CONST_FILL, COLOR_CONST_OUTLINE, LNGLAT_CONST_SHENLAN } from "../const";
|
|
4
|
+
const DEFAULT_ELLIPSE_OPT: OptEntityEllipse = {
|
|
5
|
+
ifChange: false,
|
|
6
|
+
show: true,
|
|
7
|
+
material: COLOR_CONST_FILL,
|
|
8
|
+
height: 0,
|
|
9
|
+
outline: true,
|
|
10
|
+
outlineColor: COLOR_CONST_OUTLINE,
|
|
11
|
+
outlineWidth: 1,
|
|
12
|
+
fill: true,
|
|
13
|
+
}
|
|
14
|
+
/**实体椭圆 */
|
|
15
|
+
export class EntityEllipse extends Entity {
|
|
16
|
+
constructor(opt: OptEntityEllipse) {
|
|
17
|
+
let { position, material, lnglat, ifChange,
|
|
18
|
+
show, semiMajorAxis, semiMinorAxis, height, heightReference, extrudedHeight, extrudedHeightReference, rotation, stRotation, granularity, fill, outline, outlineColor, outlineWidth, numberOfVerticalLines, shadows, distanceDisplayCondition, classificationType, zIndex,
|
|
19
|
+
} = Object.assign({}, DEFAULT_ELLIPSE_OPT, opt);
|
|
20
|
+
let c3;
|
|
21
|
+
if (ifChange) {
|
|
22
|
+
c3 = new CallbackProperty(() => { return this.cdkPosition }, false);
|
|
23
|
+
semiMajorAxis = new CallbackProperty(() => { return this.cdkSemiMajorAxis }, false);
|
|
24
|
+
semiMinorAxis = new CallbackProperty(() => { return this.cdkSemiMinorAxis }, false);
|
|
25
|
+
} else {
|
|
26
|
+
c3 = lnglat ? uc_getCartesian3(lnglat) : uc_tsIfProperty(position) ? position : uc_getCartesian3(position)
|
|
27
|
+
}
|
|
28
|
+
super({
|
|
29
|
+
position: c3,
|
|
30
|
+
ellipse: {
|
|
31
|
+
show, semiMajorAxis, semiMinorAxis, height, heightReference, extrudedHeight, extrudedHeightReference, rotation, stRotation, granularity, fill, material, outline, outlineColor, outlineWidth, numberOfVerticalLines, shadows, distanceDisplayCondition, classificationType, zIndex,
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
if (uc_tsIfNumber(semiMajorAxis) && uc_tsIfNumber(semiMinorAxis)) {
|
|
35
|
+
this.cdkSemiMajorAxis = semiMajorAxis;
|
|
36
|
+
this.cdkSemiMinorAxis = semiMinorAxis;
|
|
37
|
+
}
|
|
38
|
+
this.cdkPosition = uc_tsIfCartesian3(c3) ? c3 : uc_getCartesian3(LNGLAT_CONST_SHENLAN);
|
|
39
|
+
}
|
|
40
|
+
private cdkIfChange: boolean = true;
|
|
41
|
+
/**中心位置 */
|
|
42
|
+
private cdkPosition: Cartesian3 = uc_getCartesian3(LNGLAT_CONST_SHENLAN);
|
|
43
|
+
/**长半轴 */
|
|
44
|
+
private cdkSemiMajorAxis: number = 0.1;
|
|
45
|
+
/**短半轴 */
|
|
46
|
+
private cdkSemiMinorAxis: number = 0.1;
|
|
47
|
+
/**设置中心位置*/
|
|
48
|
+
public cdkSetPosition(position: Cartesian3 | LnglatHeight) {
|
|
49
|
+
if (!this.cdkIfChange) {
|
|
50
|
+
throw new DeveloperError(``);
|
|
51
|
+
};
|
|
52
|
+
this.cdkPosition = uc_getCartesian3(position);
|
|
53
|
+
}
|
|
54
|
+
/**设置长半轴*/
|
|
55
|
+
public cdkSetMajorAxis(axis: number) {
|
|
56
|
+
if (!this.cdkIfChange) {
|
|
57
|
+
throw new DeveloperError(``);
|
|
58
|
+
};
|
|
59
|
+
this.cdkSemiMajorAxis = axis;
|
|
60
|
+
}
|
|
61
|
+
/**设置短半轴*/
|
|
62
|
+
public cdkSetMinorAxis(axis: number) {
|
|
63
|
+
if (!this.cdkIfChange) {
|
|
64
|
+
throw new DeveloperError(``);
|
|
65
|
+
};
|
|
66
|
+
this.cdkSemiMinorAxis = axis;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Cartesian3, Entity, GeoJsonDataSource, Rectangle, Viewer } from "cesium";
|
|
2
|
+
import { uc_getDistanceByLatOffset, uc_getDiffDegreesByDistance } from "../utils";
|
|
3
|
+
import { PropertyMaterialRoad } from "../property";
|
|
4
|
+
/**导入geojson中的实体 */
|
|
5
|
+
export class EntityGeojson {
|
|
6
|
+
constructor(opt: OptEntityGeojson) {
|
|
7
|
+
const { url, viewer } = opt || {};
|
|
8
|
+
this.load(url, viewer);
|
|
9
|
+
}
|
|
10
|
+
private async load(url: string, viewer: Viewer) {
|
|
11
|
+
let geojson = await GeoJsonDataSource.load(url);
|
|
12
|
+
viewer.dataSources.add(geojson);
|
|
13
|
+
let entities = geojson.entities.values;
|
|
14
|
+
const material = new PropertyMaterialRoad();
|
|
15
|
+
entities.map((entity) => {
|
|
16
|
+
entity.polyline.material = material;
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CallbackProperty, Cartesian2, Cartesian3, Color, ConstantProperty, Entity, HeadingPitchRoll, ImageMaterialProperty, MaterialProperty, Plane, PlaneGraphics, PositionProperty, Property, Transforms } from "cesium";
|
|
2
|
+
import { CCamera } from "../core";
|
|
3
|
+
import { CMath, uc_getCartesian3, uc_getQuaternion } from "../utils";
|
|
4
|
+
import { MaterialImage2D } from "../primitives/material";
|
|
5
|
+
|
|
6
|
+
/**实体图片 */
|
|
7
|
+
export class EntityImage extends Entity {
|
|
8
|
+
constructor(opt: OptEntityImage) {
|
|
9
|
+
const { lnglat, sizeX, sizeY = sizeX, url, id, rotate } = opt
|
|
10
|
+
super({
|
|
11
|
+
id,
|
|
12
|
+
name: 'rectangle',
|
|
13
|
+
position: uc_getCartesian3(lnglat),
|
|
14
|
+
plane: {
|
|
15
|
+
plane: new Plane(Cartesian3.UNIT_Z, 0.0),
|
|
16
|
+
dimensions: new Cartesian2(sizeX, sizeY),
|
|
17
|
+
outline: false,
|
|
18
|
+
material: new ImageMaterialProperty({
|
|
19
|
+
image: url,
|
|
20
|
+
transparent: true
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
/**旋转角度 */
|
|
25
|
+
this.orientation = new ConstantProperty(uc_getQuaternion(lnglat, rotate));
|
|
26
|
+
}
|
|
27
|
+
override position: PositionProperty;
|
|
28
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 所有依靠实体实现的效果都存放在此文件夹
|
|
3
|
+
* 部分已经搭建好的实体类
|
|
4
|
+
* @property [id] -该对象的唯一标识符。如果不提供,则生成GUID。
|
|
5
|
+
* @property [name] -一个人类可读的名称显示给用户。它不必是唯一的。
|
|
6
|
+
* @property [availability] -与该对象关联的可用性(如果有的话)。
|
|
7
|
+
* @property [show] -一个布尔值,指示是否显示实体及其子实体。
|
|
8
|
+
* @property [description] -一个字符串属性,指定该实体的HTML描述。
|
|
9
|
+
* @property [position] -指定实体位置的属性。
|
|
10
|
+
* @property [orientation = Transforms.eastNorthUpToFixedFrame(position)] -一个属性指定实体的方向相对于地球-固定-以地球为中心(ECEF)。如果未定义,则在实体位置使用东北向上。
|
|
11
|
+
* @property [viewFrom] -查看该对象的建议初始偏移量。
|
|
12
|
+
* @property [parent] -与该实体关联的父实体。
|
|
13
|
+
* @property [billboard]-与该实体相关联的公告牌。
|
|
14
|
+
* @property [box] -与该实体关联的框。
|
|
15
|
+
* @property [corridor] -与该实体关联的走廊。
|
|
16
|
+
* @property [cylinder]-与该实体关联的圆柱体。
|
|
17
|
+
* @property [ellipse] -与该实体关联的椭圆。
|
|
18
|
+
* @property [ellipsoid] -一个与实体关联的椭球体。
|
|
19
|
+
* @property [label] -一个选项。与此实体关联的标签。
|
|
20
|
+
* @property [model] -与该实体关联的模型。
|
|
21
|
+
* @property [tileset] -与此实体关联的3D tile tile集。
|
|
22
|
+
* @property [path] -与该实体关联的路径。
|
|
23
|
+
* @property [plane] -与该实体关联的平面。
|
|
24
|
+
* @property [point] -与该实体关联的点。
|
|
25
|
+
* @property [polygon] -与该实体关联的多边形。
|
|
26
|
+
* @property [polyline] -与该实体关联的折线。
|
|
27
|
+
* @property [properties] -与该实体关联的任意属性。
|
|
28
|
+
* @property [polylineVolume] -与此实体关联的polylineVolume。
|
|
29
|
+
* @property [rectangle] -与该实体关联的矩形。
|
|
30
|
+
* @property [wall] -与该实体关联的墙。
|
|
31
|
+
*/
|
|
32
|
+
export * from "./ellipse";
|
|
33
|
+
export * from "./geojson";
|
|
34
|
+
export * from "./image";
|
|
35
|
+
export * from "./label";
|
|
36
|
+
export * from "./point";
|
|
37
|
+
export * from "./polygon";
|
|
38
|
+
export * from "./polyline";
|
|
39
|
+
export * from "./rectangle";
|
|
40
|
+
export * from './radar';
|
|
41
|
+
export * from './radar';
|
|
42
|
+
export * from './trailing';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CallbackProperty, Cartesian2, Cartesian3, Color, ConstantPositionProperty, ConstantProperty, DistanceDisplayCondition, Entity, HeightReference, HorizontalOrigin, LabelCollection, LabelGraphics, LabelStyle, NearFarScalar, PositionProperty, Property, VerticalOrigin } from "cesium";
|
|
2
|
+
import { COLOR_CONST_FONT, COLOR_CONST_OUTLINE } from "../const";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_LABLE_OPT: OptEntityLabel = {
|
|
5
|
+
font: "12px sans-serif",
|
|
6
|
+
fillColor: COLOR_CONST_FONT,
|
|
7
|
+
outlineColor: COLOR_CONST_OUTLINE,
|
|
8
|
+
outlineWidth: 1,
|
|
9
|
+
pixelOffset: new Cartesian2(0, -10)
|
|
10
|
+
}
|
|
11
|
+
/**实体标签 */
|
|
12
|
+
export class EntityLabel extends Entity {
|
|
13
|
+
constructor(opt?: OptEntityLabel) {
|
|
14
|
+
const { position, show, text, font, style, scale, showBackground, backgroundColor, backgroundPadding, pixelOffset, eyeOffset, horizontalOrigin, verticalOrigin, heightReference, fillColor, outlineColor, outlineWidth, translucencyByDistance, pixelOffsetScaleByDistance, scaleByDistance, distanceDisplayCondition, disableDepthTestDistance } = Object.assign({}, DEFAULT_LABLE_OPT, opt);
|
|
15
|
+
super({
|
|
16
|
+
position: position,
|
|
17
|
+
label: {
|
|
18
|
+
show, text, font, style, scale, showBackground, backgroundColor, backgroundPadding, pixelOffset, eyeOffset, horizontalOrigin, verticalOrigin, heightReference, fillColor, outlineColor, outlineWidth, translucencyByDistance, pixelOffsetScaleByDistance, scaleByDistance, distanceDisplayCondition, disableDepthTestDistance
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
this.label.text = this.cdkText;
|
|
22
|
+
}
|
|
23
|
+
/**标签文本 */
|
|
24
|
+
private cdkText = new ConstantProperty('');
|
|
25
|
+
/**改变标签提示 */
|
|
26
|
+
public cdkSetLabelText(value: string) {
|
|
27
|
+
this.cdkText.setValue(value)
|
|
28
|
+
}
|
|
29
|
+
/**改变标签位置 */
|
|
30
|
+
public cdkSetLabelPosition(c3: Cartesian3) {
|
|
31
|
+
if (this.position instanceof ConstantPositionProperty) {
|
|
32
|
+
this.position.setValue(c3)
|
|
33
|
+
} else {
|
|
34
|
+
this.position = new ConstantPositionProperty(c3)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|