@vcmap/core 6.2.4 → 6.3.0-rc.2

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 (378) hide show
  1. package/dist/cesium.d.ts +12 -0
  2. package/dist/index.d.ts +13 -3
  3. package/dist/index.js +11 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/ol.d.ts +13 -2
  6. package/dist/src/category/category.d.ts +1 -1
  7. package/dist/src/category/category.js +3 -4
  8. package/dist/src/category/category.js.map +1 -1
  9. package/dist/src/cesium/cesium3DTileFeature.d.ts +1 -0
  10. package/dist/src/cesium/cesium3DTileFeature.js +14 -3
  11. package/dist/src/cesium/cesium3DTileFeature.js.map +1 -1
  12. package/dist/src/cesium/cesium3DTilePointFeature.js +2 -1
  13. package/dist/src/cesium/cesium3DTilePointFeature.js.map +1 -1
  14. package/dist/src/classRegistry.d.ts +7 -1
  15. package/dist/src/classRegistry.js.map +1 -1
  16. package/dist/src/featureProvider/abstractAttributeProvider.d.ts +62 -0
  17. package/dist/src/featureProvider/abstractAttributeProvider.js +129 -0
  18. package/dist/src/featureProvider/abstractAttributeProvider.js.map +1 -0
  19. package/dist/src/featureProvider/abstractFeatureProvider.d.ts +10 -19
  20. package/dist/src/featureProvider/abstractFeatureProvider.js +10 -42
  21. package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
  22. package/dist/src/featureProvider/compositeFeatureProvider.d.ts +27 -0
  23. package/dist/src/featureProvider/compositeFeatureProvider.js +53 -0
  24. package/dist/src/featureProvider/compositeFeatureProvider.js.map +1 -0
  25. package/dist/src/featureProvider/csvAttributeProvider.d.ts +41 -0
  26. package/dist/src/featureProvider/csvAttributeProvider.js +126 -0
  27. package/dist/src/featureProvider/csvAttributeProvider.js.map +1 -0
  28. package/dist/src/featureProvider/featureProviderFactory.d.ts +3 -0
  29. package/dist/src/featureProvider/featureProviderFactory.js +17 -0
  30. package/dist/src/featureProvider/featureProviderFactory.js.map +1 -0
  31. package/dist/src/featureProvider/i3sAttributeProvider.d.ts +7 -0
  32. package/dist/src/featureProvider/i3sAttributeProvider.js +43 -0
  33. package/dist/src/featureProvider/i3sAttributeProvider.js.map +1 -0
  34. package/dist/src/featureProvider/jsonAttributeProvider.d.ts +26 -0
  35. package/dist/src/featureProvider/jsonAttributeProvider.js +73 -0
  36. package/dist/src/featureProvider/jsonAttributeProvider.js.map +1 -0
  37. package/dist/src/featureProvider/tileProviderFeatureProvider.d.ts +4 -6
  38. package/dist/src/featureProvider/tileProviderFeatureProvider.js +9 -11
  39. package/dist/src/featureProvider/tileProviderFeatureProvider.js.map +1 -1
  40. package/dist/src/featureProvider/urlIdAttributeProvider.d.ts +28 -0
  41. package/dist/src/featureProvider/urlIdAttributeProvider.js +50 -0
  42. package/dist/src/featureProvider/urlIdAttributeProvider.js.map +1 -0
  43. package/dist/src/featureProvider/wmsFeatureProvider.d.ts +13 -4
  44. package/dist/src/featureProvider/wmsFeatureProvider.js +19 -9
  45. package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
  46. package/dist/src/interaction/coordinateAtPixel.js +4 -6
  47. package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
  48. package/dist/src/interaction/ensurePositionInteraction.d.ts +14 -0
  49. package/dist/src/interaction/ensurePositionInteraction.js +42 -0
  50. package/dist/src/interaction/ensurePositionInteraction.js.map +1 -0
  51. package/dist/src/interaction/eventHandler.d.ts +3 -0
  52. package/dist/src/interaction/eventHandler.js +10 -1
  53. package/dist/src/interaction/eventHandler.js.map +1 -1
  54. package/dist/src/interaction/featureAtPixelInteraction.d.ts +15 -3
  55. package/dist/src/interaction/featureAtPixelInteraction.js +70 -18
  56. package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
  57. package/dist/src/interaction/featureProviderInteraction.js +42 -26
  58. package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
  59. package/dist/src/interaction/panoramaImageSelection.js +2 -2
  60. package/dist/src/interaction/panoramaImageSelection.js.map +1 -1
  61. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +17 -9
  62. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js +244 -165
  63. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
  64. package/dist/src/layer/cesium/i3sCesiumImpl.d.ts +33 -0
  65. package/dist/src/layer/cesium/i3sCesiumImpl.js +107 -0
  66. package/dist/src/layer/cesium/i3sCesiumImpl.js.map +1 -0
  67. package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +3 -3
  68. package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
  69. package/dist/src/layer/cesium/terrainCesiumImpl.d.ts +3 -3
  70. package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
  71. package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js +2 -1
  72. package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js.map +1 -1
  73. package/dist/src/layer/cesium/vectorContext.js +1 -1
  74. package/dist/src/layer/cesium/vectorContext.js.map +1 -1
  75. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +7 -6
  76. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
  77. package/dist/src/layer/cesium/vectorTileImageryProvider.js +2 -2
  78. package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
  79. package/dist/src/layer/cesiumTilesetLayer.d.ts +10 -1
  80. package/dist/src/layer/cesiumTilesetLayer.js +33 -8
  81. package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
  82. package/dist/src/layer/cogLayer.d.ts +1 -1
  83. package/dist/src/layer/cogLayer.js +3 -4
  84. package/dist/src/layer/cogLayer.js.map +1 -1
  85. package/dist/src/layer/czmlLayer.d.ts +1 -1
  86. package/dist/src/layer/czmlLayer.js +4 -4
  87. package/dist/src/layer/czmlLayer.js.map +1 -1
  88. package/dist/src/layer/featureLayer.d.ts +1 -6
  89. package/dist/src/layer/featureLayer.js +3 -10
  90. package/dist/src/layer/featureLayer.js.map +1 -1
  91. package/dist/src/layer/featureStoreLayer.d.ts +3 -2
  92. package/dist/src/layer/featureStoreLayer.js +5 -5
  93. package/dist/src/layer/featureStoreLayer.js.map +1 -1
  94. package/dist/src/layer/flatGeobufLayer.d.ts +2 -0
  95. package/dist/src/layer/flatGeobufLayer.js +8 -0
  96. package/dist/src/layer/flatGeobufLayer.js.map +1 -1
  97. package/dist/src/layer/geojsonLayer.d.ts +1 -1
  98. package/dist/src/layer/geojsonLayer.js +5 -12
  99. package/dist/src/layer/geojsonLayer.js.map +1 -1
  100. package/dist/src/layer/i3sLayer.d.ts +80 -0
  101. package/dist/src/layer/i3sLayer.js +242 -0
  102. package/dist/src/layer/i3sLayer.js.map +1 -0
  103. package/dist/src/layer/layer.d.ts +29 -10
  104. package/dist/src/layer/layer.js +114 -34
  105. package/dist/src/layer/layer.js.map +1 -1
  106. package/dist/src/layer/layerSymbols.d.ts +4 -0
  107. package/dist/src/layer/layerSymbols.js +4 -0
  108. package/dist/src/layer/layerSymbols.js.map +1 -1
  109. package/dist/src/layer/openStreetMapLayer.d.ts +1 -1
  110. package/dist/src/layer/openStreetMapLayer.js +11 -6
  111. package/dist/src/layer/openStreetMapLayer.js.map +1 -1
  112. package/dist/src/layer/panorama/vectorPanoramaImpl.d.ts +38 -0
  113. package/dist/src/layer/panorama/vectorPanoramaImpl.js +164 -0
  114. package/dist/src/layer/panorama/vectorPanoramaImpl.js.map +1 -0
  115. package/dist/src/layer/panoramaDatasetLayer.d.ts +7 -3
  116. package/dist/src/layer/panoramaDatasetLayer.js +46 -20
  117. package/dist/src/layer/panoramaDatasetLayer.js.map +1 -1
  118. package/dist/src/layer/pointCloudLayer.d.ts +1 -5
  119. package/dist/src/layer/pointCloudLayer.js +3 -15
  120. package/dist/src/layer/pointCloudLayer.js.map +1 -1
  121. package/dist/src/layer/rasterLayer.d.ts +1 -1
  122. package/dist/src/layer/rasterLayer.js +4 -4
  123. package/dist/src/layer/rasterLayer.js.map +1 -1
  124. package/dist/src/layer/singleImageLayer.d.ts +1 -1
  125. package/dist/src/layer/singleImageLayer.js +3 -3
  126. package/dist/src/layer/singleImageLayer.js.map +1 -1
  127. package/dist/src/layer/terrainLayer.d.ts +1 -1
  128. package/dist/src/layer/terrainLayer.js +8 -6
  129. package/dist/src/layer/terrainLayer.js.map +1 -1
  130. package/dist/src/layer/tileProvider/flatGeobufTileProvider.d.ts +1 -1
  131. package/dist/src/layer/tileProvider/flatGeobufTileProvider.js +7 -5
  132. package/dist/src/layer/tileProvider/flatGeobufTileProvider.js.map +1 -1
  133. package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
  134. package/dist/src/layer/tileProvider/mvtTileProvider.js +6 -5
  135. package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
  136. package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +1 -1
  137. package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +3 -3
  138. package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -1
  139. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
  140. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +7 -4
  141. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
  142. package/dist/src/layer/tileProvider/tileProvider.d.ts +7 -1
  143. package/dist/src/layer/tileProvider/tileProvider.js +15 -5
  144. package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
  145. package/dist/src/layer/tileProvider/urlTemplateTileProvider.d.ts +1 -1
  146. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js +3 -3
  147. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
  148. package/dist/src/layer/tmsLayer.d.ts +1 -1
  149. package/dist/src/layer/tmsLayer.js +3 -10
  150. package/dist/src/layer/tmsLayer.js.map +1 -1
  151. package/dist/src/layer/vectorLayer.d.ts +11 -5
  152. package/dist/src/layer/vectorLayer.js +21 -10
  153. package/dist/src/layer/vectorLayer.js.map +1 -1
  154. package/dist/src/layer/vectorProperties.js +10 -1
  155. package/dist/src/layer/vectorProperties.js.map +1 -1
  156. package/dist/src/layer/vectorTileLayer.d.ts +14 -5
  157. package/dist/src/layer/vectorTileLayer.js +82 -31
  158. package/dist/src/layer/vectorTileLayer.js.map +1 -1
  159. package/dist/src/layer/wfsLayer.d.ts +1 -1
  160. package/dist/src/layer/wfsLayer.js +5 -4
  161. package/dist/src/layer/wfsLayer.js.map +1 -1
  162. package/dist/src/layer/wmsLayer.d.ts +4 -1
  163. package/dist/src/layer/wmsLayer.js +65 -36
  164. package/dist/src/layer/wmsLayer.js.map +1 -1
  165. package/dist/src/layer/wmtsLayer.d.ts +1 -1
  166. package/dist/src/layer/wmtsLayer.js +3 -10
  167. package/dist/src/layer/wmtsLayer.js.map +1 -1
  168. package/dist/src/map/baseCesiumMap.d.ts +69 -0
  169. package/dist/src/map/baseCesiumMap.js +393 -0
  170. package/dist/src/map/baseCesiumMap.js.map +1 -0
  171. package/dist/src/map/cesiumMap.d.ts +6 -98
  172. package/dist/src/map/cesiumMap.js +29 -266
  173. package/dist/src/map/cesiumMap.js.map +1 -1
  174. package/dist/src/map/obliqueMap.d.ts +1 -1
  175. package/dist/src/map/obliqueMap.js +14 -8
  176. package/dist/src/map/obliqueMap.js.map +1 -1
  177. package/dist/src/map/openlayersMap.d.ts +1 -1
  178. package/dist/src/map/openlayersMap.js +3 -4
  179. package/dist/src/map/openlayersMap.js.map +1 -1
  180. package/dist/src/map/panoramaMap.d.ts +17 -29
  181. package/dist/src/map/panoramaMap.js +56 -100
  182. package/dist/src/map/panoramaMap.js.map +1 -1
  183. package/dist/src/map/vcsMap.d.ts +15 -2
  184. package/dist/src/map/vcsMap.js +26 -3
  185. package/dist/src/map/vcsMap.js.map +1 -1
  186. package/dist/src/oblique/obliqueCollection.d.ts +1 -1
  187. package/dist/src/oblique/obliqueCollection.js +3 -4
  188. package/dist/src/oblique/obliqueCollection.js.map +1 -1
  189. package/dist/src/panorama/panoramaCameraController.d.ts +4 -0
  190. package/dist/src/panorama/panoramaCameraController.js +8 -0
  191. package/dist/src/panorama/panoramaCameraController.js.map +1 -1
  192. package/dist/src/panorama/panoramaImage.d.ts +10 -1
  193. package/dist/src/panorama/panoramaImage.js +15 -9
  194. package/dist/src/panorama/panoramaImage.js.map +1 -1
  195. package/dist/src/panorama/panoramaImageView.d.ts +6 -1
  196. package/dist/src/panorama/panoramaImageView.js +11 -2
  197. package/dist/src/panorama/panoramaImageView.js.map +1 -1
  198. package/dist/src/panorama/panoramaTileMaterial.d.ts +6 -0
  199. package/dist/src/panorama/panoramaTileMaterial.js +14 -0
  200. package/dist/src/panorama/panoramaTileMaterial.js.map +1 -1
  201. package/dist/src/panorama/panoramaTileMaterialFS.shader.d.ts +1 -1
  202. package/dist/src/panorama/panoramaTileMaterialFS.shader.js +16 -1
  203. package/dist/src/panorama/panoramaTileMaterialFS.shader.js.map +1 -1
  204. package/dist/src/panorama/panoramaTilePrimitiveCollection.d.ts +6 -0
  205. package/dist/src/panorama/panoramaTilePrimitiveCollection.js +28 -0
  206. package/dist/src/panorama/panoramaTilePrimitiveCollection.js.map +1 -1
  207. package/dist/src/style/declarativeStyleItem.js +7 -8
  208. package/dist/src/style/declarativeStyleItem.js.map +1 -1
  209. package/dist/src/util/clipping/clippingPolygonObject.d.ts +1 -1
  210. package/dist/src/util/clipping/clippingPolygonObject.js +3 -4
  211. package/dist/src/util/clipping/clippingPolygonObject.js.map +1 -1
  212. package/dist/src/util/displayQuality/displayQuality.js +4 -4
  213. package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
  214. package/dist/src/util/editor/createFeatureSession.js +3 -1
  215. package/dist/src/util/editor/createFeatureSession.js.map +1 -1
  216. package/dist/src/util/editor/editFeaturesSession.js +9 -2
  217. package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
  218. package/dist/src/util/editor/editGeometrySession.js +3 -1
  219. package/dist/src/util/editor/editGeometrySession.js.map +1 -1
  220. package/dist/src/util/editor/editorSessionHelpers.d.ts +3 -3
  221. package/dist/src/util/editor/editorSessionHelpers.js +4 -2
  222. package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
  223. package/dist/src/util/editor/interactions/creationSnapping.js +4 -1
  224. package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -1
  225. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +2 -2
  226. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
  227. package/dist/src/util/editor/interactions/layerSnapping.js +4 -1
  228. package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -1
  229. package/dist/src/util/editor/interactions/mapInteractionController.js +12 -1
  230. package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
  231. package/dist/src/util/editor/interactions/translationSnapping.js +4 -2
  232. package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
  233. package/dist/src/util/editor/selectFeaturesSession.js +1 -1
  234. package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
  235. package/dist/src/util/editor/transformation/create3DHandlers.d.ts +2 -2
  236. package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
  237. package/dist/src/util/editor/transformation/transformationHandler.js +5 -2
  238. package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
  239. package/dist/src/util/editor/transformation/translateInteraction.js +2 -2
  240. package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
  241. package/dist/src/util/fetch.d.ts +7 -0
  242. package/dist/src/util/fetch.js +7 -0
  243. package/dist/src/util/fetch.js.map +1 -1
  244. package/dist/src/util/flight/flightInstance.d.ts +1 -1
  245. package/dist/src/util/flight/flightInstance.js +3 -4
  246. package/dist/src/util/flight/flightInstance.js.map +1 -1
  247. package/dist/src/util/mapCollection.d.ts +5 -0
  248. package/dist/src/util/mapCollection.js +14 -0
  249. package/dist/src/util/mapCollection.js.map +1 -1
  250. package/dist/src/util/renderScreenshot.js +2 -3
  251. package/dist/src/util/renderScreenshot.js.map +1 -1
  252. package/dist/src/util/viewpoint.js +1 -1
  253. package/dist/src/util/viewpoint.js.map +1 -1
  254. package/dist/src/vcsApp.d.ts +2 -3
  255. package/dist/src/vcsApp.js.map +1 -1
  256. package/dist/src/vcsModuleHelpers.d.ts +5 -2
  257. package/dist/src/vcsModuleHelpers.js +27 -1
  258. package/dist/src/vcsModuleHelpers.js.map +1 -1
  259. package/dist/src/vcsObject.d.ts +2 -1
  260. package/dist/src/vcsObject.js +9 -1
  261. package/dist/src/vcsObject.js.map +1 -1
  262. package/dist/src/vectorCluster/vectorClusterGroup.d.ts +1 -1
  263. package/dist/src/vectorCluster/vectorClusterGroup.js +3 -4
  264. package/dist/src/vectorCluster/vectorClusterGroup.js.map +1 -1
  265. package/dist/src/vectorCluster/vectorClusterStyleItem.d.ts +1 -1
  266. package/dist/src/vectorCluster/vectorClusterStyleItem.js +3 -4
  267. package/dist/src/vectorCluster/vectorClusterStyleItem.js.map +1 -1
  268. package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -1
  269. package/dist/tests/unit/helpers/cesiumHelpers.js +26 -3
  270. package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
  271. package/dist/tests/unit/helpers/panoramaHelpers.js +1 -1
  272. package/dist/tests/unit/helpers/panoramaHelpers.js.map +1 -1
  273. package/index.ts +30 -5
  274. package/package.json +3 -3
  275. package/src/category/category.ts +3 -4
  276. package/src/cesium/cesium.d.ts +12 -0
  277. package/src/cesium/cesium3DTileFeature.ts +23 -3
  278. package/src/cesium/cesium3DTilePointFeature.ts +3 -1
  279. package/src/classRegistry.ts +8 -3
  280. package/src/featureProvider/abstractAttributeProvider.ts +201 -0
  281. package/src/featureProvider/abstractFeatureProvider.ts +32 -51
  282. package/src/featureProvider/compositeFeatureProvider.ts +103 -0
  283. package/src/featureProvider/csvAttributeProvider.ts +186 -0
  284. package/src/featureProvider/featureProviderFactory.ts +31 -0
  285. package/src/featureProvider/i3sAttributeProvider.ts +60 -0
  286. package/src/featureProvider/jsonAttributeProvider.ts +109 -0
  287. package/src/featureProvider/tileProviderFeatureProvider.ts +13 -14
  288. package/src/featureProvider/urlIdAttributeProvider.ts +82 -0
  289. package/src/featureProvider/wmsFeatureProvider.ts +31 -10
  290. package/src/global.d.ts +2 -0
  291. package/src/interaction/coordinateAtPixel.ts +4 -6
  292. package/src/interaction/ensurePositionInteraction.ts +50 -0
  293. package/src/interaction/eventHandler.ts +12 -1
  294. package/src/interaction/featureAtPixelInteraction.ts +92 -32
  295. package/src/interaction/featureProviderInteraction.ts +59 -38
  296. package/src/interaction/panoramaImageSelection.ts +4 -2
  297. package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +297 -197
  298. package/src/layer/cesium/i3sCesiumImpl.ts +141 -0
  299. package/src/layer/cesium/rasterLayerCesiumImpl.ts +3 -3
  300. package/src/layer/cesium/terrainCesiumImpl.ts +3 -3
  301. package/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.ts +4 -3
  302. package/src/layer/cesium/vectorContext.ts +1 -1
  303. package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +7 -6
  304. package/src/layer/cesium/vectorTileImageryProvider.ts +2 -2
  305. package/src/layer/cesiumTilesetLayer.ts +60 -8
  306. package/src/layer/cogLayer.ts +5 -5
  307. package/src/layer/czmlLayer.ts +4 -4
  308. package/src/layer/featureLayer.ts +5 -16
  309. package/src/layer/featureStoreLayer.ts +11 -5
  310. package/src/layer/flatGeobufLayer.ts +12 -0
  311. package/src/layer/geojsonLayer.ts +5 -12
  312. package/src/layer/i3sLayer.ts +343 -0
  313. package/src/layer/layer.ts +178 -39
  314. package/src/layer/layerSymbols.ts +5 -0
  315. package/src/layer/openStreetMapLayer.ts +13 -6
  316. package/src/layer/panorama/vectorPanoramaImpl.ts +238 -0
  317. package/src/layer/panoramaDatasetLayer.ts +69 -23
  318. package/src/layer/pointCloudLayer.ts +5 -20
  319. package/src/layer/rasterLayer.ts +4 -4
  320. package/src/layer/singleImageLayer.ts +5 -3
  321. package/src/layer/terrainLayer.ts +9 -6
  322. package/src/layer/tileProvider/flatGeobufTileProvider.ts +9 -5
  323. package/src/layer/tileProvider/mvtTileProvider.ts +10 -5
  324. package/src/layer/tileProvider/staticFeatureTileProvider.ts +5 -3
  325. package/src/layer/tileProvider/staticGeojsonTileProvider.ts +11 -4
  326. package/src/layer/tileProvider/tileProvider.ts +18 -5
  327. package/src/layer/tileProvider/urlTemplateTileProvider.ts +7 -3
  328. package/src/layer/tmsLayer.ts +3 -10
  329. package/src/layer/vectorLayer.ts +29 -11
  330. package/src/layer/vectorProperties.ts +10 -1
  331. package/src/layer/vectorTileLayer.ts +141 -53
  332. package/src/layer/wfsLayer.ts +7 -4
  333. package/src/layer/wmsLayer.ts +80 -48
  334. package/src/layer/wmtsLayer.ts +3 -10
  335. package/src/map/baseCesiumMap.ts +600 -0
  336. package/src/map/cesiumMap.ts +99 -457
  337. package/src/map/obliqueMap.ts +16 -10
  338. package/src/map/openlayersMap.ts +5 -5
  339. package/src/map/panoramaMap.ts +74 -139
  340. package/src/map/vcsMap.ts +44 -4
  341. package/src/oblique/obliqueCollection.ts +5 -4
  342. package/src/ol/ol.d.ts +13 -2
  343. package/src/panorama/panoramaCameraController.ts +13 -1
  344. package/src/panorama/panoramaImage.ts +25 -8
  345. package/src/panorama/panoramaImageView.ts +29 -3
  346. package/src/panorama/panoramaTileMaterial.ts +20 -0
  347. package/src/panorama/panoramaTileMaterialFS.glsl +16 -1
  348. package/src/panorama/panoramaTilePrimitiveCollection.ts +34 -0
  349. package/src/style/declarativeStyleItem.ts +7 -9
  350. package/src/util/clipping/clippingPolygonObject.ts +5 -4
  351. package/src/util/displayQuality/displayQuality.ts +4 -4
  352. package/src/util/editor/createFeatureSession.ts +4 -1
  353. package/src/util/editor/editFeaturesSession.ts +14 -4
  354. package/src/util/editor/editGeometrySession.ts +3 -1
  355. package/src/util/editor/editorSessionHelpers.ts +5 -3
  356. package/src/util/editor/interactions/creationSnapping.ts +7 -1
  357. package/src/util/editor/interactions/ensureHandlerSelectionInteraction.ts +2 -2
  358. package/src/util/editor/interactions/layerSnapping.ts +7 -1
  359. package/src/util/editor/interactions/mapInteractionController.ts +12 -2
  360. package/src/util/editor/interactions/translationSnapping.ts +6 -4
  361. package/src/util/editor/selectFeaturesSession.ts +1 -1
  362. package/src/util/editor/transformation/create3DHandlers.ts +2 -2
  363. package/src/util/editor/transformation/transformationHandler.ts +5 -3
  364. package/src/util/editor/transformation/translateInteraction.ts +4 -4
  365. package/src/util/fetch.ts +7 -0
  366. package/src/util/flight/flightInstance.ts +6 -5
  367. package/src/util/mapCollection.ts +18 -0
  368. package/src/util/renderScreenshot.ts +4 -8
  369. package/src/util/viewpoint.ts +2 -2
  370. package/src/vcsApp.ts +7 -8
  371. package/src/vcsModuleHelpers.ts +62 -4
  372. package/src/vcsObject.ts +10 -1
  373. package/src/vectorCluster/vectorClusterGroup.ts +7 -4
  374. package/src/vectorCluster/vectorClusterStyleItem.ts +8 -4
  375. package/dist/src/map/cesiumMapHelpers.d.ts +0 -7
  376. package/dist/src/map/cesiumMapHelpers.js +0 -144
  377. package/dist/src/map/cesiumMapHelpers.js.map +0 -1
  378. package/src/map/cesiumMapHelpers.ts +0 -219
