@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.
Files changed (552) hide show
  1. package/LICENSE copy +201 -0
  2. package/README.md +5 -0
  3. package/demo/App.vue +26 -0
  4. package/demo/main.ts +5 -0
  5. package/demo/style.css +3 -0
  6. package/index.cjs +12 -0
  7. package/index.html +13 -0
  8. package/package.json +31 -3
  9. package/public/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
  10. package/public/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
  11. package/public/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
  12. package/public/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
  13. package/public/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
  14. package/public/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
  15. package/public/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
  16. package/public/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
  17. package/public/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
  18. package/public/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
  19. package/public/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
  20. package/public/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
  21. package/public/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
  22. package/public/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
  23. package/public/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
  24. package/public/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
  25. package/public/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
  26. package/public/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
  27. package/public/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
  28. package/public/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
  29. package/public/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
  30. package/public/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
  31. package/public/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
  32. package/public/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
  33. package/public/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
  34. package/public/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
  35. package/public/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
  36. package/public/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
  37. package/public/Assets/Images/bing_maps_credit.png +0 -0
  38. package/public/Assets/Images/cesium_credit.png +0 -0
  39. package/public/Assets/Images/google_earth_credit.png +0 -0
  40. package/public/Assets/Images/ion-credit.png +0 -0
  41. package/public/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  42. package/public/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  43. package/public/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  44. package/public/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  45. package/public/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  46. package/public/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  47. package/public/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  48. package/public/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  49. package/public/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  50. package/public/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  51. package/public/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  52. package/public/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  53. package/public/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  54. package/public/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  55. package/public/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  56. package/public/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  57. package/public/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  58. package/public/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  59. package/public/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  60. package/public/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  61. package/public/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  62. package/public/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  63. package/public/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  64. package/public/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  65. package/public/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  66. package/public/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  67. package/public/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  68. package/public/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  69. package/public/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  70. package/public/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  71. package/public/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  72. package/public/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  73. package/public/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  74. package/public/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  75. package/public/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  76. package/public/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  77. package/public/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  78. package/public/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  79. package/public/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  80. package/public/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  81. package/public/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  82. package/public/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  83. package/public/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  84. package/public/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  85. package/public/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
  86. package/public/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  87. package/public/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  88. package/public/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  89. package/public/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  90. package/public/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  91. package/public/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  92. package/public/Assets/Textures/maki/airfield.png +0 -0
  93. package/public/Assets/Textures/maki/airport.png +0 -0
  94. package/public/Assets/Textures/maki/alcohol-shop.png +0 -0
  95. package/public/Assets/Textures/maki/america-football.png +0 -0
  96. package/public/Assets/Textures/maki/art-gallery.png +0 -0
  97. package/public/Assets/Textures/maki/bakery.png +0 -0
  98. package/public/Assets/Textures/maki/bank.png +0 -0
  99. package/public/Assets/Textures/maki/bar.png +0 -0
  100. package/public/Assets/Textures/maki/baseball.png +0 -0
  101. package/public/Assets/Textures/maki/basketball.png +0 -0
  102. package/public/Assets/Textures/maki/beer.png +0 -0
  103. package/public/Assets/Textures/maki/bicycle.png +0 -0
  104. package/public/Assets/Textures/maki/building.png +0 -0
  105. package/public/Assets/Textures/maki/bus.png +0 -0
  106. package/public/Assets/Textures/maki/cafe.png +0 -0
  107. package/public/Assets/Textures/maki/camera.png +0 -0
  108. package/public/Assets/Textures/maki/campsite.png +0 -0
  109. package/public/Assets/Textures/maki/car.png +0 -0
  110. package/public/Assets/Textures/maki/cemetery.png +0 -0
  111. package/public/Assets/Textures/maki/cesium.png +0 -0
  112. package/public/Assets/Textures/maki/chemist.png +0 -0
  113. package/public/Assets/Textures/maki/cinema.png +0 -0
  114. package/public/Assets/Textures/maki/circle-stroked.png +0 -0
  115. package/public/Assets/Textures/maki/circle.png +0 -0
  116. package/public/Assets/Textures/maki/city.png +0 -0
  117. package/public/Assets/Textures/maki/clothing-store.png +0 -0
  118. package/public/Assets/Textures/maki/college.png +0 -0
  119. package/public/Assets/Textures/maki/commercial.png +0 -0
  120. package/public/Assets/Textures/maki/cricket.png +0 -0
  121. package/public/Assets/Textures/maki/cross.png +0 -0
  122. package/public/Assets/Textures/maki/dam.png +0 -0
  123. package/public/Assets/Textures/maki/danger.png +0 -0
  124. package/public/Assets/Textures/maki/disability.png +0 -0
  125. package/public/Assets/Textures/maki/dog-park.png +0 -0
  126. package/public/Assets/Textures/maki/embassy.png +0 -0
  127. package/public/Assets/Textures/maki/emergency-telephone.png +0 -0
  128. package/public/Assets/Textures/maki/entrance.png +0 -0
  129. package/public/Assets/Textures/maki/farm.png +0 -0
  130. package/public/Assets/Textures/maki/fast-food.png +0 -0
  131. package/public/Assets/Textures/maki/ferry.png +0 -0
  132. package/public/Assets/Textures/maki/fire-station.png +0 -0
  133. package/public/Assets/Textures/maki/fuel.png +0 -0
  134. package/public/Assets/Textures/maki/garden.png +0 -0
  135. package/public/Assets/Textures/maki/gift.png +0 -0
  136. package/public/Assets/Textures/maki/golf.png +0 -0
  137. package/public/Assets/Textures/maki/grocery.png +0 -0
  138. package/public/Assets/Textures/maki/hairdresser.png +0 -0
  139. package/public/Assets/Textures/maki/harbor.png +0 -0
  140. package/public/Assets/Textures/maki/heart.png +0 -0
  141. package/public/Assets/Textures/maki/heliport.png +0 -0
  142. package/public/Assets/Textures/maki/hospital.png +0 -0
  143. package/public/Assets/Textures/maki/ice-cream.png +0 -0
  144. package/public/Assets/Textures/maki/industrial.png +0 -0
  145. package/public/Assets/Textures/maki/land-use.png +0 -0
  146. package/public/Assets/Textures/maki/laundry.png +0 -0
  147. package/public/Assets/Textures/maki/library.png +0 -0
  148. package/public/Assets/Textures/maki/lighthouse.png +0 -0
  149. package/public/Assets/Textures/maki/lodging.png +0 -0
  150. package/public/Assets/Textures/maki/logging.png +0 -0
  151. package/public/Assets/Textures/maki/london-underground.png +0 -0
  152. package/public/Assets/Textures/maki/marker-stroked.png +0 -0
  153. package/public/Assets/Textures/maki/marker.png +0 -0
  154. package/public/Assets/Textures/maki/minefield.png +0 -0
  155. package/public/Assets/Textures/maki/mobilephone.png +0 -0
  156. package/public/Assets/Textures/maki/monument.png +0 -0
  157. package/public/Assets/Textures/maki/museum.png +0 -0
  158. package/public/Assets/Textures/maki/music.png +0 -0
  159. package/public/Assets/Textures/maki/oil-well.png +0 -0
  160. package/public/Assets/Textures/maki/park.png +0 -0
  161. package/public/Assets/Textures/maki/park2.png +0 -0
  162. package/public/Assets/Textures/maki/parking-garage.png +0 -0
  163. package/public/Assets/Textures/maki/parking.png +0 -0
  164. package/public/Assets/Textures/maki/pharmacy.png +0 -0
  165. package/public/Assets/Textures/maki/pitch.png +0 -0
  166. package/public/Assets/Textures/maki/place-of-worship.png +0 -0
  167. package/public/Assets/Textures/maki/playground.png +0 -0
  168. package/public/Assets/Textures/maki/police.png +0 -0
  169. package/public/Assets/Textures/maki/polling-place.png +0 -0
  170. package/public/Assets/Textures/maki/post.png +0 -0
  171. package/public/Assets/Textures/maki/prison.png +0 -0
  172. package/public/Assets/Textures/maki/rail-above.png +0 -0
  173. package/public/Assets/Textures/maki/rail-light.png +0 -0
  174. package/public/Assets/Textures/maki/rail-metro.png +0 -0
  175. package/public/Assets/Textures/maki/rail-underground.png +0 -0
  176. package/public/Assets/Textures/maki/rail.png +0 -0
  177. package/public/Assets/Textures/maki/religious-christian.png +0 -0
  178. package/public/Assets/Textures/maki/religious-jewish.png +0 -0
  179. package/public/Assets/Textures/maki/religious-muslim.png +0 -0
  180. package/public/Assets/Textures/maki/restaurant.png +0 -0
  181. package/public/Assets/Textures/maki/roadblock.png +0 -0
  182. package/public/Assets/Textures/maki/rocket.png +0 -0
  183. package/public/Assets/Textures/maki/school.png +0 -0
  184. package/public/Assets/Textures/maki/scooter.png +0 -0
  185. package/public/Assets/Textures/maki/shop.png +0 -0
  186. package/public/Assets/Textures/maki/skiing.png +0 -0
  187. package/public/Assets/Textures/maki/slaughterhouse.png +0 -0
  188. package/public/Assets/Textures/maki/soccer.png +0 -0
  189. package/public/Assets/Textures/maki/square-stroked.png +0 -0
  190. package/public/Assets/Textures/maki/square.png +0 -0
  191. package/public/Assets/Textures/maki/star-stroked.png +0 -0
  192. package/public/Assets/Textures/maki/star.png +0 -0
  193. package/public/Assets/Textures/maki/suitcase.png +0 -0
  194. package/public/Assets/Textures/maki/swimming.png +0 -0
  195. package/public/Assets/Textures/maki/telephone.png +0 -0
  196. package/public/Assets/Textures/maki/tennis.png +0 -0
  197. package/public/Assets/Textures/maki/theatre.png +0 -0
  198. package/public/Assets/Textures/maki/toilets.png +0 -0
  199. package/public/Assets/Textures/maki/town-hall.png +0 -0
  200. package/public/Assets/Textures/maki/town.png +0 -0
  201. package/public/Assets/Textures/maki/triangle-stroked.png +0 -0
  202. package/public/Assets/Textures/maki/triangle.png +0 -0
  203. package/public/Assets/Textures/maki/village.png +0 -0
  204. package/public/Assets/Textures/maki/warehouse.png +0 -0
  205. package/public/Assets/Textures/maki/waste-basket.png +0 -0
  206. package/public/Assets/Textures/maki/water.png +0 -0
  207. package/public/Assets/Textures/maki/wetland.png +0 -0
  208. package/public/Assets/Textures/maki/zoo.png +0 -0
  209. package/public/Assets/Textures/moonSmall.jpg +0 -0
  210. package/public/Assets/Textures/pin.svg +1 -0
  211. package/public/Assets/Textures/waterNormals.jpg +0 -0
  212. package/public/Assets/Textures/waterNormalsSmall.jpg +0 -0
  213. package/public/Assets/approximateTerrainHeights.json +1 -0
  214. package/public/Cesium.js +16587 -0
  215. package/public/ThirdParty/Workers/package.json +1 -0
  216. package/public/ThirdParty/Workers/zip-web-worker.js +1 -0
  217. package/public/ThirdParty/basis_transcoder.wasm +0 -0
  218. package/public/ThirdParty/draco_decoder.wasm +0 -0
  219. package/public/ThirdParty/google-earth-dbroot-parser.js +1 -0
  220. package/public/ThirdParty/wasm_splats_bg.wasm +0 -0
  221. package/public/ThirdParty/zip-module.wasm +0 -0
  222. package/public/Widgets/Animation/Animation.css +127 -0
  223. package/public/Widgets/Animation/lighter.css +70 -0
  224. package/public/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
  225. package/public/Widgets/BaseLayerPicker/lighter.css +22 -0
  226. package/public/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
  227. package/public/Widgets/CesiumInspector/CesiumInspector.css +113 -0
  228. package/public/Widgets/CesiumWidget/CesiumWidget.css +119 -0
  229. package/public/Widgets/CesiumWidget/lighter.css +14 -0
  230. package/public/Widgets/FullscreenButton/FullscreenButton.css +8 -0
  231. package/public/Widgets/Geocoder/Geocoder.css +70 -0
  232. package/public/Widgets/Geocoder/lighter.css +17 -0
  233. package/public/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
  234. package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  235. package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  236. package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  237. package/public/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
  238. package/public/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
  239. package/public/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  240. package/public/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  241. package/public/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  242. package/public/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  243. package/public/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  244. package/public/Widgets/Images/ImageryProviders/googleContour.png +0 -0
  245. package/public/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
  246. package/public/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
  247. package/public/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
  248. package/public/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  249. package/public/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  250. package/public/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  251. package/public/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  252. package/public/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  253. package/public/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  254. package/public/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  255. package/public/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  256. package/public/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  257. package/public/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  258. package/public/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  259. package/public/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
  260. package/public/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
  261. package/public/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
  262. package/public/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
  263. package/public/Widgets/Images/NavigationHelp/Touch.svg +120 -0
  264. package/public/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
  265. package/public/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
  266. package/public/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
  267. package/public/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
  268. package/public/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  269. package/public/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  270. package/public/Widgets/Images/TimelineIcons.png +0 -0
  271. package/public/Widgets/Images/info-loading.gif +0 -0
  272. package/public/Widgets/InfoBox/InfoBox.css +92 -0
  273. package/public/Widgets/InfoBox/InfoBoxDescription.css +178 -0
  274. package/public/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
  275. package/public/Widgets/NavigationHelpButton/lighter.css +38 -0
  276. package/public/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
  277. package/public/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
  278. package/public/Widgets/SceneModePicker/SceneModePicker.css +56 -0
  279. package/public/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
  280. package/public/Widgets/Timeline/Timeline.css +103 -0
  281. package/public/Widgets/Timeline/lighter.css +23 -0
  282. package/public/Widgets/VRButton/VRButton.css +8 -0
  283. package/public/Widgets/Viewer/Viewer.css +107 -0
  284. package/public/Widgets/VoxelInspector/VoxelInspector.css +16 -0
  285. package/public/Widgets/lighter.css +237 -0
  286. package/public/Widgets/lighterShared.css +46 -0
  287. package/public/Widgets/shared.css +103 -0
  288. package/public/Widgets/widgets.css +1342 -0
  289. package/public/Workers/chunk-3DKU5AMY.js +26 -0
  290. package/public/Workers/chunk-3MO6V622.js +26 -0
  291. package/public/Workers/chunk-3ULTL2FZ.js +26 -0
  292. package/public/Workers/chunk-43YDDN2L.js +26 -0
  293. package/public/Workers/chunk-453UE67U.js +26 -0
  294. package/public/Workers/chunk-5JJC62LP.js +26 -0
  295. package/public/Workers/chunk-65WPDQMK.js +26 -0
  296. package/public/Workers/chunk-6J7K26F7.js +26 -0
  297. package/public/Workers/chunk-A3G5ORRJ.js +26 -0
  298. package/public/Workers/chunk-AIXDAWPZ.js +26 -0
  299. package/public/Workers/chunk-ANKVUFZB.js +26 -0
  300. package/public/Workers/chunk-AZ67KQQB.js +26 -0
  301. package/public/Workers/chunk-C5F5JZAC.js +26 -0
  302. package/public/Workers/chunk-CK62LO4L.js +26 -0
  303. package/public/Workers/chunk-DXDIQEOK.js +26 -0
  304. package/public/Workers/chunk-E7ZPYMUI.js +26 -0
  305. package/public/Workers/chunk-GDE4VUE6.js +26 -0
  306. package/public/Workers/chunk-GGYRJCFH.js +29 -0
  307. package/public/Workers/chunk-HBIOVTO5.js +27 -0
  308. package/public/Workers/chunk-HJIURIT6.js +26 -0
  309. package/public/Workers/chunk-IDLM42AV.js +26 -0
  310. package/public/Workers/chunk-IFBNVX3N.js +26 -0
  311. package/public/Workers/chunk-IR47TAV5.js +26 -0
  312. package/public/Workers/chunk-ISGFCDPW.js +26 -0
  313. package/public/Workers/chunk-JJ24SU25.js +26 -0
  314. package/public/Workers/chunk-LAGV6F3C.js +29 -0
  315. package/public/Workers/chunk-LLCMCKFU.js +26 -0
  316. package/public/Workers/chunk-MSR5BKMH.js +26 -0
  317. package/public/Workers/chunk-MWVHSLYS.js +26 -0
  318. package/public/Workers/chunk-MYNU3I3W.js +26 -0
  319. package/public/Workers/chunk-NSDLDP72.js +26 -0
  320. package/public/Workers/chunk-NUY3PECV.js +26 -0
  321. package/public/Workers/chunk-OHMLE6SB.js +26 -0
  322. package/public/Workers/chunk-OJH7UFER.js +28 -0
  323. package/public/Workers/chunk-OUZ34R6R.js +26 -0
  324. package/public/Workers/chunk-OWJWRYGM.js +26 -0
  325. package/public/Workers/chunk-PAML32O3.js +26 -0
  326. package/public/Workers/chunk-PNKG35NX.js +26 -0
  327. package/public/Workers/chunk-Q6F3SO7I.js +26 -0
  328. package/public/Workers/chunk-QROIA2H7.js +26 -0
  329. package/public/Workers/chunk-RH6XN2ZV.js +28 -0
  330. package/public/Workers/chunk-SCMY6ELS.js +26 -0
  331. package/public/Workers/chunk-SP3AH7D2.js +26 -0
  332. package/public/Workers/chunk-SRXN2PE4.js +26 -0
  333. package/public/Workers/chunk-SUBLUDWJ.js +26 -0
  334. package/public/Workers/chunk-T4S74O3D.js +26 -0
  335. package/public/Workers/chunk-TITUTZNR.js +63 -0
  336. package/public/Workers/chunk-UWS7N7FB.js +26 -0
  337. package/public/Workers/chunk-V5C26K4F.js +26 -0
  338. package/public/Workers/chunk-VAPRBQYE.js +26 -0
  339. package/public/Workers/chunk-VBYW5FXW.js +26 -0
  340. package/public/Workers/chunk-VLPLGYXT.js +26 -0
  341. package/public/Workers/chunk-W5T7UWKW.js +26 -0
  342. package/public/Workers/chunk-XLJBHQML.js +26 -0
  343. package/public/Workers/chunk-XWXQVSYW.js +26 -0
  344. package/public/Workers/chunk-YSN2K4FT.js +27 -0
  345. package/public/Workers/chunk-ZTSD53QT.js +26 -0
  346. package/public/Workers/combineGeometry.js +26 -0
  347. package/public/Workers/createBoxGeometry.js +26 -0
  348. package/public/Workers/createBoxOutlineGeometry.js +26 -0
  349. package/public/Workers/createCircleGeometry.js +26 -0
  350. package/public/Workers/createCircleOutlineGeometry.js +26 -0
  351. package/public/Workers/createCoplanarPolygonGeometry.js +26 -0
  352. package/public/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
  353. package/public/Workers/createCorridorGeometry.js +26 -0
  354. package/public/Workers/createCorridorOutlineGeometry.js +26 -0
  355. package/public/Workers/createCylinderGeometry.js +26 -0
  356. package/public/Workers/createCylinderOutlineGeometry.js +26 -0
  357. package/public/Workers/createEllipseGeometry.js +26 -0
  358. package/public/Workers/createEllipseOutlineGeometry.js +26 -0
  359. package/public/Workers/createEllipsoidGeometry.js +26 -0
  360. package/public/Workers/createEllipsoidOutlineGeometry.js +26 -0
  361. package/public/Workers/createFrustumGeometry.js +26 -0
  362. package/public/Workers/createFrustumOutlineGeometry.js +26 -0
  363. package/public/Workers/createGeometry.js +26 -0
  364. package/public/Workers/createGroundPolylineGeometry.js +26 -0
  365. package/public/Workers/createPlaneGeometry.js +26 -0
  366. package/public/Workers/createPlaneOutlineGeometry.js +26 -0
  367. package/public/Workers/createPolygonGeometry.js +26 -0
  368. package/public/Workers/createPolygonOutlineGeometry.js +26 -0
  369. package/public/Workers/createPolylineGeometry.js +26 -0
  370. package/public/Workers/createPolylineVolumeGeometry.js +26 -0
  371. package/public/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
  372. package/public/Workers/createRectangleGeometry.js +26 -0
  373. package/public/Workers/createRectangleOutlineGeometry.js +26 -0
  374. package/public/Workers/createSimplePolylineGeometry.js +26 -0
  375. package/public/Workers/createSphereGeometry.js +26 -0
  376. package/public/Workers/createSphereOutlineGeometry.js +26 -0
  377. package/public/Workers/createTaskProcessorWorker.js +26 -0
  378. package/public/Workers/createVectorTileClampedPolylines.js +26 -0
  379. package/public/Workers/createVectorTileGeometries.js +26 -0
  380. package/public/Workers/createVectorTilePoints.js +26 -0
  381. package/public/Workers/createVectorTilePolygons.js +26 -0
  382. package/public/Workers/createVectorTilePolylines.js +26 -0
  383. package/public/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
  384. package/public/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
  385. package/public/Workers/createVerticesFromHeightmap.js +26 -0
  386. package/public/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
  387. package/public/Workers/createWallGeometry.js +26 -0
  388. package/public/Workers/createWallOutlineGeometry.js +26 -0
  389. package/public/Workers/decodeDraco.js +26 -0
  390. package/public/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
  391. package/public/Workers/decodeI3S.js +26 -0
  392. package/public/Workers/gaussianSplatSorter.js +26 -0
  393. package/public/Workers/gaussianSplatTextureGenerator.js +26 -0
  394. package/public/Workers/incrementallyBuildTerrainPicker.js +26 -0
  395. package/public/Workers/transcodeKTX2.js +56 -0
  396. package/public/Workers/transferTypedArrayTest.js +26 -0
  397. package/public/Workers/upsampleQuantizedTerrainMesh.js +26 -0
  398. package/public/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
  399. package/public/index.cjs +16587 -0
  400. package/public/index.js +16587 -0
  401. package/src/Assets/geojson/BaiYangDian.geojson +699 -0
  402. package/src/Assets/geojson/HeBei.geojson +97754 -0
  403. package/src/Assets/geojson//344/270/255/345/233/275_/347/234/201.geojson +1 -0
  404. package/src/Assets/images/BYD.png +0 -0
  405. package/src/Assets/images/BYH.png +0 -0
  406. package/src/Assets/images/CZD.png +0 -0
  407. package/src/Assets/images/bouys.png +0 -0
  408. package/src/Assets/images/hebei.ico +0 -0
  409. package/src/Assets/images/jinzhou.ico +0 -0
  410. package/src/Assets/images/map_bg.png +0 -0
  411. package/src/Assets/images/map_bridge.png +0 -0
  412. package/src/Assets/images/map_radar.png +0 -0
  413. package/src/Assets/images/map_vhf.png +0 -0
  414. package/src/Assets/images/shenlan.png +0 -0
  415. package/src/Assets/images/ship.png +0 -0
  416. package/src/Assets/images/ship_1.png +0 -0
  417. package/src/Assets/images/ship_1_e.png +0 -0
  418. package/src/Assets/images/ship_1_tv.png +0 -0
  419. package/src/Assets/images/ship_2.png +0 -0
  420. package/src/Assets/images/ship_2_e.png +0 -0
  421. package/src/Assets/images/ship_2_tv.png +0 -0
  422. package/src/Assets/images/ship_3.png +0 -0
  423. package/src/Assets/images/ship_3_e.png +0 -0
  424. package/src/Assets/images/ship_3_tv.png +0 -0
  425. package/src/Assets/images/ship_4.png +0 -0
  426. package/src/Assets/images/ship_4_e.png +0 -0
  427. package/src/Assets/images/ship_4_tv.png +0 -0
  428. package/src/Assets/images/ship_5.png +0 -0
  429. package/src/Assets/images/ship_5_e.png +0 -0
  430. package/src/Assets/images/ship_5_tv.png +0 -0
  431. package/src/Assets/images/snowflake_particle.png +0 -0
  432. package/src/Assets/models/fengche.gltf +2920 -0
  433. package/src/Assets/resource.ts +32 -0
  434. package/src/const/color.ts +10 -0
  435. package/src/const/config/camera.ts +16 -0
  436. package/src/const/config/index.ts +2 -0
  437. package/src/const/config/viewer.ts +42 -0
  438. package/src/const/index.ts +3 -0
  439. package/src/const/position.ts +34 -0
  440. package/src/core/cdk/compass.ts +24 -0
  441. package/src/core/cdk/index.ts +36 -0
  442. package/src/core/cdk/lnglat.ts +125 -0
  443. package/src/core/cdk/orbit.ts +118 -0
  444. package/src/core/cdk/overlay.ts +90 -0
  445. package/src/core/cdk/slider.ts +54 -0
  446. package/src/core/cdk/svg_compass.svg +33 -0
  447. package/src/core/index.ts +2 -0
  448. package/src/core/layers/baidu-map-layer.ts +117 -0
  449. package/src/core/libs/gui.ts +88 -0
  450. package/src/core/scene/camera.ts +211 -0
  451. package/src/core/scene/globe.ts +33 -0
  452. package/src/core/scene/index.ts +5 -0
  453. package/src/core/scene/layers.ts +240 -0
  454. package/src/core/scene/primitives.ts +55 -0
  455. package/src/core/scene/scene.ts +44 -0
  456. package/src/core/viewer/clock.ts +93 -0
  457. package/src/core/viewer/data.ts +17 -0
  458. package/src/core/viewer/element.ts +146 -0
  459. package/src/core/viewer/entities.ts +74 -0
  460. package/src/core/viewer/event.ts +155 -0
  461. package/src/core/viewer/index.ts +7 -0
  462. package/src/core/viewer/result.ts +7 -0
  463. package/src/core/viewer/terrain.ts +30 -0
  464. package/src/core/viewer/viewer.ts +255 -0
  465. package/src/entities/ellipse.ts +68 -0
  466. package/src/entities/geojson.ts +19 -0
  467. package/src/entities/image.ts +28 -0
  468. package/src/entities/index.ts +42 -0
  469. package/src/entities/label.ts +37 -0
  470. package/src/entities/point.ts +48 -0
  471. package/src/entities/polygon.ts +59 -0
  472. package/src/entities/polyline.ts +55 -0
  473. package/src/entities/radar.ts +18 -0
  474. package/src/entities/rectangle.ts +50 -0
  475. package/src/entities/trailing.ts +22 -0
  476. package/src/index.ts +10 -0
  477. package/src/plugins/bathymetry.ts +107 -0
  478. package/src/plugins/elevation.ts +146 -0
  479. package/src/plugins/index.ts +3 -0
  480. package/src/plugins/post-process-snow.glsl +99 -0
  481. package/src/plugins/post-process-snow.ts +45 -0
  482. package/src/plugins/thunder.glsl +159 -0
  483. package/src/primitives/appearance/demo.ts +27 -0
  484. package/src/primitives/appearance/index.ts +1 -0
  485. package/src/primitives/area.ts +40 -0
  486. package/src/primitives/geometry/geometry.ts +44 -0
  487. package/src/primitives/image-2d.ts +73 -0
  488. package/src/primitives/index.ts +9 -0
  489. package/src/primitives/instance/instance.ts +58 -0
  490. package/src/primitives/material/image2d.ts +25 -0
  491. package/src/primitives/material/index.ts +8 -0
  492. package/src/primitives/material/ship2d.ts +55 -0
  493. package/src/primitives/particle.ts +47 -0
  494. package/src/primitives/shaders/EllipsoidSurfaceAppearanceFS.glsl +31 -0
  495. package/src/primitives/shaders/EllipsoidSurfaceAppearanceVS.glsl +19 -0
  496. package/src/primitives/shaders/imageFS.glsl +22 -0
  497. package/src/primitives/shaders/raedme.md +187 -0
  498. package/src/property/index.ts +1 -0
  499. package/src/property/material/core.ts +52 -0
  500. package/src/property/material/index.ts +5 -0
  501. package/src/property/material/radar.ts +41 -0
  502. package/src/property/material/road.ts +35 -0
  503. package/src/property/material/trailing.ts +31 -0
  504. package/src/property/material/wall.ts +31 -0
  505. package/src/scene/TJG/area.ts +37 -0
  506. package/src/scene/TJG/billboard.ts +89 -0
  507. package/src/scene/TJG/entityies.ts +131 -0
  508. package/src/scene/TJG/lines.ts +14 -0
  509. package/src/scene/TJG/maps.ts +16 -0
  510. package/src/scene/TJG/scene-tjg.ts +212 -0
  511. package/src/scene/TJG/ships.ts +32 -0
  512. package/src/scene/TJG/tileset.ts +144 -0
  513. package/src/scene/TJG/tjg.d.ts +14 -0
  514. package/src/scene/cdk/fog.ts +47 -0
  515. package/src/scene/cdk/index.ts +4 -0
  516. package/src/scene/cdk/measure.ts +108 -0
  517. package/src/scene/cdk/plot.ts +182 -0
  518. package/src/scene/cdk/source.ts +33 -0
  519. package/src/shaders/3d-tileset.ts +41 -0
  520. package/src/shaders/index.ts +1 -0
  521. package/src/shaders/material-property/a-readme.md +2 -0
  522. package/src/shaders/material-property/radarFS.glsl +25 -0
  523. package/src/shaders/material-property/roadFS.glsl +14 -0
  524. package/src/shaders/material-property/trailingFS.glsl +18 -0
  525. package/src/shaders/material-property/wallFS.glsl +31 -0
  526. package/src/shaders/raedme.md +187 -0
  527. package/src/shaders/ship/ShipVS.glsl +19 -0
  528. package/src/sl-utils-cesium.ts +1 -0
  529. package/src/types/cdk.d.ts +20 -0
  530. package/src/types/core.d.ts +6 -0
  531. package/src/types/entity.d.ts +628 -0
  532. package/src/types/event.d.ts +32 -0
  533. package/src/types/extend.Cesium.d.ts +28 -0
  534. package/src/types/geometry.d.ts +55 -0
  535. package/src/types/plugins.d.ts +34 -0
  536. package/src/types/primitive.d.ts +69 -0
  537. package/src/types/scene.d.ts +25 -0
  538. package/src/types/viewer.d.ts +114 -0
  539. package/src/utils/cesium.ts +189 -0
  540. package/src/utils/common.ts +87 -0
  541. package/src/utils/index.ts +5 -0
  542. package/src/utils/map.ts +112 -0
  543. package/src/utils/types.ts +44 -0
  544. package/tsconfig.cjs.json +7 -0
  545. package/tsconfig.json +34 -0
  546. package/types/billboard.d.ts +8 -0
  547. package/types/entities.d.ts +224 -0
  548. package/types/property.d.ts +12 -0
  549. package/types/resource.d.ts +26 -0
  550. package/types/sl-utils-cesium.d.ts +17 -0
  551. package/vite.config.ts +43 -0
  552. package/webpack.config.js +29 -0
