@reearth/core 0.0.7-alpha.0 → 0.0.7-alpha.10

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 (436) hide show
  1. package/dist/core.js +34320 -34354
  2. package/dist/core.umd.cjs +3868 -3826
  3. package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
  4. package/dist/index.d.ts +217 -212
  5. package/package.json +8 -8
  6. package/src/Map/ClusteredLayers/index.tsx +2 -2
  7. package/src/Map/Layer/index.tsx +3 -3
  8. package/src/Map/Layers/hooks.ts +10 -0
  9. package/src/Map/Layers/index.tsx +2 -2
  10. package/src/Map/Sketch/hooks.ts +52 -72
  11. package/src/Map/Sketch/index.tsx +2 -24
  12. package/src/Map/Sketch/preset.ts +2 -0
  13. package/src/Map/Sketch/types.ts +31 -0
  14. package/src/Map/hooks.ts +0 -4
  15. package/src/Map/index.tsx +8 -5
  16. package/src/Map/ref.ts +4 -7
  17. package/src/Map/types/index.ts +34 -216
  18. package/src/Map/types/viewerProperty.ts +215 -0
  19. package/src/Map/useTimelineManager.ts +5 -3
  20. package/src/Map/utils.ts +1 -43
  21. package/src/Visualizer/coreContext.tsx +1 -8
  22. package/src/Visualizer/hooks.ts +20 -77
  23. package/src/Visualizer/index.stories.tsx +4 -48
  24. package/src/Visualizer/index.tsx +8 -6
  25. package/src/Visualizer/useCoreAPI.ts +30 -0
  26. package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +1 -1
  27. package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +1 -1
  28. package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -1
  29. package/src/engines/Cesium/Feature/Model/index.tsx +10 -9
  30. package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +8 -6
  31. package/src/engines/Cesium/Feature/Raster/index.stories.tsx +2 -2
  32. package/src/engines/Cesium/Feature/Resource/index.stories.tsx +1 -1
  33. package/src/engines/Cesium/Feature/Tileset/hooks.ts +12 -11
  34. package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +1 -1
  35. package/src/engines/Cesium/Feature/Tileset/index.tsx +4 -4
  36. package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
  37. package/src/engines/Cesium/Feature/index.tsx +5 -4
  38. package/src/engines/Cesium/Feature/utils.tsx +3 -2
  39. package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
  40. package/src/engines/Cesium/core/Globe.tsx +36 -68
  41. package/src/engines/Cesium/core/Imagery.test.ts +9 -9
  42. package/src/engines/Cesium/core/Imagery.tsx +17 -19
  43. package/src/engines/Cesium/core/Indicator/Indicator.tsx +8 -8
  44. package/src/engines/Cesium/hooks/useCamera.ts +135 -0
  45. package/src/engines/Cesium/{cameraLimiter.ts → hooks/useCameraLimiter.ts} +22 -45
  46. package/src/engines/Cesium/{useEngineRef.test.tsx → hooks/useEngineRef.test.tsx} +38 -34
  47. package/src/engines/Cesium/{useEngineRef.ts → hooks/useEngineRef.ts} +43 -41
  48. package/src/engines/Cesium/hooks/useExplicitRender.ts +65 -0
  49. package/src/engines/Cesium/hooks/useLayerDragDrop.ts +77 -0
  50. package/src/engines/Cesium/{VertexTerrainElevationMaterial.ts → hooks/useOverrideGlobeShader/VertexTerrainElevationMaterial.ts} +3 -2
  51. package/src/engines/Cesium/{useOverrideGlobeShader.ts → hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts} +20 -17
  52. package/src/engines/Cesium/hooks/useViewerProperty.ts +90 -0
  53. package/src/engines/Cesium/hooks.ts +129 -366
  54. package/src/engines/Cesium/index.stories.tsx +1 -1
  55. package/src/engines/Cesium/index.tsx +60 -62
  56. package/src/engines/index.ts +1 -1
  57. package/src/mantle/atoms/compute.ts +5 -1
  58. package/src/mantle/compat/types.ts +7 -7
  59. package/src/mantle/data/geojson.ts +53 -22
  60. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
  61. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
  62. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
  63. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
  64. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
  65. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
  66. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
  67. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
  68. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
  69. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
  70. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
  71. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
  72. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
  73. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
  74. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
  75. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
  76. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
  77. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
  78. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
  79. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
  80. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
  81. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
  82. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
  83. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
  84. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
  85. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
  86. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
  87. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
  88. package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
  89. package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
  90. package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
  91. package/dist/cesium/Assets/Images/ion-credit.png +0 -0
  92. package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  93. package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  94. package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  95. package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  96. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  97. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  98. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  99. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  100. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  101. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  102. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  103. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  104. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  105. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  106. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  107. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  108. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  109. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  110. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  111. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  112. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  113. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  114. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  115. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  116. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  117. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  118. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  119. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  120. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  121. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  122. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  123. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  124. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  125. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  126. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  127. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  128. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  129. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  130. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  131. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  132. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  133. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  134. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  135. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  136. package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
  137. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  138. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  139. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  140. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  141. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  142. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  143. package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
  144. package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
  145. package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
  146. package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
  147. package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
  148. package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
  149. package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
  150. package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
  151. package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
  152. package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
  153. package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
  154. package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
  155. package/dist/cesium/Assets/Textures/maki/building.png +0 -0
  156. package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
  157. package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
  158. package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
  159. package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
  160. package/dist/cesium/Assets/Textures/maki/car.png +0 -0
  161. package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
  162. package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
  163. package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
  164. package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
  165. package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
  166. package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
  167. package/dist/cesium/Assets/Textures/maki/city.png +0 -0
  168. package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
  169. package/dist/cesium/Assets/Textures/maki/college.png +0 -0
  170. package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
  171. package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
  172. package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
  173. package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
  174. package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
  175. package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
  176. package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
  177. package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
  178. package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
  179. package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
  180. package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
  181. package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
  182. package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
  183. package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
  184. package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
  185. package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
  186. package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
  187. package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
  188. package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
  189. package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
  190. package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
  191. package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
  192. package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
  193. package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
  194. package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
  195. package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
  196. package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
  197. package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
  198. package/dist/cesium/Assets/Textures/maki/library.png +0 -0
  199. package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
  200. package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
  201. package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
  202. package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
  203. package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
  204. package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
  205. package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
  206. package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
  207. package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
  208. package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
  209. package/dist/cesium/Assets/Textures/maki/music.png +0 -0
  210. package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
  211. package/dist/cesium/Assets/Textures/maki/park.png +0 -0
  212. package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
  213. package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
  214. package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
  215. package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
  216. package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
  217. package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
  218. package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
  219. package/dist/cesium/Assets/Textures/maki/police.png +0 -0
  220. package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
  221. package/dist/cesium/Assets/Textures/maki/post.png +0 -0
  222. package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
  223. package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
  224. package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
  225. package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
  226. package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
  227. package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
  228. package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
  229. package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
  230. package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
  231. package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
  232. package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
  233. package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
  234. package/dist/cesium/Assets/Textures/maki/school.png +0 -0
  235. package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
  236. package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
  237. package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
  238. package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
  239. package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
  240. package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
  241. package/dist/cesium/Assets/Textures/maki/square.png +0 -0
  242. package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
  243. package/dist/cesium/Assets/Textures/maki/star.png +0 -0
  244. package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
  245. package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
  246. package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
  247. package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
  248. package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
  249. package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
  250. package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
  251. package/dist/cesium/Assets/Textures/maki/town.png +0 -0
  252. package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
  253. package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
  254. package/dist/cesium/Assets/Textures/maki/village.png +0 -0
  255. package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
  256. package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
  257. package/dist/cesium/Assets/Textures/maki/water.png +0 -0
  258. package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
  259. package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
  260. package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
  261. package/dist/cesium/Assets/Textures/pin.svg +0 -1
  262. package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
  263. package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
  264. package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
  265. package/dist/cesium/ThirdParty/Workers/package.json +0 -1
  266. package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
  267. package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
  268. package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
  269. package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  270. package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
  271. package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
  272. package/dist/cesium/Widgets/Animation/Animation.css +0 -127
  273. package/dist/cesium/Widgets/Animation/lighter.css +0 -70
  274. package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
  275. package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
  276. package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
  277. package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
  278. package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
  279. package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
  280. package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
  281. package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
  282. package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
  283. package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
  284. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  285. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  286. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  287. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  288. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  289. package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  290. package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  291. package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  292. package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  293. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  294. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  295. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  296. package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  297. package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  298. package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  299. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  300. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  301. package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  302. package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  303. package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
  304. package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
  305. package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
  306. package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
  307. package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
  308. package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
  309. package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
  310. package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
  311. package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
  312. package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  313. package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  314. package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
  315. package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
  316. package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
  317. package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
  318. package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
  319. package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
  320. package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
  321. package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
  322. package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
  323. package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
  324. package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
  325. package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
  326. package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
  327. package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
  328. package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
  329. package/dist/cesium/Widgets/lighter.css +0 -237
  330. package/dist/cesium/Widgets/lighterShared.css +0 -46
  331. package/dist/cesium/Widgets/shared.css +0 -103
  332. package/dist/cesium/Widgets/widgets.css +0 -1346
  333. package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
  334. package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
  335. package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
  336. package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
  337. package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
  338. package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
  339. package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
  340. package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
  341. package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
  342. package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
  343. package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
  344. package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
  345. package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
  346. package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
  347. package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
  348. package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
  349. package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
  350. package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
  351. package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
  352. package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
  353. package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
  354. package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
  355. package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
  356. package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
  357. package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
  358. package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
  359. package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
  360. package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
  361. package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
  362. package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
  363. package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
  364. package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
  365. package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
  366. package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
  367. package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
  368. package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
  369. package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
  370. package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
  371. package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
  372. package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
  373. package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
  374. package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
  375. package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
  376. package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
  377. package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
  378. package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
  379. package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
  380. package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
  381. package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
  382. package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
  383. package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
  384. package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
  385. package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
  386. package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
  387. package/dist/cesium/Workers/combineGeometry.js +0 -26
  388. package/dist/cesium/Workers/createBoxGeometry.js +0 -26
  389. package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
  390. package/dist/cesium/Workers/createCircleGeometry.js +0 -26
  391. package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
  392. package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
  393. package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
  394. package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
  395. package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
  396. package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
  397. package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
  398. package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
  399. package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
  400. package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
  401. package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
  402. package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
  403. package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
  404. package/dist/cesium/Workers/createGeometry.js +0 -26
  405. package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
  406. package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
  407. package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
  408. package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
  409. package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
  410. package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
  411. package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
  412. package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
  413. package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
  414. package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
  415. package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
  416. package/dist/cesium/Workers/createSphereGeometry.js +0 -26
  417. package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
  418. package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
  419. package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
  420. package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
  421. package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
  422. package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
  423. package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
  424. package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
  425. package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
  426. package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
  427. package/dist/cesium/Workers/createWallGeometry.js +0 -26
  428. package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
  429. package/dist/cesium/Workers/decodeDraco.js +0 -26
  430. package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
  431. package/dist/cesium/Workers/decodeI3S.js +0 -26
  432. package/dist/cesium/Workers/transcodeKTX2.js +0 -56
  433. package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
  434. package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
  435. /package/src/engines/Cesium/{JapanSeaLevelEllipsoid.ts → hooks/useOverrideGlobeShader/JapanSeaLevelEllipsoid.ts} +0 -0
  436. /package/src/engines/Cesium/{vertexTerrainElevationMaterial.glsl → hooks/useOverrideGlobeShader/vertexTerrainElevationMaterial.glsl} +0 -0
