@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
@@ -11,7 +11,16 @@ import { layerClassRegistry } from '../classRegistry.js';
11
11
  import GlobalHider from './globalHider.js';
12
12
  import type VcsMap from '../map/vcsMap.js';
13
13
  import type LayerImplementation from './layerImplementation.js';
14
- import type AbstractFeatureProvider from '../featureProvider/abstractFeatureProvider.js';
14
+ import {
15
+ type default as AbstractFeatureProvider,
16
+ type AbstractFeatureProviderOptions,
17
+ } from '../featureProvider/abstractFeatureProvider.js';
18
+ import type {
19
+ // eslint-disable-next-line import/no-named-default
20
+ default as AbstractAttributeProvider,
21
+ AbstractAttributeProviderOptions,
22
+ } from '../featureProvider/abstractAttributeProvider.js';
23
+ import { getProviderForOption } from '../featureProvider/featureProviderFactory.js';
15
24
 
16
25
  export type CopyrightOptions = {
17
26
  provider?: string;
@@ -58,6 +67,18 @@ export type LayerOptions = VcsObjectOptions & {
58
67
  * Optional Request Headers which will be sent with each request.
59
68
  */
60
69
  headers?: Record<string, string>;
70
+ /**
71
+ * if true, the layer types of the map will be ignored when checking if the layer is supported
72
+ */
73
+ ignoreMapLayerTypes?: boolean;
74
+ /**
75
+ * An optional feature or attribute provider to provide or augment features on click events.
76
+ */
77
+ featureProvider?:
78
+ | AbstractFeatureProvider
79
+ | AbstractAttributeProvider
80
+ | AbstractFeatureProviderOptions
81
+ | AbstractAttributeProviderOptions;
61
82
  };
62
83
 
63
84
  export type LayerImplementationOptions = {
@@ -92,7 +113,9 @@ class Layer<
92
113
  copyright: undefined,
93
114
  datasourceId: undefined,
94
115
  headers: undefined,
116
+ ignoreMapLayerTypes: false,
95
117
  zIndex: 0,
118
+ featureProvider: undefined,
96
119
  };
97
120
  }
98
121
 
@@ -108,12 +131,9 @@ class Layer<
108
131
 
109
132
  private _initialized: boolean;
110
133
 
111
- /**
112
- * if provided, the layer will only be shown in the given MapNames.
113
- * An empty array will show the layer in all configured maps.
114
- * Changes require calling layer.redraw() to take effect.
115
- */
116
- mapNames: string[];
134
+ private _mapNames: string[];
135
+
136
+ readonly mapNamesChanged = new VcsEvent<string[]>();
117
137
 
118
138
  /**
119
139
  * The class names of the supported maps.
@@ -145,9 +165,12 @@ class Layer<
145
165
 
146
166
  copyright: CopyrightOptions | undefined;
147
167
 
148
- private _implementations: Map<VcsMap, I[]>;
168
+ private _implementations = new Map<
169
+ VcsMap,
170
+ { implementations: I[]; destroy: () => void }
171
+ >();
149
172
 
150
- private _activeMaps: Set<VcsMap>;
173
+ private _activeMaps = new Set<VcsMap>();
151
174
 
152
175
  /**
153
176
  * Event raised, if the layers state changes. Is passed the LayerState as its only parameter
@@ -155,9 +178,12 @@ class Layer<
155
178
  stateChanged: VcsEvent<LayerState>;
156
179
 
157
180
  /**
158
- * An optional feature provider to provider features based on click events.
181
+ * An optional feature or attribute provider to provide or augment features on click events.
159
182
  */
160
- featureProvider: AbstractFeatureProvider | undefined;
183
+ featureProvider:
184
+ | AbstractFeatureProvider
185
+ | AbstractAttributeProvider
186
+ | undefined;
161
187
 
162
188
  private _locale: string;
163
189
 
@@ -169,9 +195,11 @@ class Layer<
169
195
  */
170
196
  datasourceId?: string;
171
197
 