@@ -3,6 +3,8 @@ import type {
3
3
  Cesium3DTileContent,
4
4
  SplitDirection,
5
5
  CustomShader,
6
+ TileBoundingVolume,
7
+ BoundingSphere,
6
8
  } from '@vcmap-cesium/engine';
7
9
  import {
8
10
  Composite3DTileContent,
@@ -26,7 +28,6 @@ import {
26
28
  highlightFeature,
27
29
  originalStyle,
28
30
  updateOriginalStyle,
29
- FeatureVisibilityAction,
30
31
  } from '../featureVisibility.js';
31
32
  import Projection from '../../util/projection.js';
32
33
  import { circleFromCenterRadius } from '../../util/geometryHelpers.js';
@@ -34,11 +35,13 @@ import type {
34
35
  CesiumTilesetImplementationOptions,
35
36
  CesiumTilesetTilesetProperties,
36
37
  } from '../cesiumTilesetLayer.js';
37
- import type CesiumMap from '../../map/cesiumMap.js';
38
38
  import type { FeatureLayerImplementation } from '../featureLayer.js';
39
39
  import type StyleItem from '../../style/styleItem.js';
40
40
  import type GlobalHider from '../globalHider.js';
41
41
  import { getResourceOrUrl } from './resourceHelper.js';
42
+ import type BaseCesiumMap from '../../map/baseCesiumMap.js';
43
+ import type { AttributeProvider } from '../../featureProvider/abstractAttributeProvider.js';
44
+ import type I3SCesiumImpl from './i3sCesiumImpl.js';
42
45
 
43
46
  export const cesiumTilesetLastUpdated: unique symbol = Symbol(
44
47
  'cesiumTilesetLastUpdated',
@@ -48,13 +51,11 @@ export const updateFeatureOverride: unique symbol = Symbol(
48
51
  'updateFeatureOverride',
49
52
  );
50
53
 
51
- export function getExtentFromTileset(
52
- cesium3DTileset?: Cesium3DTileset,
54
+ function getExtentFromBoundingVolume(
55
+ boundingVolume: TileBoundingVolume,
56
+ boundingSphere: BoundingSphere,
53
57
  ): OLExtent {
54
- if (!cesium3DTileset) {
55
- return createEmpty();
56
- }
57
- const { rectangle } = cesium3DTileset.root.boundingVolume;
58
+ const { rectangle } = boundingVolume;
58
59
  if (rectangle) {
59
60
  const scratchSW = Rectangle.southwest(rectangle);
60
61
  const scratchNE = Rectangle.northeast(rectangle);
@@ -70,7 +71,7 @@ export function getExtentFromTileset(
70
71
  return [mercatorSW[0], mercatorSW[1], mercatorNE[0], mercatorNE[1]];
71
72
  }
72
73
 
73
- const { center, radius } = cesium3DTileset.boundingSphere;
74
+ const { center, radius } = boundingSphere;
74
75
  const cart = Cartographic.fromCartesian(center);
75
76
  const mercatorCenter = Projection.wgs84ToMercator([
76
77
  CesiumMath.toDegrees(cart.longitude),
@@ -81,11 +82,279 @@ export function getExtentFromTileset(
81
82
  return circle.getExtent();
82
83
  }
83
84
 
85
+ export function getExtentFromTileset(
86
+ cesium3DTileset?: Cesium3DTileset,
87
+ ): OLExtent {
88
+ if (!cesium3DTileset) {
89
+ return createEmpty();
90
+ }
91
+ return getExtentFromBoundingVolume(
92
+ cesium3DTileset.root.boundingVolume,
93
+ cesium3DTileset.boundingSphere,
94
+ );
95
+ }
96
+
97
+ export function createCesiumStylingContext(
98
+ impl: CesiumTilesetCesiumImpl | I3SCesiumImpl,
99
+ ): {
100
+ styleContent: (content: Cesium3DTileContent) => void;
101
+ updateStyle: (style: StyleItem) => void;
102
+ applyStyle: (tile: Cesium3DTile) => void;
103
+ destroy: () => void;
104
+ } {
105
+ let styleLastUpdated = 0;
106
+ let onStyleChangeRemover: (() => void) | null = null;
107
+ let onFeatureVisibilityChangeRemover: (() => void) | null = null;
108
+
109
+ function styleContent(content: Cesium3DTileContent): void {
110
+ const styleHasChanged =
111
+ styleLastUpdated > (content[cesiumTilesetLastUpdated] ?? 0);
112
+
113
+ if (
114
+ !content[cesiumTilesetLastUpdated] ||
115
+ content[cesiumTilesetLastUpdated] < impl.featureVisibility.lastUpdated ||
116
+ content[cesiumTilesetLastUpdated] <
117
+ (impl.globalHider?.lastUpdated ?? 0) ||
118
+ styleHasChanged
119
+ ) {
120
+ delete content[updateFeatureOverride];
121
+ const batchSize = content.featuresLength;
122
+ const featureOverride = {
123
+ hideLocal: [] as [string, HighlightableFeature][],
124
+ hideGlobal: [] as [string, HighlightableFeature][],
125
+ highlight: [] as [string, HighlightableFeature][],
126
+ };
127
+ for (let batchId = 0; batchId < batchSize; batchId++) {
128
+ const feature = content.getFeature(batchId);
129
+ if (feature) {
130
+ const id = String(feature.getId());
131
+ let shouldUpdateOriginalStyle = true;
132
+ if (
133
+ impl.featureVisibility.highlightedObjects[id] &&
134
+ !impl.featureVisibility.hasHighlightFeature(id, feature)
135
+ ) {
136
+ impl.featureVisibility.addHighlightFeature(id, feature);
137
+ featureOverride.highlight.push([id, feature]);
138
+ shouldUpdateOriginalStyle = false;
139
+ } else if (
140
+ impl.featureVisibility.hasHighlightFeature(id, feature) &&
141
+ styleHasChanged &&
142
+ feature[originalStyle]
143
+ ) {
144
+ // Feature is already highlighted and style has changed
145
+ // Clear the old cached style - when unhighlighted, we'll force a tileset style update
146
+ delete feature[originalStyle];
147
+ featureOverride.highlight.push([id, feature]);
148
+ shouldUpdateOriginalStyle = false;
149
+ }
150
+
151
+ if (impl.featureVisibility.hiddenObjects[id]) {
152
+ if (!impl.featureVisibility.hasHiddenFeature(id, feature)) {
153
+ impl.featureVisibility.addHiddenFeature(id, feature);
154
+ featureOverride.hideLocal.push([id, feature]);
155
+ } else if (styleHasChanged && feature[originalStyle]) {
156
+ // Feature is already hidden and style has changed, clear original style
157
+ // so it will be re-cached with the new style when shown
158
+ delete feature[originalStyle];
159
+ }
160
+ shouldUpdateOriginalStyle = false;
161
+ }
162
+
163
+ if (impl.globalHider?.hiddenObjects[id]) {
164
+ if (!impl.globalHider?.hasFeature(id, feature)) {
165
+ impl.globalHider?.addFeature(id, feature);
166
+ }
167
+ featureOverride.hideGlobal.push([id, feature]);
168
+ if (styleHasChanged && feature[originalStyle]) {
169
+ // Feature is globally hidden and style has changed, clear original style
170
+ delete feature[originalStyle];
171
+ }
172
+ shouldUpdateOriginalStyle = false;
173
+ }
174
+
175
+ if (
176
+ shouldUpdateOriginalStyle &&
177
+ styleHasChanged &&
178
+ feature[originalStyle] // can only be a color for cesium, so no check for undefined required
179
+ ) {
180
+ updateOriginalStyle(feature);
181
+ }
182
+ }
183
+ }
184
+ if (
185
+ featureOverride.hideLocal.length > 0 ||
186
+ featureOverride.hideGlobal.length > 0 ||
187
+ featureOverride.highlight.length > 0
188
+ ) {
189
+ content[updateFeatureOverride] = (): void => {
190
+ featureOverride.hideGlobal.forEach(([id, feature]) => {
191
+ if (impl.globalHider?.hasFeature(id, feature)) {
192
+ hideFeature(feature);
193
+ }
194
+ });
195
+
196
+ featureOverride.hideLocal.forEach(([id, feature]) => {
197
+ if (impl.featureVisibility.hasHiddenFeature(id, feature)) {
198
+ hideFeature(feature);
199
+ }
200
+ });
201
+
202
+ featureOverride.highlight.forEach(([id, feature]) => {
203
+ if (impl.featureVisibility.hasHighlightFeature(id, feature)) {
204
+ highlightFeature(feature);
205
+ }
206
+ });
207
+ };
208
+ }
209
+ content[cesiumTilesetLastUpdated] = Date.now();
210
+ } else {
211
+ content[updateFeatureOverride]?.();
212
+ }
213
+ }
214
+ function updateStyle(style: StyleItem): void {
215
+ impl.style = style;
216
+
217
+ function updateTilesetStyle(tileset: Cesium3DTileset): void {
218
+ tileset.style = impl.style.cesiumStyle;
219
+ if (onStyleChangeRemover) {
220
+ onStyleChangeRemover();
221
+ }
222
+ styleLastUpdated = Date.now();
223
+ if (tileset.colorBlendMode !== impl.style.colorBlendMode) {
224
+ // we only support replace and mix mode if the _3DTILESDIFFUSE Flag is set in the tileset
225
+ if (
226
+ impl.style.colorBlendMode !== Cesium3DTileColorBlendMode.HIGHLIGHT
227
+ ) {
228
+ if (
229
+ tileset.extras &&
230
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,no-underscore-dangle
231
+ (tileset.extras._3DTILESDIFFUSE as boolean)
232
+ ) {
233
+ tileset.colorBlendMode = impl.style.colorBlendMode;
234
+ }
235
+ } else {
236
+ tileset.colorBlendMode = impl.style.colorBlendMode;
237
+ }
238
+ }
239
+ }
240
+ if (impl.initialized) {
241
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
242
+ if (impl instanceof CesiumTilesetCesiumImpl) {
243
+ if (impl.cesium3DTileset) {
244
+ updateTilesetStyle(impl.cesium3DTileset);
245
+ onStyleChangeRemover = impl.style.styleChanged.addEventListener(
246
+ () => {
247
+ impl.cesium3DTileset?.makeStyleDirty();
248
+ styleLastUpdated = Date.now();
249
+ },
250
+ );
251
+ }
252
+ } else if (impl.data) {
253
+ impl.data.layers.forEach(({ tileset }) => {
254
+ if (tileset) {
255
+ updateTilesetStyle(tileset);
256
+ }
257
+ });
258
+ onStyleChangeRemover = impl.style.styleChanged.addEventListener(() => {
259
+ impl.data?.layers.forEach(({ tileset }) => {
260
+ tileset?.makeStyleDirty();
261
+ });
262
+ styleLastUpdated = Date.now();
263
+ });
264
+ }
265
+ }
266
+ }
267
+ function applyStyle(tile: Cesium3DTile): void {
268
+ if (tile.contentReady) {
269
+ if (tile.content instanceof Composite3DTileContent) {
270
+ for (let i = 0; i < tile.content.innerContents.length; i++) {
271
+ styleContent(tile.content.innerContents[i] as Cesium3DTileContent);
272
+ }
273
+ } else {
274
+ styleContent(tile.content);
275
+ }
276
+ }
277
+ }
278
+
279
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
280
+ if (impl instanceof CesiumTilesetCesiumImpl) {
281
+ onFeatureVisibilityChangeRemover =
282
+ impl.featureVisibility.changed.addEventListener(() => {
283
+ impl.cesium3DTileset?.makeStyleDirty();
284
+ });
285
+ } else {
286
+ onFeatureVisibilityChangeRemover =
287
+ impl.featureVisibility.changed.addEventListener(() => {
288
+ impl.data?.layers.forEach(({ tileset }) => {
289
+ tileset?.makeStyleDirty();
290
+ });
291
+ styleLastUpdated = Date.now();
292
+ });
293
+ }
294
+
295
+ return {
296
+ styleContent,
297
+ updateStyle,
298
+ applyStyle,
299
+ destroy: (): void => {
300
+ if (onStyleChangeRemover) {
301
+ onStyleChangeRemover();
302
+ onStyleChangeRemover = null;
303
+ }
304
+ if (onFeatureVisibilityChangeRemover) {
305
+ onFeatureVisibilityChangeRemover();
306
+ onFeatureVisibilityChangeRemover = null;
307
+ }
308
+ },
309
+ };
310
+ }
311
+
312
+ export function createTilesetEventListeners(
313
+ impl: CesiumTilesetCesiumImpl | I3SCesiumImpl,
314
+ tileset: Cesium3DTileset,
315
+ ): void {
316
+ function tileLoadedHandler(tile: Cesium3DTile): void {
317
+ if (impl.attributeProvider) {
318
+ const extent = getExtentFromBoundingVolume(
319
+ tile.contentBoundingVolume,
320
+ tile.boundingSphere,
321
+ );
322
+ const features: HighlightableFeature[] = [];
323
+ const batchSize = tile.content.featuresLength;
324
+ for (let batchId = 0; batchId < batchSize; batchId++) {
325
+ const feature = tile.content.getFeature(batchId);
326
+ if (feature) {
327
+ features.push(feature);
328
+ }
329
+ }
330
+
331
+ impl.attributeProvider
332
+ .augmentFeatures(features, extent)
333
+ .then(() => {
334
+ impl.applyStyle(tile);
335
+ })
336
+ .catch((err: unknown) => {
337
+ impl
338
+ .getLogger()
339
+ .error(`Error augmenting features in ${impl.className}:`, err);
340
+ });
341
+ }
342
+ }
343
+
344
+ tileset.tileLoad.addEventListener(tileLoadedHandler);
345
+ tileset.tileVisible.addEventListener(impl.applyStyle);
346
+ tileset.tileUnload.addEventListener((tile: Cesium3DTile) => {
347
+ delete tile[cesiumTilesetLastUpdated];
348
+ delete tile.content[cesiumTilesetLastUpdated];
349
+ delete tile.content[updateFeatureOverride];
350
+ });
351
+ }
352
+
84
353
  /**
85
354
  * represents the cesium implementation for a {@link CesiumTilesetLayer} layer.
86
355
  */
87
356
  class CesiumTilesetCesiumImpl
88
- extends LayerImplementation<CesiumMap>
357
+ extends LayerImplementation<BaseCesiumMap>
89
358
  implements FeatureLayerImplementation
90
359
  {
91
360
  static get className(): string {
@@ -112,19 +381,23 @@ class CesiumTilesetCesiumImpl
112
381
 
113
382
  allowPicking: boolean;
114
383
 
384
+ attributeProvider?: AttributeProvider;
385
+
115
386
  private _initializedPromise: Promise<Cesium3DTileset> | null = null;
116
387
 
117
388
  private _originalOrigin: Cartesian3 | null = null;
118
389
 
119
- private _styleLastUpdated: number = Date.now();
390
+ private _destroyStyle: (() => void) | null = null;
120
391
 
121
- private _onStyleChangeRemover: (() => void) | null = null;
392
+ private _customShader: CustomShader | undefined;
122
393
 
123
- private _onFeatureVisibilityChangeRemover: (() => void) | null = null;
394
+ styleContent: (content: Cesium3DTileContent) => void;
124
395
 
125
- private _customShader: CustomShader | undefined;
396
+ updateStyle: (style: StyleItem) => void;
126
397
 
127
- constructor(map: CesiumMap, options: CesiumTilesetImplementationOptions) {
398
+ applyStyle: (tile: Cesium3DTile) => void;
399
+
400
+ constructor(map: BaseCesiumMap, options: CesiumTilesetImplementationOptions) {
128
401
  super(map, options);
129
402
 
130
403
  this.cesium3DTileset = null;
@@ -138,18 +411,13 @@ class CesiumTilesetCesiumImpl
138
411
  this.offset = options.offset;
139
412
  this._customShader = options.customShader;
140
413
  this.allowPicking = options.allowPicking;
414
+ this.attributeProvider = options.attributeProvider;
141
415
 
142
- // Listen for unhighlight events to force style update when needed
143
- this._onFeatureVisibilityChangeRemover =
144
- this.featureVisibility.changed.addEventListener((event) => {
145
- if (
146
- event.action === FeatureVisibilityAction.UNHIGHLIGHT &&
147
- this.cesium3DTileset
148
- ) {
149
- // Force tileset to re-apply style for unhighlighted features
150
- this.cesium3DTileset.makeStyleDirty();
151
- }
152
- });
416
+ const stylingContext = createCesiumStylingContext(this);
417
+ this.styleContent = stylingContext.styleContent;
418
+ this.updateStyle = stylingContext.updateStyle;
419
+ this.applyStyle = stylingContext.applyStyle;
420
+ this._destroyStyle = stylingContext.destroy;
153
421
  }
154
422
 
155
423
  get customShader(): CustomShader | undefined {
@@ -199,14 +467,7 @@ class CesiumTilesetCesiumImpl
199
467
  }
200
468
  this.cesium3DTileset[vcsLayerName] = this.name;
201
469
  this.cesium3DTileset[allowPicking] = this.allowPicking;
202
- this.cesium3DTileset.tileVisible.addEventListener(
203
- this.applyStyle.bind(this),
204
- );
205
- this.cesium3DTileset.tileUnload.addEventListener((tile: Cesium3DTile) => {
206
- delete tile[cesiumTilesetLastUpdated];
207
- delete tile.content[cesiumTilesetLastUpdated];
208
- delete tile.content[updateFeatureOverride];
209
- });
470
+ createTilesetEventListeners(this, this.cesium3DTileset);
210
471
 
211
472
  this._originalOrigin = Cartesian3.clone(
212
473
  this.cesium3DTileset.boundingSphere.center,
@@ -290,39 +551,6 @@ class CesiumTilesetCesiumImpl
290
551
  }
291
552
  }
292
553
 
293
- updateStyle(style: StyleItem): void {
294
- this.style = style;
295
- if (this.initialized && this.cesium3DTileset) {
296
- this.cesium3DTileset.style = this.style.cesiumStyle;
297
- if (this._onStyleChangeRemover) {
298
- this._onStyleChangeRemover();
299
- }
300
- this._onStyleChangeRemover = this.style.styleChanged.addEventListener(
301
- () => {
302
- this.cesium3DTileset?.makeStyleDirty();
303
- this._styleLastUpdated = Date.now();
304
- },
305
- );
306
- this._styleLastUpdated = Date.now();
307
- if (this.cesium3DTileset.colorBlendMode !== this.style.colorBlendMode) {
308
- // we only support replace and mix mode if the _3DTILESDIFFUSE Flag is set in the tileset
309
- if (
310
- this.style.colorBlendMode !== Cesium3DTileColorBlendMode.HIGHLIGHT
311
- ) {
312
- if (
313
- this.cesium3DTileset.extras &&
314
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,no-underscore-dangle
315
- (this.cesium3DTileset.extras._3DTILESDIFFUSE as boolean)
316
- ) {
317
- this.cesium3DTileset.colorBlendMode = this.style.colorBlendMode;
318
- }
319
- } else {
320
- this.cesium3DTileset.colorBlendMode = this.style.colorBlendMode;
321
- }
322
- }
323
- }
324
- }
325
-
326
554
  updateSplitDirection(splitDirection: SplitDirection): void {
327
555
  this.splitDirection = splitDirection;
328
556
  if (this.cesium3DTileset) {
@@ -330,130 +558,6 @@ class CesiumTilesetCesiumImpl
330
558
  }
331
559
  }
332
560
 
333
- applyStyle(tile: Cesium3DTile): void {
334
- if (tile.contentReady) {
335
- if (tile.content instanceof Composite3DTileContent) {
336
- for (let i = 0; i < tile.content.innerContents.length; i++) {
337
- this.styleContent(
338
- tile.content.innerContents[i] as Cesium3DTileContent,
339
- );
340
- }
341
- } else {
342
- this.styleContent(tile.content);
343
- }
344
- }
345
- }
346
-
347
- styleContent(content: Cesium3DTileContent): void {
348
- const styleHasChanged =
349
- this._styleLastUpdated > (content[cesiumTilesetLastUpdated] ?? 0);
350
- if (
351
- !content[cesiumTilesetLastUpdated] ||
352
- content[cesiumTilesetLastUpdated] < this.featureVisibility.lastUpdated ||
353
- content[cesiumTilesetLastUpdated] <
354
- (this.globalHider?.lastUpdated ?? 0) ||
355
- styleHasChanged
356
- ) {
357
- // content[updateFeatureOverride]?.reset();
358
- delete content[updateFeatureOverride];
359
- const batchSize = content.featuresLength;
360
- const featureOverride = {
361
- hideLocal: [] as [string, HighlightableFeature][],
362
- hideGlobal: [] as [string, HighlightableFeature][],
363
- highlight: [] as [string, HighlightableFeature][],
364
- };
365
- for (let batchId = 0; batchId < batchSize; batchId++) {
366
- const feature = content.getFeature(batchId);
367
- if (feature) {
368
- let id = feature.getProperty('id') as string | undefined;
369
- if (!id) {
370
- id = `${content.url}${String(batchId)}`;
371
- }
372
-
373
- let shouldUpdateOriginalStyle = true;
374
- if (
375
- this.featureVisibility.highlightedObjects[id] &&
376
- !this.featureVisibility.hasHighlightFeature(id, feature)
377
- ) {
378
- this.featureVisibility.addHighlightFeature(id, feature);
379
- featureOverride.highlight.push([id, feature]);
380
- shouldUpdateOriginalStyle = false;
381
- } else if (
382
- this.featureVisibility.hasHighlightFeature(id, feature) &&
383
- styleHasChanged &&
384
- feature[originalStyle]
385
- ) {
386
- // Feature is already highlighted and style has changed
387
- // Clear the old cached style - when unhighlighted, we'll force a tileset style update
388
- delete feature[originalStyle];
389
- featureOverride.highlight.push([id, feature]);
390
- shouldUpdateOriginalStyle = false;
391
- }
392
-
393
- if (this.featureVisibility.hiddenObjects[id]) {
394
- if (!this.featureVisibility.hasHiddenFeature(id, feature)) {
395
- this.featureVisibility.addHiddenFeature(id, feature);
396
- featureOverride.hideLocal.push([id, feature]);
397
- } else if (styleHasChanged && feature[originalStyle]) {
398
- // Feature is already hidden and style has changed, clear original style
399
- // so it will be re-cached with the new style when shown
400
- delete feature[originalStyle];
401
- }
402
- shouldUpdateOriginalStyle = false;
403
- }
404
-
405
- if (this.globalHider?.hiddenObjects[id]) {
406
- if (!this.globalHider?.hasFeature(id, feature)) {
407
- this.globalHider?.addFeature(id, feature);
408
- }
409
- featureOverride.hideGlobal.push([id, feature]);
410
- if (styleHasChanged && feature[originalStyle]) {
411
- // Feature is globally hidden and style has changed, clear original style
412
- delete feature[originalStyle];
413
- }
414
- shouldUpdateOriginalStyle = false;
415
- }
416
-
417
- if (
418
- shouldUpdateOriginalStyle &&
419
- styleHasChanged &&
420
- feature[originalStyle] // can only be a color for cesium, so no check for undefined required
421
- ) {
422
- updateOriginalStyle(feature);
423
- }
424
- }
425
- }
426
- if (
427
- featureOverride.hideLocal.length > 0 ||
428
- featureOverride.hideGlobal.length > 0 ||
429
- featureOverride.highlight.length > 0
430
- ) {
431
- content[updateFeatureOverride] = (): void => {
432
- featureOverride.hideGlobal.forEach(([id, feature]) => {
433
- if (this.globalHider?.hasFeature(id, feature)) {
434
- hideFeature(feature);
435
- }
436
- });
437
-
438
- featureOverride.hideLocal.forEach(([id, feature]) => {
439
- if (this.featureVisibility.hasHiddenFeature(id, feature)) {
440
- hideFeature(feature);
441
- }
442
- });
443
-
444
- featureOverride.highlight.forEach(([id, feature]) => {
445
- if (this.featureVisibility.hasHighlightFeature(id, feature)) {
446
- highlightFeature(feature);
447
- }
448
- });
449
- };
450
- }
451
- content[cesiumTilesetLastUpdated] = Date.now();
452
- } else {
453
- content[updateFeatureOverride]?.();
454
- }
455
- }
456
-
457
561
  destroy(): void {
458
562
  if (this.cesium3DTileset) {
459
563
  if (this.map.initialized) {
@@ -466,12 +570,8 @@ class CesiumTilesetCesiumImpl
466
570
  this.cesium3DTileset = null;
467
571
  }
468
572
 
469
- if (this._onStyleChangeRemover) {
470
- this._onStyleChangeRemover();
471
- }
472
-
473
- if (this._onFeatureVisibilityChangeRemover) {
474
- this._onFeatureVisibilityChangeRemover();
573
+ if (this._destroyStyle) {
574
+ this._destroyStyle();
475
575
  }
476
576
 
477
577
  super.destroy();