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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/dist/core.js +32683 -32711
  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 +1 -0
  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
@@ -1,4 +1,3 @@
1
- window.CESIUM_BASE_URL = "/cesium/";
2
1
  var oe = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], M = [], Qt = typeof Uint8Array < "u" ? Uint8Array : Array, je = !1;
3
2
  function at() {
4
3
  je = !0;
package/dist/index.d.ts CHANGED
@@ -54,7 +54,7 @@ declare type Array_2 = any[];
54
54
  export { Array_2 as Array }
55
55
 
56
56
  export declare type AssetsCesiumProperty = {
57
- terrian?: {
57
+ terrain?: {
58
58
  ionAccessToken?: string;
59
59
  ionAsset?: string;
60
60
  ionUrl?: string;
@@ -137,25 +137,24 @@ export declare type CameraOptions = {
137
137
  /** Represents the camera position and state */
138
138
  export declare type CameraPosition = {
139
139
  /** degrees */
140
- lat: number;
140
+ lat?: number;
141
141
  /** degrees */
142
- lng: number;
142
+ lng?: number;
143
143
  /** meters */
144
- height: number;
144
+ height?: number;
145
145
  /** radians */
146
- heading: number;
146
+ heading?: number;
147
147
  /** radians */
148
- pitch: number;
148
+ pitch?: number;
149
149
  /** radians */
150
- roll: number;
150
+ roll?: number;
151
151
  /** Field of view expressed in radians */
152
- fov: number;
152
+ fov?: number;
153
153
  /** Aspect ratio of frustum */
154
154
  aspectRatio?: number;
155
155
  };
156
156
 
157
157
  export declare type CameraProperty = {
158
- camera?: Camera;
159
158
  allowEnterGround?: boolean;
160
159
  limiter?: CameraLimiterProperty;
161
160
  };
@@ -422,6 +421,14 @@ export declare type DefaultInfobox = {
422
421
  };
423
422
  };
424
423
 
424
+ export declare type ElevationHeatMapProperty = {
425
+ type?: "custom";
426
+ colorLUT?: LUT;
427
+ minHeight?: number;
428
+ maxHeight?: number;
429
+ logarithmic?: boolean;
430
+ };
431
+
425
432
  export declare type EllipseAppearance = {
426
433
  show?: boolean;
427
434
  heightReference?: "none" | "clamp" | "relative";
@@ -513,7 +520,7 @@ export declare type EngineRef = {
513
520
  getLocationFromScreen: (x: number, y: number, withTerrain?: boolean) => LatLngHeight | undefined;
514
521
  sampleTerrainHeight: (lng: number, lat: number) => Promise<number | undefined>;
515
522
  computeGlobeHeight: (lng: number, lat: number, height?: number) => number | undefined;
516
- getGlobeHeight: () => void;
523
+ getGlobeHeight: () => number | undefined;
517
524
  toXYZ: (lng: number, lat: number, height: number, options?: {
518
525
  useGlobeEllipsoid?: boolean;
519
526
  }) => [x: number, y: number, z: number] | undefined;
@@ -797,14 +804,6 @@ export declare type HeatMapAppearance = {
797
804
  logarithmic?: boolean;
798
805
  };
799
806
 
800
- export declare type HeightMapProperty = {
801
- type?: "custom";
802
- colorLUT?: LUT;
803
- minHeight?: number;
804
- maxHeight?: number;
805
- logarithmic?: boolean;
806
- };
807
-
808
807
  export declare type ImageBasedLighting = {
809
808
  enabled?: boolean;
810
809
  intensity?: number;
@@ -955,6 +954,7 @@ export declare type LayersRef = {
955
954
  }) | null) => void;
956
955
  deleteLayer: (...ids: string[]) => void;
957
956
  isLayer: (obj: any) => obj is LazyLayer;
957
+ isComputedLayer: (obj: any) => obj is ComputedLayer;
958
958
  layers: () => LazyLayer[];
959
959
  walk: <T>(fn: (layer: LazyLayer, index: number, parents: LazyLayer[]) => T | void) => T | undefined;
960
960
  find: (fn: (layer: LazyLayer, index: number, parents: LazyLayer[]) => boolean) => LazyLayer | undefined;
@@ -1177,18 +1177,18 @@ export declare type MouseEventCallbacks = {
1177
1177
 
1178
1178
  export declare type MouseEventHandles = {
1179
1179
  onClick: (fn: MouseEvents["click"]) => void;
1180
- onDoubleClick: (fn: MouseEvents["doubleclick"]) => void;
1181
- onMouseDown: (fn: MouseEvents["mousedown"]) => void;
1182
- onMouseUp: (fn: MouseEvents["mouseup"]) => void;
1183
- onRightClick: (fn: MouseEvents["rightclick"]) => void;
1184
- onRightDown: (fn: MouseEvents["rightdown"]) => void;
1185
- onRightUp: (fn: MouseEvents["rightup"]) => void;
1186
- onMiddleClick: (fn: MouseEvents["middleclick"]) => void;
1187
- onMiddleDown: (fn: MouseEvents["middledown"]) => void;
1188
- onMiddleUp: (fn: MouseEvents["middleup"]) => void;
1189
- onMouseMove: (fn: MouseEvents["mousemove"]) => void;
1190
- onMouseEnter: (fn: MouseEvents["mouseenter"]) => void;
1191
- onMouseLeave: (fn: MouseEvents["mouseleave"]) => void;
1180
+ onDoubleClick: (fn: MouseEvents["doubleClick"]) => void;
1181
+ onMouseDown: (fn: MouseEvents["mouseDown"]) => void;
1182
+ onMouseUp: (fn: MouseEvents["mouseUp"]) => void;
1183
+ onRightClick: (fn: MouseEvents["rightClick"]) => void;
1184
+ onRightDown: (fn: MouseEvents["rightDown"]) => void;
1185
+ onRightUp: (fn: MouseEvents["rightUp"]) => void;
1186
+ onMiddleClick: (fn: MouseEvents["middleClick"]) => void;
1187
+ onMiddleDown: (fn: MouseEvents["middleDown"]) => void;
1188
+ onMiddleUp: (fn: MouseEvents["middleUp"]) => void;
1189
+ onMouseMove: (fn: MouseEvents["mouseMove"]) => void;
1190
+ onMouseEnter: (fn: MouseEvents["mouseEnter"]) => void;
1191
+ onMouseLeave: (fn: MouseEvents["mouseLeave"]) => void;
1192
1192
  onWheel: (fn: MouseEvents["wheel"]) => void;
1193
1193
  };
1194
1194
 
@@ -1208,7 +1208,7 @@ export declare type MouseEvents = {
1208
1208
  wheel: MouseWheelEventCallback;
1209
1209
  };
1210
1210
 
1211
- export declare type MouseEventTypes = "click" | "doubleclick" | "mousedown" | "mouseup" | "rightclick" | "rightdown" | "rightup" | "middleclick" | "middledown" | "middleup" | "mousemove" | "mouseenter" | "mouseleave" | "wheel";
1211
+ export declare type MouseEventTypes = "click" | "doubleClick" | "mouseDown" | "mouseUp" | "rightClick" | "rightDown" | "rightUp" | "middleClick" | "middleDown" | "middleUp" | "mouseMove" | "mouseEnter" | "mouseLeave" | "wheel";
1212
1212
 
1213
1213
  export declare type MouseWheelEventCallback = (props: MouseEventProps) => void;
1214
1214
 
@@ -1485,6 +1485,16 @@ export declare type SketchFeature = Feature_2<Polygon_2 | MultiPolygon | Point |
1485
1485
  extrudedHeight: number;
1486
1486
  }>;
1487
1487
 
1488
+ export declare type SketchOptions = {
1489
+ color?: string;
1490
+ appearance?: SketchAppearance;
1491
+ dataOnly?: boolean;
1492
+ disableShadow?: boolean;
1493
+ enableRelativeHeight?: boolean;
1494
+ rightClickToAbort?: boolean;
1495
+ autoResetInteractionMode?: boolean;
1496
+ };
1497
+
1488
1498
  export declare type SketchProps = {
1489
1499
  layersRef: RefObject<LayersRef>;
1490
1500
  engineRef: RefObject<EngineRef>;
@@ -1499,14 +1509,10 @@ export declare type SketchProps = {
1499
1509
  };
1500
1510
 
1501
1511
  export declare type SketchRef = {
1512
+ getType: () => SketchType | undefined;
1502
1513
  setType: (type: SketchType | undefined, from?: "editor" | "plugin") => void;
1503
- setColor: (color: string) => void;
1504
- setDefaultAppearance: (appearance: SketchAppearance) => void;
1505
- disableShadow: (disable: boolean) => void;
1506
- enableRelativeHeight: (enable: boolean) => void;
1507
- createDataOnly: (dataOnly: boolean) => void;
1508
- allowRightClickToAbort: (allow: boolean) => void;
1509
- allowAutoResetInteractionMode: (allow: boolean) => void;
1514
+ getOptions: () => SketchOptions;
1515
+ overrideOptions: (options: SketchOptions) => void;
1510
1516
  };
1511
1517
 
1512
1518
  export declare type SketchType = "marker" | "polyline" | "circle" | "rectangle" | "polygon" | "extrudedCircle" | "extrudedRectangle" | "extrudedPolygon";
@@ -1554,7 +1560,7 @@ export declare type TerrainProperty = {
1554
1560
  type?: "cesium" | "arcgis" | "cesiumion";
1555
1561
  url?: string;
1556
1562
  normal?: boolean;
1557
- heightMap?: HeightMapProperty;
1563
+ elevationHeatMap?: ElevationHeatMapProperty;
1558
1564
  };
1559
1565
 
1560
1566
  export declare type TickEvent = (cb: TickEventCallback) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.1",
3
+ "version": "0.0.7-alpha.10",
4
4
  "author": "Re:Earth contributors <community@reearth.io>",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A library that abstracts a map engine as one common API.",
@@ -27,9 +27,9 @@
27
27
  "node": ">=20"
28
28
  },
29
29
  "peerDependencies": {
30
+ "cesium": "1.118.x",
30
31
  "react": "^18.2.0",
31
- "react-dom": "^18.2.0",
32
- "cesium": "1.x"
32
+ "react-dom": "^18.2.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "@reearth/cesium-mvt-imagery-provider": "1.5.4",
@@ -61,7 +61,7 @@
61
61
  "react-error-boundary": "4.0.11",
62
62
  "react-nl2br": "1.0.4",
63
63
  "react-use": "17.5.0",
64
- "resium": "1.17.4",
64
+ "resium": "1.18.1",
65
65
  "suspend-react": "0.1.3",
66
66
  "tiny-invariant": "1.3.3",
67
67
  "use-callback-ref": "1.3.2",
@@ -89,13 +89,13 @@
89
89
  "@types/lodash-es": "4.17.12",
90
90
  "@types/node": "20.12.7",
91
91
  "@types/pbf": "3.0.5",
92
- "@types/react": "18.2.6",
93
- "@types/react-dom": "18.2.6",
92
+ "@types/react": "18.3.0",
93
+ "@types/react-dom": "18.3.0",
94
94
  "@types/uuid": "9.0.8",
95
95
  "@typescript-eslint/eslint-plugin": "7.2.0",
96
96
  "@typescript-eslint/parser": "7.2.0",
97
97
  "@vitejs/plugin-react": "4.2.1",
98
- "cesium": "1.116.0",
98
+ "cesium": "1.118.0",
99
99
  "eslint": "8.57.0",
100
100
  "eslint-config-reearth": "0.3.0",
101
101
  "eslint-plugin-react-hooks": "4.6.0",
@@ -108,7 +108,7 @@
108
108
  "storybook": "8.0.8",
109
109
  "typescript": "5.2.2",
110
110
  "vite": "5.0.8",
111
- "vite-plugin-cesium": "1.2.22",
111
+ "vite-plugin-cesium": "1.2.23",
112
112
  "vite-plugin-dts": "3.8.1",
113
113
  "vite-plugin-svgr": "4.2.0",
114
114
  "vite-tsconfig-paths": "^4.3.2",
@@ -52,6 +52,7 @@ export type Ref = {
52
52
  override: (id: string, layer?: (Partial<Layer> & { property?: any }) | null) => void;
53
53
  deleteLayer: (...ids: string[]) => void;
54
54
  isLayer: (obj: any) => obj is LazyLayer;
55
+ isComputedLayer: (obj: any) => obj is ComputedLayer;
55
56
  layers: () => LazyLayer[];
56
57
  walk: <T>(
57
58
  fn: (layer: LazyLayer, index: number, parents: LazyLayer[]) => T | void,
@@ -455,6 +456,13 @@ export default function useHooks({
455
456
  [lazyLayerPrototype],
456
457
  );
457
458
 
459
+ const isComputedLayer = useCallback(
460
+ (obj: any): obj is ComputedLayer => {
461
+ return typeof obj === "object" && Object.getPrototypeOf(obj) === lazyComputedLayerPrototype;
462
+ },
463
+ [lazyComputedLayerPrototype],
464
+ );
465
+
458
466
  const rootLayers = useCallback(() => {
459
467
  return [...(layersRef() ?? []), ...tempLayersRef.current]
460
468
  .map(l => findById(l.id))
@@ -551,6 +559,7 @@ export default function useHooks({
551
559
  deleteLayer,
552
560
  findByIds,
553
561
  isLayer,
562
+ isComputedLayer,
554
563
  layers: rootLayers,
555
564
  walk,
556
565
  find,
@@ -575,6 +584,7 @@ export default function useHooks({
575
584
  deleteLayer,
576
585
  findByIds,
577
586
  isLayer,
587
+ isComputedLayer,
578
588
  rootLayers,
579
589
  walk,
580
590
  find,
@@ -24,15 +24,16 @@ import {
24
24
  MouseEventProps,
25
25
  SketchRef,
26
26
  } from "../types";
27
+ import { useGet } from "../utils";
27
28
 
28
- import { PRESET_APPEARANCE } from "./preset";
29
+ import { PRESET_APPEARANCE, PRESET_COLOR } from "./preset";
29
30
  import { Position3d, createSketchMachine } from "./sketchMachine";
30
31
  import {
31
32
  GeometryOptionsXYZ,
32
33
  SketchType,
33
34
  SketchFeature,
34
- SketchAppearance,
35
35
  SketchEventProps,
36
+ SketchOptions,
36
37
  } from "./types";
37
38
  import { useWindowEvent } from "./utils";
38
39
 
@@ -73,16 +74,25 @@ export default function useHooks({
73
74
  const [state, send] = useMachine(sketchMachine);
74
75
  const [type, updateType] = useState<SketchType | undefined>();
75
76
  const [from, updateFrom] = useState<"editor" | "plugin">("editor");
76
- const [color, updateColor] = useState<string>();
77
- const [disableShadow, updateDisableShadow] = useState(false);
78
- const [enableRelativeHeight, updateEnableRelativeHeight] = useState(false);
79
77
  const [disableInteraction, setDisableInteraction] = useState(false);
80
- const [defaultAppearance, updateDefaultAppearance] = useState<SketchAppearance | undefined>(
81
- PRESET_APPEARANCE,
82
- );
83
- const createDataOnlyForPluginEnabledRef = useRef(false);
84
- const allowRightClickToAbortEnabledRef = useRef(true);
85
- const allowAutoResetInteractionModeRef = useRef(true);
78
+
79
+ const [sketchOptions, setSketchOptions] = useState<SketchOptions>({
80
+ color: PRESET_COLOR,
81
+ appearance: PRESET_APPEARANCE,
82
+ dataOnly: false,
83
+ disableShadow: false,
84
+ enableRelativeHeight: false,
85
+ rightClickToAbort: true,
86
+ autoResetInteractionMode: true,
87
+ });
88
+
89
+ const overrideOptions = useCallback((options: SketchOptions) => {
90
+ setSketchOptions(prev => ({
91
+ ...prev,
92
+ ...options,
93
+ appearance: merge(cloneDeep(prev.appearance), options.appearance),
94
+ }));
95
+ }, []);
86
96
 
87
97
  const [geometryOptions, setGeometryOptions] = useState<GeometryOptionsXYZ | null>(null);
88
98
  const [extrudedHeight, setExtrudedHeight] = useState(0);
@@ -94,34 +104,6 @@ export default function useHooks({
94
104
  updateFrom(from ?? "editor");
95
105
  }, []);
96
106
 
97
- const setColor = useCallback((color: string) => {
98
- updateColor(color);
99
- }, []);
100
-
101
- const setDisableShadow = useCallback((disable: boolean) => {
102
- updateDisableShadow(!!disable);
103
- }, []);
104
-
105
- const setEnableRelativeHeight = useCallback((enable: boolean) => {
106
- updateEnableRelativeHeight(!!enable);
107
- }, []);
108
-
109
- const setDefaultAppearance = useCallback((appearance: SketchAppearance) => {
110
- updateDefaultAppearance(merge(cloneDeep(PRESET_APPEARANCE), appearance));
111
- }, []);
112
-
113
- const createDataOnly = useCallback((dataOnly: boolean) => {
114
- createDataOnlyForPluginEnabledRef.current = !!dataOnly;
115
- }, []);
116
-
117
- const allowRightClickToAbort = useCallback((allow: boolean) => {
118
- allowRightClickToAbortEnabledRef.current = !!allow;
119
- }, []);
120
-
121
- const allowAutoResetInteractionMode = useCallback((allow: boolean) => {
122
- allowAutoResetInteractionModeRef.current = !!allow;
123
- }, []);
124
-
125
107
  const createFeature = useCallback(() => {
126
108
  const geoOptions = type === "marker" ? markerGeometryRef.current : geometryOptions;
127
109
  if (geoOptions == null) {
@@ -169,11 +151,11 @@ export default function useHooks({
169
151
  features: [{ ...feature, id: feature.properties.id }],
170
152
  },
171
153
  },
172
- ...defaultAppearance,
154
+ ...sketchOptions.appearance,
173
155
  });
174
156
  return { layerId: newLayer?.id, featureId: feature.properties.id };
175
157
  },
176
- [layersRef, defaultAppearance],
158
+ [layersRef, sketchOptions.appearance],
177
159
  );
178
160
 
179
161
  const pluginSketchLayerFeatureAdd = useCallback(
@@ -220,13 +202,16 @@ export default function useHooks({
220
202
 
221
203
  const handleFeatureCreate = useCallback(
222
204
  (feature: SketchFeature) => {
223
- updateType(undefined);
205
+ if (sketchOptions.autoResetInteractionMode) {
206
+ updateType(undefined);
207
+ }
208
+
224
209
  if (from === "editor") {
225
210
  onSketchFeatureCreate?.(feature);
226
211
  return;
227
212
  }
228
213
 
229
- if (!createDataOnlyForPluginEnabledRef.current) {
214
+ if (!sketchOptions.dataOnly) {
230
215
  const selectedLayer = layersRef.current?.selectedLayer();
231
216
  const { layerId, featureId } =
232
217
  selectedLayer?.id?.length !== PLUGIN_LAYER_ID_LENGTH ||
@@ -262,6 +247,8 @@ export default function useHooks({
262
247
  [
263
248
  layersRef,
264
249
  from,
250
+ sketchOptions.dataOnly,
251
+ sketchOptions.autoResetInteractionMode,
265
252
  pluginSketchLayerCreate,
266
253
  pluginSketchLayerFeatureAdd,
267
254
  onSketchFeatureCreate,
@@ -481,7 +468,7 @@ export default function useHooks({
481
468
  );
482
469
 
483
470
  const handleRightClick = useCallback(() => {
484
- if (!allowRightClickToAbortEnabledRef.current) {
471
+ if (!sketchOptions.rightClickToAbort) {
485
472
  return;
486
473
  }
487
474
  if (type !== undefined) {
@@ -490,7 +477,7 @@ export default function useHooks({
490
477
  if (state.matches("idle")) return;
491
478
  send({ type: "ABORT" });
492
479
  updateGeometryOptions(undefined);
493
- }, [type, state, send, updateGeometryOptions]);
480
+ }, [type, state, sketchOptions.rightClickToAbort, send, updateGeometryOptions]);
494
481
 
495
482
  const mouseDownEventRef = useRef<MouseEventCallback>(handleLeftDown);
496
483
  mouseDownEventRef.current = handleLeftDown;
@@ -583,47 +570,40 @@ export default function useHooks({
583
570
  }
584
571
  }, [type, send, updateGeometryOptions]);
585
572
 
573
+ const fromRef = useRef(from);
574
+ fromRef.current = from;
575
+ const overrideInteractionModeRef = useRef(overrideInteractionMode);
576
+ overrideInteractionModeRef.current = overrideInteractionMode;
577
+ const onSketchTypeChangeRef = useRef(onSketchTypeChange);
578
+ onSketchTypeChangeRef.current = onSketchTypeChange;
579
+
586
580
  useEffect(() => {
587
- if (type) {
588
- overrideInteractionMode?.("sketch");
589
- } else if (allowAutoResetInteractionModeRef.current) {
590
- overrideInteractionMode?.("default");
591
- }
581
+ overrideInteractionModeRef.current?.(type ? "sketch" : "default");
582
+ onSketchTypeChangeRef.current?.(type, fromRef.current);
583
+ }, [type]);
592
584
 
593
- onSketchTypeChange?.(type, from);
594
- }, [type, from, overrideInteractionMode, onSketchTypeChange]);
585
+ // API
586
+ const getType = useGet(type);
587
+ const getOptions = useGet(sketchOptions);
595
588
 
596
589
  useImperativeHandle(
597
590
  ref,
598
591
  () => ({
592
+ getType,
599
593
  setType,
600
- setColor,
601
- setDefaultAppearance,
602
- createDataOnly,
603
- disableShadow: setDisableShadow,
604
- enableRelativeHeight: setEnableRelativeHeight,
605
- allowRightClickToAbort,
606
- allowAutoResetInteractionMode,
594
+ getOptions,
595
+ overrideOptions,
607
596
  }),
608
- [
609
- setType,
610
- setColor,
611
- setDisableShadow,
612
- setEnableRelativeHeight,
613
- setDefaultAppearance,
614
- createDataOnly,
615
- allowRightClickToAbort,
616
- allowAutoResetInteractionMode,
617
- ],
597
+ [getType, setType, getOptions, overrideOptions],
618
598
  );
619
599
 
620
600
  return {
621
601
  state,
622
602
  extrudedHeight,
623
603
  geometryOptions,
624
- color,
625
- disableShadow,
626
- enableRelativeHeight,
604
+ color: sketchOptions.color,
605
+ disableShadow: sketchOptions.disableShadow,
606
+ enableRelativeHeight: sketchOptions.enableRelativeHeight,
627
607
  } as any;
628
608
  }
629
609
 
@@ -1,38 +1,16 @@
1
1
  // Reference: Sketch feature is basically referenced from https://github.com/takram-design-engineering/plateau-view/blob/main/libs/sketch/src/SketchTool.tsx
2
2
 
3
- import { type LineString, type MultiPolygon, type Polygon } from "geojson";
4
- import { ComponentType, ForwardRefRenderFunction, RefObject, forwardRef } from "react";
5
- import { RequireExactlyOne } from "type-fest";
3
+ import { ForwardRefRenderFunction, RefObject, forwardRef } from "react";
6
4
 
7
5
  import { ComputedLayer, SelectedFeatureInfo } from "../../mantle";
8
- import { Position3d } from "../../types";
9
6
  import { InteractionModeType } from "../../Visualizer/interactionMode";
10
7
  import { EngineRef, Feature, LayerSelectionReason, LayersRef, SketchRef } from "../types";
11
8
 
12
9
  import useHooks from "./hooks";
13
- import { SketchEventProps, SketchFeature, SketchType } from "./types";
10
+ import { SketchComponentType, SketchEventProps, SketchFeature, SketchType } from "./types";
14
11
 
15
12
  export * from "./types";
16
13
 
17
- export type SketchComponentType = ComponentType<SketchComponentProps>;
18
-
19
- type GeometryOptions = {
20
- type: SketchType;
21
- controlPoints: readonly Position3d[];
22
- };
23
-
24
- type SketchComponentProps = RequireExactlyOne<
25
- {
26
- geometry?: LineString | Polygon | MultiPolygon | null;
27
- geometryOptions?: GeometryOptions | null;
28
- extrudedHeight?: number;
29
- disableShadow?: boolean;
30
- enableRelativeHeight?: boolean;
31
- color?: string;
32
- },
33
- "geometry" | "geometryOptions"
34
- >;
35
-
36
14
  export type OnLayerSelectType = (
37
15
  layerId: string | undefined,
38
16
  featureId: string | undefined,
@@ -27,3 +27,5 @@ export const PRESET_APPEARANCE: SketchAppearance = {
27
27
  strokeWidth: 2,
28
28
  },
29
29
  };
30
+
31
+ export const PRESET_COLOR: string = "#FFFFFF";
@@ -1,8 +1,29 @@
1
1
  import { Feature as GeojsonFeature, MultiPolygon, Polygon, Point, LineString } from "geojson";
2
+ import { ComponentType } from "react";
3
+ import { RequireExactlyOne } from "type-fest";
2
4
 
3
5
  import { LayerAppearanceTypes } from "../../mantle";
4
6
  import { Position3d } from "../../types";
5
7
 
8
+ type GeometryOptions = {
9
+ type: SketchType;
10
+ controlPoints: readonly Position3d[];
11
+ };
12
+
13
+ type SketchComponentProps = RequireExactlyOne<
14
+ {
15
+ geometry?: LineString | Polygon | MultiPolygon | null;
16
+ geometryOptions?: GeometryOptions | null;
17
+ extrudedHeight?: number;
18
+ disableShadow?: boolean;
19
+ enableRelativeHeight?: boolean;
20
+ color?: string;
21
+ },
22
+ "geometry" | "geometryOptions"
23
+ >;
24
+
25
+ export type SketchComponentType = ComponentType<SketchComponentProps>;
26
+
6
27
  export type SketchType =
7
28
  | "marker"
8
29
  | "polyline"
@@ -13,6 +34,16 @@ export type SketchType =
13
34
  | "extrudedRectangle"
14
35
  | "extrudedPolygon";
15
36
 
37
+ export type SketchOptions = {
38
+ color?: string;
39
+ appearance?: SketchAppearance;
40
+ dataOnly?: boolean;
41
+ disableShadow?: boolean;
42
+ enableRelativeHeight?: boolean;
43
+ rightClickToAbort?: boolean;
44
+ autoResetInteractionMode?: boolean;
45
+ };
46
+
16
47
  export type GeometryOptionsXYZ = {
17
48
  type: SketchType;
18
49
  controlPoints: Position3d[];
package/src/Map/ref.ts CHANGED
@@ -103,6 +103,7 @@ const layersRefKeys: FunctionKeys<LayersRef> = {
103
103
  findByTags: 1,
104
104
  hide: 1,
105
105
  isLayer: 1,
106
+ isComputedLayer: 1,
106
107
  layers: 1,
107
108
  override: 1,
108
109
  replace: 1,
@@ -117,14 +118,10 @@ const layersRefKeys: FunctionKeys<LayersRef> = {
117
118
  };
118
119
 
119
120
  const sketchRefKeys: FunctionKeys<SketchRef> = {
121
+ getType: 1,
120
122
  setType: 1,
121
- setColor: 1,
122
- setDefaultAppearance: 1,
123
- createDataOnly: 1,
124
- disableShadow: 1,
125
- enableRelativeHeight: 1,
126
- allowRightClickToAbort: 1,
127
- allowAutoResetInteractionMode: 1,
123
+ getOptions: 1,
124
+ overrideOptions: 1,
128
125
  };
129
126
 
130
127
  export function mapRef({