198
+ private _ignoreMapLayerTypes: boolean;
199
+
172
200
  constructor(options: LayerOptions) {
173
- super(options);
174
201
  const defaultOptions = Layer.getDefaultOptions();
202
+ super({ ...defaultOptions, ...options });
175
203
 
176
204
  this.extent = options.extent ? new Extent(options.extent) : null;
177
205
 
@@ -191,7 +219,8 @@ class Layer<
191
219
 
192
220
  this._initialized = false;
193
221
 
194
- this.mapNames = options.mapNames ?? (defaultOptions.mapNames as string[]);
222
+ this._mapNames =
223
+ options.mapNames?.slice() ?? (defaultOptions.mapNames as string[]);
195
224
 
196
225
  this._supportedMaps = [];
197
226
 
@@ -215,19 +244,20 @@ class Layer<
215
244
 
216
245
  this.copyright = options.copyright || defaultOptions.copyright;
217
246
 
218
- this._implementations = new Map();
219
-
220
- this._activeMaps = new Set();
221
-
222
247
  this.stateChanged = new VcsEvent();
223
248
 
224
- this.featureProvider = undefined;
225
-
226
249
  this._locale = 'en';
227
250
 
228
251
  this.datasourceId = options.datasourceId || defaultOptions.datasourceId;
229
252
 
230
253
  this._headers = structuredClone(options.headers);
254
+
255
+ this._ignoreMapLayerTypes = parseBoolean(
256
+ options.ignoreMapLayerTypes,
257
+ defaultOptions.ignoreMapLayerTypes,
258
+ );
259
+
260
+ this.featureProvider = getProviderForOption(options.featureProvider);
231
261
  }
232
262
 
233
263
  /**
@@ -304,6 +334,31 @@ class Layer<
304
334
  return this._globalHider;
305
335
  }
306
336
 
337
+ get mapNames(): string[] {
338
+ return this._mapNames.slice();
339
+ }
340
+
341
+ /**
342
+ * if provided, the layer will only be shown in the given MapNames.
343
+ * An empty array will show the layer in all configured maps.
344
+ * Changes will call reload on the layer.
345
+ */
346
+ set mapNames(mapNames: string[]) {
347
+ check(mapNames, [String]);
348
+
349
+ if (
350
+ mapNames.length !== this._mapNames.length ||
351
+ !mapNames.every((m) => this._mapNames.includes(m))
352
+ ) {
353
+ this._mapNames = mapNames.slice();
354
+ this.mapNamesChanged.raiseEvent(this._mapNames.slice());
355
+ this.forceRedraw().catch((err: unknown) => {
356
+ this.getLogger().error('failed to reload after mapNames setting');
357
+ this.getLogger().error(String(err));
358
+ });
359
+ }
360
+ }
361
+
307
362
  setGlobalHider(globalHider?: GlobalHider): void {
308
363
  check(globalHider, maybe(GlobalHider));
309
364
 
@@ -400,6 +455,28 @@ class Layer<
400
455
  }
401
456
  }
402
457
 
458
+ get ignoreMapLayerTypes(): boolean {
459
+ return this._ignoreMapLayerTypes;
460
+ }
461
+
462
+ /**
463
+ * if set to true, the layer types of the map will be ignored when checking if the layer is supported.
464
+ * Changes will call reload on the layer.
465
+ */
466
+ set ignoreMapLayerTypes(value: boolean) {
467
+ check(value, Boolean);
468
+
469
+ if (this._ignoreMapLayerTypes !== value) {
470
+ this._ignoreMapLayerTypes = value;
471
+ this.reload().catch((err: unknown) => {
472
+ this.getLogger().error(
473
+ 'failed to reload after setting ignoreMapLayerTypes',
474
+ );
475
+ this.getLogger().error(String(err));
476
+ });
477
+ }
478
+ }
479
+
403
480
  /**
404
481
  * creates an array of layer implementations for the given map.
405
482
  * @param _map Map
@@ -417,20 +494,61 @@ class Layer<
417
494
  */
