@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
@@ -45,6 +45,8 @@ import type { GeoJSONwriteOptions } from './geojsonHelpers.js';
45
45
  import { vcsLayerName } from './layerSymbols.js';
46
46
  import type CesiumTilesetCesiumImpl from './cesium/cesiumTilesetCesiumImpl.js';
47
47
  import VcsEvent from '../vcsEvent.js';
48
+ import PanoramaMap from '../map/panoramaMap.js';
49
+ import VectorPanoramaImpl from './panorama/vectorPanoramaImpl.js';
48
50
 
49
51
  export type VectorOptions = FeatureLayerOptions & {
50
52
  /**
@@ -72,8 +74,13 @@ export type VectorImplementationOptions = FeatureLayerImplementationOptions & {
72
74
  };
73
75
 
74
76
  /**
75
- * VectorLayer Layer for OpenlayersMap, Cesium and ObliqueMap
76
- * @group Layer
77
+ * the vector layer is the standard layer to display vector features on the map. mostly, a specialization
78
+ * is used to load data from a certain source, e.g. GeoJSONLayer, FlatGeobufLayer, etc. But it can also
79
+ * be used as a generic layer to add features to, mostly at runtime.
80
+ *
81
+ * This layer ignores the mapLayerTypes configuration by default, as it is mostly used to display user data.
82
+ * Be sure to configure this otherwise if needed and reset the default when extending this class to implement
83
+ * a layer for a specific data source.
77
84
  */
78
85
  class VectorLayer
79
86
  extends FeatureLayer<
@@ -81,6 +88,7 @@ class VectorLayer
81
88
  | VectorOpenlayersImpl
82
89
  | VectorCesiumImpl
83
90
  | CesiumTilesetCesiumImpl
91
+ | VectorPanoramaImpl
84
92
  >
85
93
  implements SplitLayer
86
94
  {
@@ -95,11 +103,11 @@ class VectorLayer
95
103
  maxResolution: undefined,
96
104
  minResolution: undefined,
97
105
  dontUseTerrainForOblique: false,
98
- zIndex: 50,
99
106
  highlightStyle: undefined,
100
107
  isDynamic: false,
101
- vectorProperties: {}, // XXX or should we return VectorProperties default options?
108
+ vectorProperties: undefined, // XXX or should we return VectorProperties default options?
102
109
  vectorClusterGroup: undefined,
110
+ ignoreMapLayerTypes: true,
103
111
  };
104
112
  }
105
113
 
@@ -107,6 +115,7 @@ class VectorLayer
107
115
  CesiumMap.className,
108
116
  ObliqueMap.className,
109
117
  OpenlayersMap.className,
118
+ PanoramaMap.className,
110
119
  ];
111
120
 
112
121
  source: VectorSource = new VectorSource({});
@@ -148,9 +157,9 @@ class VectorLayer
148
157
  }>();
149
158
 
150
159
  constructor(options: VectorOptions) {
151
- super(options);
152
-
153
160
  const defaultOptions = VectorLayer.getDefaultOptions();
161
+ super({ ...defaultOptions, ...options });
162
+
154
163
  this.projection = new Projection(options.projection);
155
164
  this.maxResolution =
156
165
  options.maxResolution != null
@@ -291,6 +300,7 @@ class VectorLayer
291
300
  | VectorOpenlayersImpl
292
301
  | VectorCesiumImpl
293
302
  | CesiumTilesetCesiumImpl
303
+ | VectorPanoramaImpl
294
304
  )[] {
295
305
  if (!this.visibility || !!this.vectorClusterGroup) {
296
306
  return [];
@@ -308,6 +318,10 @@ class VectorLayer
308
318
  return [new VectorObliqueImpl(map, this.getImplementationOptions())];
309
319
  }
310
320
 
321
+ if (map instanceof PanoramaMap) {
322
+ return [new VectorPanoramaImpl(map, this.getImplementationOptions())];
323
+ }
324
+
311
325
  return [];
312
326
  }
313
327
 
@@ -499,11 +513,13 @@ class VectorLayer
499
513
  return null;
500
514
  }
501
515
 
