@reearth/core 0.0.7-alpha.6 → 0.0.7-alpha.61

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 (515) hide show
  1. package/LICENSE +177 -0
  2. package/dist/core.js +70991 -60887
  3. package/dist/core.umd.cjs +666 -680
  4. package/dist/{index-DqatWUTw.js → index-CUJ6HGQn.js} +1021 -908
  5. package/dist/index.d.ts +157 -71
  6. package/package.json +88 -74
  7. package/src/Map/ClusteredLayers/index.tsx +1 -1
  8. package/src/Map/Geoid/index.tsx +68 -0
  9. package/src/Map/Geoid/types.ts +8 -0
  10. package/src/Map/Layer/hooks.ts +7 -4
  11. package/src/Map/Layer/index.tsx +3 -1
  12. package/src/Map/Layers/hooks.ts +35 -8
  13. package/src/Map/Layers/index.tsx +13 -2
  14. package/src/Map/Layers/keys.ts +1 -0
  15. package/src/Map/Sketch/hooks.ts +454 -411
  16. package/src/Map/Sketch/index.tsx +68 -21
  17. package/src/Map/Sketch/sketchMachine.ts +427 -102
  18. package/src/Map/Sketch/sketchMachine.typegen.ts +58 -1
  19. package/src/Map/Sketch/types.ts +10 -20
  20. package/src/Map/Sketch/usePluginSketchLayer.ts +105 -0
  21. package/src/Map/Sketch/useSketch.ts +558 -0
  22. package/src/Map/Sketch/useSketchFeature.ts +198 -0
  23. package/src/Map/SpatialId/constants.ts +21 -0
  24. package/src/Map/SpatialId/hooks.ts +448 -0
  25. package/src/Map/SpatialId/index.tsx +63 -0
  26. package/src/Map/SpatialId/types.ts +68 -0
  27. package/src/Map/SpatialId/utils.ts +65 -0
  28. package/src/Map/hooks.ts +54 -8
  29. package/src/Map/index.tsx +42 -9
  30. package/src/Map/ref.ts +32 -3
  31. package/src/Map/types/index.ts +39 -3
  32. package/src/Map/types/viewerProperty.ts +10 -0
  33. package/src/Map/useTimelineManager.ts +4 -10
  34. package/src/Map/utils.ts +1 -1
  35. package/src/Visualizer/Error.tsx +4 -1
  36. package/src/Visualizer/context.tsx +5 -5
  37. package/src/Visualizer/coreContext.tsx +3 -1
  38. package/src/Visualizer/hooks.ts +56 -22
  39. package/src/Visualizer/index.stories.tsx +15 -0
  40. package/src/Visualizer/index.tsx +25 -6
  41. package/src/Visualizer/useViewport.ts +1 -1
  42. package/src/engines/Cesium/Feature/Box/hooks/box.ts +4 -4
  43. package/src/engines/Cesium/Feature/Box/hooks/edge.ts +1 -1
  44. package/src/engines/Cesium/Feature/Box/hooks/side.ts +1 -1
  45. package/src/engines/Cesium/Feature/Box/utils.ts +6 -0
  46. package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +0 -1
  47. package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +2 -0
  48. package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +0 -1
  49. package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +1 -1
  50. package/src/engines/Cesium/Feature/Marker/index.tsx +1 -1
  51. package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -2
  52. package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
  53. package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +2 -2
  54. package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +3 -1
  55. package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +0 -1
  56. package/src/engines/Cesium/Feature/Polygon/index.tsx +6 -4
  57. package/src/engines/Cesium/Feature/Raster/index.stories.tsx +0 -1
  58. package/src/engines/Cesium/Feature/Raster/mvt.ts +2 -1
  59. package/src/engines/Cesium/Feature/Resource/index.stories.tsx +0 -1
  60. package/src/engines/Cesium/Feature/Resource/index.tsx +1 -27
  61. package/src/engines/Cesium/Feature/Resource/utils.ts +86 -91
  62. package/src/engines/Cesium/Feature/Tileset/hooks.ts +136 -71
  63. package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +0 -1
  64. package/src/engines/Cesium/Feature/Tileset/index.tsx +1 -1
  65. package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +2 -2
  66. package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +2 -2
  67. package/src/engines/Cesium/Feature/context.ts +1 -0
  68. package/src/engines/Cesium/Feature/index.tsx +9 -5
  69. package/src/engines/Cesium/Feature/utils.tsx +20 -12
  70. package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +7 -4
  71. package/src/engines/Cesium/Sketch/ControlPoint.tsx +128 -24
  72. package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +70 -25
  73. package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +3 -1
  74. package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +14 -14
  75. package/src/engines/Cesium/Sketch/PolylineEntity.tsx +7 -4
  76. package/src/engines/Cesium/Sketch/SurfaceAddingPoints.tsx +60 -0
  77. package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +126 -35
  78. package/src/engines/Cesium/Sketch/constants.ts +5 -0
  79. package/src/engines/Cesium/Sketch/index.tsx +68 -29
  80. package/src/engines/Cesium/SpatialId/CoordinateIndicator.tsx +28 -0
  81. package/src/engines/Cesium/SpatialId/SpatialIdSpace.tsx +33 -0
  82. package/src/engines/Cesium/SpatialId/VerticalSpaceIndicator.tsx +32 -0
  83. package/src/engines/Cesium/SpatialId/index.ts +3 -0
  84. package/src/engines/Cesium/common.ts +55 -18
  85. package/src/engines/Cesium/core/Clock.tsx +1 -1
  86. package/src/engines/Cesium/core/Globe/index.tsx +73 -0
  87. package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +79 -0
  88. package/src/engines/Cesium/core/Imagery.test.ts +29 -11
  89. package/src/engines/Cesium/core/Imagery.tsx +22 -6
  90. package/src/engines/Cesium/core/Indicator/Indicator.tsx +2 -2
  91. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +13 -6
  92. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +2 -1
  93. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +3 -4
  94. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
  95. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +1 -1
  96. package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
  97. package/src/engines/Cesium/core/presets.ts +24 -28
  98. package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
  99. package/src/engines/Cesium/hooks/useCamera.ts +2 -2
  100. package/src/engines/Cesium/hooks/useCameraLimiter.ts +1 -1
  101. package/src/engines/Cesium/hooks/useEngineRef.ts +52 -5
  102. package/src/engines/Cesium/hooks/useExplicitRender.ts +2 -2
  103. package/src/engines/Cesium/hooks/useInstance.ts +1 -1
  104. package/src/engines/Cesium/hooks/useLayerDragDrop.ts +3 -3
  105. package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +2 -2
  106. package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +115 -67
  107. package/src/engines/Cesium/hooks/useViewerProperty.ts +1 -1
  108. package/src/engines/Cesium/hooks.ts +55 -14
  109. package/src/engines/Cesium/index.stories.tsx +0 -1
  110. package/src/engines/Cesium/index.tsx +20 -6
  111. package/src/engines/Cesium/pickMany.ts +2 -0
  112. package/src/engines/Cesium/types.ts +1 -1
  113. package/src/engines/Cesium/utils/mouse.ts +1 -1
  114. package/src/engines/Cesium/utils/utils.ts +1 -1
  115. package/src/mantle/atoms/compute.test.ts +4 -4
  116. package/src/mantle/atoms/compute.ts +8 -4
  117. package/src/mantle/compat/forward.ts +1 -1
  118. package/src/mantle/data/geojson.ts +53 -22
  119. package/src/mantle/data/georss.ts +2 -2
  120. package/src/mantle/data/gml.ts +2 -2
  121. package/src/mantle/data/gpx.ts +2 -2
  122. package/src/mantle/data/shapefile/parseZip.ts +1 -0
  123. package/src/mantle/evaluator/simple/expression/README.md +392 -0
  124. package/src/mantle/evaluator/simple/expression/expression.test.ts +137 -0
  125. package/src/mantle/evaluator/simple/expression/node.ts +10 -12
  126. package/src/mantle/evaluator/simple/expression/variableReplacer.test.ts +178 -0
  127. package/src/mantle/evaluator/simple/expression/variableReplacer.ts +24 -11
  128. package/src/mantle/types/appearance.ts +4 -2
  129. package/src/mantle/types/index.ts +3 -0
  130. package/src/{Visualizer → shared}/interactionMode.ts +3 -2
  131. package/src/test/setup.ts +1 -1
  132. package/src/test/utils.tsx +1 -1
  133. package/src/types/modules.d.ts +96 -0
  134. package/src/utils/StringMatcher.ts +1 -1
  135. package/src/utils/image.ts +2 -12
  136. package/src/utils/use-delayed-count.ts +1 -1
  137. package/src/utils/use-dnd/drop.ts +1 -1
  138. package/src/utils/util.ts +1 -1
  139. package/src/utils/value.ts +2 -2
  140. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
  141. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
  142. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
  143. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
  144. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
  145. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
  146. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
  147. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
  148. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
  149. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
  150. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
  151. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
  152. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
  153. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
  154. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
  155. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
  156. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
  157. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
  158. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
  159. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
  160. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
  161. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
  162. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
  163. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
  164. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
  165. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
  166. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
  167. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
  168. package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
  169. package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
  170. package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
  171. package/dist/cesium/Assets/Images/ion-credit.png +0 -0
  172. package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  173. package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  174. package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  175. package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  176. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  177. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  178. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  179. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  180. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  181. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  182. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  183. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  184. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  185. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  186. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  187. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  188. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  189. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  190. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  191. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  192. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  193. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  194. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  195. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  196. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  197. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  198. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  199. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  200. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  201. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  202. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  203. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  204. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  205. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  206. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  207. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  208. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  209. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  210. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  211. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  212. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  213. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  214. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  215. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  216. package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
  217. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  218. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  219. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  220. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  221. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  222. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  223. package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
  224. package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
  225. package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
  226. package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
  227. package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
  228. package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
  229. package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
  230. package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
  231. package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
  232. package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
  233. package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
  234. package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
  235. package/dist/cesium/Assets/Textures/maki/building.png +0 -0
  236. package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
  237. package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
  238. package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
  239. package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
  240. package/dist/cesium/Assets/Textures/maki/car.png +0 -0
  241. package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
  242. package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
  243. package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
  244. package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
  245. package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
  246. package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
  247. package/dist/cesium/Assets/Textures/maki/city.png +0 -0
  248. package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
  249. package/dist/cesium/Assets/Textures/maki/college.png +0 -0
  250. package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
  251. package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
  252. package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
  253. package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
  254. package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
  255. package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
  256. package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
  257. package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
  258. package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
  259. package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
  260. package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
  261. package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
  262. package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
  263. package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
  264. package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
  265. package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
  266. package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
  267. package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
  268. package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
  269. package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
  270. package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
  271. package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
  272. package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
  273. package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
  274. package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
  275. package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
  276. package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
  277. package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
  278. package/dist/cesium/Assets/Textures/maki/library.png +0 -0
  279. package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
  280. package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
  281. package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
  282. package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
  283. package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
  284. package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
  285. package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
  286. package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
  287. package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
  288. package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
  289. package/dist/cesium/Assets/Textures/maki/music.png +0 -0
  290. package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
  291. package/dist/cesium/Assets/Textures/maki/park.png +0 -0
  292. package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
  293. package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
  294. package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
  295. package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
  296. package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
  297. package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
  298. package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
  299. package/dist/cesium/Assets/Textures/maki/police.png +0 -0
  300. package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
  301. package/dist/cesium/Assets/Textures/maki/post.png +0 -0
  302. package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
  303. package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
  304. package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
  305. package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
  306. package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
  307. package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
  308. package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
  309. package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
  310. package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
  311. package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
  312. package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
  313. package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
  314. package/dist/cesium/Assets/Textures/maki/school.png +0 -0
  315. package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
  316. package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
  317. package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
  318. package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
  319. package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
  320. package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
  321. package/dist/cesium/Assets/Textures/maki/square.png +0 -0
  322. package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
  323. package/dist/cesium/Assets/Textures/maki/star.png +0 -0
  324. package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
  325. package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
  326. package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
  327. package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
  328. package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
  329. package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
  330. package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
  331. package/dist/cesium/Assets/Textures/maki/town.png +0 -0
  332. package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
  333. package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
  334. package/dist/cesium/Assets/Textures/maki/village.png +0 -0
  335. package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
  336. package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
  337. package/dist/cesium/Assets/Textures/maki/water.png +0 -0
  338. package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
  339. package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
  340. package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
  341. package/dist/cesium/Assets/Textures/pin.svg +0 -1
  342. package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
  343. package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
  344. package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
  345. package/dist/cesium/ThirdParty/Workers/package.json +0 -1
  346. package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
  347. package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
  348. package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
  349. package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  350. package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
  351. package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
  352. package/dist/cesium/Widgets/Animation/Animation.css +0 -127
  353. package/dist/cesium/Widgets/Animation/lighter.css +0 -70
  354. package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
  355. package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
  356. package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
  357. package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
  358. package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
  359. package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
  360. package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
  361. package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
  362. package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
  363. package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
  364. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  365. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  366. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  367. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  368. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  369. package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  370. package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  371. package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  372. package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  373. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  374. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  375. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  376. package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  377. package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  378. package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  379. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  380. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  381. package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  382. package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  383. package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
  384. package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
  385. package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
  386. package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
  387. package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
  388. package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
  389. package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
  390. package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
  391. package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
  392. package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  393. package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  394. package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
  395. package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
  396. package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
  397. package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
  398. package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
  399. package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
  400. package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
  401. package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
  402. package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
  403. package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
  404. package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
  405. package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
  406. package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
  407. package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
  408. package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
  409. package/dist/cesium/Widgets/lighter.css +0 -237
  410. package/dist/cesium/Widgets/lighterShared.css +0 -46
  411. package/dist/cesium/Widgets/shared.css +0 -103
  412. package/dist/cesium/Widgets/widgets.css +0 -1346
  413. package/dist/cesium/Workers/chunk-2YD5QWGR.js +0 -28
  414. package/dist/cesium/Workers/chunk-3T4KR75X.js +0 -26
  415. package/dist/cesium/Workers/chunk-46KFVW24.js +0 -26
  416. package/dist/cesium/Workers/chunk-4EI6PP43.js +0 -28
  417. package/dist/cesium/Workers/chunk-4RS52VIY.js +0 -26
  418. package/dist/cesium/Workers/chunk-4YLYA3DC.js +0 -26
  419. package/dist/cesium/Workers/chunk-5ENAGXBI.js +0 -26
  420. package/dist/cesium/Workers/chunk-5VIB3TI5.js +0 -26
  421. package/dist/cesium/Workers/chunk-6NGZLDFZ.js +0 -26
  422. package/dist/cesium/Workers/chunk-6RGNWVZ2.js +0 -27
  423. package/dist/cesium/Workers/chunk-7AZZVJ52.js +0 -26
  424. package/dist/cesium/Workers/chunk-AMXAQQEL.js +0 -26
  425. package/dist/cesium/Workers/chunk-AQW44ZPC.js +0 -26
  426. package/dist/cesium/Workers/chunk-CPCMDW6Z.js +0 -26
  427. package/dist/cesium/Workers/chunk-DNL2WDRL.js +0 -26
  428. package/dist/cesium/Workers/chunk-ERW7V247.js +0 -26
  429. package/dist/cesium/Workers/chunk-EYRIA4TP.js +0 -26
  430. package/dist/cesium/Workers/chunk-F7RQIJML.js +0 -26
  431. package/dist/cesium/Workers/chunk-FPZMU6QP.js +0 -26
  432. package/dist/cesium/Workers/chunk-FZDVQW7A.js +0 -26
  433. package/dist/cesium/Workers/chunk-GAZ2U4FO.js +0 -26
  434. package/dist/cesium/Workers/chunk-I44IOOT4.js +0 -26
  435. package/dist/cesium/Workers/chunk-IALXUAD4.js +0 -26
  436. package/dist/cesium/Workers/chunk-IXBUEUZL.js +0 -26
  437. package/dist/cesium/Workers/chunk-J3GCYV5K.js +0 -26
  438. package/dist/cesium/Workers/chunk-KGSZTFHZ.js +0 -26
  439. package/dist/cesium/Workers/chunk-KKKPU2CI.js +0 -26
  440. package/dist/cesium/Workers/chunk-KTEJE5KE.js +0 -26
  441. package/dist/cesium/Workers/chunk-KYZ3DYY6.js +0 -26
  442. package/dist/cesium/Workers/chunk-L2QG4MRI.js +0 -26
  443. package/dist/cesium/Workers/chunk-MCE3KFYN.js +0 -26
  444. package/dist/cesium/Workers/chunk-MMLDGXML.js +0 -26
  445. package/dist/cesium/Workers/chunk-MTBRPBDQ.js +0 -26
  446. package/dist/cesium/Workers/chunk-OKT6VBRK.js +0 -26
  447. package/dist/cesium/Workers/chunk-PHYDKLSY.js +0 -26
  448. package/dist/cesium/Workers/chunk-PWPX3224.js +0 -26
  449. package/dist/cesium/Workers/chunk-QHOVE6WG.js +0 -26
  450. package/dist/cesium/Workers/chunk-QJ6MBL22.js +0 -26
  451. package/dist/cesium/Workers/chunk-QKO6VIG2.js +0 -26
  452. package/dist/cesium/Workers/chunk-QVEE4QL2.js +0 -26
  453. package/dist/cesium/Workers/chunk-RXQOQZ7S.js +0 -26
  454. package/dist/cesium/Workers/chunk-S3ZKQKMM.js +0 -26
  455. package/dist/cesium/Workers/chunk-SFEUMZSK.js +0 -26
  456. package/dist/cesium/Workers/chunk-T75MW4X3.js +0 -26
  457. package/dist/cesium/Workers/chunk-TVO2A75R.js +0 -66
  458. package/dist/cesium/Workers/chunk-UHR36K45.js +0 -27
  459. package/dist/cesium/Workers/chunk-UKJCDZOR.js +0 -26
  460. package/dist/cesium/Workers/chunk-VKVIYER6.js +0 -26
  461. package/dist/cesium/Workers/chunk-VPIQWTRZ.js +0 -26
  462. package/dist/cesium/Workers/chunk-XSX5HRFC.js +0 -26
  463. package/dist/cesium/Workers/chunk-Z5WQQHSL.js +0 -26
  464. package/dist/cesium/Workers/chunk-Z7B2VEL5.js +0 -26
  465. package/dist/cesium/Workers/combineGeometry.js +0 -26
  466. package/dist/cesium/Workers/createBoxGeometry.js +0 -26
  467. package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
  468. package/dist/cesium/Workers/createCircleGeometry.js +0 -26
  469. package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
  470. package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
  471. package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
  472. package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
  473. package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
  474. package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
  475. package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
  476. package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
  477. package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
  478. package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
  479. package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
  480. package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
  481. package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
  482. package/dist/cesium/Workers/createGeometry.js +0 -26
  483. package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
  484. package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
  485. package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
  486. package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
  487. package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
  488. package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
  489. package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
  490. package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
  491. package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
  492. package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
  493. package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
  494. package/dist/cesium/Workers/createSphereGeometry.js +0 -26
  495. package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
  496. package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
  497. package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
  498. package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
  499. package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
  500. package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
  501. package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
  502. package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
  503. package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
  504. package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
  505. package/dist/cesium/Workers/createWallGeometry.js +0 -26
  506. package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
  507. package/dist/cesium/Workers/decodeDraco.js +0 -26
  508. package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
  509. package/dist/cesium/Workers/decodeI3S.js +0 -26
  510. package/dist/cesium/Workers/transcodeKTX2.js +0 -56
  511. package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
  512. package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
  513. package/src/engines/Cesium/core/Globe.tsx +0 -104
  514. /package/src/{Visualizer → shared}/featureFlags.ts +0 -0
  515. /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