418
495
  getImplementationsForMap(map: VcsMap): I[] {
419
496
  if (!this._implementations.has(map)) {
497
+ let currentlySupported = this.isSupported(map);
498
+ let destroy: () => void;
499
+ const layerTypesChangedListener = map.layerTypesChanged.addEventListener(
500
+ () => {
501
+ const nowSupported = this.isSupported(map);
502
+ if (currentlySupported !== nowSupported) {
503
+ currentlySupported = nowSupported;
504
+ // either destroy current implementation or remove the empty array for unsupported layers.
505
+ // either way we have to reset this map if the inclusion changes
506
+ destroy();
507
+
508
+ if (
509
+ this.initialized &&
510
+ map.active &&
511
+ (this.active || this.loading)
512
+ ) {
513
+ this.getImplementationsForMap(map);
514
+ if (nowSupported) {
515
+ this._activateImplsForMap(map).catch(() => {
516
+ this.getLogger().error(
517
+ `Layer ${this.name} could not activate impl for map ${map.name} after layerTypesChanged`,
518
+ );
519
+ });
520
+ }
521
+ }
522
+ }
523
+ },
524
+ );
525
+ destroy = (): void => {
526
+ layerTypesChangedListener();
527
+ this._implementations.get(map)?.implementations?.forEach((i) => {
528
+ i.destroy();
529
+ });
530
+ this._implementations.delete(map);
531
+ };
532
+
420
533
  if (this.isSupported(map)) {
421
- this._implementations.set(map, this.createImplementationsForMap(map));
534
+ this._implementations.set(map, {
535
+ implementations: this.createImplementationsForMap(map),
536
+ destroy,
537
+ });
422
538
  } else {
423
- this._implementations.set(map, []);
539
+ this._implementations.set(map, { implementations: [], destroy });
424
540
  }
425
541
  }
426
- return this._implementations.get(map)!;
542
+ return this._implementations.get(map)!.implementations;
427
543
  }
428
544
 
429
545
  /**
430
546
  * Returns all implementation of this layer for all maps
431
547
  */
432
548
  getImplementations(): I[] {
433
- return [...this._implementations.values()].flat();
549
+ return [...this._implementations.values()].flatMap(
550
+ (i) => i.implementations,
551
+ );
434
552
  }
435
553
 
436
554
  getImplementationOptions(): LayerImplementationOptions {
@@ -529,10 +647,7 @@ class Layer<
529
647
  */
530
648
  removedFromMap(map: VcsMap): void {
531
649
  this._activeMaps.delete(map);
532
- this.getImplementationsForMap(map).forEach((impl) => {
533
- impl.destroy();
534
- });
535
- this._implementations.delete(map);
650
+ this._implementations.get(map)?.destroy();
536
651
  }
537
652
 
538
653
  /**
@@ -540,10 +655,23 @@ class Layer<
540
655
  * @param map
541
656
  */
542
657
  isSupported(map: VcsMap): boolean {
658
+ if (!map) {
659
+ return false;
660
+ }
661
+
662
+ const isSupportedMap = (): boolean =>
663
+ this._supportedMaps.includes(map.className);
664
+
665
+ const isAllowedMapName = (): boolean =>
666
+ this._mapNames.length === 0 || this._mapNames.includes(map.name);
667
+
668
+ const isAllowedLayerType = (): boolean =>
669
+ this._ignoreMapLayerTypes ||
670
+ map.layerTypes.length === 0 ||
671
+ map.layerTypes.includes(this.className);
672
+
543
673
  return (
544
- map &&
545
- this._supportedMaps.includes(map.className) &&
546
- (this.mapNames.length === 0 || this.mapNames.indexOf(map.name) >= 0)
674
+ !!map && isSupportedMap() && isAllowedMapName() && isAllowedLayerType()
547
675
  );
548
676
  }
549
677
 
@@ -556,9 +684,12 @@ class Layer<
556
684
  `Layer ${this.name} could not activate impl for map ${map.name}`,
557
685
  );
558
686
  this.getLogger().error(String(err));
559
- this._implementations.set(map, []);
560
- impls.forEach((i) => {
561
- i.destroy();
687
+ this._implementations.get(map)?.destroy();
688
+ this._implementations.set(map, {
689
+ implementations: [],
690
+ destroy: () => {
691
+ this._implementations.delete(map);
692
+ },
562
693
  });
563
694
  }
564
695
  }
@@ -580,7 +711,7 @@ class Layer<
580
711
  }
581
712
 
582
713
  await Promise.all(
583
- [...this._activeMaps].map((m) => this._activateImplsForMap(m)),
714
+ [...this._activeMaps.keys()].map((m) => this._activateImplsForMap(m)),
584
715
  );
585
716
  if (this._state !== LayerState.LOADING) {
586
717
  return;
@@ -653,9 +784,8 @@ class Layer<
653
784
  }
654
785
  }
655
786
 