502
- toJSON(): VectorOptions {
503
- const config: VectorOptions = super.toJSON();
504
- const defaultOptions = VectorLayer.getDefaultOptions();
516
+ toJSON(defaultOptions = VectorLayer.getDefaultOptions()): VectorOptions {
517
+ const config: VectorOptions = super.toJSON(defaultOptions);
518
+
519
+ const defaultProjection =
520
+ defaultOptions.projection ?? getDefaultProjection();
505
521
 
506
- if (this.projection.epsg !== getDefaultProjection().epsg) {
522
+ if (this.projection.epsg !== defaultProjection.epsg) {
507
523
  config.projection = this.projection.toJSON();
508
524
  }
509
525
 
@@ -529,7 +545,9 @@ class VectorLayer
529
545
  config.isDynamic = this.isDynamic;
530
546
  }
531
547
 
532
- const vectorPropertiesConfig = this.vectorProperties.getVcsMeta();
548
+ const vectorPropertiesConfig = this.vectorProperties.getVcsMeta(
549
+ defaultOptions.vectorProperties,
550
+ );
533
551
  if (Object.keys(vectorPropertiesConfig).length > 0) {
534
552
  config.vectorProperties = vectorPropertiesConfig;
535
553
  }
@@ -347,8 +347,8 @@ class VectorProperties {
347
347
  modelRoll: 0,
348
348
  modelOptions: undefined,
349
349
  modelAutoScale: false,
350
- baseUrl: undefined,
351
350
  primitiveOptions: undefined,
351
+ baseUrl: undefined,
352
352
  };
353
353
  }
354
354
 
@@ -1683,6 +1683,15 @@ class VectorProperties {
1683
1683
  if (this.baseUrl !== defaultValues.baseUrl) {
1684
1684
  vcsMeta.baseUrl = this.baseUrl;
1685
1685
  }
1686
+ if (!deepEqual(this.modelOptions, defaultOptions?.modelOptions)) {
1687
+ vcsMeta.modelOptions = this.modelOptions;
1688
+ }
1689
+ if (this.modelAutoScale !== defaultValues.modelAutoScale) {
1690
+ vcsMeta.modelAutoScale = this.modelAutoScale;
1691
+ }
1692
+ if (!deepEqual(this.primitiveOptions, defaultOptions?.primitiveOptions)) {
1693
+ vcsMeta.primitiveOptions = this.primitiveOptions;
1694
+ }
1686
1695
  return vcsMeta;
1687
1696
  }
1688
1697
 
@@ -1,3 +1,4 @@
1
+ import { check, is, maybe, oneOf } from '@vcsuite/check';
1
2
  import Style, { type StyleFunction } from 'ol/style/Style.js';
2
3
  import type { Feature } from 'ol/index.js';
3
4
  import type { Size } from 'ol/size.js';
@@ -53,6 +54,14 @@ import VectorTileCesiumImpl from './cesium/vectorTileCesiumImpl.js';
53
54
  import VectorTilePanoramaImpl from './panorama/vectorTilePanoramaImpl.js';
54
55
  import PanoramaMap from '../map/panoramaMap.js';
55
56
  import type LayerImplementation from './layerImplementation.js';
57
+ import AbstractFeatureProvider from '../featureProvider/abstractFeatureProvider.js';
58
+ import AbstractAttributeProvider, {
59
+ type AbstractAttributeProviderOptions,
60
+ type AttributeProvider,
61
+ } from '../featureProvider/abstractAttributeProvider.js';
62
+ import CompositeFeatureProvider from '../featureProvider/compositeFeatureProvider.js';
63
+ import { rectangleToMercatorExtent } from '../util/math.js';
64
+ import { getProviderForOption } from '../featureProvider/featureProviderFactory.js';
56
65
 
57
66
  /**
58
67
  * synchronizes featureVisibility Symbols on the feature;
@@ -113,14 +122,18 @@ export type VectorTileOptions = FeatureLayerOptions & {
113
122
  declutter?: boolean;
114
123
  debug?: boolean;
115
124
  renderer?: VectorTileRenderer;
125
+ /**
126
+ * an optional attribute provider to provide custom attributes for the tileset features on load
127
+ */
128
+ attributeProvider?: AttributeProvider | AbstractAttributeProviderOptions;
116
129
  };
117
130
 
118
131
  export type VectorTileImplementationOptions =
