@reearth/core 0.0.7-alpha.1 → 0.0.7-alpha.11

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 (404) hide show
  1. package/dist/core.js +32685 -32713
  2. package/dist/core.umd.cjs +3873 -3831
  3. package/dist/{index-DqatWUTw.js → index-DqGWVPtz.js} +0 -1
  4. package/dist/index.d.ts +45 -39
  5. package/package.json +8 -8
  6. package/src/Map/Layers/hooks.ts +10 -0
  7. package/src/Map/Sketch/hooks.ts +52 -72
  8. package/src/Map/Sketch/index.tsx +2 -24
  9. package/src/Map/Sketch/preset.ts +2 -0
  10. package/src/Map/Sketch/types.ts +31 -0
  11. package/src/Map/ref.ts +4 -7
  12. package/src/Map/types/index.ts +29 -34
  13. package/src/Map/types/viewerProperty.ts +3 -4
  14. package/src/Map/useTimelineManager.ts +3 -1
  15. package/src/Visualizer/hooks.ts +14 -2
  16. package/src/Visualizer/useCoreAPI.ts +2 -2
  17. package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +10 -1
  18. package/src/engines/Cesium/Feature/utils.tsx +12 -1
  19. package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +6 -10
  20. package/src/engines/Cesium/core/Globe.tsx +7 -7
  21. package/src/engines/Cesium/hooks/useCamera.ts +4 -13
  22. package/src/engines/Cesium/hooks/useEngineRef.test.tsx +24 -24
  23. package/src/engines/Cesium/hooks/useEngineRef.ts +26 -24
  24. package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +2 -2
  25. package/src/engines/Cesium/hooks.ts +14 -15
  26. package/src/engines/Cesium/index.tsx +12 -12
  27. package/src/mantle/atoms/compute.ts +5 -1
  28. package/src/mantle/compat/types.ts +7 -7
  29. package/src/mantle/data/geojson.ts +53 -22
  30. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
  31. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
  32. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
  33. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
  34. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
  35. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
  36. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
  37. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
  38. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
  39. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
  40. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
  41. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
  42. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
  43. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
  44. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
  45. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
  46. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
  47. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
  48. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
  49. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
  50. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
  51. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
  52. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
  53. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
  54. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
  55. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
  56. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
  57. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
  58. package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
  59. package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
  60. package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
  61. package/dist/cesium/Assets/Images/ion-credit.png +0 -0
  62. package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  63. package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  64. package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  65. package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  66. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  67. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  68. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  69. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  70. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  71. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  72. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  73. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  74. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  75. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  76. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  77. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  78. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  79. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  80. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  81. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  82. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  83. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  84. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  85. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  86. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  87. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  88. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  89. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  90. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  91. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  92. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  93. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  94. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  95. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  96. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  97. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  98. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  99. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  100. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  101. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  102. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  103. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  104. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  105. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  106. package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
  107. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  108. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  109. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  110. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  111. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  112. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  113. package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
  114. package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
  115. package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
  116. package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
  117. package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
  118. package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
  119. package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
  120. package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
  121. package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
  122. package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
  123. package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
  124. package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
  125. package/dist/cesium/Assets/Textures/maki/building.png +0 -0
  126. package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
  127. package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
  128. package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
  129. package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
  130. package/dist/cesium/Assets/Textures/maki/car.png +0 -0
  131. package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
  132. package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
  133. package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
  134. package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
  135. package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
  136. package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
  137. package/dist/cesium/Assets/Textures/maki/city.png +0 -0
  138. package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
  139. package/dist/cesium/Assets/Textures/maki/college.png +0 -0
  140. package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
  141. package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
  142. package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
  143. package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
  144. package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
  145. package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
  146. package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
  147. package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
  148. package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
  149. package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
  150. package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
  151. package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
  152. package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
  153. package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
  154. package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
  155. package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
  156. package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
  157. package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
  158. package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
  159. package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
  160. package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
  161. package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
  162. package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
  163. package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
  164. package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
  165. package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
  166. package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
  167. package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
  168. package/dist/cesium/Assets/Textures/maki/library.png +0 -0
  169. package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
  170. package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
  171. package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
  172. package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
  173. package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
  174. package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
  175. package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
  176. package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
  177. package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
  178. package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
  179. package/dist/cesium/Assets/Textures/maki/music.png +0 -0
  180. package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
  181. package/dist/cesium/Assets/Textures/maki/park.png +0 -0
  182. package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
  183. package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
  184. package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
  185. package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
  186. package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
  187. package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
  188. package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
  189. package/dist/cesium/Assets/Textures/maki/police.png +0 -0
  190. package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
  191. package/dist/cesium/Assets/Textures/maki/post.png +0 -0
  192. package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
  193. package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
  194. package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
  195. package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
  196. package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
  197. package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
  198. package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
  199. package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
  200. package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
  201. package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
  202. package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
  203. package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
  204. package/dist/cesium/Assets/Textures/maki/school.png +0 -0
  205. package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
  206. package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
  207. package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
  208. package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
  209. package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
  210. package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
  211. package/dist/cesium/Assets/Textures/maki/square.png +0 -0
  212. package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
  213. package/dist/cesium/Assets/Textures/maki/star.png +0 -0
  214. package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
  215. package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
  216. package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
  217. package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
  218. package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
  219. package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
  220. package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
  221. package/dist/cesium/Assets/Textures/maki/town.png +0 -0
  222. package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
  223. package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
  224. package/dist/cesium/Assets/Textures/maki/village.png +0 -0
  225. package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
  226. package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
  227. package/dist/cesium/Assets/Textures/maki/water.png +0 -0
  228. package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
  229. package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
  230. package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
  231. package/dist/cesium/Assets/Textures/pin.svg +0 -1
  232. package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
  233. package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
  234. package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
  235. package/dist/cesium/ThirdParty/Workers/package.json +0 -1
  236. package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
  237. package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
  238. package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
  239. package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  240. package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
  241. package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
  242. package/dist/cesium/Widgets/Animation/Animation.css +0 -127
  243. package/dist/cesium/Widgets/Animation/lighter.css +0 -70
  244. package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
  245. package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
  246. package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
  247. package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
  248. package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
  249. package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
  250. package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
  251. package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
  252. package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
  253. package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
  254. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  255. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  256. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  257. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  258. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  259. package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  260. package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  261. package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  262. package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  263. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  264. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  265. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  266. package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  267. package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  268. package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  269. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  270. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  271. package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  272. package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  273. package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
  274. package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
  275. package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
  276. package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
  277. package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
  278. package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
  279. package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
  280. package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
  281. package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
  282. package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  283. package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  284. package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
  285. package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
  286. package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
  287. package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
  288. package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
  289. package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
  290. package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
  291. package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
  292. package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
  293. package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
  294. package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
  295. package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
  296. package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
  297. package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
  298. package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
  299. package/dist/cesium/Widgets/lighter.css +0 -237
  300. package/dist/cesium/Widgets/lighterShared.css +0 -46
  301. package/dist/cesium/Widgets/shared.css +0 -103
  302. package/dist/cesium/Widgets/widgets.css +0 -1346
  303. package/dist/cesium/Workers/chunk-2ED5WI77.js +0 -26
  304. package/dist/cesium/Workers/chunk-2MBPFWCP.js +0 -26
  305. package/dist/cesium/Workers/chunk-3C74MLG3.js +0 -26
  306. package/dist/cesium/Workers/chunk-45U7TTT3.js +0 -26
  307. package/dist/cesium/Workers/chunk-4N7SRDH5.js +0 -26
  308. package/dist/cesium/Workers/chunk-4T6AS6BZ.js +0 -26
  309. package/dist/cesium/Workers/chunk-5AG2MVRM.js +0 -26
  310. package/dist/cesium/Workers/chunk-5Z6L2FHX.js +0 -26
  311. package/dist/cesium/Workers/chunk-6AUUBDOF.js +0 -26
  312. package/dist/cesium/Workers/chunk-74N6MC2V.js +0 -26
  313. package/dist/cesium/Workers/chunk-7VJK3KHI.js +0 -26
  314. package/dist/cesium/Workers/chunk-7VZHIB6P.js +0 -26
  315. package/dist/cesium/Workers/chunk-7X2YQ6I4.js +0 -27
  316. package/dist/cesium/Workers/chunk-B2SKQ7LU.js +0 -26
  317. package/dist/cesium/Workers/chunk-B4TQDFIE.js +0 -26
  318. package/dist/cesium/Workers/chunk-B6TRTFAA.js +0 -26
  319. package/dist/cesium/Workers/chunk-BK3HCS7I.js +0 -26
  320. package/dist/cesium/Workers/chunk-BOPB43LN.js +0 -26
  321. package/dist/cesium/Workers/chunk-C6DMEJQ7.js +0 -26
  322. package/dist/cesium/Workers/chunk-CN7UN2OZ.js +0 -26
  323. package/dist/cesium/Workers/chunk-CSISXEG7.js +0 -26
  324. package/dist/cesium/Workers/chunk-CUOR5F7T.js +0 -28
  325. package/dist/cesium/Workers/chunk-DGCK3LD2.js +0 -30
  326. package/dist/cesium/Workers/chunk-DXEZYE3K.js +0 -62
  327. package/dist/cesium/Workers/chunk-EXBFEYPQ.js +0 -26
  328. package/dist/cesium/Workers/chunk-FK5KFB6H.js +0 -26
  329. package/dist/cesium/Workers/chunk-HPBHKP5S.js +0 -26
  330. package/dist/cesium/Workers/chunk-JCJ24DHF.js +0 -26
  331. package/dist/cesium/Workers/chunk-JEWHFDAA.js +0 -26
  332. package/dist/cesium/Workers/chunk-JZLZJJQD.js +0 -26
  333. package/dist/cesium/Workers/chunk-KRZBI2MU.js +0 -26
  334. package/dist/cesium/Workers/chunk-KTTUANTJ.js +0 -26
  335. package/dist/cesium/Workers/chunk-LDCAXLGS.js +0 -26
  336. package/dist/cesium/Workers/chunk-LOPN5R3I.js +0 -26
  337. package/dist/cesium/Workers/chunk-MDLPQIMP.js +0 -26
  338. package/dist/cesium/Workers/chunk-MRR3RGFO.js +0 -26
  339. package/dist/cesium/Workers/chunk-NPBZI5YA.js +0 -26
  340. package/dist/cesium/Workers/chunk-NUSW5B6A.js +0 -26
  341. package/dist/cesium/Workers/chunk-OUXRUXNB.js +0 -26
  342. package/dist/cesium/Workers/chunk-QPOPEH3M.js +0 -26
  343. package/dist/cesium/Workers/chunk-R2AN7EKC.js +0 -26
  344. package/dist/cesium/Workers/chunk-RURL6ZX2.js +0 -26
  345. package/dist/cesium/Workers/chunk-SUQM3OSW.js +0 -28
  346. package/dist/cesium/Workers/chunk-UBIRX2SP.js +0 -26
  347. package/dist/cesium/Workers/chunk-VAKC5J5C.js +0 -26
  348. package/dist/cesium/Workers/chunk-VHNZBQTR.js +0 -27
  349. package/dist/cesium/Workers/chunk-VKV642QV.js +0 -26
  350. package/dist/cesium/Workers/chunk-VMSXG4OA.js +0 -26
  351. package/dist/cesium/Workers/chunk-VQZSIOZW.js +0 -26
  352. package/dist/cesium/Workers/chunk-WZUWQMI7.js +0 -26
  353. package/dist/cesium/Workers/chunk-YBI55DLZ.js +0 -26
  354. package/dist/cesium/Workers/chunk-YEJWCH6C.js +0 -26
  355. package/dist/cesium/Workers/chunk-YPDO7SPO.js +0 -26
  356. package/dist/cesium/Workers/chunk-ZYWD6OQH.js +0 -26
  357. package/dist/cesium/Workers/combineGeometry.js +0 -26
  358. package/dist/cesium/Workers/createBoxGeometry.js +0 -26
  359. package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
  360. package/dist/cesium/Workers/createCircleGeometry.js +0 -26
  361. package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
  362. package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
  363. package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
  364. package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
  365. package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
  366. package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
  367. package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
  368. package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
  369. package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
  370. package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
  371. package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
  372. package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
  373. package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
  374. package/dist/cesium/Workers/createGeometry.js +0 -26
  375. package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
  376. package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
  377. package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
  378. package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
  379. package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
  380. package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
  381. package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
  382. package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
  383. package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
  384. package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
  385. package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
  386. package/dist/cesium/Workers/createSphereGeometry.js +0 -26
  387. package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
  388. package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
  389. package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
  390. package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
  391. package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
  392. package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
  393. package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
  394. package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
  395. package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
  396. package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
  397. package/dist/cesium/Workers/createWallGeometry.js +0 -26
  398. package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
  399. package/dist/cesium/Workers/decodeDraco.js +0 -26
  400. package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
  401. package/dist/cesium/Workers/decodeI3S.js +0 -26
  402. package/dist/cesium/Workers/transcodeKTX2.js +0 -56
  403. package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
  404. package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