656
- toJSON(): LayerOptions {
657
- const config: LayerOptions = super.toJSON();
658
- const defaultOptions = Layer.getDefaultOptions();
787
+ toJSON(defaultOptions = Layer.getDefaultOptions()): LayerOptions {
788
+ const config: LayerOptions = super.toJSON(defaultOptions);
659
789
 
660
790
  if (this.activeOnStartup !== defaultOptions.activeOnStartup) {
661
791
  config.activeOnStartup = this.activeOnStartup;
@@ -665,8 +795,8 @@ class Layer<
665
795
  config.allowPicking = this.allowPicking;
666
796
  }
667
797
 
668
- if (this.mapNames.length > 0) {
669
- config.mapNames = this.mapNames.slice();
798
+ if (this._mapNames.length > 0) {
799
+ config.mapNames = this._mapNames.slice();
670
800
  }
671
801
 
672
802
  if (this.hiddenObjectIds.length > 0) {
@@ -701,6 +831,14 @@ class Layer<
701
831
  config.zIndex = this._zIndex;
702
832
  }
703
833
 
834
+ if (this._ignoreMapLayerTypes !== defaultOptions.ignoreMapLayerTypes) {
835
+ config.ignoreMapLayerTypes = this._ignoreMapLayerTypes;
836
+ }
837
+
838
+ if (this.featureProvider) {
839
+ config.featureProvider = this.featureProvider.toJSON();
840
+ }
841
+
704
842
  return config;
705
843
  }
706
844
 
@@ -723,6 +861,7 @@ class Layer<
723
861
  this.stateChanged.destroy();
724
862
  this.zIndexChanged.destroy();
725
863
  this.exclusiveGroupsChanged.destroy();
864
+ this.mapNamesChanged.destroy();
726
865
  }
727
866
  }
728
867
 
@@ -7,3 +7,8 @@ export const vcsLayerName: unique symbol = Symbol('vcsLayerName');
7
7
  * Symbol added to Cesium3DTilesets to suppress picking.
8
8
  */
9
9
  export const allowPicking: unique symbol = Symbol('allowPicking');
10
+
11
+ /**
12
+ * Symbol to store the I3SNode and the cartesian position on features created from non Cesium3DTileset sources.
13
+ */
14
+ export const i3sData: unique symbol = Symbol('i3sData');
@@ -12,6 +12,8 @@ import { layerClassRegistry } from '../classRegistry.js';
12
12
  import type { RasterLayerImplementationOptions } from './rasterLayer.js';
13
13
  import { TilingScheme } from './rasterLayer.js';
14
14
  import type VcsMap from '../map/vcsMap.js';
15
+ import PanoramaMap from '../map/panoramaMap.js';
16
+ import BaseCesiumMap from '../map/baseCesiumMap.js';
15
17
 