119
132
  FeatureLayerImplementationOptions & {
120
133
  tileProvider: TileProvider;
121
134
  tileSize: Size;
122
- minLevel: number;
123
- maxLevel: number;
135
+ minLevel?: number;
136
+ maxLevel?: number;
124
137
  extent?: Extent;
125
138
  declutter: boolean;
126
139
  vectorProperties: VectorProperties;
@@ -163,6 +176,7 @@ class VectorTileLayer<
163
176
  declutter: true,
164
177
  debug: false,
165
178
  renderer: 'image',
179
+ attributeProvider: undefined,
166
180
  };
167
181
  }
168
182
 
@@ -177,9 +191,11 @@ class VectorTileLayer<
177
191
 
178
192
  tileProvider: TileProvider;
179
193
 
180
- private _maxLevel: number;
194
+ private _attributeProvider?: AttributeProvider;
195
+
196
+ private _maxLevel?: number;
181
197
 
182
- private _minLevel: number;
198
+ private _minLevel?: number;
183
199
 
184
200
  private _declutter: boolean;
185
201
 
@@ -200,16 +216,19 @@ class VectorTileLayer<
200
216
 
201
217
  private _renderer: VectorTileRenderer;
202
218
 
219
+ private _defaultFeatureProvider?:
220
+ | TileProviderFeatureProvider
221
+ | CompositeFeatureProvider;
222
+
203
223
  /**
204
224
  * @param options
205
225
  */
206
226
  constructor(options: VectorTileOptions) {
207
- super(options);
227
+ const defaultOptions = VectorTileLayer.getDefaultOptions();
228
+ super({ ...defaultOptions, ...options });
208
229
 
209
230
  this._supportedMaps = [CesiumMap.className, OpenlayersMap.className];
210
231
 
211
- const defaultOptions = VectorTileLayer.getDefaultOptions();
212
-
213
232
  this.highlightStyle = undefined;
214
233
  if (options.highlightStyle) {
215
234
  this.highlightStyle =
@@ -230,6 +249,7 @@ class VectorTileLayer<
230
249
  tileProviderClassRegistry,
231
250
  options.tileProvider ?? { type: TileProvider.className },
232
251
  ) as TileProvider);
252
+
233
253
  if (this.tileProvider) {
234
254
  this.tileProvider.locale = this.locale;
235
255
  }
@@ -243,6 +263,17 @@ class VectorTileLayer<
243
263
  vectorTileRenderers,
244
264
  defaultOptions.renderer,
245
265
  );
266
+
267
+ const attributeProvider = getProviderForOption(options.attributeProvider);
268
+
269
+ if (
270
+ is(
271
+ attributeProvider,
272
+ oneOf(CompositeFeatureProvider, AbstractAttributeProvider),
273
+ )
274
+ ) {
275
+ this._attributeProvider = attributeProvider;
276
+ }
246
277
  }
247
278
 