@@ -12,7 +12,7 @@ import { useRef } from "react";
12
12
  import type { CesiumComponentRef } from "resium";
13
13
  import { vi, expect, test, afterEach } from "vitest";
14
14
 
15
- import type { EngineRef, Clock } from "..";
15
+ import type { EngineRef, Clock } from "../../..";
16
16
 
17
17
  import useEngineRef from "./useEngineRef";
18
18
 
@@ -57,86 +57,86 @@ test("bind mouse events", () => {
57
57
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
58
58
 
59
59
  result.current.current?.onDoubleClick(mockMouseEventCallback);
60
- expect(result.current.current?.mouseEventCallbacks.doubleclick[0]).toBe(mockMouseEventCallback);
60
+ expect(result.current.current?.mouseEventCallbacks.doubleClick[0]).toBe(mockMouseEventCallback);
61
61
 
62
- result.current.current?.mouseEventCallbacks.doubleclick[0]?.(props);
62
+ result.current.current?.mouseEventCallbacks.doubleClick[0]?.(props);
63
63
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(2);
64
64
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
65
65
 
66
66
  result.current.current?.onMouseDown(mockMouseEventCallback);
67
- expect(result.current.current?.mouseEventCallbacks.mousedown[0]).toBe(mockMouseEventCallback);
67
+ expect(result.current.current?.mouseEventCallbacks.mouseDown[0]).toBe(mockMouseEventCallback);
68
68
 
69
- result.current.current?.mouseEventCallbacks.mousedown[0]?.(props);
69
+ result.current.current?.mouseEventCallbacks.mouseDown[0]?.(props);
70
70
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(3);
71
71
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
72
72
 
73
73
  result.current.current?.onMouseUp(mockMouseEventCallback);
74
- expect(result.current.current?.mouseEventCallbacks.mouseup[0]).toBe(mockMouseEventCallback);
74
+ expect(result.current.current?.mouseEventCallbacks.mouseUp[0]).toBe(mockMouseEventCallback);
75
75
 
76
- result.current.current?.mouseEventCallbacks.mouseup[0]?.(props);
76
+ result.current.current?.mouseEventCallbacks.mouseUp[0]?.(props);
77
77
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(4);
78
78
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
79
79
 
80
80
  result.current.current?.onRightClick(mockMouseEventCallback);
81
- expect(result.current.current?.mouseEventCallbacks.rightclick[0]).toBe(mockMouseEventCallback);
81
+ expect(result.current.current?.mouseEventCallbacks.rightClick[0]).toBe(mockMouseEventCallback);
82
82
 
83
- result.current.current?.mouseEventCallbacks.rightclick[0]?.(props);
83
+ result.current.current?.mouseEventCallbacks.rightClick[0]?.(props);
84
84
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(5);
85
85
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
86
86
 
87
87
  result.current.current?.onRightDown(mockMouseEventCallback);
88
- expect(result.current.current?.mouseEventCallbacks.rightdown[0]).toBe(mockMouseEventCallback);
88
+ expect(result.current.current?.mouseEventCallbacks.rightDown[0]).toBe(mockMouseEventCallback);
89
89
 
90
- result.current.current?.mouseEventCallbacks.rightdown[0]?.(props);
90
+ result.current.current?.mouseEventCallbacks.rightDown[0]?.(props);
91
91
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(6);
92
92
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
93
93
 
94
94
  result.current.current?.onRightUp(mockMouseEventCallback);
95
- expect(result.current.current?.mouseEventCallbacks.rightup[0]).toBe(mockMouseEventCallback);
95
+ expect(result.current.current?.mouseEventCallbacks.rightUp[0]).toBe(mockMouseEventCallback);
96
96
 
97
- result.current.current?.mouseEventCallbacks.rightup[0]?.(props);
97
+ result.current.current?.mouseEventCallbacks.rightUp[0]?.(props);
98
98
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(7);
99
99
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
100
100
 
101
101
  result.current.current?.onMiddleClick(mockMouseEventCallback);
102
- expect(result.current.current?.mouseEventCallbacks.middleclick[0]).toBe(mockMouseEventCallback);
102
+ expect(result.current.current?.mouseEventCallbacks.middleClick[0]).toBe(mockMouseEventCallback);
103
103
 
104
- result.current.current?.mouseEventCallbacks.middleclick[0]?.(props);
104
+ result.current.current?.mouseEventCallbacks.middleClick[0]?.(props);
105
105
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(8);
106
106
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
107
107
 
108
108
  result.current.current?.onMiddleDown(mockMouseEventCallback);
109
- expect(result.current.current?.mouseEventCallbacks.middledown[0]).toBe(mockMouseEventCallback);
109
+ expect(result.current.current?.mouseEventCallbacks.middleDown[0]).toBe(mockMouseEventCallback);
110
110
 
111
- result.current.current?.mouseEventCallbacks.middledown[0]?.(props);
111
+ result.current.current?.mouseEventCallbacks.middleDown[0]?.(props);
112
112
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(9);
113
113
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
114
114
 
115
115
  result.current.current?.onMiddleUp(mockMouseEventCallback);
116
- expect(result.current.current?.mouseEventCallbacks.middleup[0]).toBe(mockMouseEventCallback);
116
+ expect(result.current.current?.mouseEventCallbacks.middleUp[0]).toBe(mockMouseEventCallback);
117
117
 
118
- result.current.current?.mouseEventCallbacks.middleup[0]?.(props);
118
+ result.current.current?.mouseEventCallbacks.middleUp[0]?.(props);
119
119
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(10);
120
120
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
121
121
 
122
122
  result.current.current?.onMouseMove(mockMouseEventCallback);
123
- expect(result.current.current?.mouseEventCallbacks.mousemove[0]).toBe(mockMouseEventCallback);
123
+ expect(result.current.current?.mouseEventCallbacks.mouseMove[0]).toBe(mockMouseEventCallback);
124
124
 
125
- result.current.current?.mouseEventCallbacks.mousemove[0]?.(props);
125
+ result.current.current?.mouseEventCallbacks.mouseMove[0]?.(props);
126
126
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(11);
127
127
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
128
128
 
129
129
  result.current.current?.onMouseEnter(mockMouseEventCallback);
130
- expect(result.current.current?.mouseEventCallbacks.mouseenter[0]).toBe(mockMouseEventCallback);
130
+ expect(result.current.current?.mouseEventCallbacks.mouseEnter[0]).toBe(mockMouseEventCallback);
131
131
 
132
- result.current.current?.mouseEventCallbacks.mouseenter[0]?.(props);
132
+ result.current.current?.mouseEventCallbacks.mouseEnter[0]?.(props);
133
133
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(12);
134
134
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
135
135
 
136
136
  result.current.current?.onMouseLeave(mockMouseEventCallback);
137
- expect(result.current.current?.mouseEventCallbacks.mouseleave[0]).toBe(mockMouseEventCallback);
137
+ expect(result.current.current?.mouseEventCallbacks.mouseLeave[0]).toBe(mockMouseEventCallback);
138
138
 
139
- result.current.current?.mouseEventCallbacks.mouseleave[0]?.(props);
139
+ result.current.current?.mouseEventCallbacks.mouseLeave[0]?.(props);
140
140
  expect(mockMouseEventCallback).toHaveBeenCalledTimes(13);
141
141
  expect(mockMouseEventCallback).toHaveBeenCalledWith(props);
142
142
 
@@ -188,10 +188,11 @@ test("zoom", async () => {
188
188
  return engineRef;
189
189
  });
190
190
 
191
- const commons = await import("./common");
191
+ const commons = await import("../common");
192
+ const zoom = vi.spyOn(commons, "zoom");
192
193
 
193
194
  result.current.current?.zoomIn(10);
194
- expect(commons.zoom).toHaveBeenCalledTimes(1);
195
+ expect(zoom).toHaveBeenCalledTimes(1);
195
196
  expect(commons.zoom).toHaveBeenCalledWith(
196
197
  {
197
198
  viewer,
@@ -221,6 +222,7 @@ test("call orbit when camera focuses on center", async () => {
221
222
  rotateUp: vi.fn(),
222
223
  look: vi.fn(),
223
224
  move: vi.fn(),
225
+ getPickRay: vi.fn(),
224
226
  positionCartographic: new Cartesian3(),
225
227
  },
226
228
  mode: SceneMode.SCENE3D,
@@ -247,15 +249,14 @@ test("call orbit when camera focuses on center", async () => {
247
249
  return [engineRef, cesium] as const;
248
250
  });
249
251
 
250
- const commons = await import("./common");
252
+ const commons = await import("../common");
253
+ const getCenterCamera = vi.spyOn(commons, "getCenterCamera");
251
254
 
252
255
  const [engineRef, cesium] = result.current;
253
256
 
254
257
  engineRef.current?.orbit(90);
255
- expect(commons.getCenterCamera).toHaveBeenCalled();
256
- expect(cesium.current.cesiumElement?.scene.camera.rotateLeft).toHaveBeenCalled();
257
- expect(cesium.current.cesiumElement?.scene.camera.rotateUp).toHaveBeenCalled();
258
- expect(cesium.current.cesiumElement?.scene.camera.lookAtTransform).toHaveBeenCalledTimes(2);
258
+ expect(getCenterCamera).toHaveBeenCalled();
259
+ expect(cesium.current.cesiumElement?.scene.camera.lookAtTransform).toHaveBeenCalledTimes(1);
259
260
  });
260
261
 
261
262
  test("call orbit when camera does not focus on center", async () => {
@@ -268,6 +269,7 @@ test("call orbit when camera does not focus on center", async () => {
268
269
  rotateUp: vi.fn(),
269
270
  look: vi.fn(),
270
271
  move: vi.fn(),
272
+ getPickRay: vi.fn(),
271
273
  positionWC: new Cartesian3(),
272
274
  positionCartographic: new Cartesian3(),
273
275
  },
@@ -294,12 +296,13 @@ test("call orbit when camera does not focus on center", async () => {
294
296
  return [engineRef, cesium] as const;
295
297
  });
296
298
 
297
- const commons = await import("./common");
299
+ const commons = await import("../common");
300
+ const getCenterCamera = vi.spyOn(commons, "getCenterCamera");
298
301
 
299
302
  const [engineRef, cesium] = result.current;
300
303
 
301
304
  engineRef.current?.orbit(90);
302
- expect(commons.getCenterCamera).toHaveBeenCalled();
305
+ expect(getCenterCamera).toHaveBeenCalled();
303
306
  expect(cesium.current.cesiumElement?.scene.camera.look).toHaveBeenCalledTimes(2);
304
307
  expect(cesium.current.cesiumElement?.scene.camera.lookAtTransform).toHaveBeenCalledTimes(2);
305
308
  });
@@ -314,6 +317,7 @@ test("orbit on 2D mode", async () => {
314
317
  rotateUp: vi.fn(),
315
318
  look: vi.fn(),
316
319
  move: vi.fn(),
320
+ getPickRay: vi.fn(),
317
321
  positionWC: new Cartesian3(),
318
322
  positionCartographic: new Cartesian3(),
319
323
  },
@@ -4,11 +4,9 @@ import { ClockStep, JulianDate, Math as CesiumMath } from "cesium";
4
4
  import { useImperativeHandle, Ref, RefObject, useMemo, useRef } from "react";
5
5
  import { CesiumComponentRef } from "resium";
6
6
 
7
- import type { EngineRef, MouseEventProps, Feature, ComputedFeature } from "..";
8
- import { MouseEventCallbacks, TickEventCallback } from "../../Map";
9
- import { SketchType } from "../../Map/Sketch/types";
10
- import { Position2d, Position3d } from "../../types";
11
-
7
+ import type { EngineRef, MouseEventProps, Feature, ComputedFeature } from "../..";
8
+ import { MouseEventCallbacks, TickEventCallback, SketchType } from "../../../Map";
9
+ import { Position2d, Position3d } from "../../../types";
12
10
  import {
13
11
  getLocationFromScreen,
14
12
  flyTo,
@@ -34,11 +32,11 @@ import {
34
32
  cartesianToLatLngHeight,
35
33
  getExtrudedHeight,
36
34
  getOverriddenScreenSpaceCameraOptions,
37
- } from "./common";
38
- import { attachTag, getTag } from "./Feature";
39
- import { PickedFeature, pickManyFromViewportAsFeature } from "./pickMany";
40
- import { createGeometry } from "./Sketch/createGeometry";
41
- import { CursorType } from "./types";
35
+ } from "../common";
36
+ import { attachTag, getTag } from "../Feature";
37
+ import { PickedFeature, pickManyFromViewportAsFeature } from "../pickMany";
38
+ import { createGeometry } from "../Sketch/createGeometry";
39
+ import { CursorType } from "../types";
42
40
  import {
43
41
  convertCesium3DTileFeatureProperties,
44
42
  convertEntityDescription,
@@ -46,7 +44,7 @@ import {
46
44
  convertObjToComputedFeature,
47
45
  findEntity,
48
46
  findFeaturesFromLayer,
49
- } from "./utils/utils";
47
+ } from "../utils/utils";
50
48
 
51
49
  export default function useEngineRef(
52
50
  ref: Ref<EngineRef>,
@@ -55,18 +53,18 @@ export default function useEngineRef(
55
53
  const cancelCameraFlight = useRef<() => void>();
56
54
  const mouseEventCallbacks = useRef<MouseEventCallbacks>({
57
55
  click: [],
58
- doubleclick: [],
59
- mousedown: [],
60
- mouseup: [],
61
- rightclick: [],
62
- rightdown: [],
63
- rightup: [],
64
- middleclick: [],
65
- middledown: [],
66
- middleup: [],
67
- mousemove: [],
68
- mouseenter: [],
69
- mouseleave: [],
56
+ doubleClick: [],
57
+ mouseDown: [],
58
+ mouseUp: [],
59
+ rightClick: [],
60
+ rightDown: [],
61
+ rightUp: [],
62
+ middleClick: [],
63
+ middleDown: [],
64
+ middleUp: [],
65
+ mouseMove: [],
66
+ mouseEnter: [],
67
+ mouseLeave: [],
70
68
  wheel: [],
71
69
  });
72
70
  const tickEventCallback = useRef<TickEventCallback[]>([]);
@@ -239,6 +237,8 @@ export default function useEngineRef(
239
237
  setView: camera => {
240
238
  const viewer = cesium.current?.cesiumElement;
241
239
  if (!viewer || viewer.isDestroyed()) return false;
240
+ if (camera.lat === undefined || camera.lng === undefined || camera.height === undefined)
241
+ return false;
242
242
  const scene = viewer.scene;
243
243
  if (camera.lng || camera.lat || camera.height) {
244
244
  const xyz = Cesium.Cartesian3.fromDegrees(camera.lng, camera.lat, camera.height);
@@ -539,13 +539,15 @@ export default function useEngineRef(
539
539
  const oldTransform = Cesium.Matrix4.clone(camera.transform);
540
540
 
541
541
  const center = getCenterCamera({ camera, scene });
542
- // Get fixed frame from center to globe ellipsoid.
543
- const frame = Cesium.Transforms.eastNorthUpToFixedFrame(
544
- center || camera.positionWC,
545
- scene.globe.ellipsoid,
546
- );
542
+ if (center || camera.positionWC) {
543
+ // Get fixed frame from center to globe ellipsoid.
544
+ const frame = Cesium.Transforms.eastNorthUpToFixedFrame(
545
+ center || camera.positionWC,
546
+ scene.globe.ellipsoid,
547
+ );
547
548
 
548
- camera.lookAtTransform(frame);
549
+ camera.lookAtTransform(frame);
550
+ }
549
551
 
550
552
  if (viewer.scene.mode !== Cesium.SceneMode.SCENE3D) {
551
553
  camera.move(
@@ -675,40 +677,40 @@ export default function useEngineRef(
675
677
  mouseEventCallbacks.current.click.push(cb);
676
678
  },
677
679
  onDoubleClick: (cb: (props: MouseEventProps) => void) => {
678
- mouseEventCallbacks.current.doubleclick.push(cb);
680
+ mouseEventCallbacks.current.doubleClick.push(cb);
679
681
  },
680
682
  onMouseDown: (cb: (props: MouseEventProps) => void) => {
681
- mouseEventCallbacks.current.mousedown.push(cb);
683
+ mouseEventCallbacks.current.mouseDown.push(cb);
682
684
  },
683
685
  onMouseUp: (cb: (props: MouseEventProps) => void) => {
684
- mouseEventCallbacks.current.mouseup.push(cb);
686
+ mouseEventCallbacks.current.mouseUp.push(cb);
685
687
  },
686
688
  onRightClick: (cb: (props: MouseEventProps) => void) => {
687
- mouseEventCallbacks.current.rightclick.push(cb);
689
+ mouseEventCallbacks.current.rightClick.push(cb);
688
690
  },
689
691
  onRightDown: (cb: (props: MouseEventProps) => void) => {
690
- mouseEventCallbacks.current.rightdown.push(cb);
692
+ mouseEventCallbacks.current.rightDown.push(cb);
691
693
  },
692
694
  onRightUp: (cb: (props: MouseEventProps) => void) => {
693
- mouseEventCallbacks.current.rightup.push(cb);
695
+ mouseEventCallbacks.current.rightUp.push(cb);
694
696
  },
695
697
  onMiddleClick: (cb: (props: MouseEventProps) => void) => {
696
- mouseEventCallbacks.current.middleclick.push(cb);
698
+ mouseEventCallbacks.current.middleClick.push(cb);
697
699
  },
698
700
  onMiddleDown: (cb: (props: MouseEventProps) => void) => {
699
- mouseEventCallbacks.current.middledown.push(cb);
701
+ mouseEventCallbacks.current.middleDown.push(cb);
700
702
  },
701
703
  onMiddleUp: (cb: (props: MouseEventProps) => void) => {
702
- mouseEventCallbacks.current.middleup.push(cb);
704
+ mouseEventCallbacks.current.middleUp.push(cb);
703
705
  },
704
706
  onMouseMove: (cb: (props: MouseEventProps) => void) => {
705
- mouseEventCallbacks.current.mousemove.push(cb);
707
+ mouseEventCallbacks.current.mouseMove.push(cb);
706
708
  },
707
709
  onMouseEnter: (cb: (props: MouseEventProps) => void) => {
708
- mouseEventCallbacks.current.mouseenter.push(cb);
710
+ mouseEventCallbacks.current.mouseEnter.push(cb);
709
711
  },
710
712
  onMouseLeave: (cb: (props: MouseEventProps) => void) => {
711
- mouseEventCallbacks.current.mouseleave.push(cb);
713
+ mouseEventCallbacks.current.mouseLeave.push(cb);
712
714
  },
713
715
  onWheel: (cb: (props: MouseEventProps) => void) => {
714
716
  mouseEventCallbacks.current.wheel.push(cb);
@@ -0,0 +1,65 @@
1
+ import { Viewer } from "cesium";
2
+ import { MutableRefObject, RefObject, useCallback, useEffect, useRef } from "react";
3
+ import { CesiumComponentRef } from "resium";
4
+
5
+ import { RequestingRenderMode, ViewerProperty } from "../../../Map";
6
+ import { FORCE_REQUEST_RENDER, NO_REQUEST_RENDER, REQUEST_RENDER_ONCE } from "../../../Map/hooks";
7
+
8
+ export default ({
9
+ cesium,
10
+ requestingRenderMode,
11
+ isLayerDragging,
12
+ shouldRender,
13
+ property,
14
+ }: {
15
+ cesium: RefObject<CesiumComponentRef<Viewer>>;
16
+ requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
17
+ isLayerDragging?: boolean;
18
+ shouldRender?: boolean;
19
+ property?: ViewerProperty;
20
+ }) => {
21
+ // explicit rendering
22
+ const explicitRender = useCallback(() => {
23
+ const viewer = cesium.current?.cesiumElement;
24
+ if (!requestingRenderMode?.current || !viewer || viewer.isDestroyed()) return;
25
+ viewer.scene.requestRender();
26
+ if (requestingRenderMode.current === REQUEST_RENDER_ONCE) {
27
+ requestingRenderMode.current = NO_REQUEST_RENDER;
28
+ }
29
+ }, [cesium, requestingRenderMode]);
30
+
31
+ const explicitRenderRef = useRef<() => void>();
32
+
33
+ useEffect(() => {
34
+ explicitRenderRef.current = explicitRender;
35
+ }, [explicitRender]);
36
+
37
+ useEffect(() => {
38
+ const viewer = cesium.current?.cesiumElement;
39
+ if (!viewer || viewer.isDestroyed()) return;
40
+ return viewer.scene.postUpdate.addEventListener(() => {
41
+ explicitRenderRef.current?.();
42
+ });
43
+ }, [cesium]);
44
+
45
+ // render one frame when scene property changes
46
+ useEffect(() => {
47
+ if (requestingRenderMode) {
48
+ requestingRenderMode.current = REQUEST_RENDER_ONCE;
49
+ }
50
+ }, [property, requestingRenderMode]);
51
+
52
+ // force render when timeline is animating or is shouldRender
53
+ useEffect(() => {
54
+ const viewer = cesium.current?.cesiumElement;
55
+ if (!viewer || viewer.isDestroyed()) return;
56
+ if (requestingRenderMode) {
57
+ requestingRenderMode.current =
58
+ isLayerDragging || shouldRender
59
+ ? FORCE_REQUEST_RENDER
60
+ : requestingRenderMode.current === REQUEST_RENDER_ONCE
61
+ ? REQUEST_RENDER_ONCE
62
+ : NO_REQUEST_RENDER;
63
+ }
64
+ }, [cesium, isLayerDragging, shouldRender, requestingRenderMode]);
65
+ };
@@ -0,0 +1,77 @@
1
+ import { Cartesian3, Entity, Viewer } from "cesium";
2
+ import CesiumDnD, { Context } from "cesium-dnd";
3
+ import { RefObject, useCallback, useEffect, useRef } from "react";
4
+ import { CesiumComponentRef } from "resium";
5
+
6
+ import { LatLng } from "../../../utils";
7
+ import { isDraggable, isSelectable } from "../common";
8
+ import { getTag } from "../Feature";
9
+ import { convertCartesian3ToPosition } from "../utils/utils";
10
+
11
+ export default ({
12
+ cesium,
13
+ isLayerDraggable,
14
+ onLayerDrag,
15
+ onLayerDrop,
16
+ }: {
17
+ cesium: RefObject<CesiumComponentRef<Viewer>>;
18
+ isLayerDraggable?: boolean;
19
+ onLayerDrag?: (layerId: string, featureId: string | undefined, position: LatLng) => void;
20
+ onLayerDrop?: (
21
+ layerId: string,
22
+ featureId: string | undefined,
23
+ position: LatLng | undefined,
24
+ ) => void;
25
+ }) => {
26
+ // enable Drag and Drop Layers
27
+ const handleLayerDrag = useCallback(
28
+ (e: Entity, position: Cartesian3 | undefined, _context: Context): boolean | void => {
29
+ const viewer = cesium.current?.cesiumElement;
30
+ if (!viewer || viewer.isDestroyed() || !isSelectable(e) || !isDraggable(e)) return false;
31
+
32
+ const pos = convertCartesian3ToPosition(cesium.current?.cesiumElement, position);
33
+ if (!pos) return false;
34
+
35
+ const tag = getTag(e);
36
+ if (!tag) return false;
37
+
38
+ onLayerDrag?.(tag.layerId || "", tag.featureId, pos);
39
+ },
40
+ [cesium, onLayerDrag],
41
+ );
42
+
43
+ const handleLayerDrop = useCallback(
44
+ (e: Entity, position: Cartesian3 | undefined): boolean | void => {
45
+ const viewer = cesium.current?.cesiumElement;
46
+ if (!viewer || viewer.isDestroyed()) return false;
47
+
48
+ const tag = getTag(e);
49
+ const pos = convertCartesian3ToPosition(cesium.current?.cesiumElement, position);
50
+ onLayerDrop?.(tag?.layerId || "", tag?.featureId || "", pos);
51
+
52
+ return false; // let apollo-client handle optimistic updates
53
+ },
54
+ [cesium, onLayerDrop],
55
+ );
56
+
57
+ const cesiumDnD = useRef<CesiumDnD>();
58
+ useEffect(() => {
59
+ const viewer = cesium.current?.cesiumElement;
60
+ if (!viewer || viewer.isDestroyed()) return;
61
+ cesiumDnD.current = new CesiumDnD(viewer, {
62
+ onDrag: handleLayerDrag,
63
+ onDrop: handleLayerDrop,
64
+ dragDelay: 1000,
65
+ initialDisabled: !isLayerDraggable,
66
+ });
67
+ return () => {
68
+ if (!viewer || viewer.isDestroyed()) return;
69
+ cesiumDnD.current?.disable();
70
+ };
71
+ }, [cesium, isLayerDraggable, handleLayerDrag, handleLayerDrop]);
72
+
73
+ return {
74
+ handleLayerDrag,
75
+ handleLayerDrop,
76
+ };
77
+ };
@@ -1,7 +1,8 @@
1
1
  import { Ellipsoid, Material } from "cesium";
2
2
 
3
- import { createColorMapImage } from "./Feature/HeatMap/colorMap";
4
- import { turboColorMap } from "./Feature/HeatMap/constants";
3
+ import { createColorMapImage } from "../../Feature/HeatMap/colorMap";
4
+ import { turboColorMap } from "../../Feature/HeatMap/constants";
5
+
5
6
  import { JapanSeaLevelEllipsoid } from "./JapanSeaLevelEllipsoid";
6
7
  import source from "./vertexTerrainElevationMaterial.glsl?raw";
7
8
 
@@ -8,15 +8,15 @@ import { Viewer, Globe, Material, Cartesian3 } from "cesium";
8
8
  import { RefObject, useCallback, useEffect, useMemo, useRef } from "react";
9
9
  import { CesiumComponentRef } from "resium";
10
10
 
11
- import { TerrainProperty } from "..";
12
- import { useImmutableFunction } from "../../hooks/useRefFunction";
13
- import { StringMatcher } from "../../utils/StringMatcher";
14
-
15
- import { createColorMapImage } from "./Feature/HeatMap/colorMap";
16
- import GlobeFSDefinitions from "./Shaders/OverriddenShaders/GlobeFS/Definitions.glsl?raw";
17
- import HeatmapForTerrainFS from "./Shaders/OverriddenShaders/GlobeFS/HeatmapForTerrain.glsl?raw";
18
- import IBLFS from "./Shaders/OverriddenShaders/GlobeFS/IBL.glsl?raw";
19
- import { PrivateCesiumGlobe } from "./types";
11
+ import { TerrainProperty } from "../../..";
12
+ import { useImmutableFunction } from "../../../../hooks/useRefFunction";
13
+ import { StringMatcher } from "../../../../utils/StringMatcher";
14
+ import { createColorMapImage } from "../../Feature/HeatMap/colorMap";
15
+ import GlobeFSDefinitions from "../../Shaders/OverriddenShaders/GlobeFS/Definitions.glsl?raw";
16
+ import HeatmapForTerrainFS from "../../Shaders/OverriddenShaders/GlobeFS/HeatmapForTerrain.glsl?raw";
17
+ import IBLFS from "../../Shaders/OverriddenShaders/GlobeFS/IBL.glsl?raw";
18
+ import { PrivateCesiumGlobe } from "../../types";
19
+
20
20
  import { VertexTerrainElevationMaterial } from "./VertexTerrainElevationMaterial";
21
21
 
22
22
  const defaultMatcher = new StringMatcher()
@@ -122,17 +122,19 @@ const useIBL = ({
122
122
 
123
123
  const useTerrainHeatmap = ({
124
124
  cesium,
125
- terrain: {
126
- heatmapType,
127
- heatmapMaxHeight,
128
- heatmapMinHeight,
129
- heatmapLogarithmic,
130
- heatmapColorLUT,
131
- } = {},
125
+ terrain,
132
126
  }: {
133
127
  cesium: RefObject<CesiumComponentRef<Viewer>>;
134
128
  terrain: TerrainProperty | undefined;
135
129
  }) => {
130
+ const {
131
+ type: heatmapType,
132
+ maxHeight: heatmapMaxHeight,
133
+ minHeight: heatmapMinHeight,
134
+ logarithmic: heatmapLogarithmic,
135
+ colorLUT: heatmapColorLUT,
136
+ } = terrain?.elevationHeatMap ?? {};
137
+
136
138
  const isCustomHeatmapEnabled = useMemo(() => heatmapType === "custom", [heatmapType]);
137
139
 
138
140
  const shaderForTerrainHeatmap = useMemo(
@@ -141,7 +143,7 @@ const useTerrainHeatmap = ({
141
143
  [
142
144
  "#ifdef APPLY_COLOR_TO_ALPHA",
143
145
  "vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);",
144
- "colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);",
146
+ "colorDiff.r = czm_maximumComponent(colorDiff);",
145
147
  "alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);",
146
148
  "#endif",
147
149
  ],
@@ -206,6 +208,7 @@ export const useOverrideGlobeShader = ({
206
208
  enableLighting,
207
209
  });
208
210
 
211
+ // Terrain Heatmap is actually a built-in feature for globe, it renders as a heatmap using terrain height data.
209
212
  const { isCustomHeatmapEnabled, shaderForTerrainHeatmap } = useTerrainHeatmap({
210
213
  cesium,
211
214
  terrain,
@@ -0,0 +1,90 @@
1
+ import { Cartesian3, Color, DirectionalLight, SceneMode, SunLight, Viewer } from "cesium";
2
+ import { RefObject, useMemo } from "react";
3
+ import { CesiumComponentRef } from "resium";
4
+
5
+ import { ViewerProperty } from "../..";
6
+
7
+ // TODO: move all viewer property -> resium component prop logic here (from the gerneal long Cesium/hooks file)
8
+ export default ({
9
+ cesium,
10
+ property,
11
+ }: {
12
+ cesium: RefObject<CesiumComponentRef<Viewer>>;
13
+ property?: ViewerProperty;
14
+ }) => {
15
+ const sceneLight = useMemo(() => {
16
+ let light;
17
+ if (property?.scene?.light?.type === "sunLight") {
18
+ light = new SunLight({
19
+ color: property.scene?.light?.color
20
+ ? Color.fromCssColorString(property.scene.light.color)
21
+ : undefined,
22
+ intensity: property.scene?.light?.intensity,
23
+ });
24
+ } else if (property?.scene?.light?.type === "directionalLight") {
25
+ light = new DirectionalLight({
26
+ direction: new Cartesian3(
27
+ property?.scene?.light?.direction?.[0] ?? 1,
28
+ property?.scene?.light?.direction?.[1] ?? 0,
29
+ property?.scene?.light?.direction?.[2] ?? 0,
30
+ ),
31
+ color: property.scene?.light?.color
32
+ ? Color.fromCssColorString(property.scene.light.color)
33
+ : undefined,
34
+ intensity: property.scene?.light?.intensity,
35
+ });
36
+ } else {
37
+ light = cesium.current?.cesiumElement?.scene.light;
38
+ if (light) {
39
+ light.color = property?.scene?.light?.color
40
+ ? Color.fromCssColorString(property.scene.light.color)
41
+ : light.color;
42
+ light.intensity = property?.scene?.light?.intensity
43
+ ? property.scene.light.intensity
44
+ : light.intensity;
45
+ }
46
+ }
47
+ return light;
48
+ }, [
49
+ cesium,
50
+ property?.scene?.light?.type,
51
+ property?.scene?.light?.color,
52
+ property?.scene?.light?.direction,
53
+ property?.scene?.light?.intensity,
54
+ ]);
55
+
56
+ const sceneBackgroundColor = useMemo(
57
+ () =>
58
+ property?.scene?.backgroundColor
59
+ ? Color.fromCssColorString(property.scene.backgroundColor)
60
+ : undefined,
61
+ [property?.scene?.backgroundColor],
62
+ );
63
+
64
+ const sceneMsaaSamples = useMemo(() => {
65
+ // TODO: FXAA doesn't support alpha blending in Cesium, so we will enable FXAA when this is fixed.
66
+ // viewer.scene.postProcessStages.fxaa.enabled = property?.render?.antialias === "high";
67
+ return property?.render?.antialias === "extreme"
68
+ ? 8
69
+ : property?.render?.antialias === "high"
70
+ ? 6
71
+ : property?.render?.antialias === "medium"
72
+ ? 4
73
+ : 1;
74
+ }, [property?.render?.antialias]);
75
+
76
+ const sceneMode = useMemo(() => {
77
+ return property?.scene?.mode === "2d"
78
+ ? SceneMode.SCENE2D
79
+ : property?.scene?.mode === "columbus"
80
+ ? SceneMode.COLUMBUS_VIEW
81
+ : SceneMode.SCENE3D;
82
+ }, [property?.scene?.mode]);
83
+
84
+ return {
85
+ sceneLight,
86
+ sceneBackgroundColor,
87
+ sceneMsaaSamples,
88
+ sceneMode,
89
+ };
90
+ };