@@ -0,0 +1,55 @@
1
+ import { Cartesian3, Entity, JulianDate, PolygonHierarchy } from "cesium";
2
+
3
+ import { Geometry } from "../../../mantle";
4
+
5
+ export function getMarkerCoordinates(
6
+ entity: Entity,
7
+ currentTime: JulianDate,
8
+ ): [number, number, number] {
9
+ const position = entity.position?.getValue(currentTime) as Cartesian3 | undefined;
10
+ return [position?.x ?? 0, position?.y ?? 0, position?.z ?? 0];
11
+ }
12
+
13
+ export function getGeometryFromEntity(currentTime: JulianDate, entity: Entity) {
14
+ if (entity.point || entity.billboard || entity.label) {
15
+ const coordinates = getMarkerCoordinates(entity, currentTime);
16
+
17
+ const geometry: Geometry = {
18
+ type: "Point",
19
+ coordinates,
20
+ };
21
+ return geometry;
22
+ }
23
+
24
+ if (entity.polyline) {
25
+ const positions = entity.polyline?.positions?.getValue(currentTime) as Cartesian3[];
26
+ const coordinates = positions?.map(position => [
27
+ position?.x ?? 0,
28
+ position?.y ?? 0,
29
+ position?.z ?? 0,
30
+ ]);
31
+
32
+ const geometry: Geometry = {
33
+ type: "LineString",
34
+ coordinates,
35
+ };
36
+ return geometry;
37
+ }
38
+
39
+ if (entity.polygon) {
40
+ const hierarchy = entity.polygon?.hierarchy?.getValue(currentTime) as PolygonHierarchy;
41
+ const coordinates = hierarchy?.positions?.map(position => [
42
+ position?.x ?? 0,
43
+ position?.y ?? 0,
44
+ position?.z ?? 0,
45
+ ]);
46
+
47
+ const geometry: Geometry = {
48
+ type: "Polygon",
49
+ coordinates: [coordinates],
50
+ };
51
+ return geometry;
52
+ }
53
+
54
+ return undefined;
55
+ }
@@ -7,7 +7,7 @@ import { useCustomCompareCallback } from "use-custom-compare";
7
7
 