248
279
  /**
@@ -268,6 +299,26 @@ class VectorTileLayer<
268
299
  this.vectorProperties.allowPicking = allowPicking;
269
300
  }
270
301
 
302
+ get attributeProvider(): AttributeProvider | undefined {
303
+ return this._attributeProvider;
304
+ }
305
+
306
+ set attributeProvider(provider: AttributeProvider | undefined) {
307
+ check(
308
+ provider,
309
+ maybe(oneOf(AbstractAttributeProvider, CompositeFeatureProvider)),
310
+ );
311
+
312
+ if (this._attributeProvider !== provider) {
313
+ this._attributeProvider = provider;
314
+ this.forceRedraw().catch((e: unknown) => {
315
+ this.getLogger().error(
316
+ `Error forcing redraw after setting attribute provider: ${String(e)}`,
317
+ );
318
+ });
319
+ }
320
+ }
321
+
271
322
  async initialize(): Promise<void> {
272
323
  if (!this.initialized) {
273
324
  this._tileLoadEventListener =
@@ -280,14 +331,26 @@ class VectorTileLayer<
280
331
  void this.reload();
281
332
  });
282
333
 
283
- if (this._renderer === 'image') {
284
- // primitives dont need a feature provider
285
- this.featureProvider = new TileProviderFeatureProvider(this.name, {
286
- // XXX this overwrites
334
+ if (
335
+ this._renderer === 'image' &&
336
+ !(this.featureProvider instanceof AbstractFeatureProvider)
337
+ ) {
338
+ const defaultFeatureProvider = new TileProviderFeatureProvider({
287
339
  style: this.style,
288
340
  tileProvider: this.tileProvider,
289
341
  vectorProperties: this.vectorProperties,
290
342
  });
343
+
344
+ if (this.featureProvider instanceof AbstractAttributeProvider) {
345
+ const attributeProvider = this.featureProvider;
346
+ this._defaultFeatureProvider = new CompositeFeatureProvider({
347
+ featureProviders: [defaultFeatureProvider],
348
+ attributeProviders: [attributeProvider],
349
+ });
350
+ } else {
351
+ this._defaultFeatureProvider = defaultFeatureProvider;
352
+ }
353
+ this.featureProvider = this._defaultFeatureProvider;
291
354
  }
292
355
  }
293
356
  await super.initialize();
@@ -298,27 +361,40 @@ class VectorTileLayer<
298
361
  return this._styleZIndex;
299
362
  }
300
363
 
301
- private _handleTileLoaded({ rtree }: TileLoadedEvent): void {
302
- rtree
303
- .all()
304
- .map((item) => item.value)
305
- .forEach((feature) => {
306
- const featureStyle = feature.getStyle();
307
- if (featureStyle && featureStyle instanceof Style) {
308
- featureStyle.setZIndex(this._getNextStyleZIndex());
309
- }
310
- feature[vcsLayerName] = this.name;
311
- feature.getStyleFunction = (): StyleFunction => {
312
- return this._featureStyle.bind(this) as StyleFunction;
313
- };
314
- if (this.tileProvider.trackFeaturesToTiles && this.globalHider) {
315
- synchronizeFeatureVisibility(
316
- this.featureVisibility,
317
- this.globalHider,
318
- feature,
319
- );
320
- }
321
- });
364
+ private _handleTileLoaded({ rtree, tileId }: TileLoadedEvent): void {
365
+ const features = rtree.all().map((item) => {
366
+ const feature = item.value;
367
+ const featureStyle = feature.getStyle();
368
+ if (featureStyle && featureStyle instanceof Style) {
369
+ featureStyle.setZIndex(this._getNextStyleZIndex());
370
+ }
371
+ feature[vcsLayerName] = this.name;
372
+ feature.getStyleFunction = (): StyleFunction => {
373
+ return this._featureStyle.bind(this) as StyleFunction;
374
+ };
375
+ if (this.tileProvider.trackFeaturesToTiles && this.globalHider) {
376
+ synchronizeFeatureVisibility(
377
+ this.featureVisibility,
378
+ this.globalHider,
379
+ feature,
380
+ );
381
+ }
382
+ return feature;
383
+ });
384
+
385
+ if (this._attributeProvider) {
386
+ const { x, y, level } = this.tileProvider.parseCacheKey(tileId);
387
+ const rectangle = this.tileProvider.tilingScheme.tileXYToRectangle(
388
+ x,
389
+ y,
390
+ level,
391
+ );
392
+ this._attributeProvider
393
+ .augmentFeatures(features, rectangleToMercatorExtent(rectangle))
394
+ .catch((error: unknown) => {
395
+ this.getLogger().error(`Error augmenting features: ${String(error)}`);
396
+ });
397
+ }
322
398
  }
323
399
 
324
400
  setGlobalHider(globalHider: GlobalHider): void {
@@ -517,27 +593,10 @@ class VectorTileLayer<
517
593
  });
518
594
  }
519
595
 
520
- destroy(): void {
521
- this._featureVisibilityListeners.forEach((cb) => {
522
- cb();
523
- });
524
- super.destroy();
525
- this._tileLoadEventListener();
526
- if (this.featureProvider) {
527
- this.featureProvider.destroy();
528
- }
529
- if (this.tileProvider) {
530
- this.tileProvider.destroy();
531
- }
532
- this._vectorPropertiesChangedListener();
533
- if (this.vectorProperties) {
534
- this.vectorProperties.destroy();
535
- }
536
- }
537
-
538
- toJSON(): VectorTileOptions {
539
- const config: VectorTileOptions = super.toJSON();
540
- const defaultOptions = VectorTileLayer.getDefaultOptions();
596
+ toJSON(
597
+ defaultOptions = VectorTileLayer.getDefaultOptions(),
598
+ ): VectorTileOptions {
599
+ const config: VectorTileOptions = super.toJSON(defaultOptions);
541
600
 
542
601
  if (this._maxLevel !== defaultOptions.maxLevel) {
543
602
  config.maxLevel = this._maxLevel;
@@ -572,8 +631,37 @@ class VectorTileLayer<
572
631
  config.debug = this._debug;
573
632
  }
574
633
 
634
+ if (this.featureProvider === this._defaultFeatureProvider) {
635
+ delete config.featureProvider;
636
+ if (this.featureProvider instanceof CompositeFeatureProvider) {
637
+ const { attributeProviders } = this.featureProvider.toJSON();
638
+ config.featureProvider = attributeProviders[0];
639
+ }
640
+ }
641
+
642
+ if (this._attributeProvider) {
643
+ config.attributeProvider = this._attributeProvider.toJSON();
644
+ }
645
+
575
646
  return config;
576
647
  }
648
+
649
+ destroy(): void {
650
+ this._featureVisibilityListeners.forEach((cb) => {
651
+ cb();
652
+ });
653
+ this.attributeProvider?.destroy();
654
+ this._defaultFeatureProvider?.destroy();
655
+ super.destroy();
656
+ this._tileLoadEventListener();
657
+ if (this.tileProvider) {
658
+ this.tileProvider.destroy();
659
+ }
660
+ this._vectorPropertiesChangedListener();
661
+ if (this.vectorProperties) {
662
+ this.vectorProperties.destroy();
663
+ }
664
+ }
577
665
  }
578
666
 
579
667
  layerClassRegistry.registerClass(VectorTileLayer.className, VectorTileLayer);
@@ -56,6 +56,7 @@ class WFSLayer extends VectorLayer {
56
56
  featurePrefix: '',
57
57
  getFeatureOptions: {},
58
58
  version: undefined,
59
+ ignoreMapLayerTypes: false,
59
60
  };
60
61
  }
61
62
 
@@ -66,7 +67,8 @@ class WFSLayer extends VectorLayer {
66
67
  (proj.epsg as string).match(/\d+/)?.[0] as string
67
68
  }`,
68
69
  ];
69
- super({ ...options, projection: proj });
70
+ const defaultOptions = WFSLayer.getDefaultOptions();
71
+ super({ ...defaultOptions, ...options, projection: proj });
70
72
 
71
73
  this.featureType = Array.isArray(options.featureType)
72
74
  ? options.featureType
@@ -157,15 +159,16 @@ class WFSLayer extends VectorLayer {
157
159
  this.addFeatures(features);
158
160
  }
159
161
 
160
- toJSON(): WFSOptions {
161
- const config: Partial<WFSOptions> = super.toJSON();
162
- const defaultOptions = WFSLayer.getDefaultOptions();
162
+ toJSON(defaultOptions = WFSLayer.getDefaultOptions()): WFSOptions {
163
+ const config: Partial<WFSOptions> = super.toJSON(defaultOptions);
163
164
  config.featureType = this.featureType.slice();
164
165
  config.featureNS = this.featureNS;
165
166
  config.featurePrefix = this.featurePrefix;
167
+
166
168
  if (Object.keys(this.getFeaturesOptions).length > 0) {
167
169
  config.getFeatureOptions = this.getFeaturesOptions;
168
170
  }
171
+
169
172
  if (this.version !== defaultOptions.version) {
170
173
  config.version = this.version;
171
174
  }
@@ -16,6 +16,10 @@ import WmsOpenlayersImpl from './openlayers/wmsOpenlayersImpl.js';
16
16
  import Extent from '../util/extent.js';
17
17
  import { layerClassRegistry } from '../classRegistry.js';
18
18
  import type VcsMap from '../map/vcsMap.js';
19
+ import AbstractAttributeProvider from '../featureProvider/abstractAttributeProvider.js';
20
+ import CompositeFeatureProvider, {
21
+ type CompositeFeatureProviderOptions,
22
+ } from '../featureProvider/compositeFeatureProvider.js';
19
23
 
20
24
  export type WMSImplementationOptions = RasterLayerImplementationOptions & {
21
25
  parameters: Record<string, string>;
@@ -39,9 +43,10 @@ export type WMSOptions = RasterLayerOptions & {
39
43
  * key value pair of additional WMS parameters, url query notation possible
40
44
  */