@@ -38,8 +38,7 @@ import type {
38
38
  LayerSelectionReason,
39
39
  Ref as LayersRef,
40
40
  } from "../Layers";
41
- import { SketchComponentType } from "../Sketch";
42
- import { SketchAppearance, SketchType } from "../Sketch/types";
41
+ import { SketchType, SketchOptions, SketchComponentType } from "../Sketch/types";
43
42
  import type { TimelineManagerRef } from "../useTimelineManager";
44
43
 
45
44
  import type { SceneMode, ViewerProperty } from "./viewerProperty";
@@ -89,7 +88,7 @@ export type EngineRef = {
89
88
  getLocationFromScreen: (x: number, y: number, withTerrain?: boolean) => LatLngHeight | undefined;
90
89
  sampleTerrainHeight: (lng: number, lat: number) => Promise<number | undefined>;
91
90
  computeGlobeHeight: (lng: number, lat: number, height?: number) => number | undefined;
92
- getGlobeHeight: () => void;
91
+ getGlobeHeight: () => number | undefined;
93
92
  toXYZ: (
94
93
  lng: number,
95
94
  lat: number,
@@ -300,18 +299,18 @@ export type MouseEventCallback = (props: MouseEventProps) => void;
300
299
  export type MouseWheelEventCallback = (props: MouseEventProps) => void;
301
300
  export type MouseEventTypes =
302
301
  | "click"
303
- | "doubleclick"
304
- | "mousedown"
305
- | "mouseup"
306
- | "rightclick"
307
- | "rightdown"
308
- | "rightup"
309
- | "middleclick"
310
- | "middledown"
311
- | "middleup"
312
- | "mousemove"
313
- | "mouseenter"
314
- | "mouseleave"
302
+ | "doubleClick"
303
+ | "mouseDown"
304
+ | "mouseUp"
305
+ | "rightClick"
306
+ | "rightDown"
307
+ | "rightUp"
308
+ | "middleClick"
309
+ | "middleDown"
310
+ | "middleUp"
311
+ | "mouseMove"
312
+ | "mouseEnter"
313
+ | "mouseLeave"
315
314
  | "wheel";
316
315
 
317
316
  export type MouseEvents = {
@@ -322,18 +321,18 @@ export type MouseEvents = {
322
321
 
323
322
  export type MouseEventHandles = {
324
323
  onClick: (fn: MouseEvents["click"]) => void;
325
- onDoubleClick: (fn: MouseEvents["doubleclick"]) => void;
326
- onMouseDown: (fn: MouseEvents["mousedown"]) => void;
327
- onMouseUp: (fn: MouseEvents["mouseup"]) => void;
328
- onRightClick: (fn: MouseEvents["rightclick"]) => void;
329
- onRightDown: (fn: MouseEvents["rightdown"]) => void;
330
- onRightUp: (fn: MouseEvents["rightup"]) => void;
331
- onMiddleClick: (fn: MouseEvents["middleclick"]) => void;
332
- onMiddleDown: (fn: MouseEvents["middledown"]) => void;
333
- onMiddleUp: (fn: MouseEvents["middleup"]) => void;
334
- onMouseMove: (fn: MouseEvents["mousemove"]) => void;
335
- onMouseEnter: (fn: MouseEvents["mouseenter"]) => void;
336
- onMouseLeave: (fn: MouseEvents["mouseleave"]) => void;
324
+ onDoubleClick: (fn: MouseEvents["doubleClick"]) => void;
325
+ onMouseDown: (fn: MouseEvents["mouseDown"]) => void;
326
+ onMouseUp: (fn: MouseEvents["mouseUp"]) => void;
327
+ onRightClick: (fn: MouseEvents["rightClick"]) => void;
328
+ onRightDown: (fn: MouseEvents["rightDown"]) => void;
329
+ onRightUp: (fn: MouseEvents["rightUp"]) => void;
330
+ onMiddleClick: (fn: MouseEvents["middleClick"]) => void;
331
+ onMiddleDown: (fn: MouseEvents["middleDown"]) => void;
332
+ onMiddleUp: (fn: MouseEvents["middleUp"]) => void;
333
+ onMouseMove: (fn: MouseEvents["mouseMove"]) => void;
334
+ onMouseEnter: (fn: MouseEvents["mouseEnter"]) => void;
335
+ onMouseLeave: (fn: MouseEvents["mouseLeave"]) => void;
337
336
  onWheel: (fn: MouseEvents["wheel"]) => void;
338
337
  };
339
338
 
@@ -357,12 +356,8 @@ export type Engine = {
357
356
  export type RequestingRenderMode = -1 | 0 | 1; // -1: force render on every postUpdate, 0: no request to render, 1: request one frame
358
357
 
359
358
  export type SketchRef = {
359
+ getType: () => SketchType | undefined;
360
360
  setType: (type: SketchType | undefined, from?: "editor" | "plugin") => void;
361
- setColor: (color: string) => void;
362
- setDefaultAppearance: (appearance: SketchAppearance) => void;
363
- disableShadow: (disable: boolean) => void;
364
- enableRelativeHeight: (enable: boolean) => void;
365
- createDataOnly: (dataOnly: boolean) => void;
366
- allowRightClickToAbort: (allow: boolean) => void;
367
- allowAutoResetInteractionMode: (allow: boolean) => void;
361
+ getOptions: () => SketchOptions;
362
+ overrideOptions: (options: SketchOptions) => void;
368
363
  };
@@ -69,10 +69,10 @@ export type TerrainProperty = {
69
69
  type?: "cesium" | "arcgis" | "cesiumion";
70
70
  url?: string;
71
71
  normal?: boolean;
72
- heightMap?: HeightMapProperty;
72
+ elevationHeatMap?: ElevationHeatMapProperty;
73
73
  };
74
74
 
75
- export type HeightMapProperty = {
75
+ export type ElevationHeatMapProperty = {
76
76
  type?: "custom";
77
77
  colorLUT?: LUT;
78
78
  minHeight?: number;
@@ -167,7 +167,6 @@ export type SkyAtmosphereProperty = {
167
167
  };
168
168
 
169
169
  export type CameraProperty = {
170
- camera?: Camera;
171
170
  allowEnterGround?: boolean;
172
171
  limiter?: CameraLimiterProperty;
173
172
  };
@@ -203,7 +202,7 @@ export type AssetsProperty = {
203
202
  };
204
203
 
205
204
  export type AssetsCesiumProperty = {
206
- terrian?: {
205
+ terrain?: {
207
206
  ionAccessToken?: string;
208
207
  ionAsset?: string;
209
208
  ionUrl?: string;
@@ -193,7 +193,9 @@ export default ({ init, engineRef, timelineManagerRef }: Props) => {
193
193
  onCommit,
194
194
  offCommit,
195
195
  handleTick,
196
- tick: engineRef?.current?.tick,
196
+ get tick() {
197
+ return engineRef?.current?.tick;
198
+ },
197
199
  };
198
200
  }, [
199
201
  options,
@@ -82,12 +82,24 @@ export default function useHooks(
82
82
  reason: LayerSelectionReason | undefined,
83
83
  info: SelectedFeatureInfo | undefined,
84
84
  ) => {
85
- if (selectedLayer.layerId === layerId && selectedLayer.featureId === featureId) return;
85
+ const isSketchLayer =
86
+ selectedLayer.layer?.layer.type === "simple" &&
87
+ selectedLayer.layer?.layer?.data?.isSketchLayer;
88
+ // Sketch layer feature has a fixed featureId, we need to exclude it from the skip condition
89
+ if (
90
+ selectedLayer.layerId === layerId &&
91
+ selectedLayer.featureId === featureId &&
92
+ !isSketchLayer
93
+ )
94
+ return;
86
95
 
87
96
  const computedLayer = await layer?.();
88
97
  const computedFeature =
89
98
  layerId && featureId
90
- ? mapRef.current?.engine.findComputedFeatureById?.(layerId, featureId) ?? info?.feature
99
+ ? (isSketchLayer
100
+ ? computedLayer?.features?.find(f => f.id === featureId)
101
+ : mapRef.current?.engine.findComputedFeatureById?.(layerId, featureId)) ??
102
+ info?.feature
91
103
  : undefined;
92
104
 
93
105
  selectFeature(
@@ -5,7 +5,7 @@ import { ViewerProperty } from "../engines";
5
5
 
6
6
  interface CoreAPI {
7
7
  readonly version: string;
8
- readonly property?: ViewerProperty;
8
+ readonly viewerProperty?: ViewerProperty;
9
9
  }
10
10
 
11
11
  export default ({ viewerProperty }: { viewerProperty?: ViewerProperty }) => {
@@ -17,7 +17,7 @@ export default ({ viewerProperty }: { viewerProperty?: ViewerProperty }) => {
17
17
  get version() {
18
18
  return version;
19
19
  },
20
- get property() {
20
+ get viewerProperty() {
21
21
  return viewerPropertyRef.current;
22
22
  },
23
23
  }),
@@ -411,7 +411,16 @@ export const useClippingBox = ({
411
411
  eventHandler.setInputAction(handleMouseUp, ScreenSpaceEventType.LEFT_UP);
412
412
  }, [eventHandler, handleMouseDown, handleRawMouseMove, handleMouseUp]);
413
413
 
414
- useEffect(() => () => eventHandler.destroy(), [eventHandler]);
414
+ useEffect(
415
+ () => () => {
416
+ requestAnimationFrame(() => {
417
+ if (!eventHandler.isDestroyed()) {
418
+ eventHandler.destroy();
419
+ }
420
+ });
421
+ },
422
+ [eventHandler],
423
+ );
415
424
 
416
425
  const boxProperty = useMemo(
417
426
  () => ({ ...boxState, ...dimensions, allowEnterGround }),
@@ -17,7 +17,7 @@ import {
17
17
  GroundPrimitive,
18
18
  } from "cesium";
19
19
  import md5 from "js-md5";
20
- import { pick } from "lodash-es";
20
+ import { isEqual, pick } from "lodash-es";
21
21
  import {
22
22
  ComponentProps,
23
23
  ComponentType,
@@ -87,8 +87,17 @@ function EntityExtComponent(
87
87
  ref: ForwardedRef<CesiumComponentRef<CesiumEntity>>,
88
88
  ) {
89
89
  const r = useRef<CesiumComponentRef<CesiumEntity>>(null);
90
+ const entityRef = useRef<CesiumEntity | undefined>(r?.current?.cesiumElement);
90
91
 
91
92
  useLayoutEffect(() => {
93
+ // Note: Sketch feature's tag cannot be attached properly when first load
94
+ // The cesiumElement is undefined when attach, and doesn't have a chance to attach again.
95
+ // Root cause is still not clear.
96
+ // Here we add r.current as a dependency and check cesiumElement instead.
97
+ if (entityRef.current !== undefined && isEqual(entityRef.current, r.current?.cesiumElement))
98
+ return;
99
+ entityRef.current = r.current?.cesiumElement;
100
+
92
101
  attachTag(r.current?.cesiumElement, {
93
102
  layerId: layerId || props.id,
94
103
  featureId,
@@ -97,6 +106,7 @@ function EntityExtComponent(
97
106
  legacyLocationPropertyKey,
98
107
  hideIndicator,
99
108
  });
109
+ // eslint-disable-next-line react-hooks/exhaustive-deps
100
110
  }, [
101
111
  draggable,
102
112
  featureId,
@@ -105,6 +115,7 @@ function EntityExtComponent(
105
115
  props.id,
106
116
  unselectable,
107
117
  hideIndicator,
118
+ r.current,
108
119
  ]);
109
120
 
110
121
  return <Entity ref={composeRefs(ref, r)} {...props} />;
@@ -6,8 +6,7 @@
6
6
  // https://github.com/CesiumGS/cesium/blob/1.106/packages/engine/Source/Shaders/Model/ImageBasedLightingStageFS.glsl
7
7
  // Specular term was removed, as I never apply it on terrain.
8
8
  vec3 reearth_imageBasedLightingStage(vec3 positionEC, vec3 normalEC,
9
- vec3 lightDirectionEC, vec3 lightColorHdr,
10
- czm_pbrParameters pbrParameters) {
9
+ vec3 lightDirectionEC, czm_modelMaterial material) {
11
10
  vec3 v = -positionEC;
12
11
  vec3 n = normalEC;
13
12
  vec3 l = normalize(lightDirectionEC);
@@ -24,21 +23,18 @@ vec3 reearth_imageBasedLightingStage(vec3 positionEC, vec3 normalEC,
24
23
  vec3 diffuseIrradiance =
25
24
  czm_sphericalHarmonics(cubeDir, u_reearth_sphericalHarmonicCoefficients);
26
25
 
27
- return pbrParameters.diffuseColor * diffuseIrradiance;
26
+ return material.diffuse * diffuseIrradiance;
28
27
  }
29
28
 
30
29
  vec4 reearth_computeImageBasedLightingColor(vec4 color) {
31
30
  if (u_reearth_globeImageBasedLighting) {
32
- czm_pbrParameters pbrParameters;
33
- pbrParameters.diffuseColor = color.rgb;
31
+ czm_modelMaterial material;
32
+ material.diffuse = color.rgb;
34
33
 
35
34
  vec3 normalEC = normalize(v_normalEC);
36
35
  vec3 lighting =
37
- czm_pbrLighting(v_positionEC, normalEC, czm_lightDirectionEC,
38
- czm_lightColorHdr, pbrParameters);
39
- lighting += reearth_imageBasedLightingStage(
40
- v_positionEC, normalEC, czm_lightDirectionEC,
41
- czm_lightColorHdr, pbrParameters) *
36
+ czm_pbrLighting(v_positionEC, normalEC, czm_lightDirectionEC, material) * czm_lightColorHdr;
37
+ lighting += reearth_imageBasedLightingStage(v_positionEC, normalEC, czm_lightDirectionEC, material) *
42
38
  u_vertexShadowDarkness;
43
39
 
44
40
  #ifndef HDR
@@ -30,9 +30,9 @@ export default function Globe({ property, cesiumIonAccessToken }: Props): JSX.El
30
30
  terrain: terrainProperty?.enabled,
31
31
  terrainType: terrainProperty?.type,
32
32
  normal: terrainProperty?.normal,
33
- ionAccessToken: property?.assets?.cesium?.terrian?.ionAccessToken || cesiumIonAccessToken,
34
- ionAsset: property?.assets?.cesium?.terrian?.ionAsset,
35
- ionUrl: property?.assets?.cesium?.terrian?.ionUrl,
33
+ ionAccessToken: property?.assets?.cesium?.terrain?.ionAccessToken || cesiumIonAccessToken,
34
+ ionAsset: property?.assets?.cesium?.terrain?.ionAsset,
35
+ ionUrl: property?.assets?.cesium?.terrain?.ionUrl,
36
36
  };
37
37
  const provider = opts.terrain ? terrainProviders[opts.terrainType || "cesium"] : undefined;
38
38
  return (typeof provider === "function" ? provider(opts) : provider) ?? defaultTerrainProvider;
@@ -40,9 +40,9 @@ export default function Globe({ property, cesiumIonAccessToken }: Props): JSX.El
40
40
  terrainProperty?.enabled,
41
41
  terrainProperty?.type,
42
42
  terrainProperty?.normal,
43
- property?.assets?.cesium?.terrian?.ionAccessToken,
44
- property?.assets?.cesium?.terrian?.ionAsset,
45
- property?.assets?.cesium?.terrian?.ionUrl,
43
+ property?.assets?.cesium?.terrain?.ionAccessToken,
44
+ property?.assets?.cesium?.terrain?.ionAsset,
45
+ property?.assets?.cesium?.terrain?.ionUrl,
46
46
  cesiumIonAccessToken,
47
47
  ]);
48
48
 
@@ -72,7 +72,7 @@ const terrainProviders: {
72
72
  [k in NonNullable<TerrainProperty["type"]>]:
73
73
  | TerrainProvider
74
74
  | ((
75
- opts: Pick<TerrainProperty, "normal"> & AssetsCesiumProperty["terrian"],
75
+ opts: Pick<TerrainProperty, "normal"> & AssetsCesiumProperty["terrain"],
76
76
  ) => Promise<TerrainProvider> | TerrainProvider | null);
77
77
  } = {
78
78
  cesium: ({ ionAccessToken, normal }) =>
@@ -84,21 +84,12 @@ export default ({
84
84
  initialCameraFlight.current = true;
85
85
  if (property?.camera?.limiter?.enabled && property?.camera?.limiter?.targetArea) {
86
86
  engineAPI.flyTo(property?.camera?.limiter?.targetArea, { duration: 0 });
87
- } else if (property?.camera?.camera) {
88
- const camera = property?.camera?.camera;
89
- engineAPI.flyTo(camera as Camera, { duration: 0 });
90
- }
91
- const camera = getCamera(cesium?.current?.cesiumElement);
92
- if (camera) {
93
- onCameraChange?.(camera);
87
+ } else if (camera) {
88
+ engineAPI.flyTo(camera, { duration: 0 });
94
89
  }
95
90
  },
96
- [engineAPI, property?.camera?.camera, property?.camera?.limiter?.enabled, onCameraChange],
97
- (prevDeps, nextDeps) =>
98
- prevDeps[0] === nextDeps[0] &&
99
- isEqual(prevDeps[1], nextDeps[1]) &&
100
- prevDeps[2] === nextDeps[2] &&
101
- prevDeps[3] === nextDeps[3],
91
+ [engineAPI, property?.camera?.limiter?.enabled],
92
+ (prevDeps, nextDeps) => prevDeps[0] === nextDeps[0] && prevDeps[1] === nextDeps[1],
102
93
  );
103
94
 
104
95
  const unmountCamera = useCallback(() => {
@@ -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
 
@@ -53,18 +53,18 @@ export default function useEngineRef(
53
53
  const cancelCameraFlight = useRef<() => void>();
54
54
  const mouseEventCallbacks = useRef<MouseEventCallbacks>({
55
55
  click: [],
56
- doubleclick: [],
57
- mousedown: [],
58
- mouseup: [],
59
- rightclick: [],
60
- rightdown: [],
61
- rightup: [],
62
- middleclick: [],
63
- middledown: [],
64
- middleup: [],
65
- mousemove: [],
66
- mouseenter: [],
67
- 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: [],
68
68
  wheel: [],
69
69
  });
70
70
  const tickEventCallback = useRef<TickEventCallback[]>([]);
@@ -237,6 +237,8 @@ export default function useEngineRef(
237
237
  setView: camera => {
238
238
  const viewer = cesium.current?.cesiumElement;
239
239
  if (!viewer || viewer.isDestroyed()) return false;
240
+ if (camera.lat === undefined || camera.lng === undefined || camera.height === undefined)
241
+ return false;
240
242
  const scene = viewer.scene;
241
243
  if (camera.lng || camera.lat || camera.height) {
242
244
  const xyz = Cesium.Cartesian3.fromDegrees(camera.lng, camera.lat, camera.height);
@@ -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);
@@ -133,7 +133,7 @@ const useTerrainHeatmap = ({
133
133
  minHeight: heatmapMinHeight,
134
134
  logarithmic: heatmapLogarithmic,
135
135
  colorLUT: heatmapColorLUT,
136
- } = terrain?.heightMap ?? {};
136
+ } = terrain?.elevationHeatMap ?? {};
137
137
 
138
138
  const isCustomHeatmapEnabled = useMemo(() => heatmapType === "custom", [heatmapType]);
139
139
 
@@ -143,7 +143,7 @@ const useTerrainHeatmap = ({
143
143
  [
144
144
  "#ifdef APPLY_COLOR_TO_ALPHA",
145
145
  "vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);",
146
- "colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);",
146
+ "colorDiff.r = czm_maximumComponent(colorDiff);",
147
147
  "alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);",
148
148
  "#endif",
149
149
  ],
@@ -412,18 +412,18 @@ export default ({
412
412
  wheel: CesiumMouseWheelEvent | undefined;
413
413
  } = {
414
414
  click: undefined,
415
- doubleclick: undefined,
416
- mousedown: undefined,
417
- mouseup: undefined,
418
- rightclick: undefined,
419
- rightdown: undefined,
420
- rightup: undefined,
421
- middleclick: undefined,
422
- middledown: undefined,
423
- middleup: undefined,
424
- mousemove: undefined,
425
- mouseenter: undefined,
426
- mouseleave: undefined,
415
+ doubleClick: undefined,
416
+ mouseDown: undefined,
417
+ mouseUp: undefined,
418
+ rightClick: undefined,
419
+ rightDown: undefined,
420
+ rightUp: undefined,
421
+ middleClick: undefined,
422
+ middleDown: undefined,
423
+ middleUp: undefined,
424
+ mouseMove: undefined,
425
+ mouseEnter: undefined,
426
+ mouseLeave: undefined,
427
427
  wheel: (delta: number) => {
428
428
  handleMouseWheel(delta);
429
429
  },
@@ -666,16 +666,15 @@ export default ({
666
666
  [selectionReason, engineAPI, onLayerEdit, onLayerVisibility, onLayerLoad, timelineManagerRef],
667
667
  );
668
668
 
669
- const globe = cesium.current?.cesiumElement?.scene.globe;
670
-
671
669
  useEffect(() => {
670
+ const globe = cesium.current?.cesiumElement?.scene.globe;
672
671
  if (globe) {
673
672
  const surface = (globe as any)._surface as CustomGlobeSurface;
674
673
  if (surface) {
675
674
  surface.tileProvider._debug.wireframe = property?.debug?.showGlobeWireframe ?? false;
676
675
  }
677
676
  }
678
- }, [globe, property?.debug?.showGlobeWireframe]);
677
+ }, [property?.debug?.showGlobeWireframe]);
679
678
 
680
679
  useEffect(() => {
681
680
  if (!time) return;
@@ -143,18 +143,18 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
143
143
  }}
144
144
  shadows={!!property?.scene?.shadow?.enabled}
145
145
  onClick={handleClick}
146
- onDoubleClick={mouseEventHandles.doubleclick}
147
- onMouseDown={mouseEventHandles.mousedown}
148
- onMouseUp={mouseEventHandles.mouseup}
149
- onRightClick={mouseEventHandles.rightclick}
150
- onRightDown={mouseEventHandles.rightdown}
151
- onRightUp={mouseEventHandles.rightup}
152
- onMiddleClick={mouseEventHandles.middleclick}
153
- onMiddleDown={mouseEventHandles.middledown}
154
- onMiddleUp={mouseEventHandles.middleup}
155
- onMouseMove={mouseEventHandles.mousemove}
156
- onMouseEnter={mouseEventHandles.mouseenter}
157
- onMouseLeave={mouseEventHandles.mouseleave}
146
+ onDoubleClick={mouseEventHandles.doubleClick}
147
+ onMouseDown={mouseEventHandles.mouseDown}
148
+ onMouseUp={mouseEventHandles.mouseUp}
149
+ onRightClick={mouseEventHandles.rightClick}
150
+ onRightDown={mouseEventHandles.rightDown}
151
+ onRightUp={mouseEventHandles.rightUp}
152
+ onMiddleClick={mouseEventHandles.middleClick}
153
+ onMiddleDown={mouseEventHandles.middleDown}
154
+ onMiddleUp={mouseEventHandles.middleUp}
155
+ onMouseMove={mouseEventHandles.mouseMove}
156
+ onMouseEnter={mouseEventHandles.mouseEnter}
157
+ onMouseLeave={mouseEventHandles.mouseLeave}
158
158
  onWheel={mouseEventHandles.wheel}>
159
159
  <Event onMount={handleMount} onUnmount={handleUnmount} />
160
160
  <Clock timelineManagerRef={timelineManagerRef} />