16
18
  export type OpenStreetMapOptions = LayerOptions & {
17
19
  /**
@@ -102,11 +104,15 @@ class OpenStreetMapLayer
102
104
  */
103
105
  imageryLayerOptions: ImageryLayer.ConstructorOptions | undefined;
104
106
 
105
- protected _supportedMaps = [CesiumMap.className, OpenlayersMap.className];
107
+ protected _supportedMaps = [
108
+ CesiumMap.className,
109
+ OpenlayersMap.className,
110
+ PanoramaMap.className,
111
+ ];
106
112
 
107
113
  constructor(options: OpenStreetMapOptions) {
108
- super(options);
109
114
  const defaultOptions = OpenStreetMapLayer.getDefaultOptions();
115
+ super({ ...defaultOptions, ...options });
110
116
  this._splitDirection = SplitDirection.NONE;
111
117
 
112
118
  if (options.splitDirection) {
@@ -188,7 +194,7 @@ class OpenStreetMapLayer
188
194
  ];
189
195
  }
190
196
 
191
- if (map instanceof CesiumMap) {
197
+ if (map instanceof BaseCesiumMap) {
192
198
  return [
193
199
  new OpenStreetMapCesiumImpl(map, this.getImplementationOptions()),
194
200
  ];
@@ -196,9 +202,10 @@ class OpenStreetMapLayer
196
202
  return [];
197
203
  }
198
204
 
199
- toJSON(): OpenStreetMapOptions {
200
- const config: OpenStreetMapOptions = super.toJSON();
201
- const defaultOptions = OpenStreetMapLayer.getDefaultOptions();
205
+ toJSON(
206
+ defaultOptions = OpenStreetMapLayer.getDefaultOptions(),
207
+ ): OpenStreetMapOptions {
208
+ const config: OpenStreetMapOptions = super.toJSON(defaultOptions);
202
209
 
203
210
  if (this._splitDirection !== SplitDirection.NONE) {
204
211
  config.splitDirection =
@@ -0,0 +1,238 @@
1
+ import { PrimitiveCollection, type SplitDirection } from '@vcmap-cesium/engine';
2
+ import VectorSource from 'ol/source/Vector.js';
3
+ import { unByKey } from 'ol/Observable.js';
4
+ import type { Feature } from 'ol/index.js';
5
+ import { vcsLayerName } from '../layerSymbols.js';
6
+ import LayerImplementation from '../layerImplementation.js';
7
+ import { synchronizeFeatureVisibilityWithSource } from '../vectorHelpers.js';
8
+ import type { FeatureLayerImplementation } from '../featureLayer.js';
9
+ import type { VectorImplementationOptions } from '../vectorLayer.js';
10
+ import type VectorProperties from '../vectorProperties.js';
11
+ import type StyleItem from '../../style/styleItem.js';
12
+ import type FeatureVisibility from '../featureVisibility.js';
13
+ import type GlobalHider from '../globalHider.js';
14
+ import VectorContext from '../cesium/vectorContext.js';
15
+ import {
16
+ createSourceVectorContextSync,
17
+ type SourceVectorContextSync,
18
+ } from '../cesium/sourceVectorContextSync.js';
19
+ import type PanoramaMap from '../../map/panoramaMap.js';
20
+ import type { PanoramaImage } from '../../panorama/panoramaImage.js';
21
+ import { cartesianToMercator } from '../../util/math.js';
22
+
23
+ type PanoramaSourceSync = {
24
+ paused: boolean;
25
+ destroy: () => void;
26
+ };
27
+
28
+ function getImageExtent(
29
+ image: PanoramaImage,
30
+ ): [number, number, number, number] {
31
+ const center = cartesianToMercator(image.position);
32
+ const depth = image.maxDepth ?? 50;
33
+ return [
34
+ center[0] - depth,
35
+ center[1] - depth,
36
+ center[0] + depth,
37
+ center[1] + depth,
38
+ ];
39
+ }
40
+
41
+ function featureWithinImage(feature?: Feature, image?: PanoramaImage): boolean {
42
+ if (feature && image) {
43
+ const extent = getImageExtent(image);
44
+ return feature.getGeometry()?.intersectsExtent(extent) ?? false;
45
+ }
46
+ return false;
47
+ }
48
+
49
+ function setupMapSourceListeners(
50
+ map: PanoramaMap,
51
+ originalSource: VectorSource,
52
+ panoramaSource: VectorSource,
53
+ ): PanoramaSourceSync {
54
+ let paused = false;
55
+ const sourceListeners = [
56
+ originalSource.on('addfeature', (event) => {
57
+ if (
58
+ !paused &&
59
+ featureWithinImage(event.feature, map.currentPanoramaImage)
60
+ ) {
61
+ panoramaSource.addFeature(event.feature as Feature);
62
+ }
63
+ }),
64
+ originalSource.on('removefeature', (event) => {
65
+ panoramaSource.removeFeature(event.feature as Feature);
66
+ }),
67
+ ];
68
+
69
+ const setFeatures = (): void => {
70
+ panoramaSource.clear();
71
+ if (map.currentPanoramaImage) {
72
+ const extent = getImageExtent(map.currentPanoramaImage);
73
+ originalSource.getFeaturesInExtent(extent).forEach((f) => {
74
+ panoramaSource.addFeature(f);
75
+ });
76
+ }
77
+ };
78
+ const panoramaImageListener =
79
+ map.currentImageChanged.addEventListener(setFeatures);
80
+
81
+ return {
82
+ get paused(): boolean {
83
+ return paused;
84
+ },
85
+ set paused(p: boolean) {
86
+ paused = p;
87
+ if (!paused) {
88
+ setFeatures();
89
+ }
90
+ },
91
+ destroy: (): void => {
92
+ unByKey(sourceListeners);
93
+ panoramaImageListener();
94
+ },
95
+ };
96
+ }
97
+
98
+ /**
99
+ * represents a specific vector layer for cesium.
100
+ */
101
+ export default class VectorPanoramaImpl
102
+ extends LayerImplementation<PanoramaMap>
103
+ implements FeatureLayerImplementation
104
+ {
105
+ static get className(): string {
106
+ return 'VectorPanoramaImpl';
107
+ }
108
+
109
+ vectorProperties: VectorProperties;
110
+
111
+ source: VectorSource;
112
+
113
+ splitDirection: SplitDirection;
114
+
115
+ style: StyleItem;
116
+
117
+ featureVisibility: FeatureVisibility;
118
+
119
+ private _featureVisibilityListeners: (() => void)[] = [];
120
+
121
+ private _rootCollection: PrimitiveCollection;
122
+
123
+ private _context: VectorContext | null = null;
124
+
125
+ private _sourceVectorContextSync: SourceVectorContextSync | undefined;
126
+
127
+ private _sourceSync: PanoramaSourceSync;
128
+
129
+ globalHider: GlobalHider | undefined;
130
+
131
+ constructor(map: PanoramaMap, options: VectorImplementationOptions) {
132
+ super(map, options);
133
+
134
+ this.vectorProperties = options.vectorProperties;
135
+ this.source = new VectorSource();
136
+
137
+ this.splitDirection = options.splitDirection;
138
+ this.style = options.style;
139
+ this.featureVisibility = options.featureVisibility;
140
+
141
+ this._rootCollection = new PrimitiveCollection();
142
+ this._rootCollection[vcsLayerName] = options.name;
143
+ this.globalHider = options.globalHider;
144
+ this._sourceSync = setupMapSourceListeners(
145
+ map,
146
+ options.source,
147
+ this.source,
148
+ );
149
+ this._sourceSync.paused = true;
150
+ }
151
+
152
+ async initialize(): Promise<void> {
153
+ if (!this.initialized) {
154
+ this._context = new VectorContext(
155
+ this.map,
156
+ this._rootCollection,
157
+ this.splitDirection,
158
+ );
159
+ this.map.addPrimitiveCollection(this._rootCollection);
160
+ this._sourceVectorContextSync = createSourceVectorContextSync(
161
+ this.source,
162
+ this._context,
163
+ this.map.getCesiumWidget().scene,
164
+ this.style.style,
165
+ this.vectorProperties,
166
+ );
167
+ }
168
+ await super.initialize();
169
+ if (this.splitDirection) {
170
+ this.updateSplitDirection(this.splitDirection);
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Forces a complete re-render of all features.
176
+ */
177
+ refresh(): void {
178
+ this._sourceVectorContextSync?.refresh();
179
+ }
180
+
181
+ async activate(): Promise<void> {
182
+ if (!this.active) {
183
+ await super.activate();
184
+ if (this.active) {
185
+ this._sourceVectorContextSync?.activate();
186
+ this._rootCollection.show = true;
187
+ if (this._featureVisibilityListeners.length === 0) {
188
+ this._featureVisibilityListeners =
189
+ synchronizeFeatureVisibilityWithSource(
190
+ this.featureVisibility,
191
+ this.source,
192
+ this.globalHider as GlobalHider,
193
+ );
194
+ }
195
+ this._sourceSync.paused = false;
196
+ }
197
+ }
198
+ }
199
+
200
+ deactivate(): void {
201
+ super.deactivate();
202
+ this._sourceVectorContextSync?.deactivate();
203
+ this._rootCollection.show = false;
204
+ this._featureVisibilityListeners.forEach((cb) => {
205
+ cb();
206
+ });
207
+ this._featureVisibilityListeners = [];
208
+ this._sourceSync.paused = true;
209
+ }
210
+
211
+ updateStyle(style: StyleItem, silent?: boolean): void {
212
+ this.style = style;
213
+ this._sourceVectorContextSync?.setStyle(style.style, silent);
214
+ }
215
+
216
+ updateSplitDirection(splitDirection: SplitDirection): void {
217
+ this.splitDirection = splitDirection;
218
+ if (this.initialized) {
219
+ this._context?.updateSplitDirection(splitDirection);
220
+ }
221
+ }
222
+
223
+ destroy(): void {
224
+ if (this.initialized) {
225
+ this._sourceVectorContextSync?.destroy();
226
+ this._context?.destroy();
227
+ this.map.removePrimitiveCollection(this._rootCollection);
228
+ this._rootCollection.destroy();
229
+ }
230
+ this._context = null;
231
+ this._featureVisibilityListeners.forEach((cb) => {
232
+ cb();
233
+ });
234
+ this._featureVisibilityListeners = [];
235
+ this._sourceSync.destroy();
236
+ super.destroy();
237
+ }
238
+ }