41
45
  parameters?: Record<string, string> | string;
42
-
43
46
  /**
44
47
  * whether this layer should send getFeatureInfo requests to the service when objects are clicked.
48
+ * do not provide this option AND a feature provider. this option will configure a
49
+ * layer specific WMSFeatureProvider. providing an attribute provider will create a composite feature provider.
45
50
  */
46
51
  featureInfo?: Partial<WMSFeatureProviderOptions>;
47
52
  /**
@@ -92,12 +97,14 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
92
97
 
93
98
  private _featureInfoOptions: Partial<WMSFeatureProviderOptions> | undefined;
94
99
 
100
+ private _attributeProvider?: AbstractAttributeProvider;
101
+
95
102
  /**
96
103
  * @param options
97
104
  */
98
105
  constructor(options: WMSOptions) {
99
- super(options);
100
106
  const defaultOptions = WMSLayer.getDefaultOptions();
107
+ super({ ...defaultOptions, ...options });
101
108
 
102
109
  this.version = options.version || (defaultOptions.version as string);
103
110
 
@@ -140,6 +147,10 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
140
147
  options.singleImage2d,
141
148
  defaultOptions.singleImage2d,
142
149
  );
150
+
151
+ if (this.featureProvider instanceof AbstractAttributeProvider) {
152
+ this._attributeProvider = this.featureProvider;
153
+ }
143
154
  }
