@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
@@ -0,0 +1,242 @@
1
+ import { Cartesian3, Color } from '@vcmap-cesium/engine';
2
+ import { parseBoolean, parseInteger } from '@vcsuite/parsers';
3
+ import { check, is, maybe, oneOf } from '@vcsuite/check';
4
+ import AbstractFeatureProvider from '../featureProvider/abstractFeatureProvider.js';
5
+ import I3SCesiumImpl from './cesium/i3sCesiumImpl.js';
6
+ import FeatureLayer from './featureLayer.js';
7
+ import { layerClassRegistry } from '../classRegistry.js';
8
+ import CesiumMap from '../map/cesiumMap.js';
9
+ import BaseCesiumMap from '../map/baseCesiumMap.js';
10
+ import PanoramaMap from '../map/panoramaMap.js';
11
+ import Extent from '../util/extent.js';
12
+ import { isMobile } from '../util/isMobile.js';
13
+ import { mercatorProjection } from '../util/projection.js';
14
+ import { rectangleToMercatorExtent } from '../util/math.js';
15
+ import { cesiumColorToColor, getStringColor } from '../style/styleHelpers.js';
16
+ import VectorStyleItem from '../style/vectorStyleItem.js';
17
+ import I3SAttributeProvider from '../featureProvider/i3sAttributeProvider.js';
18
+ import AbstractAttributeProvider from '../featureProvider/abstractAttributeProvider.js';
19
+ import CompositeFeatureProvider from '../featureProvider/compositeFeatureProvider.js';
20
+ import { getProviderForOption } from '../featureProvider/featureProviderFactory.js';
21
+ class I3SLayer extends FeatureLayer {
22
+ static get className() {
23
+ return 'I3SLayer';
24
+ }
25
+ static getDefaultOptions() {
26
+ return {
27
+ ...FeatureLayer.getDefaultOptions(),
28
+ adjustMaterialAlphaMode: false,
29
+ applySymbology: false,
30
+ calculateNormals: false,
31
+ showFeatures: false,
32
+ cesium3dTilesetOptions: undefined,
33
+ lightColor: undefined,
34
+ outlineColor: undefined,
35
+ screenSpaceError: 16,
36
+ screenSpaceErrorMobile: 32,
37
+ highlightStyle: undefined,
38
+ hasBatchTable: true,
39
+ };
40
+ }
41
+ adjustMaterialAlphaMode;
42
+ applySymbology;
43
+ calculateNormals;
44
+ showFeatures;
45
+ cesium3dTilesetOptions;
46
+ lightColor;
47
+ outlineColor;
48
+ screenSpaceError;
49
+ screenSpaceErrorMobile;
50
+ highlightStyle = null;
51
+ hasBatchTable;
52
+ _supportedMaps = [CesiumMap.className, PanoramaMap.className];
53
+ _attributeProvider;
54
+ constructor(options) {
55
+ const defaultOptions = I3SLayer.getDefaultOptions();
56
+ super({ ...defaultOptions, ...options });
57
+ this.adjustMaterialAlphaMode = parseBoolean(options.adjustMaterialAlphaMode ?? defaultOptions.adjustMaterialAlphaMode);
58
+ this.applySymbology = parseBoolean(options.applySymbology ?? defaultOptions.applySymbology);
59
+ this.calculateNormals = parseBoolean(options.calculateNormals ?? defaultOptions.calculateNormals);
60
+ this.showFeatures = parseBoolean(options.showFeatures ?? defaultOptions.showFeatures);
61
+ this.screenSpaceError = parseInteger(options.screenSpaceError, defaultOptions.screenSpaceError);
62
+ this.screenSpaceErrorMobile = parseInteger(options.screenSpaceErrorMobile, defaultOptions.screenSpaceErrorMobile);
63
+ this.hasBatchTable = parseBoolean(options.hasBatchTable ?? defaultOptions.hasBatchTable);
64
+ if (options.highlightStyle) {
65
+ this.highlightStyle =
66
+ options.highlightStyle instanceof VectorStyleItem
67
+ ? options.highlightStyle
68
+ : new VectorStyleItem(options.highlightStyle);
69
+ }
70
+ const cesium3dTilesetOptions = options.cesium3dTilesetOptions || defaultOptions.cesium3dTilesetOptions;
71
+ this.cesium3dTilesetOptions = {
72
+ maximumScreenSpaceError: isMobile()
73
+ ? this.screenSpaceErrorMobile
74
+ : this.screenSpaceError,
75
+ ...cesium3dTilesetOptions,
76
+ ...(options.lightColor && {
77
+ lightColor: new Cartesian3(options.lightColor.x, options.lightColor.y, options.lightColor.z),
78
+ }),
79
+ ...(options.outlineColor && {
80
+ outlineColor: Color.fromCssColorString(options.outlineColor),
81
+ }),
82
+ };
83
+ const attributeProvider = getProviderForOption(options.attributeProvider);
84
+ if (this.hasBatchTable) {
85
+ if (is(attributeProvider, oneOf(CompositeFeatureProvider, AbstractAttributeProvider))) {
86
+ this._attributeProvider = attributeProvider;
87
+ }
88
+ else {
89
+ this._attributeProvider = new I3SAttributeProvider({});
90
+ }
91
+ }
92
+ else if (this.allowPicking) {
93
+ if (is(this.featureProvider, AbstractFeatureProvider)) {
94
+ this.attributeProvider = new CompositeFeatureProvider({
95
+ featureProviders: [this.featureProvider],
96
+ attributeProviders: [new I3SAttributeProvider({})],
97
+ });
98
+ }
99
+ else {
100
+ this.featureProvider = new I3SAttributeProvider({});
101
+ }
102
+ }
103
+ }
104
+ get attributeProvider() {
105
+ return this._attributeProvider;
106
+ }
107
+ set attributeProvider(provider) {
108
+ check(provider, maybe(oneOf(AbstractAttributeProvider, CompositeFeatureProvider)));
109
+ if (this._attributeProvider !== provider) {
110
+ this._attributeProvider = provider;
111
+ this.forceRedraw().catch((e) => {
112
+ this.getLogger().error(`Error forcing redraw after setting attribute provider: ${String(e)}`);
113
+ });
114
+ }
115
+ }
116
+ getImplementationOptions() {
117
+ return {
118
+ ...super.getImplementationOptions(),
119
+ allowPicking: this.allowPicking,
120
+ adjustMaterialAlphaMode: this.adjustMaterialAlphaMode,
121
+ applySymbology: this.applySymbology,
122
+ calculateNormals: this.calculateNormals,
123
+ showFeatures: this.showFeatures,
124
+ cesium3dTilesetOptions: this.cesium3dTilesetOptions,
125
+ hasBatchTable: this.hasBatchTable,
126
+ attributeProvider: this._attributeProvider,
127
+ };
128
+ }
129
+ createImplementationsForMap(map) {
130
+ if (map instanceof BaseCesiumMap) {
131
+ return [new I3SCesiumImpl(map, this.getImplementationOptions())];
132
+ }
133
+ return [];
134
+ }
135
+ getZoomToExtent() {
136
+ const metaExtent = super.getZoomToExtent();
137
+ if (metaExtent) {
138
+ return metaExtent;
139
+ }
140
+ const impl = this.getImplementations()[0];
141
+ if (impl?.data) {
142
+ const coordinates = rectangleToMercatorExtent(impl.data.extent);
143
+ const extent = new Extent({
144
+ projection: mercatorProjection.toJSON(),
145
+ coordinates,
146
+ });
147
+ if (extent.isValid()) {
148
+ return extent;
149
+ }
150
+ }
151
+ return null;
152
+ }
153
+ /**
154
+ * set the maximum screenspace error of this layer
155
+ */
156
+ setMaximumScreenSpaceError(value) {
157
+ this.getImplementations().forEach((impl) => {
158
+ if (impl.data) {
159
+ impl.data.layers.forEach(({ tileset }) => {
160
+ if (tileset) {
161
+ tileset.maximumScreenSpaceError = value;
162
+ }
163
+ });
164
+ }
165
+ });
166
+ }
167
+ toJSON(defaultOptions = I3SLayer.getDefaultOptions()) {
168
+ const config = super.toJSON(defaultOptions);
169
+ if (this.adjustMaterialAlphaMode !== defaultOptions.adjustMaterialAlphaMode) {
170
+ config.adjustMaterialAlphaMode = this.adjustMaterialAlphaMode;
171
+ }
172
+ if (this.applySymbology !== defaultOptions.applySymbology) {
173
+ config.applySymbology = this.applySymbology;
174
+ }
175
+ if (this.calculateNormals !== defaultOptions.calculateNormals) {
176
+ config.calculateNormals = this.calculateNormals;
177
+ }
178
+ if (this.showFeatures !== defaultOptions.showFeatures) {
179
+ config.showFeatures = this.showFeatures;
180
+ }
181
+ if (this.screenSpaceError !== defaultOptions.screenSpaceError) {
182
+ config.screenSpaceError = this.screenSpaceError;
183
+ }
184
+ if (this.screenSpaceErrorMobile !== defaultOptions.screenSpaceErrorMobile) {
185
+ config.screenSpaceErrorMobile = this.screenSpaceErrorMobile;
186
+ }
187
+ if (this.hasBatchTable !== defaultOptions.hasBatchTable) {
188
+ config.hasBatchTable = this.hasBatchTable;
189
+ }
190
+ if (this.highlightStyle) {
191
+ config.highlightStyle = this.highlightStyle.toJSON();
192
+ }
193
+ const tilesetOptions = { ...this.cesium3dTilesetOptions };
194
+ if (tilesetOptions.outlineColor) {
195
+ config.outlineColor = getStringColor(cesiumColorToColor(tilesetOptions.outlineColor));
196
+ }
197
+ delete tilesetOptions.outlineColor;
198
+ if (tilesetOptions.lightColor) {
199
+ config.lightColor = {
200
+ x: tilesetOptions.lightColor.x,
201
+ y: tilesetOptions.lightColor.y,
202
+ z: tilesetOptions.lightColor.z,
203
+ };
204
+ }
205
+ delete tilesetOptions.lightColor;
206
+ const usedScreenSpaceError = isMobile()
207
+ ? this.screenSpaceErrorMobile
208
+ : this.screenSpaceError;
209
+ if (tilesetOptions.maximumScreenSpaceError === usedScreenSpaceError) {
210
+ delete tilesetOptions.maximumScreenSpaceError;
211
+ }
212
+ if (Object.keys(tilesetOptions).length > 0) {
213
+ config.cesium3dTilesetOptions = structuredClone(tilesetOptions);
214
+ }
215
+ if (this._attributeProvider &&
216
+ !(this._attributeProvider instanceof I3SAttributeProvider) &&
217
+ !(this._attributeProvider instanceof AbstractFeatureProvider)) {
218
+ config.attributeProvider = this._attributeProvider.toJSON();
219
+ if (this._attributeProvider instanceof CompositeFeatureProvider) {
220
+ const { featureProviders, attributeProviders } = this._attributeProvider.toJSON();
221
+ config.featureProvider = featureProviders[0];
222
+ if (!(attributeProviders[0] instanceof I3SAttributeProvider)) {
223
+ config.attributeProvider = attributeProviders[0];
224
+ }
225
+ }
226
+ else {
227
+ config.attributeProvider = this._attributeProvider.toJSON();
228
+ }
229
+ }
230
+ return config;
231
+ }
232
+ /**
233
+ * disposes of this layer, removes instances from the current maps and the framework
234
+ */
235
+ destroy() {
236
+ this.attributeProvider?.destroy();
237
+ super.destroy();
238
+ }
239
+ }
240
+ layerClassRegistry.registerClass(I3SLayer.className, I3SLayer);
241
+ export default I3SLayer;
242
+ //# sourceMappingURL=i3sLayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i3sLayer.js","sourceRoot":"","sources":["../../../src/layer/i3sLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,uBAAuB,MAAM,+CAA+C,CAAC;AACpF,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAI7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;A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AAO,EAAE,CAAC;IAClB,CAAC;CACF;AAED,kBAAkB,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/D,eAAe,QAAQ,CAAC"}
@@ -7,7 +7,8 @@ import VcsEvent from '../vcsEvent.js';
7
7
  import GlobalHider from './globalHider.js';