8
8
  import { EngineRef, ViewerProperty } from "../..";
9
9
  import { Camera } from "../../../mantle";
10
- import { FEATURE_FLAGS } from "../../../Visualizer";
10
+ import { FEATURE_FLAGS } from "../../../shared/featureFlags";
11
11
  import { getCamera } from "../common";
12
12
 
13
13
  import { useCameraLimiter } from "./useCameraLimiter";
@@ -21,7 +21,7 @@ export default ({
21
21
  cameraForceHorizontalRoll = false,
22
22
  onCameraChange,
23
23
  }: {
24
- cesium: RefObject<CesiumComponentRef<Viewer>>;
24
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
25
25
  property?: ViewerProperty;
26
26
  engineAPI: EngineRef;
27
27
  featureFlags: number;
@@ -20,7 +20,7 @@ const targetWidth = 1000000;
20
20
  const targetLength = 1000000;
21
21
 
22
22
  export function useCameraLimiter(
23
- cesium: RefObject<CesiumComponentRef<CesiumViewer>>,
23
+ cesium: RefObject<CesiumComponentRef<CesiumViewer> | null>,
24
24
  camera: Camera | undefined,
25
25
  property: CameraLimiterProperty | undefined,
26
26
  ) {
@@ -32,8 +32,10 @@ import {
32
32
  cartesianToLatLngHeight,
33
33
  getExtrudedHeight,
34
34
  getOverriddenScreenSpaceCameraOptions,
35
+ getCredits,
35
36
  } from "../common";
36
37
  import { attachTag, getTag } from "../Feature";
38
+ import { getGeometryFromEntity } from "../helpers/getGeometryFromEntity";
37
39
  import { PickedFeature, pickManyFromViewportAsFeature } from "../pickMany";
38
40
  import { createGeometry } from "../Sketch/createGeometry";
39
41
  import { CursorType } from "../types";
@@ -48,9 +50,9 @@ import {
48
50
 
49
51
  export default function useEngineRef(
50
52
  ref: Ref<EngineRef>,
51
- cesium: RefObject<CesiumComponentRef<Cesium.Viewer>>,
53
+ cesium: RefObject<CesiumComponentRef<Cesium.Viewer> | null>,
52
54
  ): EngineRef {
53
- const cancelCameraFlight = useRef<() => void>();
55
+ const cancelCameraFlight = useRef<() => void>(undefined);
54
56
  const mouseEventCallbacks = useRef<MouseEventCallbacks>({
55
57
  click: [],
56
58
  doubleClick: [],
@@ -107,7 +109,8 @@ export default function useEngineRef(
107
109
  if (
108
110
  calcViewSize &&
109
111
  cartesian &&
110
- viewer.scene.camera.frustum instanceof Cesium.PerspectiveFrustum
112
+ viewer.scene.camera.frustum instanceof Cesium.PerspectiveFrustum &&
113
+ viewer.scene.camera.frustum.fov !== undefined
111
114
  ) {
112
115
  const distance = Cesium.Cartesian3.distance(viewer.scene.camera.positionWC, cartesian);
113
116
  viewSize = distance * Math.tan(viewer.scene.camera.frustum.fov / 2);
@@ -169,10 +172,11 @@ export default function useEngineRef(
169
172
  toWindowPosition: (position: [x: number, y: number, z: number]) => {
170
173
  const viewer = cesium.current?.cesiumElement;
171
174
  if (!viewer || viewer.isDestroyed()) return;
172
- const result = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
175
+ const result = Cesium.SceneTransforms.worldToWindowCoordinates(
173
176
  viewer.scene,
174
177
  Cesium.Cartesian3.fromElements(...position),
175
178
  );
179
+ if (!result) return;
176
180
  return [result.x, result.y];
177
181
  },
178
182
  // Calculate next positino from screen(window) offset.
@@ -259,15 +263,31 @@ export default function useEngineRef(
259
263
  }
260
264
  return;
261
265
  },
262
- getExtrudedHeight: (position, windowPosition) => {
266
+ getExtrudedHeight: (position, windowPosition, allowNegative) => {
263
267
  const viewer = cesium.current?.cesiumElement;
264
268
  if (!viewer || viewer.isDestroyed()) return;
265
269
  return getExtrudedHeight(
266
270
  viewer.scene,
267
271
  new Cesium.Cartesian3(position[0], position[1], position[2]),
268
272
  new Cesium.Cartesian2(windowPosition[0], windowPosition[1]),
273
+ allowNegative,
269
274
  );
270
275
  },
276
+ getExtrudedPoint: (position, extrudedHeight) => {
277
+ if (!position || !extrudedHeight) return;
278
+ const viewer = cesium.current?.cesiumElement;
279
+ if (!viewer || viewer.isDestroyed()) return;
280
+ const point = new Cesium.Cartesian3(position[0], position[1], position[2]);
281
+ const cartesianScratch = new Cesium.Cartesian3();
282
+ const normal = viewer.scene?.globe.ellipsoid.geodeticSurfaceNormal(point, cartesianScratch);
283
+ if (!normal) return;
284
+ const extrudedPoint = Cesium.Cartesian3.add(
285
+ point,
286
+ Cesium.Cartesian3.multiplyByScalar(normal, extrudedHeight, cartesianScratch),
287
+ cartesianScratch,
288
+ );
289
+ return [extrudedPoint.x, extrudedPoint.y, extrudedPoint.z];
290
+ },
271
291
  getSurfaceDistance: (point1, point2) => {
272
292
  const viewer = cesium.current?.cesiumElement;
273
293
  if (!viewer || viewer.isDestroyed()) return;
@@ -831,6 +851,7 @@ export default function useEngineRef(
831
851
  tag.computedFeature ?? {
832
852
  type: "computedFeature",
833
853
  id: tag.featureId,
854
+ geometry: getGeometryFromEntity(viewer.clock.currentTime, entity),
834
855
  properties: convertEntityProperties(viewer.clock.currentTime, entity),
835
856
  metaData: {
836
857
  description: convertEntityDescription(viewer.clock.currentTime, entity),
@@ -938,6 +959,32 @@ export default function useEngineRef(
938
959
  tickEventCallback.current = tickEventCallback.current.filter(c => c !== cb) || [];
939
960
  },
940
961
  tickEventCallback,
962
+ calcRectangleControlPoint: (p1: Position3d, p2: Position3d, p3: Position3d) => {
963
+ const pp1 = new Cesium.Cartesian3(...p1);
964
+ const pp2 = new Cesium.Cartesian3(...p2);
965
+ const pp3 = new Cesium.Cartesian3(...p3);
966
+ const cartesianScratch1 = new Cesium.Cartesian3();
967
+ const cartesianScratch2 = new Cesium.Cartesian3();
968
+ const projection = Cesium.Cartesian3.projectVector(
969
+ Cesium.Cartesian3.subtract(pp3, pp1, cartesianScratch1),
970
+ Cesium.Cartesian3.subtract(pp2, pp1, cartesianScratch2),
971
+ cartesianScratch1,
972
+ );
973
+ const offset = Cesium.Cartesian3.subtract(
974
+ pp3,
975
+ Cesium.Cartesian3.add(pp1, projection, cartesianScratch1),
976
+ cartesianScratch2,
977
+ );
978
+ const pp4 = Cesium.Cartesian3.midpoint(pp1, pp2, cartesianScratch1);
979
+ const pp5 = Cesium.Cartesian3.add(pp4, offset, cartesianScratch2);
980
+ const p5 = [pp5.x, pp5.y, pp5.z] as Position3d;
981
+ return [p1, p2, p5];
982
+ },
983
+ getCredits: () => {
984
+ const viewer = cesium.current?.cesiumElement;
985
+ if (!viewer || viewer.isDestroyed()) return;
986
+ return getCredits(viewer);
987
+ },
941
988
  };
942
989
  }, [cesium]);
943
990
 
@@ -12,7 +12,7 @@ export default ({
12
12
  shouldRender,
13
13
  property,
14
14
  }: {
15
- cesium: RefObject<CesiumComponentRef<Viewer>>;
15
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
16
16
  requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
17
17
  isLayerDragging?: boolean;
18
18
  shouldRender?: boolean;
@@ -28,7 +28,7 @@ export default ({
28
28
  }
29
29
  }, [cesium, requestingRenderMode]);
30
30
 
31
- const explicitRenderRef = useRef<() => void>();
31
+ const explicitRenderRef = useRef<() => void>(undefined);
32
32
 
33
33
  useEffect(() => {
34
34
  explicitRenderRef.current = explicitRender;
@@ -70,7 +70,7 @@ export function useInstance<T, Keys extends unknown[], Owner>(
70
70
  descriptor: InstanceDescriptor<T, () => DisallowPromise<T>, Keys, Owner>,
71
71
  ): T {
72
72
  const [state, setState] = useState<T>();
73
- const ref = useRef<T>();
73
+ const ref = useRef<T>(undefined);
74
74
  if (ref.current == null) {
75
75
  ref.current = descriptor.create();
76
76
  }
@@ -1,5 +1,5 @@
1
1
  import { Cartesian3, Entity, Viewer } from "cesium";
2
- import CesiumDnD, { Context } from "cesium-dnd";
2
+ import CesiumDnD, { type Context } from "cesium-dnd";
3
3
  import { RefObject, useCallback, useEffect, useRef } from "react";
4
4
  import { CesiumComponentRef } from "resium";
5
5
 
@@ -14,7 +14,7 @@ export default ({
14
14
  onLayerDrag,
15
15
  onLayerDrop,
16
16
  }: {
17
- cesium: RefObject<CesiumComponentRef<Viewer>>;
17
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
18
18
  isLayerDraggable?: boolean;
19
19
  onLayerDrag?: (layerId: string, featureId: string | undefined, position: LatLng) => void;
20
20
  onLayerDrop?: (
@@ -54,7 +54,7 @@ export default ({
54
54
  [cesium, onLayerDrop],
55
55
  );
56
56
 
57
- const cesiumDnD = useRef<CesiumDnD>();
57
+ const cesiumDnD = useRef<Context>(undefined);
58
58
  useEffect(() => {
59
59
  const viewer = cesium.current?.cesiumElement;
60
60
  if (!viewer || viewer.isDestroyed()) return;
@@ -9,7 +9,7 @@ import {
9
9
  LayerSelectWithRectMove,
10
10
  LayerSelectWithRectStart,
11
11
  } from "../../../Map";
12
- import { INTERACTION_MODES } from "../../../Visualizer/interactionMode";
12
+ import { INTERACTION_MODES } from "../../../shared/interactionMode";
13
13
  import { makeMouseEventProps } from "../utils/mouse";
14
14
 
15
15
  export const useLayerSelectWithRect = ({
@@ -20,7 +20,7 @@ export const useLayerSelectWithRect = ({
20
20
  onLayerSelectWithRectMove,
21
21
  onLayerSelectWithRectEnd,
22
22
  }: {
23
- cesium: RefObject<CesiumComponentRef<Viewer>>;
23
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
24
24
  engineAPI: EngineRef;
25
25
  featureFlags: number;
26
26
  onLayerSelectWithRectStart?: (e: LayerSelectWithRectStart) => void;
@@ -41,28 +41,36 @@ const defaultMatcher = new StringMatcher()
41
41
  initialColor = u_initialColor;
42
42
  #endif
43
43
  vec4 color = computeDayColor(initialColor`,
44
- )
45
- .erase([
46
- "#ifdef APPLY_MATERIAL",
47
- "czm_materialInput materialInput;",
48
- "materialInput.st = v_textureCoordinates.st;",
49
- "materialInput.normalEC = normalize(v_normalEC);",
50
- "materialInput.positionToEyeEC = -v_positionEC;",
51
- "materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));",
52
- "materialInput.slope = v_slope;",
53
- "materialInput.height = v_height;",
54
- "materialInput.aspect = v_aspect;",
55
- "czm_material material = czm_getMaterial(materialInput);",
56
- "vec4 materialColor = vec4(material.diffuse, material.alpha);",
57
- "color = alphaBlend(materialColor, color);",
58
- "#endif",
59
- ]);
44
+ );
45
+ // Note: Commented out erase() call as it's not needed for Cesium 1.118.x
46
+ // The replace() above already handles the material code modification
47
+ // .erase([
48
+ // "#ifdef APPLY_MATERIAL",
49
+ // "czm_materialInput materialInput;",
50
+ // "materialInput.st = v_textureCoordinates.st;",
51
+ // "materialInput.normalEC = normalize(v_normalEC);",
52
+ // "materialInput.positionToEyeEC = -v_positionEC;",
53
+ // "materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));",
54
+ // "materialInput.slope = v_slope;",
55
+ // "materialInput.height = v_height;",
56
+ // "materialInput.aspect = v_aspect;",
57
+ // "czm_material material = czm_getMaterial(materialInput);",
58
+ // "vec4 materialColor = vec4(material.diffuse, material.alpha);",
59
+ // "color = alphaBlend(materialColor, color);",
60
+ // "#endif",
61
+ // ]);
60
62
 
61
63
  function makeGlobeShadersDirty(globe: Globe): void {
62
64
  // Invoke the internal makeShadersDirty() by setting a material to globe to
63
65
  // reset surface shader source to the initial state (assuming that we never
64
66
  // use custom material on globe).
65
67
  // ref: https://github.com/CesiumGS/cesium/blob/1.106/packages/engine/Source/Scene/Globe.js#L562-L572
68
+
69
+ // Safety check: ensure globe's internal properties exist before manipulation
70
+ if (!globe || globe.isDestroyed() || !(globe as any)._surface) {
71
+ return;
72
+ }
73
+
66
74
  const material = globe.material;
67
75
  if (material == null) {
68
76
  globe.material = Material.fromType("Color");
@@ -73,6 +81,18 @@ function makeGlobeShadersDirty(globe: Globe): void {
73
81
  }
74
82
  }
75
83
 
84
+ function withUniforms(globe: PrivateCesiumGlobe, add?: Record<string, () => any>) {
85
+ if (!globe._surface?._tileProvider) return;
86
+ const mm = (globe._surface._tileProvider as any)?.materialUniformMap ?? {};
87
+ (globe._surface._tileProvider as any).materialUniformMap = { ...mm, ...(add ?? {}) };
88
+ }
89
+
90
+ function removeUniforms(globe: PrivateCesiumGlobe, keys: string[]) {
91
+ const tp = globe._surface?._tileProvider as any;
92
+ if (!tp?.materialUniformMap) return;
93
+ for (const k of keys) delete tp.materialUniformMap[k];
94
+ }
95
+
76
96
  const useIBL = ({
77
97
  sphericalHarmonicCoefficients,
78
98
  globeImageBasedLighting,
@@ -124,7 +144,7 @@ const useTerrainHeatmap = ({
124
144
  cesium,
125
145
  terrain,
126
146
  }: {
127
- cesium: RefObject<CesiumComponentRef<Viewer>>;
147
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
128
148
  terrain: TerrainProperty | undefined;
129
149
  }) => {
130
150
  const {
@@ -184,6 +204,18 @@ const useTerrainHeatmap = ({
184
204
  return { isCustomHeatmapEnabled, shaderForTerrainHeatmap };
185
205
  };
186
206
 
207
+ async function waitTerrainReady(scene: any) {
208
+ const t = scene.terrain;
209
+ if (t?.ready) return;
210
+ await new Promise<void>(resolve => {
211
+ if (!t) return resolve();
212
+ const off = t.readyEvent.addEventListener(() => {
213
+ off();
214
+ resolve();
215
+ });
216
+ });
217
+ }
218
+
187
219
  export const useOverrideGlobeShader = ({
188
220
  cesium,
189
221
  sphericalHarmonicCoefficients,
@@ -193,7 +225,7 @@ export const useOverrideGlobeShader = ({
193
225
  enableLighting,
194
226
  terrain,
195
227
  }: {
196
- cesium: RefObject<CesiumComponentRef<Viewer>>;
228
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
197
229
  sphericalHarmonicCoefficients?: Cartesian3[];
198
230
  globeShadowDarkness?: number;
199
231
  globeImageBasedLighting?: boolean;
@@ -201,6 +233,8 @@ export const useOverrideGlobeShader = ({
201
233
  enableLighting?: boolean;
202
234
  terrain: TerrainProperty | undefined;
203
235
  }) => {
236
+ const applyingRef = useRef(false);
237
+
204
238
  const { uniformMapForIBL, isIBLEnabled, shaderForIBL } = useIBL({
205
239
  sphericalHarmonicCoefficients,
206
240
  globeImageBasedLighting,
@@ -223,75 +257,85 @@ export const useOverrideGlobeShader = ({
223
257
 
224
258
  const needUpdateGlobeRef = useRef(false);
225
259
 
226
- const handleGlobeShader = useCallback(() => {
260
+ const handleGlobeShader = useCallback(async () => {
227
261
  // NOTE: Support the spherical harmonic coefficient only when the terrain normal is enabled.
228
262
  // Because it's difficult to control the shader for the entire globe.
229
263
  // ref: https://github.com/CesiumGS/cesium/blob/af4e2bebbef25259f049b05822adf2958fce11ff/packages/engine/Source/Shaders/GlobeFS.glsl#L408
230
264
  if (!cesium.current?.cesiumElement || !needUpdateGlobeRef.current) return;
231
265
 
232
- const globe = cesium.current.cesiumElement.scene.globe as PrivateCesiumGlobe;
266
+ if (applyingRef.current) return;
267
+ applyingRef.current = true;
233
268
 
234
- const surfaceShaderSet = globe._surfaceShaderSet;
235
- if (!surfaceShaderSet) {
236
- if (import.meta.env.DEV) {
237
- throw new Error("`globe._surfaceShaderSet` could not found");
238
- }
239
- return;
240
- }
269
+ try {
270
+ const { scene } = cesium.current.cesiumElement;
271
+ await waitTerrainReady(scene);
241
272
 
242
- const baseFragmentShaderSource = surfaceShaderSet.baseFragmentShaderSource;
273
+ const globe = cesium.current.cesiumElement.scene.globe as PrivateCesiumGlobe;
243
274
 
244
- const GlobeFS = baseFragmentShaderSource?.sources[baseFragmentShaderSource.sources.length - 1];
275
+ // Reset shaders first so we patch the freshest base
276
+ makeGlobeShadersDirty(globe);
245
277
 
246
- if (!GlobeFS || !baseFragmentShaderSource) {
247
- if (import.meta.env.DEV) {
248
- throw new Error("GlobeFS could not find.");
278
+ const surfaceShaderSet = globe._surfaceShaderSet;
279
+ if (!surfaceShaderSet) {
280
+ if (import.meta.env.DEV) {
281
+ throw new Error("`globe._surfaceShaderSet` could not found");
282
+ }
283
+ return;
249
284
  }
250
- return;
251
- }
252
285
 
253
- const matchers: StringMatcher[] = [];
254
- const shaders: string[] = [];
255
- if (isIBLEnabled && globe.enableLighting && globe.terrainProvider.hasVertexNormals) {
256
- matchers.push(shaderForIBL);
257
- shaders.push(IBLFS);
258
- }
286
+ const baseFragmentShaderSource = surfaceShaderSet.baseFragmentShaderSource;
287
+ const GlobeFS =
288
+ baseFragmentShaderSource?.sources[baseFragmentShaderSource.sources.length - 1];
259
289
 
260
- if (isCustomHeatmapEnabled) {
261
- // This will log the variables needed in the shader below.
262
- // we need the minHeight, maxHeight and logarithmic
263
- matchers.push(shaderForTerrainHeatmap);
264
- shaders.push(HeatmapForTerrainFS);
265
- }
290
+ if (!GlobeFS || !baseFragmentShaderSource) {
291
+ if (import.meta.env.DEV) {
292
+ throw new Error("GlobeFS could not find.");
293
+ }
294
+ return;
295
+ }
266
296
 
267
- // This means there is no overridden shader.
268
- if (!matchers.length) return;
297
+ const matchers: StringMatcher[] = [];
298
+ const shaders: string[] = [];
299
+ const terrainHasNormals = !!(globe.terrainProvider as any)?.hasVertexNormals;
269
300
 
270
- needUpdateGlobeRef.current = false;
301
+ if (isIBLEnabled && globe.enableLighting && terrainHasNormals) {
302
+ matchers.push(shaderForIBL);
303
+ shaders.push(IBLFS);
304
+ }
271
305
 
272
- if (!globe?._surface?._tileProvider) {
273
- if (import.meta.env.DEV) {
274
- throw new Error("`globe._surface._tileProvider.materialUniformMap` could not found");
306
+ if (isCustomHeatmapEnabled && terrainHasNormals) {
307
+ // This will log the variables needed in the shader below.
308
+ // we need the minHeight, maxHeight and logarithmic
309
+ matchers.push(shaderForTerrainHeatmap);
310
+ shaders.push(HeatmapForTerrainFS);
275
311
  }
276
- return;
277
- }
278
312
 
279
- makeGlobeShadersDirty(globe);
313
+ // This means there is no overridden shader.
314
+ if (!matchers.length) return;
280
315
 
281
- const replacedGlobeFS = defaultMatcher.concat(...matchers).execute(GlobeFS);
316
+ needUpdateGlobeRef.current = false;
282
317
 
283
- globe._surface._tileProvider.materialUniformMap = {
284
- ...(globe._surface._tileProvider.materialUniformMap ?? {}),
285
- ...uniformMapForIBL,
286
- };
318
+ if (!globe?._surface?._tileProvider) {
319
+ if (import.meta.env.DEV) {
320
+ throw new Error("`globe._surface._tileProvider.materialUniformMap` could not found");
321
+ }
322
+ return;
323
+ }
287
324
 
288
- surfaceShaderSet.baseFragmentShaderSource = new ShaderSource({
289
- sources: [
290
- ...baseFragmentShaderSource.sources.slice(0, -1),
291
- GlobeFSDefinitions + replacedGlobeFS + shaders.join(""),
292
- ],
293
- defines: baseFragmentShaderSource.defines,
294
- });
325
+ const replacedGlobeFS = defaultMatcher.concat(...matchers).execute(GlobeFS);
326
+
327
+ withUniforms(globe, isIBLEnabled ? uniformMapForIBL : undefined);
328
+
329
+ surfaceShaderSet.baseFragmentShaderSource = new ShaderSource({
330
+ sources: [
331
+ ...baseFragmentShaderSource.sources.slice(0, -1),
332
+ GlobeFSDefinitions + replacedGlobeFS + shaders.join(""),
333
+ ],
334
+ defines: baseFragmentShaderSource.defines,
335
+ });
336
+ } finally {
337
+ applyingRef.current = false;
338
+ }
295
339
  }, [
296
340
  cesium,
297
341
  isCustomHeatmapEnabled,
@@ -317,6 +361,10 @@ export const useOverrideGlobeShader = ({
317
361
 
318
362
  return () => {
319
363
  if (!globe.isDestroyed()) {
364
+ removeUniforms(globe, [
365
+ "u_reearth_sphericalHarmonicCoefficients",
366
+ "u_reearth_globeImageBasedLighting",
367
+ ]);
320
368
  // Reset customized shader to default
321
369
  makeGlobeShadersDirty(globe);
322
370
  }
@@ -9,7 +9,7 @@ export default ({
9
9
  cesium,
10
10
  property,
11
11
  }: {
12
- cesium: RefObject<CesiumComponentRef<Viewer>>;
12
+ cesium: RefObject<CesiumComponentRef<Viewer> | null>;
13
13
  property?: ViewerProperty;
14
14
  }) => {
15
15
  const sceneLight = useMemo(() => {