@@ -0,0 +1,32 @@
1
+ import type { CameraEventType, ScreenSpaceEventType } from "cesium";
2
+
3
+ declare global {
4
+ /**Cesium可注册事件 */
5
+ /**相机事件 */
6
+ type CameraEvent = 'CAMERA_MOVESTART' | 'CAMERA_MOVEEND' | 'CAMERA_CHANGED';
7
+ /**场景事件 */
8
+ type SceneEvent = 'PREUPDATE' | 'POSTUPDATE' | 'PRERENDER' | 'POSTRENDER';
9
+ /**时钟事件 */
10
+ type ClockEvent = 'TICK';
11
+ /**键盘事件(开发人员编写) */
12
+ type KeyboardEventDeveloper = 'KEY_DOWN' | 'KEY_UP';
13
+ /**DOM节点事件(开发人员编写) */
14
+ type ElementEventDeveloper = 'RESIZE' | KeyboardEventDeveloper | `${keyof typeof ScreenSpaceEventType}`;
15
+ /**初始化标识 INIT_PICK */
16
+ type INIT = 'INIT_PICK'
17
+ /**整体综合事件 */
18
+ type UCEvent = ClockEvent | SceneEvent | CameraEvent | ElementEventDeveloper | INIT | 'PICKED' | 'PROGRESS' | 'END';
19
+ /**键盘按键事件Code */
20
+ type KeyCode = 'Escape'
21
+ | 'Backquote' | 'Minus' | 'Equal' | 'Backspace'
22
+ | 'Tab' | 'Backslash'
23
+ | 'CapsLock' | 'Semicolon' | 'Quote' | 'Enter'
24
+ | 'Comma' | 'Period' | 'Slash'
25
+ | 'MetaLeft' | 'Space' | 'ContextMenu'
26
+ | `${'Alt' | 'Bracket' | 'Control' | 'Shift'}${'Left' | 'Right'}`
27
+ | `Key${'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'}`
28
+ /**Digit 主键盘上方数字表 Numpad 数字键盘*/
29
+ | `${'Digit' | 'Numpad' | 'F'}${'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'}` | 'F10' | 'F11' | 'F12'
30
+ | `Numpad${'Add' | 'Subtract' | 'Multiply' | 'Divide' | 'Enter' | 'Decimal'}` | 'NumLock'
31
+ | `Arrow${'Down' | 'Left' | 'Right' | 'Up'}`;
32
+ }
@@ -0,0 +1,28 @@
1
+ // import { Cartesian3, VoxelShapeType } from "cesium";
2
+ /**对Cesium.d.ts进行扩展 */
3
+
4
+ declare module 'cesium' {
5
+ /**cesium中有一个枚举类VoxelShapeType,其实际代码实现了一个方法getMinBounds,通过命名空间实现其合并添加方法 */
6
+ // enum VoxelShapeType { } 枚举无法添加方法
7
+ // interface VoxelShapeType { } 枚举声明只能与命名空间或其他枚举声明合并
8
+ namespace VoxelShapeType {
9
+ /**获取最小界限 */
10
+ function getMinBounds(shapeType: VoxelShapeType): Cartesian3
11
+ /**获取最大界限 */
12
+ function getMaxBounds(shapeType: VoxelShapeType): Cartesian3
13
+ }
14
+ namespace MetadataType {
15
+ /**获取向量或矩阵类型的组件数量。例如,VEC[N] 返回 [N],MAT[N] 返回 [N]*[N]。所有其他类型均返回 1*/
16
+ function getComponentCount(type: MetadataType): number
17
+ }
18
+ namespace GeometryInstance {
19
+
20
+ }
21
+ function defaultValue(v1: any, v2: any)
22
+ var knockout: {
23
+ track: (value: Object) => void;
24
+ applyBindings: any
25
+ getObservable: any
26
+ subscribe: any
27
+ };
28
+ }
@@ -0,0 +1,55 @@
1
+ import { ArcType, Cartesian3, EllipseGeometry, Ellipsoid, EllipsoidSurfaceAppearance, PolygonGeometry, PolygonHierarchy, VertexFormat } from "cesium";
2
+ declare global {
3
+
4
+
5
+ /**多边形配置 */
6
+ interface PolygonGeometryOpt {
7
+ /**一个可包含孔洞的多边形层次结构 */
8
+ polygonHierarchy: PolygonHierarchy;
9
+ /**多边形与椭球面之间的距离 */
10
+ height?: number;
11
+ /**多边形挤出面与椭球面之间的距离(单位:米)。 */
12
+ extrudedHeight?: number;
13
+ /**要计算的顶点属性。 */
14
+ vertexFormat?: VertexFormat;
15
+ /**纹理坐标的旋转角度,单位为弧度。正旋转表示逆时针旋转 */
16
+ stRotation?: number;
17
+ /**用作参考的椭球体 */
18
+ ellipsoid?: Ellipsoid;
19
+ /**每个纬度和经度之间的距离(以弧度为单位)。决定缓冲区中的位置数量 Math.RADIANS_PER_DEGREE*/
20
+ granularity?: number;
21
+ /**为每个位置使用options.positions的高度,而不是使用options.height来确定高度 false*/
22
+ perPositionHeight?: boolean;
23
+ /**当为false时,挤出的多边形的顶部保持开放 true*/
24
+ closeTop?: boolean;
25
+ /**当为false时,挤出的多边形的底部保持开放 true*/
26
+ closeBottom?: boolean;
27
+ /**多边形边必须遵循的线类型。有效选项包括{@link ArcType.GEODESIC}和{@link ArcType.RHUMB}。 */
28
+ arcType?: ArcType;
29
+ /**作为由{@link Cartesian2}点组成的{@link PolygonHierarchy}的纹理坐标。对地面图元无影响 */
30
+ textureCoordinates?: PolygonHierarchy;
31
+ }
32
+ /**椭圆几何体配置 */
33
+ interface EllipseGeometryOpt {
34
+ /**椭圆的中心点 */
35
+ center: Cartesian3;
36
+ /**椭圆半长轴的长度,单位为米 */
37
+ semiMajorAxis: number;
38
+ /**椭圆半短轴的长度,单位为米 */
39
+ semiMinorAxis: number;
40
+ /**椭圆所在的椭球体 */
41
+ ellipsoid?: Ellipsoid;
42
+ /**椭圆与椭球面之间的距离 0.0*/
43
+ height?: number;
44
+ /**椭圆挤出面与椭球面之间的距离 0.0*/
45
+ extrudedHeight?: number;
46
+ /**从北方向逆时针旋转的角度 0.0*/
47
+ rotation?: number;
48
+ /**纹理坐标从北方向逆时针旋转的角度 0.0*/
49
+ stRotation?: number;
50
+ /**椭圆上点与点之间的角度距离,以弧度为单位 Math.RADIANS_PER_DEGREE*/
51
+ granularity?: number;
52
+ /**要计算的顶点属性 VertexFormat.DEFAULT*/
53
+ vertexFormat?: VertexFormat;
54
+ }
55
+ }
@@ -0,0 +1,34 @@
1
+ import { Color } from "cesium";
2
+
3
+
4
+ declare global {
5
+
6
+ /**插件海拔线配置项 */
7
+ interface PluginElevationOpt {
8
+ /**指定高度及其颜色 [高度,[r,g,b,a?],厚度][]*/
9
+ heightStyles?: [number, [number, number, number, number?], number?][];
10
+ /**统一透明度 */
11
+ alpha?: number;
12
+ /**统一厚度 */
13
+ thickness?: number,
14
+ /**是否渐变 */
15
+ ifGradient?: boolean;
16
+ /**要划分的网格线(分割线) */
17
+ grid?: ElevationGrid;
18
+ }
19
+ /**海拔线属性网格配置 */
20
+ interface ElevationGrid {
21
+ /**网格线条数 */
22
+ count?: number;
23
+ /**网格线颜色 [r,g,b,a] */
24
+ color?: [number, number, number, number?]
25
+ /**网格线高点高度 */
26
+ heightAbove?: number;
27
+ /**网格线低点高度 */
28
+ heightBelow?: number;
29
+ /**条纹宽度(米) */
30
+ width?: number;
31
+ }
32
+
33
+
34
+ }
@@ -0,0 +1,69 @@
1
+ import type { Color, Geometry, GeometryFactory, Matrix4 } from 'cesium';
2
+ import * as Cesium from 'cesium';
3
+
4
+ declare global {
5
+ /**区域构造配置 */
6
+ interface OptPrimitiveArea {
7
+ /**生成几何实例的id,主要用于事件对象区分 */
8
+ id?: string;
9
+ /**类型 圆形 circle | 多边形 polygon */
10
+ type: 'ellipse' | 'polygon';
11
+ /**半径 */
12
+ radius?: number | LnglatHeight,
13
+ /**颜色 */
14
+ color?: Color;
15
+ /**边框颜色 */
16
+ outlineColor?: Color;
17
+ /**层级 */
18
+ zIndex?: number;
19
+ }
20
+ /**图元---椭圆区域构造 */
21
+ interface OptPrimitiveAreaEllipse extends OptPrimitiveArea {
22
+ /**类型 圆形 circle | 多边形 polygon */
23
+ type: 'ellipse',
24
+ /**经纬度坐标 */
25
+ positions: LnglatHeight,
26
+ /**半径 */
27
+ radius: number | LnglatHeight,
28
+ }
29
+ /**图元---多边形区域构造 */
30
+ interface OptPrimitiveAreaPolygon extends OptPrimitiveArea {
31
+ /**类型 圆形 circle | 多边形 polygon */
32
+ type: 'polygon',
33
+ /**经纬度坐标 */
34
+ positions: LnglatHeight[],
35
+ }
36
+
37
+ /**图元---贴地图片构造 */
38
+ interface OptPrimitiveImage2D {
39
+ /**id,设置图元实例的id,用于调取信息 */
40
+ id?: string;
41
+ /**图片位置 */
42
+ image: string;
43
+ /**经纬度坐标 */
44
+ positions: LnglatHeight,
45
+ /**类型 */
46
+ type?: string,
47
+ /**固定大小(m) */
48
+ size?: number;
49
+ /**旋转 °*/
50
+ rotation?: number;
51
+ /**离近是显示的图片*/
52
+ urlNear?: string;
53
+ distanceDisplayCondition?: [number, number];
54
+ }
55
+
56
+ /**实例化几何体所需配置 */
57
+ interface OptInstanceGeometry {
58
+ id?: any;
59
+ geometry: Geometry | GeometryFactory;
60
+ /**几何体大小 */
61
+ size: number;
62
+ /**几何体位置 */
63
+ lnglat: LnglatHeight;
64
+ /**几何体旋转返现 */
65
+ rotation: number;
66
+ modelMatrix?: Matrix4;
67
+ attributes?: any;
68
+ }
69
+ }
@@ -0,0 +1,25 @@
1
+ import * as Cesium from 'cesium';
2
+ /**针对不同场景需要的特定的类型 */
3
+ declare global {
4
+ /**实体模型加载配置 */
5
+ interface EntityModelOpt {
6
+ /**此物体的唯一id */
7
+ id: string,
8
+ /**模型地理位置 */
9
+ lnglat: LnglatHeight,
10
+ /**模型转向 */
11
+ heading?: number;
12
+ /**模型动画 */
13
+ }
14
+
15
+
16
+ /**地图着色器配置 */
17
+ interface LayerShaderOpt {
18
+ /**对颜色进行百分比调整 */
19
+ rbga?: any;
20
+ colorInvert: boolean;
21
+ colorFilter: any[];
22
+ }
23
+
24
+ }
25
+
@@ -0,0 +1,114 @@
1
+ import type { CesiumTerrainProvider, ClockViewModel, ContextOptions, Credit, DataSourceCollection, Ellipsoid, GeocoderService, Globe, ImageryLayer, MapMode2D, MapProjection, ProviderViewModel, SceneMode, ShadowMode, SkyAtmosphere, SkyBox, Terrain, TerrainProvider, Viewer } from "cesium";
2
+
3
+ declare global {
4
+ /**Viewer构造函数的初始化选项 */
5
+ interface SLCViewerOpt extends Viewer.ConstructorOptions {
6
+ /**动画表盘[true] */
7
+ animation?: boolean;
8
+ /**是否显示时间轴[true] */
9
+ timeline?: boolean;
10
+ /**是否显示全屏按钮[true] */
11
+ fullscreenButton?: boolean;
12
+ /**是否创建VRButton小部件[false] */
13
+ vrButton?: boolean;
14
+ /**是否显示搜索框(搜索地址)[true] */
15
+ geocoder?: boolean | GeocoderService[];
16
+ /**是否显示home按钮[true] */
17
+ homeButton?: boolean;
18
+ /**是否显示信息框(点击3D模型后显示资源路径或相关信息)[true] */
19
+ infoBox?: boolean;
20
+ /**是否显示场景模式选择按钮(2D、3D切换)[true]*/
21
+ sceneModePicker?: boolean;
22
+ /**是否显示选中框[true] */
23
+ selectionIndicator?: boolean;
24
+ /**是否帮助按钮[true] */
25
+ navigationHelpButton?: boolean;
26
+ /**如果导航说明最初应该是可见的,则为true,否则,如果直到用户明确单击按钮才显示,则为false [true] */
27
+ navigationInstructionsInitiallyVisible?: boolean;
28
+ /**每个几何实例将仅以3D形式渲染,以节省GPU内存[false] */
29
+ scene3DOnly?: boolean;
30
+ /**时钟是否尝试推进模拟时间[false]。此选项优先于设置{@link Viewer#clockViewModel} */
31
+ shouldAnimate?: boolean;
32
+ /**用于控制当前时间的时钟视图模型[new ClockViewModel(clock)] */
33
+ clockViewModel?: ClockViewModel;
34
+ /**是否显示图层选择按钮[true] */
35
+ baseLayerPicker?: boolean;
36
+ /**当前基础图像层的视图模型,如果未提供,则使用第一个可用的基础层。仅在baseLayerPicker=true 时有效 */
37
+ selectedImageryProviderViewModel?: ProviderViewModel;
38
+ /**可从BaseLayerPicker选择的ProviderViewModels数组,仅在baseLayerPicker=true时有效[createDefaultImageryProviderViewModels()] */
39
+ imageryProviderViewModels?: ProviderViewModel[];
40
+ /**当前基础地形图层的视图模型,如果未提供,则使用第一个可用的基础图层。仅在baseLayerPicker=true时有效 */
41
+ selectedTerrainProviderViewModel?: ProviderViewModel;
42
+ /**可从BaseLayerPicker选择的ProviderViewModels数组,仅在baseLayerPicker=true时有效[createDefaultTerrainProviderViewModels()] */
43
+ terrainProviderViewModels?: ProviderViewModel[];
44
+ /**应用于地球的最底层图像层。如为false则不添加任何图像提供程序。仅在baseLayerPicker=false时有效[ImageryLayer.fromWorldImagery()] */
45
+ baseLayer?: ImageryLayer | false;
46
+ /**要使用的地形提供程序[new EllipsoidTerrainProvider()] */
47
+ terrainProvider?: TerrainProvider;
48
+ /**处理异步地形提供程序的地形对象。仅当terrainProvider未定义时才能指定 */
49
+ terrain?: Terrain;
50
+ /**用于渲染星星的天空盒。当为undefined时,将使用默认的星星。如果设置为false,则不会添加天空盒、太阳或月亮 */
51
+ skyBox?: SkyBox | false;
52
+ /**蓝天,以及地球边缘周围的光晕。设置为 false 可将其关闭 */
53
+ skyAtmosphere?: SkyAtmosphere | false;
54
+ /**全屏按钮被按下时,要被置于全屏模式的元素或id [document.body] */
55
+ fullscreenElement?: Element | string;
56
+ /**如果此小部件应控制渲染循环,则为true,否则为false [true] */
57
+ useDefaultRenderLoop?: boolean;
58
+ /**使用默认渲染循环时的目标帧速率 */
59
+ targetFrameRate?: number;
60
+ /**则当出现渲染循环错误时,此小部件将自动向用户显示包含错误的 HTML 面板 [true] */
61
+ showRenderLoopErrors?: boolean;
62
+ /**以浏览器的推荐分辨率呈现,并忽略 window.devicePixelRatio [true] */
63
+ useBrowserRecommendedResolution?: boolean;
64
+ /**自动跟踪新添加的数据源的时钟设置,如果数据源的时钟发生更改,则进行更新。如果要单独配置时钟,请将其设置为 false [true]*/
65
+ automaticallyTrackDataSourceClocks?: boolean;
66
+ /**传递给{@link Scene}的上下文和WebGL创建属性 */
67
+ contextOptions?: ContextOptions;
68
+ /**初始场景模式 [SceneMode.SCENE3D] */
69
+ sceneMode?: SceneMode;
70
+ /**在二维和哥伦布视图模式下使用的地图投影 [new GeographicProjection()] */
71
+ mapProjection?: MapProjection;
72
+ /**场景中使用的地球仪。如果设置为false,则不会添加地球仪,默认情况下天空氛围将被隐藏。 */
73
+ globe?: Globe | false;
74
+ /**如果为 true,并且配置支持它,则使用顺序无关半透明 [true] */
75
+ orderIndependentTranslucency?: boolean;
76
+ /**将包含{@link CreditDisplay}的DOM元素或ID。 如果未指定,则将学分添加到小部件本身的底部 */
77
+ creditContainer?: Element | string;
78
+ /**将包含由{@link CreditDisplay}创建的信用弹出窗口的DOM元素或ID。 如果未指定,它将出现在小部件本身之上 */
79
+ creditViewport?: Element | string;
80
+ /**由小部件可视化的数据源集合。如果提供了此参数,假设实例归调用者所有,并且在查看器被销毁时不会被销毁。[new DataSourceCollection()]*/
81
+ dataSources?: DataSourceCollection;
82
+ /**确定阴影是否由光源投射 [false] */
83
+ shadows?: boolean;
84
+ /**确定地形是否投射或接收来自光源的阴影[ShadowMode.RECEIVE_ONLY] */
85
+ terrainShadows?: ShadowMode;
86
+ /**确定2D地图是否可旋转,或者是否可以在水平方向上无限滚动[MapMode2D.INFINITE_SCROLL] */
87
+ mapMode2D?: MapMode2D;
88
+ /**是否创建相机模式小部件(正交相机、透视相机)[false] */
89
+ projectionPicker?: boolean;
90
+ /**当查看者的画布被点击时,活动元素将模糊。将此设置为 false 对于仅点击画布以检索位置或实体数据而不实际将画布设置为活动元素的情况很有用 [true]*/
91
+ blurActiveElementOnCanvasFocus?: boolean;
92
+ /**如果为 true,则仅在场景中的更改确定需要时才呈现帧。启用此选项可降低应用程序的 CPU/GPU 使用率,并减少移动设备的电池使用量,但需要使用{@link Scene#requestRender} 在此模式下显式呈现新帧。在 API 的其他部分对场景进行更改后,在许多情况下都需要这样做。请参阅《通过显式呈现提高性能》[false] */
93
+ requestRenderMode?: boolean;
94
+ /**如果 requestRenderMode 为 true,则此值定义了在请求渲染之前允许的最大模拟时间变化。请参阅《通过显式渲染提高性能》(https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/)[0.0] */
95
+ maximumRenderTimeChange?: number;
96
+ /**调整 DepthPlane 以解决低于椭球零高度的渲染伪影 [0.0] */
97
+ depthPlaneEllipsoidOffset?: number;
98
+ /**如果提供,此值控制多采样抗锯齿的速率。典型的多采样率为每像素 2、4,有时为 8 个采样。更高的 MSAA 采样率可能会影响性能,以换取更好的视觉质量。此值仅适用于支持多采样渲染目标的 WebGL2 上下文 [1] */
99
+ msaaSamples?: number;
100
+ }
101
+ /** 地形静态资源初始化选项 */
102
+ interface CTerrainAssetOpt extends CesiumTerrainProvider.ConstructorOptions {
103
+ /**从服务器请求水体效果 */
104
+ requestWaterMask?: boolean,
105
+ /**从服务器请求地形光照信息效果 */
106
+ requestVertexNormals?: boolean,
107
+ /**从服务器请求每个图块元数据的标记 */
108
+ requestMetadata?: boolean,
109
+ /**椭球体。如果未指定,则使用 WGS84 椭球体 */
110
+ ellipsoid?: Ellipsoid;
111
+ /**数据源的信用,显示在画布上*/
112
+ credit?: Credit | string;
113
+ }
114
+ }
@@ -0,0 +1,189 @@
1
+ import * as Cesium from 'cesium';
2
+ import { Cartesian2, Cartesian3, Cartographic, DeveloperError, EllipsoidGeodesic, Scene, Math as CesiumMath, Camera, Property, HeadingPitchRoll, Transforms, Quaternion, Model, Matrix4, Ellipsoid } from 'cesium';
3
+ import { CMath, uc_mathGetPoint } from './common';
4
+ import { uc_tsIfCartesian2, uc_tsIfCartesian3, uc_tsIfLnglatHeight, uc_tsIfProperty, uc_tsIfScene } from './types';
5
+ /**获取指定经纬度处转向的四元数时使用 uc_getQuaternion */
6
+ const HEADING_PITCH_ROLL: HeadingPitchRoll = new HeadingPitchRoll(0, 0, 0)
7
+ /**作为中转的C3 */
8
+ const CARTESIAN3_CONST = new Cartesian3();
9
+ const ELLIPSOIDGEODESIC_CONST = new EllipsoidGeodesic();
10
+ /**根据经纬度和高度获取地球Cartesian3的坐标 */
11
+ function getCartesian3ByLnglat(lnglatheight: LnglatHeight, ellipsoid?: Cesium.Ellipsoid, result?: Cesium.Cartesian3, ifTerrain?: boolean) {
12
+ const [lng, lat, height = 0] = lnglatheight;
13
+ return Cartesian3.fromDegrees(lng, lat, height, ellipsoid, result);
14
+ }
15
+ /**获取三维坐标根据屏幕坐标(如果超出地球re)
16
+ * @param scene 场景
17
+ * @param c2 屏幕坐标
18
+ * @param result 如果超出地球会返回undefined,但是result不变
19
+ * @param ifTerrain 是否有地形
20
+ */
21
+ function getCartesian3ByCartesian2(c2: Cartesian2, scene: Scene, result?: Cartesian3, ifTerrain?: boolean): Cartesian3 | undefined {
22
+ result = scene.pickPosition(c2, result);
23
+ if (!result) return;
24
+ if (!ifTerrain) {
25
+ /**有地形数据时不要将高度降为0 */
26
+ let { longitude, latitude } = Cartographic.fromCartesian(result);
27
+ getCartesian3ByLnglat([CesiumMath.toDegrees(longitude), CesiumMath.toDegrees(latitude), 0], undefined, result)
28
+ }
29
+ return result;
30
+ }
31
+ /**获取地球上的经纬度和高度坐标(单位:度,非弧度值)
32
+ * @param p 三维笛卡尔坐标 | 屏幕坐标 | 经纬度地理坐标
33
+ * @param result 结果要覆盖的原对象(相对new能节约性能)
34
+ * @param scene 场景(屏幕坐标必须传)
35
+ * @param ifTerrain 是否拥有地形
36
+ */
37
+ function uc_getLnglat(p: Cartesian3 | LnglatHeight, result?: LnglatHeight): LnglatHeight;
38
+ function uc_getLnglat(p: Cartesian2, scene: Scene, result?: LnglatHeight, ifTerrain?: boolean): LnglatHeight | undefined;
39
+ function uc_getLnglat(p1: Cartesian3 | Cartesian2 | LnglatHeight, p2?: Scene | LnglatHeight, p3?: LnglatHeight, p4?: boolean): LnglatHeight | undefined {
40
+ let flag, res: LnglatHeight = (uc_tsIfScene(p2) ? p3 : p2) || [0, 0];
41
+ if (uc_tsIfCartesian3(p1)) {
42
+ flag = uc_getCartesian3(p1, CARTESIAN3_CONST);
43
+ } else if (uc_tsIfCartesian2(p1)) {
44
+ if (!p2 || uc_tsIfLnglatHeight(p2)) throw new DeveloperError(`屏幕坐标参数2必须传入场景`);
45
+ flag = uc_getCartesian3(p1, p2, CARTESIAN3_CONST, p4);
46
+ } else if (uc_tsIfLnglatHeight(p1)) {
47
+ flag = uc_getCartesian3(p1, CARTESIAN3_CONST)
48
+ }
49
+ if (!flag) return undefined;
50
+ let cartesian = Cartographic.fromCartesian(CARTESIAN3_CONST);
51
+ if (!cartesian) return undefined;
52
+ res[0] = uc_mathGetPoint(CesiumMath.toDegrees(cartesian.longitude), 8),
53
+ res[1] = uc_mathGetPoint(CesiumMath.toDegrees(cartesian.latitude), 8),
54
+ res[2] = uc_mathGetPoint(cartesian.height);
55
+ return res
56
+ }
57
+ /**获取二维屏幕坐标
58
+ * @param p1 三维笛卡尔坐标 | 屏幕坐标 | 经纬度地理坐标
59
+ * @param result 结果要覆盖的原对象(相对new能节约性能)
60
+ * @param scene 场景(三维、经纬度必须传)
61
+ * @param ifTerrain 是否拥有地形
62
+ */
63
+ function uc_getCartesian2(p: Cartesian2, result?: Cartesian2): Cartesian2;
64
+ function uc_getCartesian2(p: Cartesian3 | LnglatHeight, scene: Scene, result?: Cartesian2): Cartesian2 | undefined;
65
+ function uc_getCartesian2(p1: Cartesian3 | Cartesian2 | LnglatHeight, p2?: Scene | Cartesian2, p3?: Cartesian2): Cartesian2 {
66
+ if (uc_tsIfCartesian3(p1) || uc_tsIfLnglatHeight(p1)) {
67
+ if (!p2 || uc_tsIfCartesian2(p2)) throw new DeveloperError(`参数2(场景)必须传入`);
68
+ uc_getCartesian3(p1, CARTESIAN3_CONST)
69
+ return p2.cartesianToCanvasCoordinates(CARTESIAN3_CONST, p3);
70
+ }
71
+ return p1.clone(p2 as Cartesian2)
72
+ }
73
+ /**获取地球上的Cartesian3坐标
74
+ * @param p 三维笛卡尔坐标 | 屏幕坐标 | 经纬度地理坐标
75
+ * @param result 结果要覆盖的原对象(相对new能节约性能)
76
+ * @param scene 场景(屏幕坐标必须传)
77
+ * @param ifTerrain 是否拥有地形
78
+ */
79
+ function uc_getCartesian3(p: Cartesian3 | LnglatHeight, result?: Cartesian3): Cartesian3;
80
+ function uc_getCartesian3(p: Cartesian2, scene: Scene, result?: Cartesian3, ifTerrain?: boolean): Cartesian3 | undefined;
81
+ function uc_getCartesian3(p1: Cartesian3 | Cartesian2 | LnglatHeight, p2?: Scene | Cartesian3, p3?: Cartesian3, p4?: boolean): Cartesian3 | undefined {
82
+ if (uc_tsIfLnglatHeight(p1)) {
83
+ return getCartesian3ByLnglat(p1, undefined, p2 as Cartesian3)
84
+ } else if (uc_tsIfCartesian3(p1)) {
85
+ return p1.clone(p2 as Cartesian3)
86
+ } else if (uc_tsIfCartesian2(p1)) {
87
+ if (!p2 || uc_tsIfCartesian3(p2)) throw new DeveloperError(`屏幕坐标参数2必须传入场景`);
88
+ return getCartesian3ByCartesian2(p1, p2, p3, p4)
89
+ }
90
+ }
91
+
92
+
93
+ /**获取模型的世界坐标 */
94
+ function uc_getCartesian3ByModel(target: Model, result: Cartesian3 = new Cartesian3()): Cartesian3 {
95
+ return Matrix4.multiplyByPoint(target.modelMatrix, Cartesian3.ZERO, result)
96
+ }
97
+
98
+ /**计算得到P2相对P1的方位
99
+ * (heading => 正北 0 东 80 南 180 西 -90(270) pitch 正上方 +90 正下方 -90 )
100
+ * */
101
+ function uc_getDirection(p1: Cartesian3 | LnglatHeight, p2: Cartesian3 | LnglatHeight) {
102
+ const [lng1, lat1, height1] = uc_getLnglat(p1), [lng2, lat2, height2] = uc_getLnglat(p2);
103
+ const c1 = Cartographic.fromDegrees(lng1, lat1, 0), c2 = Cartographic.fromDegrees(lng2, lat2, 0)
104
+ // 使用 EllipsoidGeodesic 计算大圆距离
105
+ ELLIPSOIDGEODESIC_CONST.setEndPoints(c1, c2);
106
+ return {
107
+ heading: Math.PI / 2 - Math.atan2(lat2 - lat1, lng2 - lng1),
108
+ pitch: Math.atan2(height2 - height1, ELLIPSOIDGEODESIC_CONST.surfaceDistance),
109
+ roll: 0.0
110
+ }
111
+ }
112
+
113
+ /**获取经纬度差值根据指定距离(纬度上的差值是固定的,经度方向的差值是根据纬度决定的)
114
+ * @param {number} lat 纬度
115
+ * @param {number} distance 距离
116
+ * @returns {经度差值diffLng , 纬度差值diffLat } 经纬度差值
117
+ */
118
+ function uc_getDiffDegreesByDistance(lat: number, distance: number) {
119
+ // 计算distance米在指定纬度上的偏移量
120
+ const diffLng = distance / (111320 * Math.cos(CMath.toRadians(lat))); // 经度方向10米的偏移量
121
+ const diffLat = distance / 111320; // 纬度方向10米的偏移量
122
+ Ellipsoid.UNIT_SPHERE
123
+ return { diffLng, diffLat };
124
+ }
125
+ /**获取指定纬度点上固定差值的距离
126
+ * @param {number} lat 纬度
127
+ * @param {number} distance 距离
128
+ */
129
+ function uc_getDistanceByLatOffset(lat: number, offset: number): number {
130
+ return 111320 * offset * Math.cos(CMath.toRadians(lat));
131
+ }
132
+ /**获取地球两点间的距离(m)小数点若干*/
133
+ function uc_getDistanceByCartesian3(c0: Cartesian3, c1: Cartesian3): number {
134
+ const cartographic1 = Cartographic.fromCartesian(c0);
135
+ const cartographic2 = Cartographic.fromCartesian(c1);
136
+ // 使用 EllipsoidGeodesic 计算大圆距离
137
+ ELLIPSOIDGEODESIC_CONST.setEndPoints(cartographic1, cartographic2);
138
+ const distance = ELLIPSOIDGEODESIC_CONST.surfaceDistance; // 距离以米为单位
139
+ return distance;
140
+ }
141
+ /**获取地球两点间的距离(曲面)和距离单位*/
142
+ function uc_getDistanceAndUnits(c0: Cartesian3, c1: Cartesian3): { distance, units } {
143
+ let distance = uc_getDistanceByCartesian3(c0, c1), units = 'm';
144
+ if (distance < 1) {
145
+ distance = uc_mathGetPoint(distance * 100);
146
+ units = 'cm'
147
+ } else if (distance < 1000) {
148
+ distance = uc_mathGetPoint(distance)
149
+ } else {
150
+ distance = uc_mathGetPoint(distance / 1000)
151
+ units = 'km'
152
+ }
153
+ return { distance, units };
154
+ }
155
+
156
+
157
+ /**获取指定经纬度处转向的四元数
158
+ * @param lnglat 物体所处的位置
159
+ * @param rotate 物体要旋转的度数
160
+ */
161
+ function uc_getQuaternion(position: LnglatHeight | Cartesian3, rotate: number): Quaternion {
162
+ if (uc_tsIfLnglatHeight(position)) position = uc_getCartesian3(position)
163
+ const heading = CMath.toRadians(rotate);
164
+ const pitch = CMath.toRadians(0);
165
+ const roll = CMath.toRadians(0);
166
+ HEADING_PITCH_ROLL.heading = heading;
167
+ HEADING_PITCH_ROLL.pitch = pitch;
168
+ HEADING_PITCH_ROLL.roll = roll;
169
+ const orientation = Transforms.headingPitchRollQuaternion(
170
+ position,
171
+ HEADING_PITCH_ROLL
172
+ );
173
+ return orientation
174
+ }
175
+
176
+
177
+
178
+ export {
179
+ uc_getLnglat,
180
+ uc_getCartesian2,
181
+ uc_getCartesian3,
182
+ uc_getCartesian3ByModel,
183
+ uc_getDistanceByCartesian3,
184
+ uc_getDistanceByLatOffset,
185
+ uc_getDistanceAndUnits,
186
+ uc_getDirection,
187
+ uc_getDiffDegreesByDistance,
188
+ uc_getQuaternion,
189
+ };
@@ -0,0 +1,87 @@
1
+ /**一些简单的数学工具 */
2
+ import { Math as Cmath } from 'cesium'
3
+ const CMath = Cmath;
4
+ /**深拷贝将 obj 的数据更新到res => 更新或深拷贝
5
+ * @param obj 获取更新数据的对象
6
+ * @param res 存储更新结果的对象
7
+ * @param update 只更新原结果res的数据,不删减
8
+ * @example
9
+ * let obj = { a:{a1:1},b:1},res = {a:{a2:2},c:2};
10
+ * assign( obj , res) => { a: { a1:1, a2:2}, b:1, c:2}
11
+ * assign( obj , res, false)=> { a: { a1:1}, b:1}
12
+ */
13
+ function uc_deepAssign<T>(obj: T, res?: any, update: boolean = true): T {
14
+ if (Array.isArray(obj)) {
15
+ res = res && Array.isArray(res) && update ? res : [];
16
+ obj.map((e, i) => res[i] = uc_deepAssign(e, res[i]))
17
+ } else if (typeof obj === 'object') {
18
+ res = res && update ? res : Object.create(null);
19
+ for (const key in obj) {
20
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
21
+ const e = obj[key];
22
+ if (Array.isArray(e) || typeof e === 'object') {
23
+ res[key] = uc_deepAssign(e, res[key], update)
24
+ } else {
25
+ res[key] = e
26
+ }
27
+ }
28
+ }
29
+ } else if (obj === undefined && update) {
30
+ res = res
31
+ } else {
32
+ res = obj
33
+ }
34
+ return res
35
+ }
36
+
37
+ /**数组删除或增加指定(不改变引用地址,不适用于多重数组)
38
+ * @param arr 要增删的数组
39
+ * @param item 要添加或删除的项目组
40
+ * @param add true--添加
41
+ */
42
+ function uc_arrChange<T>(arr: T[], item: T | T[], add: boolean = true): T[] {
43
+ if (!Array.isArray(item)) item = [item];
44
+ if (add) {
45
+ item.forEach(e => {
46
+ if (!arr.includes(e)) arr.push(e);
47
+ });
48
+ } else {
49
+ item.forEach(e => {
50
+ const index = arr.indexOf(e);
51
+ if (index > -1) arr.splice(index, 1);
52
+ });
53
+ }
54
+ return arr;
55
+ }
56
+ /**获取指定位数的小数(num过大或point过大可能导致数据异常出现负值)
57
+ * @param num 数字
58
+ * @param point 需要几位小数
59
+ * @param type 0四舍五入 1下取整 2 上取整
60
+ */
61
+ function uc_mathGetPoint(num: number, point: number = 2, type: 0 | 1 | 2 = 0): number {
62
+ let res = num * Math.pow(10, point);
63
+ res = type == 0 ? Math.round(res) : type == 1 ? Math.floor(res) : Math.ceil(res);
64
+ return res / Math.pow(10, point)
65
+ }
66
+
67
+ /**获得一个uuid */
68
+ function uc_getUUID() {
69
+ let d = Date.now();
70
+ if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
71
+ d += performance.now(); // use high-precision timer if available
72
+ }
73
+ const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
74
+ const r = (d + Math.random() * 16) % 16 | 0;
75
+ d = Math.floor(d / 16);
76
+ return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
77
+ });
78
+ return uuid;
79
+ }
80
+
81
+ export {
82
+ CMath,
83
+ uc_mathGetPoint,
84
+ uc_getUUID,
85
+ uc_deepAssign,
86
+ uc_arrChange,
87
+ }
@@ -0,0 +1,5 @@
1
+
2
+ export * from './cesium';
3
+ export * from './common';
4
+ export * from './map';
5
+ export * from './types';