@reearth/core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (649) hide show
  1. package/README.md +18 -0
  2. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
  3. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
  4. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
  5. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
  6. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
  7. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
  8. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
  9. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
  10. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
  11. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
  12. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
  13. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
  14. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
  15. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
  16. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
  17. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
  18. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
  19. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
  20. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
  21. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
  22. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
  23. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
  24. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
  25. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
  26. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
  27. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
  28. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
  29. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
  30. package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
  31. package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
  32. package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
  33. package/dist/cesium/Assets/Images/ion-credit.png +0 -0
  34. package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  35. package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  36. package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  37. package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  38. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  39. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  40. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  41. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  42. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  43. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  44. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  45. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  46. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  47. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  48. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  49. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  50. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  51. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  52. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  53. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  54. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  55. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  56. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  57. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  58. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  59. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  60. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  61. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  62. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  63. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  64. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  65. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  66. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  67. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  68. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  69. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  70. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  71. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  72. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  73. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  74. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  75. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  76. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  77. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  78. package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
  79. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  80. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  81. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  82. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  83. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  84. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  85. package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
  86. package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
  87. package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
  88. package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
  89. package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
  90. package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
  91. package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
  92. package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
  93. package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
  94. package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
  95. package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
  96. package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
  97. package/dist/cesium/Assets/Textures/maki/building.png +0 -0
  98. package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
  99. package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
  100. package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
  101. package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
  102. package/dist/cesium/Assets/Textures/maki/car.png +0 -0
  103. package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
  104. package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
  105. package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
  106. package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
  107. package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
  108. package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
  109. package/dist/cesium/Assets/Textures/maki/city.png +0 -0
  110. package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
  111. package/dist/cesium/Assets/Textures/maki/college.png +0 -0
  112. package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
  113. package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
  114. package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
  115. package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
  116. package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
  117. package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
  118. package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
  119. package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
  120. package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
  121. package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
  122. package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
  123. package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
  124. package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
  125. package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
  126. package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
  127. package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
  128. package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
  129. package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
  130. package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
  131. package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
  132. package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
  133. package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
  134. package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
  135. package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
  136. package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
  137. package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
  138. package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
  139. package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
  140. package/dist/cesium/Assets/Textures/maki/library.png +0 -0
  141. package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
  142. package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
  143. package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
  144. package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
  145. package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
  146. package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
  147. package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
  148. package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
  149. package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
  150. package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
  151. package/dist/cesium/Assets/Textures/maki/music.png +0 -0
  152. package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
  153. package/dist/cesium/Assets/Textures/maki/park.png +0 -0
  154. package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
  155. package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
  156. package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
  157. package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
  158. package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
  159. package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
  160. package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
  161. package/dist/cesium/Assets/Textures/maki/police.png +0 -0
  162. package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
  163. package/dist/cesium/Assets/Textures/maki/post.png +0 -0
  164. package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
  165. package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
  166. package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
  167. package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
  168. package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
  169. package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
  170. package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
  171. package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
  172. package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
  173. package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
  174. package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
  175. package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
  176. package/dist/cesium/Assets/Textures/maki/school.png +0 -0
  177. package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
  178. package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
  179. package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
  180. package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
  181. package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
  182. package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
  183. package/dist/cesium/Assets/Textures/maki/square.png +0 -0
  184. package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
  185. package/dist/cesium/Assets/Textures/maki/star.png +0 -0
  186. package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
  187. package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
  188. package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
  189. package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
  190. package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
  191. package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
  192. package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
  193. package/dist/cesium/Assets/Textures/maki/town.png +0 -0
  194. package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
  195. package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
  196. package/dist/cesium/Assets/Textures/maki/village.png +0 -0
  197. package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
  198. package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
  199. package/dist/cesium/Assets/Textures/maki/water.png +0 -0
  200. package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
  201. package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
  202. package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
  203. package/dist/cesium/Assets/Textures/pin.svg +1 -0
  204. package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
  205. package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
  206. package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
  207. package/dist/cesium/ThirdParty/Workers/package.json +1 -0
  208. package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +1 -0
  209. package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +1 -0
  210. package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
  211. package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  212. package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
  213. package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
  214. package/dist/cesium/Widgets/Animation/Animation.css +127 -0
  215. package/dist/cesium/Widgets/Animation/lighter.css +70 -0
  216. package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
  217. package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
  218. package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
  219. package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
  220. package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +124 -0
  221. package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
  222. package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
  223. package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
  224. package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
  225. package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
  226. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  227. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  228. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  229. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  230. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  231. package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  232. package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  233. package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  234. package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  235. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  236. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  237. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  238. package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  239. package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  240. package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  241. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  242. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  243. package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  244. package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  245. package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
  246. package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
  247. package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
  248. package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
  249. package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
  250. package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
  251. package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
  252. package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
  253. package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
  254. package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  255. package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  256. package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
  257. package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
  258. package/dist/cesium/Widgets/InfoBox/InfoBox.css +92 -0
  259. package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
  260. package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
  261. package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
  262. package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
  263. package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
  264. package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
  265. package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
  266. package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
  267. package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
  268. package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
  269. package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
  270. package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
  271. package/dist/cesium/Widgets/lighter.css +237 -0
  272. package/dist/cesium/Widgets/lighterShared.css +46 -0
  273. package/dist/cesium/Widgets/shared.css +103 -0
  274. package/dist/cesium/Widgets/widgets.css +1346 -0
  275. package/dist/cesium/Workers/chunk-2ED5WI77.js +26 -0
  276. package/dist/cesium/Workers/chunk-2MBPFWCP.js +26 -0
  277. package/dist/cesium/Workers/chunk-3C74MLG3.js +26 -0
  278. package/dist/cesium/Workers/chunk-45U7TTT3.js +26 -0
  279. package/dist/cesium/Workers/chunk-4N7SRDH5.js +26 -0
  280. package/dist/cesium/Workers/chunk-4T6AS6BZ.js +26 -0
  281. package/dist/cesium/Workers/chunk-5AG2MVRM.js +26 -0
  282. package/dist/cesium/Workers/chunk-5Z6L2FHX.js +26 -0
  283. package/dist/cesium/Workers/chunk-6AUUBDOF.js +26 -0
  284. package/dist/cesium/Workers/chunk-74N6MC2V.js +26 -0
  285. package/dist/cesium/Workers/chunk-7VJK3KHI.js +26 -0
  286. package/dist/cesium/Workers/chunk-7VZHIB6P.js +26 -0
  287. package/dist/cesium/Workers/chunk-7X2YQ6I4.js +27 -0
  288. package/dist/cesium/Workers/chunk-B2SKQ7LU.js +26 -0
  289. package/dist/cesium/Workers/chunk-B4TQDFIE.js +26 -0
  290. package/dist/cesium/Workers/chunk-B6TRTFAA.js +26 -0
  291. package/dist/cesium/Workers/chunk-BK3HCS7I.js +26 -0
  292. package/dist/cesium/Workers/chunk-BOPB43LN.js +26 -0
  293. package/dist/cesium/Workers/chunk-C6DMEJQ7.js +26 -0
  294. package/dist/cesium/Workers/chunk-CN7UN2OZ.js +26 -0
  295. package/dist/cesium/Workers/chunk-CSISXEG7.js +26 -0
  296. package/dist/cesium/Workers/chunk-CUOR5F7T.js +28 -0
  297. package/dist/cesium/Workers/chunk-DGCK3LD2.js +30 -0
  298. package/dist/cesium/Workers/chunk-DXEZYE3K.js +62 -0
  299. package/dist/cesium/Workers/chunk-EXBFEYPQ.js +26 -0
  300. package/dist/cesium/Workers/chunk-FK5KFB6H.js +26 -0
  301. package/dist/cesium/Workers/chunk-HPBHKP5S.js +26 -0
  302. package/dist/cesium/Workers/chunk-JCJ24DHF.js +26 -0
  303. package/dist/cesium/Workers/chunk-JEWHFDAA.js +26 -0
  304. package/dist/cesium/Workers/chunk-JZLZJJQD.js +26 -0
  305. package/dist/cesium/Workers/chunk-KRZBI2MU.js +26 -0
  306. package/dist/cesium/Workers/chunk-KTTUANTJ.js +26 -0
  307. package/dist/cesium/Workers/chunk-LDCAXLGS.js +26 -0
  308. package/dist/cesium/Workers/chunk-LOPN5R3I.js +26 -0
  309. package/dist/cesium/Workers/chunk-MDLPQIMP.js +26 -0
  310. package/dist/cesium/Workers/chunk-MRR3RGFO.js +26 -0
  311. package/dist/cesium/Workers/chunk-NPBZI5YA.js +26 -0
  312. package/dist/cesium/Workers/chunk-NUSW5B6A.js +26 -0
  313. package/dist/cesium/Workers/chunk-OUXRUXNB.js +26 -0
  314. package/dist/cesium/Workers/chunk-QPOPEH3M.js +26 -0
  315. package/dist/cesium/Workers/chunk-R2AN7EKC.js +26 -0
  316. package/dist/cesium/Workers/chunk-RURL6ZX2.js +26 -0
  317. package/dist/cesium/Workers/chunk-SUQM3OSW.js +28 -0
  318. package/dist/cesium/Workers/chunk-UBIRX2SP.js +26 -0
  319. package/dist/cesium/Workers/chunk-VAKC5J5C.js +26 -0
  320. package/dist/cesium/Workers/chunk-VHNZBQTR.js +27 -0
  321. package/dist/cesium/Workers/chunk-VKV642QV.js +26 -0
  322. package/dist/cesium/Workers/chunk-VMSXG4OA.js +26 -0
  323. package/dist/cesium/Workers/chunk-VQZSIOZW.js +26 -0
  324. package/dist/cesium/Workers/chunk-WZUWQMI7.js +26 -0
  325. package/dist/cesium/Workers/chunk-YBI55DLZ.js +26 -0
  326. package/dist/cesium/Workers/chunk-YEJWCH6C.js +26 -0
  327. package/dist/cesium/Workers/chunk-YPDO7SPO.js +26 -0
  328. package/dist/cesium/Workers/chunk-ZYWD6OQH.js +26 -0
  329. package/dist/cesium/Workers/combineGeometry.js +26 -0
  330. package/dist/cesium/Workers/createBoxGeometry.js +26 -0
  331. package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
  332. package/dist/cesium/Workers/createCircleGeometry.js +26 -0
  333. package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
  334. package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
  335. package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
  336. package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
  337. package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
  338. package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
  339. package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
  340. package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
  341. package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
  342. package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
  343. package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
  344. package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
  345. package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
  346. package/dist/cesium/Workers/createGeometry.js +26 -0
  347. package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
  348. package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
  349. package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
  350. package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
  351. package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
  352. package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
  353. package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
  354. package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
  355. package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
  356. package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
  357. package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
  358. package/dist/cesium/Workers/createSphereGeometry.js +26 -0
  359. package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
  360. package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
  361. package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
  362. package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
  363. package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
  364. package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
  365. package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
  366. package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
  367. package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
  368. package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
  369. package/dist/cesium/Workers/createWallGeometry.js +26 -0
  370. package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
  371. package/dist/cesium/Workers/decodeDraco.js +26 -0
  372. package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
  373. package/dist/cesium/Workers/decodeI3S.js +26 -0
  374. package/dist/cesium/Workers/transcodeKTX2.js +56 -0
  375. package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
  376. package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
  377. package/dist/core.js +83397 -0
  378. package/dist/core.umd.cjs +6710 -0
  379. package/dist/index-DqatWUTw.js +3225 -0
  380. package/dist/index.d.ts +1760 -0
  381. package/package.json +115 -0
  382. package/src/Map/ClusteredLayers/index.tsx +106 -0
  383. package/src/Map/Layer/hooks.ts +180 -0
  384. package/src/Map/Layer/index.tsx +92 -0
  385. package/src/Map/Layers/hooks.test.ts +819 -0
  386. package/src/Map/Layers/hooks.ts +955 -0
  387. package/src/Map/Layers/index.test.tsx +188 -0
  388. package/src/Map/Layers/index.tsx +76 -0
  389. package/src/Map/Layers/keys.ts +51 -0
  390. package/src/Map/Layers/utils.test.ts +53 -0
  391. package/src/Map/Layers/utils.ts +37 -0
  392. package/src/Map/Sketch/hooks.ts +641 -0
  393. package/src/Map/Sketch/index.tsx +101 -0
  394. package/src/Map/Sketch/preset.ts +29 -0
  395. package/src/Map/Sketch/sketchMachine.ts +323 -0
  396. package/src/Map/Sketch/sketchMachine.typegen.ts +72 -0
  397. package/src/Map/Sketch/types.ts +52 -0
  398. package/src/Map/Sketch/utils.ts +24 -0
  399. package/src/Map/hooks.ts +127 -0
  400. package/src/Map/index.tsx +147 -0
  401. package/src/Map/ref.ts +147 -0
  402. package/src/Map/types/event.ts +104 -0
  403. package/src/Map/types/index.ts +545 -0
  404. package/src/Map/useTimelineManager.ts +215 -0
  405. package/src/Map/utils.test.ts +62 -0
  406. package/src/Map/utils.ts +71 -0
  407. package/src/Visualizer/DropHolder.tsx +41 -0
  408. package/src/Visualizer/Error.tsx +15 -0
  409. package/src/Visualizer/context.tsx +27 -0
  410. package/src/Visualizer/coreContext.tsx +47 -0
  411. package/src/Visualizer/engines.ts +7 -0
  412. package/src/Visualizer/featureFlags.ts +9 -0
  413. package/src/Visualizer/hooks.ts +403 -0
  414. package/src/Visualizer/index.stories.tsx +128 -0
  415. package/src/Visualizer/index.tsx +187 -0
  416. package/src/Visualizer/interactionMode.ts +25 -0
  417. package/src/Visualizer/useViewport.ts +74 -0
  418. package/src/e2eConfig.ts +20 -0
  419. package/src/engines/Cesium/Cluster.tsx +90 -0
  420. package/src/engines/Cesium/Event.tsx +15 -0
  421. package/src/engines/Cesium/Feature/Box/Edge.tsx +94 -0
  422. package/src/engines/Cesium/Feature/Box/ScalePoints.tsx +158 -0
  423. package/src/engines/Cesium/Feature/Box/Side.tsx +70 -0
  424. package/src/engines/Cesium/Feature/Box/constants.ts +63 -0
  425. package/src/engines/Cesium/Feature/Box/hooks/box.ts +375 -0
  426. package/src/engines/Cesium/Feature/Box/hooks/edge.ts +112 -0
  427. package/src/engines/Cesium/Feature/Box/hooks/scalePoint.ts +174 -0
  428. package/src/engines/Cesium/Feature/Box/hooks/side.ts +72 -0
  429. package/src/engines/Cesium/Feature/Box/index.tsx +156 -0
  430. package/src/engines/Cesium/Feature/Box/utils.ts +168 -0
  431. package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +48 -0
  432. package/src/engines/Cesium/Feature/Ellipse/index.tsx +91 -0
  433. package/src/engines/Cesium/Feature/Ellipsoid/index.tsx +84 -0
  434. package/src/engines/Cesium/Feature/Frustum/FrustumColorAppearance.ts +38 -0
  435. package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +23 -0
  436. package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +49 -0
  437. package/src/engines/Cesium/Feature/Frustum/index.tsx +163 -0
  438. package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.frag.glsl +31 -0
  439. package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.vert.glsl +29 -0
  440. package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +186 -0
  441. package/src/engines/Cesium/Feature/HeatMap/HeatmapMeshMaterial.ts +81 -0
  442. package/src/engines/Cesium/Feature/HeatMap/colorMap.ts +47 -0
  443. package/src/engines/Cesium/Feature/HeatMap/constants.ts +781 -0
  444. package/src/engines/Cesium/Feature/HeatMap/createMeshImageData.ts +108 -0
  445. package/src/engines/Cesium/Feature/HeatMap/index.tsx +169 -0
  446. package/src/engines/Cesium/Feature/HeatMap/shaders/heatmapMeshMaterial.glsl +78 -0
  447. package/src/engines/Cesium/Feature/HeatMap/shaders/makeContour.glsl +13 -0
  448. package/src/engines/Cesium/Feature/HeatMap/shaders/sampleBicubic.glsl +57 -0
  449. package/src/engines/Cesium/Feature/Marker/index.tsx +296 -0
  450. package/src/engines/Cesium/Feature/Marker/marker.svg +3 -0
  451. package/src/engines/Cesium/Feature/Model/index.stories.tsx +48 -0
  452. package/src/engines/Cesium/Feature/Model/index.tsx +223 -0
  453. package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +98 -0
  454. package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +163 -0
  455. package/src/engines/Cesium/Feature/PhotoOverlay/primPhotoIcon.svg +3 -0
  456. package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +174 -0
  457. package/src/engines/Cesium/Feature/Polygon/index.tsx +182 -0
  458. package/src/engines/Cesium/Feature/Polyline/index.tsx +98 -0
  459. package/src/engines/Cesium/Feature/Raster/hooks.ts +52 -0
  460. package/src/engines/Cesium/Feature/Raster/index.stories.tsx +77 -0
  461. package/src/engines/Cesium/Feature/Raster/index.tsx +37 -0
  462. package/src/engines/Cesium/Feature/Raster/mvt.ts +33 -0
  463. package/src/engines/Cesium/Feature/Raster/tiles.ts +27 -0
  464. package/src/engines/Cesium/Feature/Raster/tms.ts +31 -0
  465. package/src/engines/Cesium/Feature/Raster/types.ts +5 -0
  466. package/src/engines/Cesium/Feature/Raster/utils.test.ts +14 -0
  467. package/src/engines/Cesium/Feature/Raster/utils.ts +10 -0
  468. package/src/engines/Cesium/Feature/Raster/wms.ts +28 -0
  469. package/src/engines/Cesium/Feature/Resource/index.stories.tsx +46 -0
  470. package/src/engines/Cesium/Feature/Resource/index.tsx +218 -0
  471. package/src/engines/Cesium/Feature/Resource/utils.test.ts +69 -0
  472. package/src/engines/Cesium/Feature/Resource/utils.ts +377 -0
  473. package/src/engines/Cesium/Feature/Tileset/DrawClippingPolygon/index.tsx +77 -0
  474. package/src/engines/Cesium/Feature/Tileset/TilesetFeatureIndex.ts +46 -0
  475. package/src/engines/Cesium/Feature/Tileset/hooks.ts +793 -0
  476. package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +41 -0
  477. package/src/engines/Cesium/Feature/Tileset/index.tsx +127 -0
  478. package/src/engines/Cesium/Feature/Tileset/types.ts +5 -0
  479. package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +457 -0
  480. package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +200 -0
  481. package/src/engines/Cesium/Feature/context.ts +33 -0
  482. package/src/engines/Cesium/Feature/index.tsx +250 -0
  483. package/src/engines/Cesium/Feature/utils.test.tsx +30 -0
  484. package/src/engines/Cesium/Feature/utils.tsx +289 -0
  485. package/src/engines/Cesium/FeatureIndex.ts +15 -0
  486. package/src/engines/Cesium/JapanSeaLevelEllipsoid.ts +20 -0
  487. package/src/engines/Cesium/PostProcesses/README.md +1 -0
  488. package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +120 -0
  489. package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusionOutputType.ts +7 -0
  490. package/src/engines/Cesium/PostProcesses/hbao/README.md +3 -0
  491. package/src/engines/Cesium/PostProcesses/hbao/config.ts +29 -0
  492. package/src/engines/Cesium/PostProcesses/hbao/createAmbientOcclusionStage.ts +173 -0
  493. package/src/engines/Cesium/PostProcesses/hbao/createCrossBilateralFilterStage.ts +94 -0
  494. package/src/engines/Cesium/PostProcesses/hbao/index.ts +3 -0
  495. package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionGenerate.glsl +151 -0
  496. package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionModulate.glsl +46 -0
  497. package/src/engines/Cesium/PostProcesses/hbao/shaders/crossBilateralFilter.glsl +108 -0
  498. package/src/engines/Cesium/PostProcesses/hbao/shaders/depth.glsl +3 -0
  499. package/src/engines/Cesium/PostProcesses/hbao/shaders/globeDepth.glsl +15 -0
  500. package/src/engines/Cesium/PostProcesses/hbao/shaders/highPassRandom.glsl +28 -0
  501. package/src/engines/Cesium/PostProcesses/hbao/shaders/packing.glsl +7 -0
  502. package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructNormal.glsl +109 -0
  503. package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructPosition.glsl +10 -0
  504. package/src/engines/Cesium/PostProcesses/hbao/shaders/turboColorMap.glsl +20 -0
  505. package/src/engines/Cesium/PostProcesses/hbao/shaders/vogelDisk.glsl +13 -0
  506. package/src/engines/Cesium/Shaders/CustomShaders/NonPBRLightingShader.ts +66 -0
  507. package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/Definitions.glsl +5 -0
  508. package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/HeatmapForTerrain.glsl +13 -0
  509. package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +57 -0
  510. package/src/engines/Cesium/Shaders/OverriddenShaders/README.md +13 -0
  511. package/src/engines/Cesium/Sketch/ControlPoint.tsx +67 -0
  512. package/src/engines/Cesium/Sketch/Entity.tsx +43 -0
  513. package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +51 -0
  514. package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +70 -0
  515. package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +75 -0
  516. package/src/engines/Cesium/Sketch/MeasurementText.tsx +13 -0
  517. package/src/engines/Cesium/Sketch/PolygonEntity.tsx +48 -0
  518. package/src/engines/Cesium/Sketch/PolylineEntity.tsx +44 -0
  519. package/src/engines/Cesium/Sketch/ScreenSpaceElement.tsx +87 -0
  520. package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +67 -0
  521. package/src/engines/Cesium/Sketch/SurfaceMeasurement.tsx +80 -0
  522. package/src/engines/Cesium/Sketch/createGeometry.ts +224 -0
  523. package/src/engines/Cesium/Sketch/index.tsx +119 -0
  524. package/src/engines/Cesium/Sketch/utils.ts +27 -0
  525. package/src/engines/Cesium/VertexTerrainElevationMaterial.ts +33 -0
  526. package/src/engines/Cesium/cameraLimiter.ts +256 -0
  527. package/src/engines/Cesium/common.test.ts +38 -0
  528. package/src/engines/Cesium/common.ts +901 -0
  529. package/src/engines/Cesium/constants.ts +25 -0
  530. package/src/engines/Cesium/core/Clock.tsx +58 -0
  531. package/src/engines/Cesium/core/Globe.tsx +136 -0
  532. package/src/engines/Cesium/core/Imagery.test.ts +102 -0
  533. package/src/engines/Cesium/core/Imagery.tsx +184 -0
  534. package/src/engines/Cesium/core/Indicator/Indicator.tsx +141 -0
  535. package/src/engines/Cesium/core/Indicator/crosshair.svg +3 -0
  536. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +321 -0
  537. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +56 -0
  538. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +146 -0
  539. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +258 -0
  540. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/getAnnotationType.ts +117 -0
  541. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +24 -0
  542. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/index.ts +3 -0
  543. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/types.ts +26 -0
  544. package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +39 -0
  545. package/src/engines/Cesium/core/presets.ts +95 -0
  546. package/src/engines/Cesium/helpers/createUniforms.ts +64 -0
  547. package/src/engines/Cesium/helpers/sphericalHaromic.test.ts +33 -0
  548. package/src/engines/Cesium/helpers/sphericalHaromic.ts +27 -0
  549. package/src/engines/Cesium/hooks/useInstance.ts +98 -0
  550. package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +157 -0
  551. package/src/engines/Cesium/hooks/useSceneEvent.ts +47 -0
  552. package/src/engines/Cesium/hooks.ts +1004 -0
  553. package/src/engines/Cesium/index.stories.tsx +42 -0
  554. package/src/engines/Cesium/index.tsx +285 -0
  555. package/src/engines/Cesium/pickMany.ts +310 -0
  556. package/src/engines/Cesium/type.d.ts +47 -0
  557. package/src/engines/Cesium/types.ts +24 -0
  558. package/src/engines/Cesium/useEngineRef.test.tsx +627 -0
  559. package/src/engines/Cesium/useEngineRef.ts +945 -0
  560. package/src/engines/Cesium/useOverrideGlobeShader.ts +322 -0
  561. package/src/engines/Cesium/utils/mouse.ts +16 -0
  562. package/src/engines/Cesium/utils/polygon.ts +48 -0
  563. package/src/engines/Cesium/utils/utils.ts +446 -0
  564. package/src/engines/Cesium/vertexTerrainElevationMaterial.glsl +25 -0
  565. package/src/engines/index.ts +37 -0
  566. package/src/env.d.ts +3 -0
  567. package/src/hooks/index.ts +2 -0
  568. package/src/hooks/useRefFunction.ts +10 -0
  569. package/src/hooks/useRefValue.ts +7 -0
  570. package/src/index.ts +4 -0
  571. package/src/mantle/README.md +7 -0
  572. package/src/mantle/atoms/cache.test.ts +61 -0
  573. package/src/mantle/atoms/cache.ts +55 -0
  574. package/src/mantle/atoms/compute.test.ts +794 -0
  575. package/src/mantle/atoms/compute.ts +344 -0
  576. package/src/mantle/atoms/data.test.ts +182 -0
  577. package/src/mantle/atoms/data.ts +114 -0
  578. package/src/mantle/atoms/index.ts +1 -0
  579. package/src/mantle/compat/backward.test.ts +368 -0
  580. package/src/mantle/compat/backward.ts +189 -0
  581. package/src/mantle/compat/forward.test.ts +688 -0
  582. package/src/mantle/compat/forward.ts +272 -0
  583. package/src/mantle/compat/index.ts +4 -0
  584. package/src/mantle/compat/types.ts +73 -0
  585. package/src/mantle/data/csv.test.ts +478 -0
  586. package/src/mantle/data/csv.ts +194 -0
  587. package/src/mantle/data/geojson.ts +72 -0
  588. package/src/mantle/data/georss.ts +172 -0
  589. package/src/mantle/data/gml.ts +244 -0
  590. package/src/mantle/data/gpx.test.ts +65 -0
  591. package/src/mantle/data/gpx.ts +551 -0
  592. package/src/mantle/data/gtfs.ts +116 -0
  593. package/src/mantle/data/gtfsReader.ts +454 -0
  594. package/src/mantle/data/index.test.ts +16 -0
  595. package/src/mantle/data/index.ts +73 -0
  596. package/src/mantle/data/shapefile.ts +232 -0
  597. package/src/mantle/data/utils.ts +21 -0
  598. package/src/mantle/evaluator/index.ts +40 -0
  599. package/src/mantle/evaluator/simple/conditionalExpression/index.ts +60 -0
  600. package/src/mantle/evaluator/simple/expression/constants.ts +204 -0
  601. package/src/mantle/evaluator/simple/expression/expression.test.ts +63 -0
  602. package/src/mantle/evaluator/simple/expression/expression.ts +116 -0
  603. package/src/mantle/evaluator/simple/expression/functions/binaryFunctions.ts +43 -0
  604. package/src/mantle/evaluator/simple/expression/functions/colors.ts +189 -0
  605. package/src/mantle/evaluator/simple/expression/functions/index.ts +3 -0
  606. package/src/mantle/evaluator/simple/expression/functions/unaryFunctions.ts +54 -0
  607. package/src/mantle/evaluator/simple/expression/index.ts +1 -0
  608. package/src/mantle/evaluator/simple/expression/node.ts +570 -0
  609. package/src/mantle/evaluator/simple/expression/runtime.ts +266 -0
  610. package/src/mantle/evaluator/simple/expression/variableReplacer.test.ts +54 -0
  611. package/src/mantle/evaluator/simple/expression/variableReplacer.ts +121 -0
  612. package/src/mantle/evaluator/simple/index.test.ts +656 -0
  613. package/src/mantle/evaluator/simple/index.ts +178 -0
  614. package/src/mantle/evaluator/simple/interval.test.ts +102 -0
  615. package/src/mantle/evaluator/simple/interval.ts +27 -0
  616. package/src/mantle/evaluator/simple/utils.test.ts +56 -0
  617. package/src/mantle/evaluator/simple/utils.ts +31 -0
  618. package/src/mantle/index.ts +6 -0
  619. package/src/mantle/types/appearance.ts +318 -0
  620. package/src/mantle/types/events.ts +16 -0
  621. package/src/mantle/types/expression.ts +9 -0
  622. package/src/mantle/types/index.ts +156 -0
  623. package/src/mantle/types/value.ts +153 -0
  624. package/src/mantle/utils.test.ts +74 -0
  625. package/src/mantle/utils.ts +53 -0
  626. package/src/reearthTypes.ts +64 -0
  627. package/src/setupTests.ts +1 -0
  628. package/src/test/setup.ts +40 -0
  629. package/src/test/utils.tsx +40 -0
  630. package/src/types.ts +66 -0
  631. package/src/utils/StringMatcher.test.ts +132 -0
  632. package/src/utils/StringMatcher.ts +104 -0
  633. package/src/utils/assertType.ts +1 -0
  634. package/src/utils/generate-random-string.ts +9 -0
  635. package/src/utils/idle.ts +22 -0
  636. package/src/utils/image.ts +35 -0
  637. package/src/utils/index.ts +11 -0
  638. package/src/utils/object.ts +70 -0
  639. package/src/utils/raf.ts +58 -0
  640. package/src/utils/time.ts +18 -0
  641. package/src/utils/use-delayed-count.test.ts +139 -0
  642. package/src/utils/use-delayed-count.ts +65 -0
  643. package/src/utils/use-dnd/drag.ts +34 -0
  644. package/src/utils/use-dnd/drop.ts +93 -0
  645. package/src/utils/use-dnd/index.tsx +20 -0
  646. package/src/utils/use-dnd/types.ts +47 -0
  647. package/src/utils/util.ts +81 -0
  648. package/src/utils/value.ts +260 -0
  649. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,901 @@