8
8
  import type VcsMap from '../map/vcsMap.js';
9
9
  import type LayerImplementation from './layerImplementation.js';
10
- import type AbstractFeatureProvider from '../featureProvider/abstractFeatureProvider.js';
10
+ import { type default as AbstractFeatureProvider, type AbstractFeatureProviderOptions } from '../featureProvider/abstractFeatureProvider.js';
11
+ import type { default as AbstractAttributeProvider, AbstractAttributeProviderOptions } from '../featureProvider/abstractAttributeProvider.js';
11
12
  export type CopyrightOptions = {
12
13
  provider?: string;
13
14
  url?: string;
@@ -50,6 +51,14 @@ export type LayerOptions = VcsObjectOptions & {
50
51
  * Optional Request Headers which will be sent with each request.
51
52
  */
52
53
  headers?: Record<string, string>;
54
+ /**
55
+ * if true, the layer types of the map will be ignored when checking if the layer is supported
56
+ */
57
+ ignoreMapLayerTypes?: boolean;
58
+ /**
59
+ * An optional feature or attribute provider to provide or augment features on click events.
60
+ */
61
+ featureProvider?: AbstractFeatureProvider | AbstractAttributeProvider | AbstractFeatureProviderOptions | AbstractAttributeProviderOptions;
53
62
  };
54
63
  export type LayerImplementationOptions = {
55
64
  name: string;
@@ -71,12 +80,8 @@ declare class Layer<I extends LayerImplementation<VcsMap> = LayerImplementation<
71
80
  private _state;
72
81
  private _loadingPromise;
73
82
  private _initialized;
74
- /**
75
- * if provided, the layer will only be shown in the given MapNames.
76
- * An empty array will show the layer in all configured maps.
77
- * Changes require calling layer.redraw() to take effect.
78
- */
79
- mapNames: string[];
83
+ private _mapNames;
84
+ readonly mapNamesChanged: VcsEvent<string[]>;
80
85
  /**
81
86
  * The class names of the supported maps.
82
87
  */
@@ -105,9 +110,9 @@ declare class Layer<I extends LayerImplementation<VcsMap> = LayerImplementation<
105
110
  */
106
111
  stateChanged: VcsEvent<LayerState>;
107
112
  /**
108
- * An optional feature provider to provider features based on click events.
113
+ * An optional feature or attribute provider to provide or augment features on click events.
109
114
  */
110
- featureProvider: AbstractFeatureProvider | undefined;
115
+ featureProvider: AbstractFeatureProvider | AbstractAttributeProvider | undefined;
111
116
  private _locale;
112
117
  protected _headers?: Record<string, string>;
113
118
  /**
@@ -115,6 +120,7 @@ declare class Layer<I extends LayerImplementation<VcsMap> = LayerImplementation<
115
120
  * to other sources of data.
116
121
  */
117
122
  datasourceId?: string;
123
+ private _ignoreMapLayerTypes;
118
124
  constructor(options: LayerOptions);
119
125
  /**
120
126
  * True if this layer has been initialized, typically after its first activation.
@@ -133,6 +139,13 @@ declare class Layer<I extends LayerImplementation<VcsMap> = LayerImplementation<
133
139
  get hiddenObjectIds(): string[];
134
140
  set hiddenObjectIds(hiddenObjectIds: string[]);
135
141
  get globalHider(): GlobalHider | undefined;
142
+ get mapNames(): string[];
143
+ /**
144
+ * if provided, the layer will only be shown in the given MapNames.
145
+ * An empty array will show the layer in all configured maps.
146
+ * Changes will call reload on the layer.
147
+ */
148
+ set mapNames(mapNames: string[]);
136
149
  setGlobalHider(globalHider?: GlobalHider): void;
137
150
  /**
138
151
  * Indicates, that this layer is part of an exclusiveGroup
@@ -162,6 +175,12 @@ declare class Layer<I extends LayerImplementation<VcsMap> = LayerImplementation<
162
175
  * sets the locale and reloads the layer the if the URL is a locale aware Object.
163
176
  */
164
177
  set locale(value: string);
178
+ get ignoreMapLayerTypes(): boolean;
179
+ /**
180
+ * if set to true, the layer types of the map will be ignored when checking if the layer is supported.
181
+ * Changes will call reload on the layer.
182
+ */
183
+ set ignoreMapLayerTypes(value: boolean);
165
184
  /**
166
185
  * creates an array of layer implementations for the given map.
167
186
  * @param _map Map
@@ -236,7 +255,7 @@ declare class Layer<I extends LayerImplementation<VcsMap> = LayerImplementation<
236
255
  * Deactivates a layer, changing the internal view state
237
256
  */
238
257
  deactivate(): void;
239
- toJSON(): LayerOptions;
258
+ toJSON(defaultOptions?: LayerOptions): LayerOptions;
240
259
  /**
241
260
  * disposes of this layer, removes instances from the current maps and the framework
242
261
  */
@@ -7,6 +7,7 @@ import LayerState from './layerState.js';
7
7
  import VcsEvent from '../vcsEvent.js';
8
8
  import { layerClassRegistry } from '../classRegistry.js';
9
9
  import GlobalHider from './globalHider.js';
10
+ import { getProviderForOption } from '../featureProvider/featureProviderFactory.js';
10
11
  /**
11
12
  * Abstract base class for Layers.
12
13
  * To create a layer Implementation the function `createImplementationsForMap` has to be implemented.
@@ -30,7 +31,9 @@ class Layer extends VcsObject {
30
31
  copyright: undefined,
31
32
  datasourceId: undefined,
32
33
  headers: undefined,
34
+ ignoreMapLayerTypes: false,
33
35
  zIndex: 0,
36
+ featureProvider: undefined,
34
37
  };
35
38
  }
36
39
  extent;
@@ -39,12 +42,8 @@ class Layer extends VcsObject {
39
42
  _state;
40
43
  _loadingPromise;
41
44
  _initialized;
42
- /**
43
- * if provided, the layer will only be shown in the given MapNames.
44
- * An empty array will show the layer in all configured maps.
45
- * Changes require calling layer.redraw() to take effect.
46
- */
47
- mapNames;
45
+ _mapNames;
46
+ mapNamesChanged = new VcsEvent();
48
47
  /**
49
48
  * The class names of the supported maps.
50
49
  */
@@ -66,14 +65,14 @@ class Layer extends VcsObject {
66
65
  */
67
66
  exclusiveGroupsChanged;
68
67
  copyright;
69
- _implementations;
70
- _activeMaps;
68
+ _implementations = new Map();
69
+ _activeMaps = new Set();
71
70
  /**
72
71
  * Event raised, if the layers state changes. Is passed the LayerState as its only parameter
73
72
  */
74
73
  stateChanged;
75
74
  /**
76
- * An optional feature provider to provider features based on click events.
75
+ * An optional feature or attribute provider to provide or augment features on click events.
77
76
  */
78
77
  featureProvider;
79
78
  _locale;
@@ -83,16 +82,18 @@ class Layer extends VcsObject {
83
82
  * to other sources of data.
84
83
  */
85
84
  datasourceId;
85
+ _ignoreMapLayerTypes;
86
86
  constructor(options) {
87
- super(options);
88
87
  const defaultOptions = Layer.getDefaultOptions();
88
+ super({ ...defaultOptions, ...options });
89
89
  this.extent = options.extent ? new Extent(options.extent) : null;
90
90
  this.activeOnStartup = parseBoolean(options.activeOnStartup, defaultOptions.activeOnStartup);
91
91
  this._allowPicking = parseBoolean(options.allowPicking, defaultOptions.allowPicking);
92
92
  this._state = LayerState.INACTIVE;
93
93
  this._loadingPromise = null;
94
94
  this._initialized = false;
95
- this.mapNames = options.mapNames ?? defaultOptions.mapNames;
95
+ this._mapNames =
96
+ options.mapNames?.slice() ?? defaultOptions.mapNames;
96
97
  this._supportedMaps = [];
97
98
  this._url = options.url;
98
99
  this._zIndex = parseInteger(options.zIndex, defaultOptions.zIndex);
@@ -106,13 +107,12 @@ class Layer extends VcsObject {
106
107
  : defaultOptions.exclusiveGroups;
107
108
  this.exclusiveGroupsChanged = new VcsEvent();
108
109
  this.copyright = options.copyright || defaultOptions.copyright;
109
- this._implementations = new Map();
110
- this._activeMaps = new Set();
111
110
  this.stateChanged = new VcsEvent();
112
- this.featureProvider = undefined;
113
111
  this._locale = 'en';
114
112
  this.datasourceId = options.datasourceId || defaultOptions.datasourceId;
115
113
  this._headers = structuredClone(options.headers);
114
+ this._ignoreMapLayerTypes = parseBoolean(options.ignoreMapLayerTypes, defaultOptions.ignoreMapLayerTypes);
115
+ this.featureProvider = getProviderForOption(options.featureProvider);
116
116
  }
117
117
  /**
118
118
  * True if this layer has been initialized, typically after its first activation.
@@ -175,6 +175,26 @@ class Layer extends VcsObject {
175
175
  get globalHider() {
176
176
  return this._globalHider;
177
177
  }
178
+ get mapNames() {
179
+ return this._mapNames.slice();
180
+ }
181
+ /**
182
+ * if provided, the layer will only be shown in the given MapNames.
183
+ * An empty array will show the layer in all configured maps.
184
+ * Changes will call reload on the layer.
185
+ */
186
+ set mapNames(mapNames) {
187
+ check(mapNames, [String]);
188
+ if (mapNames.length !== this._mapNames.length ||
189
+ !mapNames.every((m) => this._mapNames.includes(m))) {
190
+ this._mapNames = mapNames.slice();
191
+ this.mapNamesChanged.raiseEvent(this._mapNames.slice());
192
+ this.forceRedraw().catch((err) => {
193
+ this.getLogger().error('failed to reload after mapNames setting');
194
+ this.getLogger().error(String(err));
195
+ });
196
+ }
197
+ }
178
198
  setGlobalHider(globalHider) {
179
199
  check(globalHider, maybe(GlobalHider));
180
200
  if (globalHider && this.active) {
@@ -253,6 +273,23 @@ class Layer extends VcsObject {
253
273
  }
254
274
  }
255
275
  }
276
+ get ignoreMapLayerTypes() {
277
+ return this._ignoreMapLayerTypes;
278
+ }
279
+ /**
280
+ * if set to true, the layer types of the map will be ignored when checking if the layer is supported.
281
+ * Changes will call reload on the layer.
282
+ */
283
+ set ignoreMapLayerTypes(value) {
284
+ check(value, Boolean);
285
+ if (this._ignoreMapLayerTypes !== value) {
286
+ this._ignoreMapLayerTypes = value;
287
+ this.reload().catch((err) => {
288
+ this.getLogger().error('failed to reload after setting ignoreMapLayerTypes');
289
+ this.getLogger().error(String(err));
290
+ });
291
+ }
292
+ }
256
293
  /**
257
294
  * creates an array of layer implementations for the given map.
258
295
  * @param _map Map
@@ -269,20 +306,51 @@ class Layer extends VcsObject {
269
306
  */
270
307
  getImplementationsForMap(map) {
271
308
  if (!this._implementations.has(map)) {
309
+ let currentlySupported = this.isSupported(map);
310
+ let destroy;
311
+ const layerTypesChangedListener = map.layerTypesChanged.addEventListener(() => {
312
+ const nowSupported = this.isSupported(map);
313
+ if (currentlySupported !== nowSupported) {
314
+ currentlySupported = nowSupported;
315
+ // either destroy current implementation or remove the empty array for unsupported layers.
316
+ // either way we have to reset this map if the inclusion changes
317
+ destroy();
318
+ if (this.initialized &&
319
+ map.active &&
320
+ (this.active || this.loading)) {
321
+ this.getImplementationsForMap(map);
322
+ if (nowSupported) {
323
+ this._activateImplsForMap(map).catch(() => {
324
+ this.getLogger().error(`Layer ${this.name} could not activate impl for map ${map.name} after layerTypesChanged`);
325
+ });
326
+ }
327
+ }
328
+ }
329
+ });
330
+ destroy = () => {
331
+ layerTypesChangedListener();
332
+ this._implementations.get(map)?.implementations?.forEach((i) => {
333
+ i.destroy();
334
+ });
335
+ this._implementations.delete(map);
336
+ };
272
337
  if (this.isSupported(map)) {
273
- this._implementations.set(map, this.createImplementationsForMap(map));
338
+ this._implementations.set(map, {
339
+ implementations: this.createImplementationsForMap(map),
340
+ destroy,
341
+ });
274
342
  }
275
343
  else {
276
- this._implementations.set(map, []);
344
+ this._implementations.set(map, { implementations: [], destroy });
277
345
  }
278
346
  }
279
- return this._implementations.get(map);
347
+ return this._implementations.get(map).implementations;
280
348
  }
281
349
  /**
282
350
  * Returns all implementation of this layer for all maps
283
351
  */
284
352
  getImplementations() {
285
- return [...this._implementations.values()].flat();
353
+ return [...this._implementations.values()].flatMap((i) => i.implementations);
286
354
  }
287
355
  getImplementationOptions() {
288
356
  return {
@@ -367,19 +435,22 @@ class Layer extends VcsObject {
367
435
  */
368
436
  removedFromMap(map) {
369
437
  this._activeMaps.delete(map);
370
- this.getImplementationsForMap(map).forEach((impl) => {
371
- impl.destroy();
372
- });
373
- this._implementations.delete(map);
438
+ this._implementations.get(map)?.destroy();
374
439
  }
375
440
  /**
376
441
  * checks if the currently active map supports this layer
377
442
  * @param map
378
443
  */
379
444
  isSupported(map) {
380
- return (map &&
381
- this._supportedMaps.includes(map.className) &&
382
- (this.mapNames.length === 0 || this.mapNames.indexOf(map.name) >= 0));
445
+ if (!map) {
446
+ return false;
447
+ }
448
+ const isSupportedMap = () => this._supportedMaps.includes(map.className);
449
+ const isAllowedMapName = () => this._mapNames.length === 0 || this._mapNames.includes(map.name);
450
+ const isAllowedLayerType = () => this._ignoreMapLayerTypes ||
451
+ map.layerTypes.length === 0 ||
452
+ map.layerTypes.includes(this.className);
453
+ return (!!map && isSupportedMap() && isAllowedMapName() && isAllowedLayerType());
383
454
  }
384
455
  async _activateImplsForMap(map) {
385
456
  const impls = this.getImplementationsForMap(map);
@@ -389,9 +460,12 @@ class Layer extends VcsObject {
389
460
  catch (err) {
390
461
  this.getLogger().error(`Layer ${this.name} could not activate impl for map ${map.name}`);
391
462
  this.getLogger().error(String(err));
392
- this._implementations.set(map, []);
393
- impls.forEach((i) => {
394
- i.destroy();
463
+ this._implementations.get(map)?.destroy();
464
+ this._implementations.set(map, {
465
+ implementations: [],
466
+ destroy: () => {
467
+ this._implementations.delete(map);
468
+ },
395
469
  });
396
470
  }
397
471
  }
@@ -407,7 +481,7 @@ class Layer extends VcsObject {
407
481
  if (this._state !== LayerState.LOADING) {
408
482
  return;
409
483
  }
410
- await Promise.all([...this._activeMaps].map((m) => this._activateImplsForMap(m)));
484
+ await Promise.all([...this._activeMaps.keys()].map((m) => this._activateImplsForMap(m)));
411
485
  if (this._state !== LayerState.LOADING) {
412
486
  return;
413
487
  }
@@ -467,17 +541,16 @@ class Layer extends VcsObject {
467
541
  }
468
542
  }
469
543
  }
470
- toJSON() {
471
- const config = super.toJSON();
472
- const defaultOptions = Layer.getDefaultOptions();
544
+ toJSON(defaultOptions = Layer.getDefaultOptions()) {
545
+ const config = super.toJSON(defaultOptions);
473
546
  if (this.activeOnStartup !== defaultOptions.activeOnStartup) {
474
547
  config.activeOnStartup = this.activeOnStartup;
475
548
  }
476
549
  if (this.allowPicking !== defaultOptions.allowPicking) {
477
550
  config.allowPicking = this.allowPicking;
478
551
  }
479
- if (this.mapNames.length > 0) {
480
- config.mapNames = this.mapNames.slice();
552
+ if (this._mapNames.length > 0) {
553
+ config.mapNames = this._mapNames.slice();
481
554
  }
482
555
  if (this.hiddenObjectIds.length > 0) {
483
556
  config.hiddenObjectIds = this.hiddenObjectIds.slice();
@@ -503,6 +576,12 @@ class Layer extends VcsObject {
503
576
  if (this._zIndex !== defaultOptions.zIndex) {
504
577
  config.zIndex = this._zIndex;
505
578
  }
579
+ if (this._ignoreMapLayerTypes !== defaultOptions.ignoreMapLayerTypes) {
580
+ config.ignoreMapLayerTypes = this._ignoreMapLayerTypes;
581
+ }
582
+ if (this.featureProvider) {
583
+ config.featureProvider = this.featureProvider.toJSON();
584
+ }
506
585
  return config;
507
586
  }
508
587
  /**
@@ -522,6 +601,7 @@ class Layer extends VcsObject {
522
601
  this.stateChanged.destroy();
523
602
  this.zIndexChanged.destroy();
524
603
  this.exclusiveGroupsChanged.destroy();
604
+ this.mapNamesChanged.destroy();
525
605
  }
526
606
  }
527
607
  layerClassRegistry.registerClass(Layer.className, Layer);