144
155
 
145
156
  initialize(): Promise<void> {
@@ -163,9 +174,19 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
163
174
  extent: this.extent,
164
175
  parameters: this.parameters,
165
176
  version: this.version,
177
+ headers: this.headers,
166
178
  ...this._featureInfoOptions,
167
179
  };
168
- this.featureProvider = new WMSFeatureProvider(this.name, options);
180
+
181
+ const wmsFeatureProvider = new WMSFeatureProvider(options);
182
+ if (this._attributeProvider) {
183
+ this.featureProvider = new CompositeFeatureProvider({
184
+ featureProviders: [wmsFeatureProvider],
185
+ attributeProviders: [this._attributeProvider],
186
+ });
187
+ } else {
188
+ this.featureProvider = wmsFeatureProvider;
189
+ }
169
190
  }
170
191
  }
171
192
 
@@ -217,9 +238,8 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
217
238
  return this.parameters.LAYERS ? this.parameters.LAYERS.split(',') : [];
218
239
  }
219
240
 
220
- toJSON(): WMSOptions {
221
- const config: WMSOptions = super.toJSON();
222
- const defaultOptions = WMSLayer.getDefaultOptions();
241
+ toJSON(defaultOptions = WMSLayer.getDefaultOptions()): WMSOptions {
242
+ const config: WMSOptions = super.toJSON(defaultOptions);
223
243
 
224
244
  if (this.parameters.LAYERS) {
225
245
  config.layers = this.parameters.LAYERS;
@@ -261,49 +281,61 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
261
281
  config.singleImage2d = this.singleImage2d;
262
282
  }
263
283
 
264
- if (
265
- this.featureProvider &&
266
- this.featureProvider instanceof WMSFeatureProvider
267
- ) {
268
- const featureInfoConfig: Partial<WMSFeatureProviderOptions> =
269
- this.featureProvider.toJSON();
270
- if (
271
- this.tileSize[0] === featureInfoConfig?.tileSize?.[0] ||
272
- this.tileSize[1] === featureInfoConfig?.tileSize?.[1]
273
- ) {
274
- delete featureInfoConfig.tileSize;
275
- }
276
- if (
277
- Object.entries(this.parameters).every(
278
- ([key, value]) => featureInfoConfig?.parameters?.[key] === value,
279
- )
280
- ) {
281
- delete featureInfoConfig.parameters;
282
- }
283
- if (
284
- featureInfoConfig.extent &&
285
- new Extent(featureInfoConfig.extent).equals(this.extent)
286
- ) {
287
- delete featureInfoConfig.extent;
288
- }
289
- if (this.url === featureInfoConfig.url) {
290
- delete featureInfoConfig.url;
291
- }
292
- if (this.tilingSchema === featureInfoConfig.tilingSchema) {
293
- delete featureInfoConfig.tilingSchema;
294
- }
295
- if (this.version === featureInfoConfig.version) {
296
- delete featureInfoConfig.version;
297
- }
298
- if (this.minLevel === featureInfoConfig.minLevel) {
299
- delete featureInfoConfig.minLevel;
300
- }
301
- if (this.maxLevel === featureInfoConfig.maxLevel) {
302
- delete featureInfoConfig.maxLevel;
284
+ if (this._featureInfoOptions) {
285
+ delete config.featureProvider;
286
+ if (this.featureProvider) {
287
+ let featureInfoConfig: Partial<WMSFeatureProviderOptions>;
288
+ if (this._attributeProvider) {
289
+ const compositeInfo =
290
+ this.featureProvider.toJSON() as CompositeFeatureProviderOptions;
291
+ featureInfoConfig = compositeInfo.featureProviders[0];
292
+ config.featureProvider = this._attributeProvider.toJSON();
293
+ } else {
294
+ featureInfoConfig = this.featureProvider.toJSON();
295
+ }
296
+ if (
297
+ this.tileSize[0] === featureInfoConfig?.tileSize?.[0] ||
298
+ this.tileSize[1] === featureInfoConfig?.tileSize?.[1]
299
+ ) {
300
+ delete featureInfoConfig.tileSize;
301
+ }
302
+ if (
303
+ Object.entries(this.parameters).every(
304
+ ([key, value]) => featureInfoConfig?.parameters?.[key] === value,
305
+ )
306
+ ) {
307
+ delete featureInfoConfig.parameters;
308
+ }
309
+ if (
310
+ featureInfoConfig.extent &&
311
+ new Extent(featureInfoConfig.extent).equals(this.extent)
312
+ ) {
313
+ delete featureInfoConfig.extent;
314
+ }
315
+ if (this.url === featureInfoConfig.url) {
316
+ delete featureInfoConfig.url;
317
+ }
318
+ if (this.tilingSchema === featureInfoConfig.tilingSchema) {
319
+ delete featureInfoConfig.tilingSchema;
320
+ }
321
+ if (this.version === featureInfoConfig.version) {
322
+ delete featureInfoConfig.version;
323
+ }
324
+ if (this.minLevel === featureInfoConfig.minLevel) {
325
+ delete featureInfoConfig.minLevel;
326
+ }
327
+ if (this.maxLevel === featureInfoConfig.maxLevel) {
328
+ delete featureInfoConfig.maxLevel;
329
+ }
330
+
331
+ if (this._featureInfoOptions) {
332
+ delete featureInfoConfig.name;
333
+ delete featureInfoConfig.type;
334
+ }
335
+ config.featureInfo = featureInfoConfig;
336
+ } else {
337
+ config.featureInfo = this._featureInfoOptions;
303
338
  }
304
- config.featureInfo = featureInfoConfig;
305
- } else if (this._featureInfoOptions) {
306
- config.featureInfo = this._featureInfoOptions;
307
339
  }
308
340
 
309
341
  return config;
@@ -106,7 +106,7 @@ class WMTSLayer extends RasterLayer<WmtsCesiumImpl | WmtsOpenlayersImpl> {
106
106
 
107
107
  constructor(options: WMTSOptions) {
108
108
  const defaultOptions = WMTSLayer.getDefaultOptions();
109
- super({ tilingSchema: defaultOptions.tilingSchema, ...options });
109
+ super({ ...defaultOptions, ...options });
110
110
 
111
111
  this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
112
112
 
@@ -174,15 +174,8 @@ class WMTSLayer extends RasterLayer<WmtsCesiumImpl | WmtsOpenlayersImpl> {
174
174
  return [];
175
175
  }
176
176
 
177
- toJSON(): WMTSOptions {
178
- const config: Partial<WMTSOptions> = super.toJSON();
179
- const defaultOptions = WMTSLayer.getDefaultOptions();
180
-
181
- if (this.tilingSchema !== defaultOptions.tilingSchema) {
182
- config.tilingSchema = this.tilingSchema;
183
- } else {
184
- delete config.tilingSchema;
185
- }
177
+ toJSON(defaultOptions = WMTSLayer.getDefaultOptions()): WMTSOptions {
178
+ const config: Partial<WMTSOptions> = super.toJSON(defaultOptions);
186
179
 
187
180
  if (
188
181
  this.numberOfLevelZeroTilesX !== defaultOptions.numberOfLevelZeroTilesX