1
+ import {
2
+ ColorBlendMode,
3
+ BoundingSphere,
4
+ HeadingPitchRange,
5
+ HorizontalOrigin,
6
+ VerticalOrigin,
7
+ Camera as CesiumCamera,
8
+ Math as CesiumMath,
9
+ Scene,
10
+ Cartesian2,
11
+ Cartesian3,
12
+ CesiumWidget,
13
+ PerspectiveFrustum,
14
+ OrthographicOffCenterFrustum,
15
+ Viewer,
16
+ HeightReference,
17
+ ClassificationType as CesiumClassificationType,
18
+ ShadowMode,
19
+ Entity,
20
+ PropertyBag,
21
+ Clock as CesiumClock,
22
+ JulianDate,
23
+ Ellipsoid,
24
+ Quaternion,
25
+ Matrix3,
26
+ Cartographic,
27
+ EllipsoidTerrainProvider,
28
+ sampleTerrainMostDetailed,
29
+ Ray,
30
+ IntersectionTests,
31
+ Matrix4,
32
+ Color,
33
+ SceneMode,
34
+ Cesium3DTileColorBlendMode,
35
+ Plane,
36
+ CameraEventType,
37
+ KeyboardEventModifier,
38
+ } from "cesium";
39
+ import { useCallback, MutableRefObject } from "react";
40
+
41
+ import type { Camera, Clock } from "..";
42
+ import { ClassificationType } from "../../mantle";
43
+ import type {
44
+ CameraOptions,
45
+ FlyToDestination,
46
+ ModifiedCameraEventType,
47
+ OverideCameraEventType,
48
+ OverideKeyboardEventModifier,
49
+ ScreenSpaceCameraControllerOptions,
50
+ } from "../../types";
51
+ import { tweenInterval, useCanvas, useImage, LatLngHeight } from "../../utils";
52
+
53
+ import { DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS } from "./constants";
54
+
55
+ export const layerIdField = `__reearth_layer_id`;
56
+
57
+ const defaultImageSize = 50;
58
+
59
+ export const drawIcon = (
60
+ c: HTMLCanvasElement,
61
+ image: HTMLImageElement | undefined,
62
+ w: number,
63
+ h: number,
64
+ crop: "circle" | "rounded" | "none" = "none",
65
+ shadow = false,
66
+ shadowColor = "rgba(0, 0, 0, 0.7)",
67
+ shadowBlur = 3,
68
+ shadowOffsetX = 0,
69
+ shadowOffsetY = 0,
70
+ ) => {
71
+ const ctx = c.getContext("2d");
72
+ if (!image || !ctx) return;
73
+
74
+ ctx.save();
75
+
76
+ c.width = w + shadowBlur;
77
+ c.height = h + shadowBlur;
78
+ ctx.shadowBlur = shadowBlur;
79
+ ctx.shadowOffsetX = shadowOffsetX;
80
+ ctx.shadowOffsetY = shadowOffsetY;
81
+ ctx.globalCompositeOperation = "source-over";
82
+ ctx.clearRect(0, 0, c.width, c.height);
83
+ ctx.drawImage(image, (c.width - w) / 2, (c.height - h) / 2, w, h);
84
+
85
+ if (crop === "circle") {
86
+ ctx.fillStyle = "black";
87
+ ctx.globalCompositeOperation = "destination-in";
88
+ ctx.arc(w / 2, h / 2, Math.min(w, h) / 2, 0, 2 * Math.PI);
89
+ ctx.fill();
90
+
91
+ if (shadow) {
92
+ ctx.shadowColor = shadowColor;
93
+ ctx.globalCompositeOperation = "destination-over";
94
+ ctx.fillStyle = "black";
95
+ ctx.arc(w / 2, h / 2, Math.min(w, h) / 2, 0, 2 * Math.PI);
96
+ ctx.fill();
97
+ }
98
+ } else if (shadow) {
99
+ ctx.shadowColor = shadowColor;
100
+ ctx.globalCompositeOperation = "destination-over";
101
+ ctx.fillStyle = "black";
102
+ ctx.rect((c.width - w) / 2, (c.height - h) / 2, w, h);
103
+ ctx.fill();
104
+ }
105
+
106
+ ctx.restore();
107
+ };
108
+
109
+ export const useIcon = ({
110
+ image,
111
+ imageSize,
112
+ crop,
113
+ shadow,
114
+ shadowColor,
115
+ shadowBlur,
116
+ shadowOffsetX,
117
+ shadowOffsetY,
118
+ }: {
119
+ image?: string;
120
+ imageSize?: number;
121
+ crop?: "circle" | "rounded" | "none";
122
+ shadow?: boolean;
123
+ shadowColor?: string;
124
+ shadowBlur?: number;
125
+ shadowOffsetX?: number;
126
+ shadowOffsetY?: number;
127
+ }): [string, number, number] => {
128
+ const img = useImage(image);
129
+
130
+ const w = !img
131
+ ? 0
132
+ : typeof imageSize === "number"
133
+ ? Math.floor(img.width * imageSize)
134
+ : Math.min(defaultImageSize, img.width);
135
+ const h = !img
136
+ ? 0
137
+ : typeof imageSize === "number"
138
+ ? Math.floor(img.height * imageSize)
139
+ : Math.floor((w / img.width) * img.height);
140
+
141
+ const draw = useCallback(
142
+ (can: HTMLCanvasElement) =>
143
+ drawIcon(can, img, w, h, crop, shadow, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY),
144
+ [crop, h, img, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, w],
145
+ );
146
+ const canvas = useCanvas(draw);
147
+ return [canvas, w, h];
148
+ };
149
+
150
+ export const ho = (o: "left" | "center" | "right" | undefined): HorizontalOrigin | undefined =>
151
+ ({
152
+ left: HorizontalOrigin.LEFT,
153
+ center: HorizontalOrigin.CENTER,
154
+ right: HorizontalOrigin.RIGHT,
155
+ [""]: undefined,
156
+ })[o || ""];
157
+
158
+ export const vo = (
159
+ o: "top" | "center" | "baseline" | "bottom" | undefined,
160
+ ): VerticalOrigin | undefined =>
161
+ ({
162
+ top: VerticalOrigin.TOP,
163
+ center: VerticalOrigin.CENTER,
164
+ baseline: VerticalOrigin.BASELINE,
165
+ bottom: VerticalOrigin.BOTTOM,
166
+ [""]: undefined,
167
+ })[o || ""];
168
+
169
+ export const getLocationFromScreen = (
170
+ scene: Scene | undefined | null,
171
+ x: number,
172
+ y: number,
173
+ withTerrain = false,
174
+ ) => {
175
+ if (!scene) return undefined;
176
+ const camera = scene.camera;
177
+ const ellipsoid = scene.globe.ellipsoid;
178
+ let cartesian;
179
+ if (withTerrain) {
180
+ const ray = camera.getPickRay(new Cartesian2(x, y));
181
+ if (ray) {
182
+ cartesian = scene.globe.pick(ray, scene);
183
+ }
184
+ }
185
+ if (!cartesian) {
186
+ cartesian = camera?.pickEllipsoid(new Cartesian2(x, y), ellipsoid);
187
+ }
188
+ if (!cartesian) return undefined;
189
+ const { latitude, longitude, height } = ellipsoid.cartesianToCartographic(cartesian);
190
+ return {
191
+ lat: CesiumMath.toDegrees(latitude),
192
+ lng: CesiumMath.toDegrees(longitude),
193
+ height,
194
+ };
195
+ };
196
+
197
+ export const getRayEllipsoidIntersection = (
198
+ ray: Ray,
199
+ ellipsoid: Ellipsoid,
200
+ result?: Cartesian3,
201
+ ): Cartesian3 => {
202
+ const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);
203
+ if (!intersection) {
204
+ const cartesian = IntersectionTests.grazingAltitudeLocation(ray, ellipsoid);
205
+ return result ? cartesian.clone(result) : cartesian;
206
+ }
207
+ return Ray.getPoint(ray, intersection.start, result);
208
+ };
209
+
210
+ const createRayFromCamera = (camera: CesiumCamera): Ray => {
211
+ const ray = new Ray();
212
+ camera.positionWC.clone(ray.origin);
213
+ camera.directionWC.clone(ray.direction);
214
+ return ray;
215
+ };
216
+
217
+ export const getCameraEllipsoidIntersection = (
218
+ scene: Scene,
219
+ resultOrWindowPosition?: Cartesian2 | Cartesian3,
220
+ result?: Cartesian3,
221
+ ): Cartesian3 | undefined => {
222
+ let ray: Ray | undefined;
223
+ const { camera, globe } = scene;
224
+
225
+ if (resultOrWindowPosition instanceof Cartesian2) {
226
+ ray = camera.getPickRay(resultOrWindowPosition, new Ray());
227
+ if (!ray) return undefined;
228
+ } else {
229
+ ray = createRayFromCamera(camera);
230
+ result = resultOrWindowPosition as Cartesian3;
231
+ }
232
+
233
+ return getRayEllipsoidIntersection(ray, globe.ellipsoid, result);
234
+ };
235
+
236
+ export const getCameraTerrainIntersection = (scene: Scene): Cartesian3 | undefined => {
237
+ const ray = createRayFromCamera(scene.camera);
238
+ return scene.globe.pick(ray, scene);
239
+ };
240
+
241
+ export const cartesianToLatLngHeight = (cartesian: Cartesian3, scene: Scene): LatLngHeight => {
242
+ const cartographic = Cartographic.fromCartesian(cartesian, scene.globe.ellipsoid);
243
+ return {
244
+ lng: CesiumMath.toDegrees(cartographic.longitude),
245
+ lat: CesiumMath.toDegrees(cartographic.latitude),
246
+ height: cartographic.height,
247
+ };
248
+ };
249
+ export const flyTo = (
250
+ cesiumCamera?: CesiumCamera,
251
+ camera?: {
252
+ /** degrees */
253
+ lat?: number;
254
+ /** degrees */
255
+ lng?: number;
256
+ /** meters */
257
+ height?: number;
258
+ /** radians */
259
+ heading?: number;
260
+ /** radians */
261
+ pitch?: number;
262
+ /** radians */
263
+ roll?: number;
264
+ /** Field of view expressed in radians */
265
+ fov?: number;
266
+ },
267
+ options?: {
268
+ /** Seconds */
269
+ duration?: number;
270
+ easing?: (time: number) => number;
271
+ },
272
+ ) => {
273
+ if (!cesiumCamera || !camera) return () => {};
274
+
275
+ const cancelFov = animateFOV({
276
+ fov: camera.fov,
277
+ camera: cesiumCamera,
278
+ duration: options?.duration,
279
+ easing: options?.easing,
280
+ });
281
+
282
+ const position =
283
+ typeof camera.lat === "number" &&
284
+ typeof camera.lng === "number" &&
285
+ typeof camera.height === "number"
286
+ ? Cartesian3.fromDegrees(camera.lng, camera.lat, camera.height)
287
+ : undefined;
288
+
289
+ if (position) {
290
+ cesiumCamera.flyTo({
291
+ destination: position,
292
+ orientation: {
293
+ heading: camera.heading,
294
+ pitch: camera.pitch,
295
+ roll: camera.roll,
296
+ },
297
+ duration: options?.duration ?? 0,
298
+ easingFunction: options?.easing,
299
+ });
300
+ }
301
+
302
+ return () => {
303
+ cancelFov?.();
304
+ cesiumCamera?.cancelFlight();
305
+ };
306
+ };
307
+
308
+ export const lookAt = (
309
+ cesiumCamera?: CesiumCamera,
310
+ camera?: {
311
+ /** degrees */
312
+ lat?: number;
313
+ /** degrees */
314
+ lng?: number;
315
+ /** meters */
316
+ height?: number;
317
+ /** radians */
318
+ heading?: number;
319
+ /** radians */
320
+ pitch?: number;
321
+ /** radians */
322
+ range?: number;
323
+ /** Field of view expressed in radians */
324
+ fov?: number;
325
+ /** Radius of bounding sphere */
326
+ radius?: number;
327
+ },
328
+ options?: {
329
+ /** Seconds */
330
+ duration?: number;
331
+ easing?: (time: number) => number;
332
+ },
333
+ ) => {
334
+ if (!cesiumCamera || !camera) return () => {};
335
+
336
+ const cancelFov = animateFOV({
337
+ fov: camera.fov,
338
+ camera: cesiumCamera,
339
+ duration: options?.duration,
340
+ easing: options?.easing,
341
+ });
342
+
343
+ const position =
344
+ typeof camera.lat === "number" &&
345
+ typeof camera.lng === "number" &&
346
+ typeof camera.height === "number"
347
+ ? Cartesian3.fromDegrees(camera.lng, camera.lat, camera.height)
348
+ : undefined;
349
+
350
+ if (position) {
351
+ cesiumCamera.flyToBoundingSphere(new BoundingSphere(position, camera.radius), {
352
+ offset:
353
+ camera.heading !== undefined || camera.pitch !== undefined || camera.range !== undefined
354
+ ? new HeadingPitchRange(camera.heading, camera.pitch, camera.range)
355
+ : undefined,
356
+ duration: options?.duration,
357
+ easingFunction: options?.easing,
358
+ });
359
+ }
360
+
361
+ return () => {
362
+ cancelFov?.();
363
+ cesiumCamera?.cancelFlight();
364
+ };
365
+ };
366
+
367
+ export const lookAtWithoutAnimation = (
368
+ scene: Scene,
369
+ camera?: {
370
+ /** degrees */
371
+ lat?: number;
372
+ /** degrees */
373
+ lng?: number;
374
+ /** meters */
375
+ height?: number;
376
+ /** radians */
377
+ heading?: number;
378
+ /** radians */
379
+ pitch?: number;
380
+ /** radians */
381
+ range?: number;
382
+ /** Field of view expressed in radians */
383
+ fov?: number;
384
+ },
385
+ ) => {
386
+ if (!camera) {
387
+ return;
388
+ }
389
+
390
+ const position =
391
+ typeof camera.lat === "number" && typeof camera.lng === "number"
392
+ ? Cartesian3.fromDegrees(camera.lng, camera.lat, camera.height)
393
+ : undefined;
394
+
395
+ if (position) {
396
+ scene.camera.lookAtTransform(Matrix4.fromTranslation(position));
397
+ }
398
+ };
399
+
400
+ export const animateFOV = ({
401
+ fov,
402
+ camera,
403
+ easing,
404
+ duration,
405
+ }: {
406
+ fov?: number;
407
+ camera: CesiumCamera;
408
+ easing?: (t: number) => number;
409
+ duration?: number;
410
+ }): (() => void) | undefined => {
411
+ // fov animation
412
+ if (
413
+ typeof fov === "number" &&
414
+ camera.frustum instanceof PerspectiveFrustum &&
415
+ typeof camera.frustum.fov === "number" &&
416
+ camera.frustum.fov !== fov
417
+ ) {
418
+ const fromFov = camera.frustum.fov;
419
+ return tweenInterval(
420
+ t => {
421
+ if (!(camera.frustum instanceof PerspectiveFrustum)) return;
422
+ camera.frustum.fov = (fov - fromFov) * t + fromFov;
423
+ },
424
+ easing || "inOutCubic",
425
+ (duration ?? 0) * 1000,
426
+ );
427
+ }
428
+ return undefined;
429
+ };
430
+
431
+ /**
432
+ * Get the center of globe.
433
+ */
434
+ export const getCenterCamera = ({
435
+ camera,
436
+ scene,
437
+ }: {
438
+ camera: CesiumCamera;
439
+ scene: Scene;
440
+ }): Cartesian3 | void => {
441
+ const result = new Cartesian3();
442
+ const ray = camera.getPickRay(camera.positionWC);
443
+ if (ray) {
444
+ ray.origin = camera.positionWC;
445
+ ray.direction = camera.directionWC;
446
+ return scene.globe.pick(ray, scene, result);
447
+ }
448
+ };
449
+
450
+ export const zoom = (
451
+ { viewer, relativeAmount }: { viewer: Viewer; relativeAmount: number },
452
+ options?: CameraOptions,
453
+ ) => {
454
+ const { camera, scene } = viewer;
455
+ if (scene.mode !== SceneMode.SCENE3D) {
456
+ const pos = getCamera(viewer);
457
+ flyTo(camera, { ...pos, height: (pos?.height || 1) * relativeAmount }, { duration: 0.5 });
458
+ return;
459
+ }
460
+
461
+ const center = getCenterCamera({ camera, scene });
462
+ const target =
463
+ center ||
464
+ IntersectionTests.grazingAltitudeLocation(
465
+ // Get the ray from cartographic to the camera direction
466
+ new Ray(
467
+ // Get the cartographic position of camera on 3D space.
468
+ scene.globe.ellipsoid.cartographicToCartesian(camera.positionCartographic),
469
+ // Get the camera direction.
470
+ camera.directionWC,
471
+ ),
472
+ scene.globe.ellipsoid,
473
+ );
474
+
475
+ if (!target) {
476
+ return;
477
+ }
478
+
479
+ const orientation = {
480
+ heading: camera.heading,
481
+ pitch: camera.pitch,
482
+ roll: camera.roll,
483
+ };
484
+
485
+ const cartesian3Scratch = new Cartesian3();
486
+ const direction = Cartesian3.subtract(camera.position, target, cartesian3Scratch);
487
+ const movementVector = Cartesian3.multiplyByScalar(direction, relativeAmount, direction);
488
+ const endPosition = Cartesian3.add(target, movementVector, target);
489
+
490
+ camera.flyTo({
491
+ destination: endPosition,
492
+ orientation: orientation,
493
+ duration: options?.duration || 0.5,
494
+ convert: false,
495
+ });
496
+ };
497
+
498
+ export const getCamera = (viewer: Viewer | CesiumWidget | undefined): Camera | undefined => {
499
+ if (!viewer || viewer.isDestroyed() || !viewer.camera || !viewer.scene) return undefined;
500
+ const { camera } = viewer;
501
+ if (
502
+ !(
503
+ camera.frustum instanceof PerspectiveFrustum ||
504
+ camera.frustum instanceof OrthographicOffCenterFrustum
505
+ )
506
+ )
507
+ return;
508
+ const { latitude, longitude, height } = camera.positionCartographic;
509
+ const lat = CesiumMath.toDegrees(latitude);
510
+ const lng = CesiumMath.toDegrees(longitude);
511
+ const { heading, pitch, roll } = camera;
512
+ const fov = camera.frustum instanceof PerspectiveFrustum ? camera.frustum.fov : 1;
513
+ const aspectRatio = camera.frustum instanceof PerspectiveFrustum ? camera.frustum.aspectRatio : 1;
514
+ return { lng, lat, height, heading, pitch, roll, fov, aspectRatio };
515
+ };
516
+
517
+ export const getClock = (clock: CesiumClock | undefined): Clock | undefined => {
518
+ if (!clock) return undefined;
519
+ return {
520
+ get start() {
521
+ return JulianDate.toDate(clock.startTime);
522
+ },
523
+ get stop() {
524
+ return JulianDate.toDate(clock.stopTime);
525
+ },
526
+ get current() {
527
+ return JulianDate.toDate(clock.currentTime);
528
+ },
529
+ get playing() {
530
+ return clock.shouldAnimate;
531
+ },
532
+ get speed() {
533
+ return clock.multiplier;
534
+ },
535
+ };
536
+ };
537
+
538
+ export const colorBlendMode = (colorBlendMode?: "highlight" | "replace" | "mix" | "none") =>
539
+ (
540
+ ({
541
+ highlight: ColorBlendMode.HIGHLIGHT,
542
+ replace: ColorBlendMode.REPLACE,
543
+ mix: ColorBlendMode.MIX,
544
+ }) as { [key in string]?: ColorBlendMode }
545
+ )[colorBlendMode || ""];
546
+
547
+ export const colorBlendModeFor3DTile = (
548
+ colorBlendMode?: "highlight" | "replace" | "mix" | "default",
549
+ ) =>
550
+ (
551
+ ({
552
+ highlight: Cesium3DTileColorBlendMode.HIGHLIGHT,
553
+ replace: Cesium3DTileColorBlendMode.REPLACE,
554
+ mix: Cesium3DTileColorBlendMode.MIX,
555
+ }) as { [key in string]?: Cesium3DTileColorBlendMode }
556
+ )[colorBlendMode || ""];
557
+
558
+ export const heightReference = (
559
+ heightReference?: "none" | "clamp" | "relative",
560
+ ): HeightReference | undefined =>
561
+ (
562
+ ({
563
+ clamp: HeightReference.CLAMP_TO_GROUND,
564
+ relative: HeightReference.RELATIVE_TO_GROUND,
565
+ none: HeightReference.NONE,
566
+ }) as {
567
+ [key in string]?: HeightReference;
568
+ }
569
+ )[heightReference || ""];
570
+
571
+ export const getOverriddenScreenSpaceCameraOptions = (
572
+ options?: ScreenSpaceCameraControllerOptions,
573
+ ) => {
574
+ if (!options) return;
575
+ const cameraEventTypeMap = new Map<OverideCameraEventType, CameraEventType>([
576
+ ["left_drag", CameraEventType.LEFT_DRAG],
577
+ ["right_drag", CameraEventType.RIGHT_DRAG],
578
+ ["middle_drag", CameraEventType.MIDDLE_DRAG],
579
+ ["wheel", CameraEventType.WHEEL],
580
+ ["pinch", CameraEventType.PINCH],
581
+ ]);
582
+
583
+ const keyboardEventModifierMap = new Map<OverideKeyboardEventModifier, KeyboardEventModifier>([
584
+ ["ctrl", KeyboardEventModifier.CTRL],
585
+ ["shift", KeyboardEventModifier.SHIFT],
586
+ ["alt", KeyboardEventModifier.ALT],
587
+ ]);
588
+
589
+ const convertOptions = (
590
+ arr: (OverideCameraEventType | ModifiedCameraEventType)[] | undefined,
591
+ ) => {
592
+ if (!arr) return;
593
+ return arr.map((v: OverideCameraEventType | ModifiedCameraEventType) => {
594
+ if (typeof v === "string") {
595
+ return cameraEventTypeMap.get(v);
596
+ } else {
597
+ return {
598
+ eventType: cameraEventTypeMap.get(v.eventType),
599
+ modifier: keyboardEventModifierMap.get(v.modifier),
600
+ };
601
+ }
602
+ });
603
+ };
604
+
605
+ const translateEventTypes = convertOptions(options.translateEventTypes);
606
+ const zoomEventTypes = convertOptions(options.zoomEventTypes);
607
+ const rotateEventTypes = convertOptions(options.rotateEventTypes);
608
+ const tiltEventTypes = convertOptions(options.tiltEventTypes);
609
+ const lookEventTypes = convertOptions(options.lookEventTypes);
610
+
611
+ return {
612
+ ...DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS,
613
+ ...(translateEventTypes && { translateEventTypes }),
614
+ ...(zoomEventTypes && { zoomEventTypes }),
615
+ ...(rotateEventTypes && { rotateEventTypes }),
616
+ ...(tiltEventTypes && { tiltEventTypes }),
617
+ ...(lookEventTypes && { lookEventTypes }),
618
+ ...(options.minimumZoomDistance !== undefined && {
619
+ minimumZoomDistance: options.minimumZoomDistance,
620
+ }),
621
+ ...(options.maximumZoomDistance !== undefined && {
622
+ maximumZoomDistance: options.maximumZoomDistance,
623
+ }),
624
+ ...(options.enableCollisionDetection !== undefined && {
625
+ enableCollisionDetection: options.enableCollisionDetection,
626
+ }),
627
+ };
628
+ };
629
+
630
+ export const classificationType = (
631
+ classificationType?: ClassificationType,
632
+ ): CesiumClassificationType | undefined =>
633
+ (
634
+ ({
635
+ both: CesiumClassificationType.BOTH,
636
+ "3dtiles": CesiumClassificationType.CESIUM_3D_TILE,
637
+ terrain: CesiumClassificationType.TERRAIN,
638
+ }) as {
639
+ [key in ClassificationType | ""]?: CesiumClassificationType;
640
+ }
641
+ )[classificationType || ""];
642
+
643
+ export const shadowMode = (
644
+ shadows?: "disabled" | "enabled" | "cast_only" | "receive_only",
645
+ ): ShadowMode | undefined =>
646
+ (
647
+ ({
648
+ enabled: ShadowMode.ENABLED,
649
+ cast_only: ShadowMode.CAST_ONLY,
650
+ receive_only: ShadowMode.RECEIVE_ONLY,
651
+ disabled: ShadowMode.DISABLED,
652
+ }) as {
653
+ [key in string]?: ShadowMode;
654
+ }
655
+ )[shadows || ""];
656
+
657
+ export const unselectableTag = "reearth_unselectable";
658
+ export const draggableTag = "reearth_draggable";
659
+
660
+ export function isSelectable(e: Entity | undefined): boolean {
661
+ return !e?.properties?.hasProperty(unselectableTag);
662
+ }
663
+
664
+ export function isDraggable(e: Entity): string | undefined {
665
+ return e.properties?.[draggableTag];
666
+ }
667
+
668
+ export function attachTag(entity: Entity | undefined, tag: string, value: any) {
669
+ if (!entity) return;
670
+ if (typeof value !== "undefined" && !entity.properties) {
671
+ entity.properties = new PropertyBag({ [tag]: value });
672
+ } else if (typeof value === "undefined") {
673
+ entity.properties?.removeProperty(tag);
674
+ } else if (entity.properties?.hasProperty(tag)) {
675
+ entity.properties?.removeProperty(tag);
676
+ entity.properties?.addProperty(tag, value);
677
+ } else {
678
+ entity.properties?.addProperty(tag, value);
679
+ }
680
+ }
681
+
682
+ export function lookHorizontal(scene: Scene, amount: number) {
683
+ const camera = scene.camera;
684
+ const ellipsoid = scene.globe.ellipsoid;
685
+ const surfaceNormal = ellipsoid.geodeticSurfaceNormal(camera.position, new Cartesian3());
686
+ camera.look(surfaceNormal, amount);
687
+ }
688
+
689
+ export function lookVertical(scene: Scene, amount: number) {
690
+ const camera = scene.camera;
691
+ const ellipsoid = scene.globe.ellipsoid;
692
+ const lookAxis = projectVectorToSurface(camera.right, camera.position, ellipsoid);
693
+ const surfaceNormal = ellipsoid.geodeticSurfaceNormal(camera.position, new Cartesian3());
694
+ const currentAngle = CesiumMath.toDegrees(Cartesian3.angleBetween(surfaceNormal, camera.up));
695
+ const upAfterLook = rotateVectorAboutAxis(camera.up, lookAxis, amount);
696
+ const angleAfterLook = CesiumMath.toDegrees(Cartesian3.angleBetween(surfaceNormal, upAfterLook));
697
+ const friction = angleAfterLook < currentAngle ? 1 : (90 - currentAngle) / 90;
698
+ camera.look(lookAxis, amount * friction);
699
+ }
700
+
701
+ export function moveForward(scene: Scene, amount: number) {
702
+ const direction = projectVectorToSurface(
703
+ scene.camera.direction,
704
+ scene.camera.position,
705
+ scene.globe.ellipsoid,
706
+ );
707
+ scene.camera.move(direction, amount);
708
+ }
709
+
710
+ export function moveBackward(scene: Scene, amount: number) {
711
+ const direction = projectVectorToSurface(
712
+ scene.camera.direction,
713
+ scene.camera.position,
714
+ scene.globe.ellipsoid,
715
+ );
716
+ scene.camera.move(direction, -amount);
717
+ }
718
+
719
+ export function moveUp(scene: Scene, amount: number) {
720
+ const surfaceNormal = scene.globe.ellipsoid.geodeticSurfaceNormal(
721
+ scene.camera.position,
722
+ new Cartesian3(),
723
+ );
724
+ scene.camera.move(surfaceNormal, amount);
725
+ }
726
+
727
+ export function moveDown(scene: Scene, amount: number) {
728
+ const surfaceNormal = scene.globe.ellipsoid.geodeticSurfaceNormal(
729
+ scene.camera.position,
730
+ new Cartesian3(),
731
+ );
732
+ scene.camera.move(surfaceNormal, -amount);
733
+ }
734
+
735
+ export function moveLeft(scene: Scene, amount: number) {
736
+ const direction = projectVectorToSurface(
737
+ scene.camera.right,
738
+ scene.camera.position,
739
+ scene.globe.ellipsoid,
740
+ );
741
+ scene.camera.move(direction, -amount);
742
+ }
743
+
744
+ export function moveRight(scene: Scene, amount: number) {
745
+ const direction = projectVectorToSurface(
746
+ scene.camera.right,
747
+ scene.camera.position,
748
+ scene.globe.ellipsoid,
749
+ );
750
+ scene.camera.move(direction, amount);
751
+ }
752
+
753
+ export async function moveOverTerrain(viewer: Viewer, offset = 0) {
754
+ const camera = getCamera(viewer);
755
+ if (camera?.lng === undefined || camera?.lat === undefined) return;
756
+ const height = await sampleTerrainHeight(viewer.scene, camera.lng, camera.lat);
757
+ if (height && height !== 0) {
758
+ const innerCamera = getCamera(viewer);
759
+ if (innerCamera && innerCamera?.height < height + offset) {
760
+ viewer.scene.camera.moveUp(height + offset - innerCamera.height);
761
+ }
762
+ }
763
+ }
764
+
765
+ export async function flyToGround(
766
+ viewer: Viewer,
767
+ cancelCameraFlight: MutableRefObject<(() => void) | undefined>,
768
+ camera: FlyToDestination,
769
+ options?: {
770
+ duration?: number;
771
+ easing?: (time: number) => number;
772
+ },
773
+ offset = 0,
774
+ ) {
775
+ if (camera.lng === undefined || camera.lat === undefined) return;
776
+ const height = await sampleTerrainHeight(viewer.scene, camera.lng, camera.lat);
777
+ const tarHeight = height ? height + offset : offset;
778
+ cancelCameraFlight.current?.();
779
+ cancelCameraFlight.current = flyTo(
780
+ viewer.scene?.camera,
781
+ { ...getCamera(viewer), ...camera, height: tarHeight },
782
+ options,
783
+ );
784
+ }
785
+
786
+ function projectVectorToSurface(vector: Cartesian3, position: Cartesian3, ellipsoid: Ellipsoid) {
787
+ const surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, new Cartesian3());
788
+ const magnitudeOfProjectionOnSurfaceNormal = Cartesian3.dot(vector, surfaceNormal);
789
+ const projectionOnSurfaceNormal = Cartesian3.multiplyByScalar(
790
+ surfaceNormal,
791
+ magnitudeOfProjectionOnSurfaceNormal,
792
+ new Cartesian3(),
793
+ );
794
+ return Cartesian3.subtract(vector, projectionOnSurfaceNormal, new Cartesian3());
795
+ }
796
+
797
+ function rotateVectorAboutAxis(vector: Cartesian3, rotateAxis: Cartesian3, rotateAmount: number) {
798
+ const quaternion = Quaternion.fromAxisAngle(rotateAxis, -rotateAmount, new Quaternion());
799
+ const rotation = Matrix3.fromQuaternion(quaternion, new Matrix3());
800
+ const rotatedVector = Matrix3.multiplyByVector(rotation, vector, vector.clone());
801
+ return rotatedVector;
802
+ }
803
+
804
+ export async function sampleTerrainHeight(
805
+ scene: Scene,
806
+ lng: number,
807
+ lat: number,
808
+ ): Promise<number | undefined> {
809
+ const terrainProvider = scene.terrainProvider;
810
+ if (terrainProvider instanceof EllipsoidTerrainProvider) return 0;
811
+
812
+ const [sample] = await sampleTerrainMostDetailed(terrainProvider, [
813
+ Cartographic.fromDegrees(lng, lat),
814
+ ]);
815
+ return sample.height;
816
+ }
817
+
818
+ export async function sampleTerrainHeightFromCartesian(scene: Scene, translation: Cartesian3) {
819
+ const cart = Cartographic.fromCartesian(translation);
820
+ const [lng, lat] = [
821
+ CesiumMath.toDegrees(cart?.longitude || 0),
822
+ CesiumMath.toDegrees(cart?.latitude || 0),
823
+ ];
824
+ if (!lng || !lat) {
825
+ return;
826
+ }
827
+ return await sampleTerrainHeight(scene, lng, lat);
828
+ }
829
+
830
+ export const isColor = (c?: string) => c?.match(/^#[A-Fa-f0-9]|^rgba?/);
831
+
832
+ export const toColor = (c?: string) => {
833
+ if (!c || typeof c !== "string") return undefined;
834
+
835
+ // support alpha
836
+ const m = c.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);
837
+ if (!m) return Color.fromCssColorString(c);
838
+
839
+ const alpha = parseInt(m[4] ? m[4].repeat(2) : m[2], 16) / 255;
840
+ return Color.fromCssColorString(`#${m[1] ?? m[3]}`).withAlpha(alpha);
841
+ };
842
+
843
+ export const updateMapController = (viewer: Viewer, enabled: boolean) => {
844
+ viewer.scene.screenSpaceCameraController.enableTranslate = enabled;
845
+ viewer.scene.screenSpaceCameraController.enableRotate = enabled;
846
+ viewer.scene.screenSpaceCameraController.enableLook = enabled;
847
+ viewer.scene.screenSpaceCameraController.enableTilt = enabled;
848
+ viewer.scene.screenSpaceCameraController.enableZoom = enabled;
849
+ };
850
+
851
+ export function getExtrudedHeight(
852
+ scene: Scene,
853
+ position: Cartesian3,
854
+ windowPosition: Cartesian2,
855
+ ): number | undefined {
856
+ const cartesianScratch = new Cartesian3();
857
+ const normalScratch = new Cartesian3();
858
+ const rayScratch = new Ray();
859
+ const planeScratch = new Plane(Cartesian3.UNIT_X, 0);
860
+ const cartographicScratch = new Cartographic();
861
+ let intersection;
862
+ try {
863
+ const normal = scene.globe.ellipsoid.geodeticSurfaceNormal(position, normalScratch);
864
+ const ray = scene.camera.getPickRay(windowPosition, rayScratch);
865
+ if (ray == null) {
866
+ return;
867
+ }
868
+ // Plane coincident with surface normal and perpendicular to another plane
869
+ // coincident with the ray direction.
870
+ const plane = Plane.fromPointNormal(
871
+ position,
872
+ Cartesian3.normalize(
873
+ Cartesian3.cross(
874
+ normal,
875
+ Cartesian3.cross(normal, ray.direction, cartesianScratch),
876
+ cartesianScratch,
877
+ ),
878
+ cartesianScratch,
879
+ ),
880
+ planeScratch,
881
+ );
882
+ intersection = IntersectionTests.rayPlane(ray, plane, cartesianScratch);
883
+ if (intersection == null) {
884
+ return;
885
+ }
886
+ const toHeight = Cartographic.fromCartesian(
887
+ intersection,
888
+ scene.globe.ellipsoid,
889
+ cartographicScratch,
890
+ ).height;
891
+ const fromHeight = Cartographic.fromCartesian(
892
+ position,
893
+ scene.globe.ellipsoid,
894
+ cartographicScratch,
895
+ ).height;
896
+ return Math.max(0, toHeight - fromHeight);
897
+ } catch (error) {
898
+ console.error(error);
899
+ }
900
+ return;
901
+ }