@vcmap/core 6.2.4 → 6.3.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/dist/cesium.d.ts +12 -0
  2. package/dist/index.d.ts +13 -3
  3. package/dist/index.js +11 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/ol.d.ts +13 -2
  6. package/dist/src/category/category.d.ts +1 -1
  7. package/dist/src/category/category.js +3 -4
  8. package/dist/src/category/category.js.map +1 -1
  9. package/dist/src/cesium/cesium3DTileFeature.d.ts +1 -0
  10. package/dist/src/cesium/cesium3DTileFeature.js +14 -3
  11. package/dist/src/cesium/cesium3DTileFeature.js.map +1 -1
  12. package/dist/src/cesium/cesium3DTilePointFeature.js +2 -1
  13. package/dist/src/cesium/cesium3DTilePointFeature.js.map +1 -1
  14. package/dist/src/classRegistry.d.ts +7 -1
  15. package/dist/src/classRegistry.js.map +1 -1
  16. package/dist/src/featureProvider/abstractAttributeProvider.d.ts +62 -0
  17. package/dist/src/featureProvider/abstractAttributeProvider.js +129 -0
  18. package/dist/src/featureProvider/abstractAttributeProvider.js.map +1 -0
  19. package/dist/src/featureProvider/abstractFeatureProvider.d.ts +10 -19
  20. package/dist/src/featureProvider/abstractFeatureProvider.js +10 -42
  21. package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
  22. package/dist/src/featureProvider/compositeFeatureProvider.d.ts +27 -0
  23. package/dist/src/featureProvider/compositeFeatureProvider.js +53 -0
  24. package/dist/src/featureProvider/compositeFeatureProvider.js.map +1 -0
  25. package/dist/src/featureProvider/csvAttributeProvider.d.ts +41 -0
  26. package/dist/src/featureProvider/csvAttributeProvider.js +126 -0
  27. package/dist/src/featureProvider/csvAttributeProvider.js.map +1 -0
  28. package/dist/src/featureProvider/featureProviderFactory.d.ts +3 -0
  29. package/dist/src/featureProvider/featureProviderFactory.js +17 -0
  30. package/dist/src/featureProvider/featureProviderFactory.js.map +1 -0
  31. package/dist/src/featureProvider/i3sAttributeProvider.d.ts +7 -0
  32. package/dist/src/featureProvider/i3sAttributeProvider.js +43 -0
  33. package/dist/src/featureProvider/i3sAttributeProvider.js.map +1 -0
  34. package/dist/src/featureProvider/jsonAttributeProvider.d.ts +26 -0
  35. package/dist/src/featureProvider/jsonAttributeProvider.js +73 -0
  36. package/dist/src/featureProvider/jsonAttributeProvider.js.map +1 -0
  37. package/dist/src/featureProvider/tileProviderFeatureProvider.d.ts +4 -6
  38. package/dist/src/featureProvider/tileProviderFeatureProvider.js +9 -11
  39. package/dist/src/featureProvider/tileProviderFeatureProvider.js.map +1 -1
  40. package/dist/src/featureProvider/urlIdAttributeProvider.d.ts +28 -0
  41. package/dist/src/featureProvider/urlIdAttributeProvider.js +50 -0
  42. package/dist/src/featureProvider/urlIdAttributeProvider.js.map +1 -0
  43. package/dist/src/featureProvider/wmsFeatureProvider.d.ts +13 -4
  44. package/dist/src/featureProvider/wmsFeatureProvider.js +19 -9
  45. package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
  46. package/dist/src/interaction/coordinateAtPixel.js +4 -6
  47. package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
  48. package/dist/src/interaction/ensurePositionInteraction.d.ts +14 -0
  49. package/dist/src/interaction/ensurePositionInteraction.js +42 -0
  50. package/dist/src/interaction/ensurePositionInteraction.js.map +1 -0
  51. package/dist/src/interaction/eventHandler.d.ts +3 -0
  52. package/dist/src/interaction/eventHandler.js +10 -1
  53. package/dist/src/interaction/eventHandler.js.map +1 -1
  54. package/dist/src/interaction/featureAtPixelInteraction.d.ts +15 -3
  55. package/dist/src/interaction/featureAtPixelInteraction.js +70 -18
  56. package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
  57. package/dist/src/interaction/featureProviderInteraction.js +42 -26
  58. package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
  59. package/dist/src/interaction/panoramaImageSelection.js +2 -2
  60. package/dist/src/interaction/panoramaImageSelection.js.map +1 -1
  61. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +17 -9
  62. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js +244 -165
  63. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
  64. package/dist/src/layer/cesium/i3sCesiumImpl.d.ts +33 -0
  65. package/dist/src/layer/cesium/i3sCesiumImpl.js +107 -0
  66. package/dist/src/layer/cesium/i3sCesiumImpl.js.map +1 -0
  67. package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +3 -3
  68. package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
  69. package/dist/src/layer/cesium/terrainCesiumImpl.d.ts +3 -3
  70. package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
  71. package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js +2 -1
  72. package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js.map +1 -1
  73. package/dist/src/layer/cesium/vectorContext.js +1 -1
  74. package/dist/src/layer/cesium/vectorContext.js.map +1 -1
  75. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +7 -6
  76. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
  77. package/dist/src/layer/cesium/vectorTileImageryProvider.js +2 -2
  78. package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
  79. package/dist/src/layer/cesiumTilesetLayer.d.ts +10 -1
  80. package/dist/src/layer/cesiumTilesetLayer.js +33 -8
  81. package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
  82. package/dist/src/layer/cogLayer.d.ts +1 -1
  83. package/dist/src/layer/cogLayer.js +3 -4
  84. package/dist/src/layer/cogLayer.js.map +1 -1
  85. package/dist/src/layer/czmlLayer.d.ts +1 -1
  86. package/dist/src/layer/czmlLayer.js +4 -4
  87. package/dist/src/layer/czmlLayer.js.map +1 -1
  88. package/dist/src/layer/featureLayer.d.ts +1 -6
  89. package/dist/src/layer/featureLayer.js +3 -10
  90. package/dist/src/layer/featureLayer.js.map +1 -1
  91. package/dist/src/layer/featureStoreLayer.d.ts +3 -2
  92. package/dist/src/layer/featureStoreLayer.js +5 -5
  93. package/dist/src/layer/featureStoreLayer.js.map +1 -1
  94. package/dist/src/layer/flatGeobufLayer.d.ts +2 -0
  95. package/dist/src/layer/flatGeobufLayer.js +8 -0
  96. package/dist/src/layer/flatGeobufLayer.js.map +1 -1
  97. package/dist/src/layer/geojsonLayer.d.ts +1 -1
  98. package/dist/src/layer/geojsonLayer.js +5 -12
  99. package/dist/src/layer/geojsonLayer.js.map +1 -1
  100. package/dist/src/layer/i3sLayer.d.ts +80 -0
  101. package/dist/src/layer/i3sLayer.js +242 -0
  102. package/dist/src/layer/i3sLayer.js.map +1 -0
  103. package/dist/src/layer/layer.d.ts +29 -10
  104. package/dist/src/layer/layer.js +114 -34
  105. package/dist/src/layer/layer.js.map +1 -1
  106. package/dist/src/layer/layerSymbols.d.ts +4 -0
  107. package/dist/src/layer/layerSymbols.js +4 -0
  108. package/dist/src/layer/layerSymbols.js.map +1 -1
  109. package/dist/src/layer/openStreetMapLayer.d.ts +1 -1
  110. package/dist/src/layer/openStreetMapLayer.js +11 -6
  111. package/dist/src/layer/openStreetMapLayer.js.map +1 -1
  112. package/dist/src/layer/panorama/vectorPanoramaImpl.d.ts +38 -0
  113. package/dist/src/layer/panorama/vectorPanoramaImpl.js +164 -0
  114. package/dist/src/layer/panorama/vectorPanoramaImpl.js.map +1 -0
  115. package/dist/src/layer/panoramaDatasetLayer.d.ts +7 -3
  116. package/dist/src/layer/panoramaDatasetLayer.js +46 -20
  117. package/dist/src/layer/panoramaDatasetLayer.js.map +1 -1
  118. package/dist/src/layer/pointCloudLayer.d.ts +1 -5
  119. package/dist/src/layer/pointCloudLayer.js +3 -15
  120. package/dist/src/layer/pointCloudLayer.js.map +1 -1
  121. package/dist/src/layer/rasterLayer.d.ts +1 -1
  122. package/dist/src/layer/rasterLayer.js +4 -4
  123. package/dist/src/layer/rasterLayer.js.map +1 -1
  124. package/dist/src/layer/singleImageLayer.d.ts +1 -1
  125. package/dist/src/layer/singleImageLayer.js +3 -3
  126. package/dist/src/layer/singleImageLayer.js.map +1 -1
  127. package/dist/src/layer/terrainLayer.d.ts +1 -1
  128. package/dist/src/layer/terrainLayer.js +8 -6
  129. package/dist/src/layer/terrainLayer.js.map +1 -1
  130. package/dist/src/layer/tileProvider/flatGeobufTileProvider.d.ts +1 -1
  131. package/dist/src/layer/tileProvider/flatGeobufTileProvider.js +7 -5
  132. package/dist/src/layer/tileProvider/flatGeobufTileProvider.js.map +1 -1
  133. package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
  134. package/dist/src/layer/tileProvider/mvtTileProvider.js +6 -5
  135. package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
  136. package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +1 -1
  137. package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +3 -3
  138. package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -1
  139. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
  140. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +7 -4
  141. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
  142. package/dist/src/layer/tileProvider/tileProvider.d.ts +7 -1
  143. package/dist/src/layer/tileProvider/tileProvider.js +15 -5
  144. package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
  145. package/dist/src/layer/tileProvider/urlTemplateTileProvider.d.ts +1 -1
  146. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js +3 -3
  147. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
  148. package/dist/src/layer/tmsLayer.d.ts +1 -1
  149. package/dist/src/layer/tmsLayer.js +3 -10
  150. package/dist/src/layer/tmsLayer.js.map +1 -1
  151. package/dist/src/layer/vectorLayer.d.ts +11 -5
  152. package/dist/src/layer/vectorLayer.js +21 -10
  153. package/dist/src/layer/vectorLayer.js.map +1 -1
  154. package/dist/src/layer/vectorProperties.js +10 -1
  155. package/dist/src/layer/vectorProperties.js.map +1 -1
  156. package/dist/src/layer/vectorTileLayer.d.ts +14 -5
  157. package/dist/src/layer/vectorTileLayer.js +82 -31
  158. package/dist/src/layer/vectorTileLayer.js.map +1 -1
  159. package/dist/src/layer/wfsLayer.d.ts +1 -1
  160. package/dist/src/layer/wfsLayer.js +5 -4
  161. package/dist/src/layer/wfsLayer.js.map +1 -1
  162. package/dist/src/layer/wmsLayer.d.ts +4 -1
  163. package/dist/src/layer/wmsLayer.js +65 -36
  164. package/dist/src/layer/wmsLayer.js.map +1 -1
  165. package/dist/src/layer/wmtsLayer.d.ts +1 -1
  166. package/dist/src/layer/wmtsLayer.js +3 -10
  167. package/dist/src/layer/wmtsLayer.js.map +1 -1
  168. package/dist/src/map/baseCesiumMap.d.ts +69 -0
  169. package/dist/src/map/baseCesiumMap.js +393 -0
  170. package/dist/src/map/baseCesiumMap.js.map +1 -0
  171. package/dist/src/map/cesiumMap.d.ts +6 -98
  172. package/dist/src/map/cesiumMap.js +29 -266
  173. package/dist/src/map/cesiumMap.js.map +1 -1
  174. package/dist/src/map/obliqueMap.d.ts +1 -1
  175. package/dist/src/map/obliqueMap.js +14 -8
  176. package/dist/src/map/obliqueMap.js.map +1 -1
  177. package/dist/src/map/openlayersMap.d.ts +1 -1
  178. package/dist/src/map/openlayersMap.js +3 -4
  179. package/dist/src/map/openlayersMap.js.map +1 -1
  180. package/dist/src/map/panoramaMap.d.ts +17 -29
  181. package/dist/src/map/panoramaMap.js +56 -100
  182. package/dist/src/map/panoramaMap.js.map +1 -1
  183. package/dist/src/map/vcsMap.d.ts +15 -2
  184. package/dist/src/map/vcsMap.js +26 -3
  185. package/dist/src/map/vcsMap.js.map +1 -1
  186. package/dist/src/oblique/obliqueCollection.d.ts +1 -1
  187. package/dist/src/oblique/obliqueCollection.js +3 -4
  188. package/dist/src/oblique/obliqueCollection.js.map +1 -1
  189. package/dist/src/panorama/panoramaCameraController.d.ts +4 -0
  190. package/dist/src/panorama/panoramaCameraController.js +8 -0
  191. package/dist/src/panorama/panoramaCameraController.js.map +1 -1
  192. package/dist/src/panorama/panoramaImage.d.ts +10 -1
  193. package/dist/src/panorama/panoramaImage.js +15 -9
  194. package/dist/src/panorama/panoramaImage.js.map +1 -1
  195. package/dist/src/panorama/panoramaImageView.d.ts +6 -1
  196. package/dist/src/panorama/panoramaImageView.js +11 -2
  197. package/dist/src/panorama/panoramaImageView.js.map +1 -1
  198. package/dist/src/panorama/panoramaTileMaterial.d.ts +6 -0
  199. package/dist/src/panorama/panoramaTileMaterial.js +14 -0
  200. package/dist/src/panorama/panoramaTileMaterial.js.map +1 -1
  201. package/dist/src/panorama/panoramaTileMaterialFS.shader.d.ts +1 -1
  202. package/dist/src/panorama/panoramaTileMaterialFS.shader.js +16 -1
  203. package/dist/src/panorama/panoramaTileMaterialFS.shader.js.map +1 -1
  204. package/dist/src/panorama/panoramaTilePrimitiveCollection.d.ts +6 -0
  205. package/dist/src/panorama/panoramaTilePrimitiveCollection.js +28 -0
  206. package/dist/src/panorama/panoramaTilePrimitiveCollection.js.map +1 -1
  207. package/dist/src/style/declarativeStyleItem.js +7 -8
  208. package/dist/src/style/declarativeStyleItem.js.map +1 -1
  209. package/dist/src/util/clipping/clippingPolygonObject.d.ts +1 -1
  210. package/dist/src/util/clipping/clippingPolygonObject.js +3 -4
  211. package/dist/src/util/clipping/clippingPolygonObject.js.map +1 -1
  212. package/dist/src/util/displayQuality/displayQuality.js +4 -4
  213. package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
  214. package/dist/src/util/editor/createFeatureSession.js +3 -1
  215. package/dist/src/util/editor/createFeatureSession.js.map +1 -1
  216. package/dist/src/util/editor/editFeaturesSession.js +9 -2
  217. package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
  218. package/dist/src/util/editor/editGeometrySession.js +3 -1
  219. package/dist/src/util/editor/editGeometrySession.js.map +1 -1
  220. package/dist/src/util/editor/editorSessionHelpers.d.ts +3 -3
  221. package/dist/src/util/editor/editorSessionHelpers.js +4 -2
  222. package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
  223. package/dist/src/util/editor/interactions/creationSnapping.js +4 -1
  224. package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -1
  225. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +2 -2
  226. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
  227. package/dist/src/util/editor/interactions/layerSnapping.js +4 -1
  228. package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -1
  229. package/dist/src/util/editor/interactions/mapInteractionController.js +12 -1
  230. package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
  231. package/dist/src/util/editor/interactions/translationSnapping.js +4 -2
  232. package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
  233. package/dist/src/util/editor/selectFeaturesSession.js +1 -1
  234. package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
  235. package/dist/src/util/editor/transformation/create3DHandlers.d.ts +2 -2
  236. package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
  237. package/dist/src/util/editor/transformation/transformationHandler.js +5 -2
  238. package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
  239. package/dist/src/util/editor/transformation/translateInteraction.js +2 -2
  240. package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
  241. package/dist/src/util/fetch.d.ts +7 -0
  242. package/dist/src/util/fetch.js +7 -0
  243. package/dist/src/util/fetch.js.map +1 -1
  244. package/dist/src/util/flight/flightInstance.d.ts +1 -1
  245. package/dist/src/util/flight/flightInstance.js +3 -4
  246. package/dist/src/util/flight/flightInstance.js.map +1 -1
  247. package/dist/src/util/mapCollection.d.ts +5 -0
  248. package/dist/src/util/mapCollection.js +14 -0
  249. package/dist/src/util/mapCollection.js.map +1 -1
  250. package/dist/src/util/renderScreenshot.js +2 -3
  251. package/dist/src/util/renderScreenshot.js.map +1 -1
  252. package/dist/src/util/viewpoint.js +1 -1
  253. package/dist/src/util/viewpoint.js.map +1 -1
  254. package/dist/src/vcsApp.d.ts +2 -3
  255. package/dist/src/vcsApp.js.map +1 -1
  256. package/dist/src/vcsModuleHelpers.d.ts +5 -2
  257. package/dist/src/vcsModuleHelpers.js +27 -1
  258. package/dist/src/vcsModuleHelpers.js.map +1 -1
  259. package/dist/src/vcsObject.d.ts +2 -1
  260. package/dist/src/vcsObject.js +9 -1
  261. package/dist/src/vcsObject.js.map +1 -1
  262. package/dist/src/vectorCluster/vectorClusterGroup.d.ts +1 -1
  263. package/dist/src/vectorCluster/vectorClusterGroup.js +3 -4
  264. package/dist/src/vectorCluster/vectorClusterGroup.js.map +1 -1
  265. package/dist/src/vectorCluster/vectorClusterStyleItem.d.ts +1 -1
  266. package/dist/src/vectorCluster/vectorClusterStyleItem.js +3 -4
  267. package/dist/src/vectorCluster/vectorClusterStyleItem.js.map +1 -1
  268. package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -1
  269. package/dist/tests/unit/helpers/cesiumHelpers.js +26 -3
  270. package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
  271. package/dist/tests/unit/helpers/panoramaHelpers.js +1 -1
  272. package/dist/tests/unit/helpers/panoramaHelpers.js.map +1 -1
  273. package/index.ts +30 -5
  274. package/package.json +3 -3
  275. package/src/category/category.ts +3 -4
  276. package/src/cesium/cesium.d.ts +12 -0
  277. package/src/cesium/cesium3DTileFeature.ts +23 -3
  278. package/src/cesium/cesium3DTilePointFeature.ts +3 -1
  279. package/src/classRegistry.ts +8 -3
  280. package/src/featureProvider/abstractAttributeProvider.ts +201 -0
  281. package/src/featureProvider/abstractFeatureProvider.ts +32 -51
  282. package/src/featureProvider/compositeFeatureProvider.ts +103 -0
  283. package/src/featureProvider/csvAttributeProvider.ts +186 -0
  284. package/src/featureProvider/featureProviderFactory.ts +31 -0
  285. package/src/featureProvider/i3sAttributeProvider.ts +60 -0
  286. package/src/featureProvider/jsonAttributeProvider.ts +109 -0
  287. package/src/featureProvider/tileProviderFeatureProvider.ts +13 -14
  288. package/src/featureProvider/urlIdAttributeProvider.ts +82 -0
  289. package/src/featureProvider/wmsFeatureProvider.ts +31 -10
  290. package/src/global.d.ts +2 -0
  291. package/src/interaction/coordinateAtPixel.ts +4 -6
  292. package/src/interaction/ensurePositionInteraction.ts +50 -0
  293. package/src/interaction/eventHandler.ts +12 -1
  294. package/src/interaction/featureAtPixelInteraction.ts +92 -32
  295. package/src/interaction/featureProviderInteraction.ts +59 -38
  296. package/src/interaction/panoramaImageSelection.ts +4 -2
  297. package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +297 -197
  298. package/src/layer/cesium/i3sCesiumImpl.ts +141 -0
  299. package/src/layer/cesium/rasterLayerCesiumImpl.ts +3 -3
  300. package/src/layer/cesium/terrainCesiumImpl.ts +3 -3
  301. package/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.ts +4 -3
  302. package/src/layer/cesium/vectorContext.ts +1 -1
  303. package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +7 -6
  304. package/src/layer/cesium/vectorTileImageryProvider.ts +2 -2
  305. package/src/layer/cesiumTilesetLayer.ts +60 -8
  306. package/src/layer/cogLayer.ts +5 -5
  307. package/src/layer/czmlLayer.ts +4 -4
  308. package/src/layer/featureLayer.ts +5 -16
  309. package/src/layer/featureStoreLayer.ts +11 -5
  310. package/src/layer/flatGeobufLayer.ts +12 -0
  311. package/src/layer/geojsonLayer.ts +5 -12
  312. package/src/layer/i3sLayer.ts +343 -0
  313. package/src/layer/layer.ts +178 -39
  314. package/src/layer/layerSymbols.ts +5 -0
  315. package/src/layer/openStreetMapLayer.ts +13 -6
  316. package/src/layer/panorama/vectorPanoramaImpl.ts +238 -0
  317. package/src/layer/panoramaDatasetLayer.ts +69 -23
  318. package/src/layer/pointCloudLayer.ts +5 -20
  319. package/src/layer/rasterLayer.ts +4 -4
  320. package/src/layer/singleImageLayer.ts +5 -3
  321. package/src/layer/terrainLayer.ts +9 -6
  322. package/src/layer/tileProvider/flatGeobufTileProvider.ts +9 -5
  323. package/src/layer/tileProvider/mvtTileProvider.ts +10 -5
  324. package/src/layer/tileProvider/staticFeatureTileProvider.ts +5 -3
  325. package/src/layer/tileProvider/staticGeojsonTileProvider.ts +11 -4
  326. package/src/layer/tileProvider/tileProvider.ts +18 -5
  327. package/src/layer/tileProvider/urlTemplateTileProvider.ts +7 -3
  328. package/src/layer/tmsLayer.ts +3 -10
  329. package/src/layer/vectorLayer.ts +29 -11
  330. package/src/layer/vectorProperties.ts +10 -1
  331. package/src/layer/vectorTileLayer.ts +141 -53
  332. package/src/layer/wfsLayer.ts +7 -4
  333. package/src/layer/wmsLayer.ts +80 -48
  334. package/src/layer/wmtsLayer.ts +3 -10
  335. package/src/map/baseCesiumMap.ts +600 -0
  336. package/src/map/cesiumMap.ts +99 -457
  337. package/src/map/obliqueMap.ts +16 -10
  338. package/src/map/openlayersMap.ts +5 -5
  339. package/src/map/panoramaMap.ts +74 -139
  340. package/src/map/vcsMap.ts +44 -4
  341. package/src/oblique/obliqueCollection.ts +5 -4
  342. package/src/ol/ol.d.ts +13 -2
  343. package/src/panorama/panoramaCameraController.ts +13 -1
  344. package/src/panorama/panoramaImage.ts +25 -8
  345. package/src/panorama/panoramaImageView.ts +29 -3
  346. package/src/panorama/panoramaTileMaterial.ts +20 -0
  347. package/src/panorama/panoramaTileMaterialFS.glsl +16 -1
  348. package/src/panorama/panoramaTilePrimitiveCollection.ts +34 -0
  349. package/src/style/declarativeStyleItem.ts +7 -9
  350. package/src/util/clipping/clippingPolygonObject.ts +5 -4
  351. package/src/util/displayQuality/displayQuality.ts +4 -4
  352. package/src/util/editor/createFeatureSession.ts +4 -1
  353. package/src/util/editor/editFeaturesSession.ts +14 -4
  354. package/src/util/editor/editGeometrySession.ts +3 -1
  355. package/src/util/editor/editorSessionHelpers.ts +5 -3
  356. package/src/util/editor/interactions/creationSnapping.ts +7 -1
  357. package/src/util/editor/interactions/ensureHandlerSelectionInteraction.ts +2 -2
  358. package/src/util/editor/interactions/layerSnapping.ts +7 -1
  359. package/src/util/editor/interactions/mapInteractionController.ts +12 -2
  360. package/src/util/editor/interactions/translationSnapping.ts +6 -4
  361. package/src/util/editor/selectFeaturesSession.ts +1 -1
  362. package/src/util/editor/transformation/create3DHandlers.ts +2 -2
  363. package/src/util/editor/transformation/transformationHandler.ts +5 -3
  364. package/src/util/editor/transformation/translateInteraction.ts +4 -4
  365. package/src/util/fetch.ts +7 -0
  366. package/src/util/flight/flightInstance.ts +6 -5
  367. package/src/util/mapCollection.ts +18 -0
  368. package/src/util/renderScreenshot.ts +4 -8
  369. package/src/util/viewpoint.ts +2 -2
  370. package/src/vcsApp.ts +7 -8
  371. package/src/vcsModuleHelpers.ts +62 -4
  372. package/src/vcsObject.ts +10 -1
  373. package/src/vectorCluster/vectorClusterGroup.ts +7 -4
  374. package/src/vectorCluster/vectorClusterStyleItem.ts +8 -4
  375. package/dist/src/map/cesiumMapHelpers.d.ts +0 -7
  376. package/dist/src/map/cesiumMapHelpers.js +0 -144
  377. package/dist/src/map/cesiumMapHelpers.js.map +0 -1
  378. package/src/map/cesiumMapHelpers.ts +0 -219
@@ -3,8 +3,8 @@ import type { Feature } from 'ol/index.js';
3
3
  import AbstractFeatureProvider, {
4
4
  type AbstractFeatureProviderOptions,
5
5
  } from './abstractFeatureProvider.js';
6
- import { featureProviderClassRegistry } from '../classRegistry.js';
7
6
  import type TileProvider from '../layer/tileProvider/tileProvider.js';
7
+ import type Layer from '../layer/layer.js';
8
8
 
9
9
  export type TileProviderFeatureProviderOptions =
10
10
  AbstractFeatureProviderOptions & {
@@ -18,26 +18,21 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
18
18
 
19
19
  tileProvider: TileProvider;
20
20
 
21
- /**
22
- * @param layerName
23
- * @param options
24
- */
25
- constructor(layerName: string, options: TileProviderFeatureProviderOptions) {
26
- super(layerName, options);
21
+ constructor(options: TileProviderFeatureProviderOptions) {
22
+ super({ ...options, mapTypes: ['CesiumMap'] });
27
23
 
28
- this.mapTypes = ['CesiumMap'];
29
24
  this.tileProvider = options.tileProvider;
30
25
  }
31
26
 
32
27
  async getFeaturesByCoordinate(
33
28
  coordinate: Coordinate,
34
29
  resolution: number,
35
- headers?: Record<string, string>,
30
+ layer: Layer,
36
31
  ): Promise<Feature[]> {
37
32
  const features = await this.tileProvider.getFeaturesByCoordinate(
38
33
  coordinate,
39
34
  resolution,
40
- headers,
35
+ layer.headers,
41
36
  );
42
37
  const checkShow = (feature: Feature): boolean =>
43
38
  this.style ? !!this.style.cesiumStyle.show.evaluate(feature) : true;
@@ -48,6 +43,14 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
48
43
  });
49
44
  }
50
45
 
46
+ toJSON(
47
+ defaultOptions: AbstractFeatureProviderOptions = AbstractFeatureProvider.getDefaultOptions(),
48
+ ): AbstractFeatureProviderOptions {
49
+ const options = super.toJSON(defaultOptions);
50
+ delete options.mapTypes;
51
+ return options;
52
+ }
53
+
51
54
  destroy(): void {
52
55
  this.tileProvider.destroy();
53
56
  super.destroy();
@@ -55,7 +58,3 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
55
58
  }
56
59
 
57
60
  export default TileProviderFeatureProvider;
58
- featureProviderClassRegistry.registerClass(
59
- TileProviderFeatureProvider.className,
60
- TileProviderFeatureProvider,
61
- );
@@ -0,0 +1,82 @@
1
+ import AbstractAttributeProvider from './abstractAttributeProvider.js';
2
+ import type { VcsObjectOptions } from '../vcsObject.js';
3
+ import { getInitForUrl, requestJson } from '../util/fetch.js';
4
+ import { featureProviderClassRegistry } from '../classRegistry.js';
5
+
6
+ export type UrlIdAttributeProviderOptions = VcsObjectOptions & {
7
+ urlTemplate: string;
8
+ headers?: Record<string, string>;
9
+ };
10
+
11
+ /**
12
+ * Provides attributes for features by fetching data from a URL based on feature IDs.
13
+ * The URL template should contain a {id} placeholder that will be replaced with the encoded feature ID.
14
+ * urlTemplate: 'https://api.example.com/features/{id}'
15
+ * For a feature with ID "123", this would request: https://api.example.com/features/123
16
+ *
17
+ * The backend should return a JSON object with attribute key-value pairs.
18
+ * {
19
+ * "name": "Feature Name",
20
+ * "description": "Feature description",
21
+ * "value": 42
22
+ * }
23
+ * If the request fails or returns invalid data, the provider returns undefined.
24
+ */
25
+ export default class UrlIdAttributeProvider extends AbstractAttributeProvider {
26
+ static get className(): string {
27
+ return 'UrlIdAttributeProvider';
28
+ }
29
+
30
+ private _urlTemplate: string;
31
+
32
+ private _headers?: Record<string, string> | undefined;
33
+
34
+ constructor(options: UrlIdAttributeProviderOptions) {
35
+ super(options);
36
+
37
+ this._urlTemplate = options.urlTemplate;
38
+
39
+ this._headers = options.headers
40
+ ? structuredClone(options.headers)
41
+ : undefined;
42
+ }
43
+
44
+ protected async _getAttributes(
45
+ id: string,
46
+ ): Promise<Record<string, unknown> | undefined> {
47
+ const url = this._urlTemplate.replace(
48
+ '{id}',
49
+ encodeURIComponent(String(id)),
50
+ );
51
+
52
+ try {
53
+ return await requestJson<Record<string, unknown>>(
54
+ url,
55
+ getInitForUrl(url, this._headers),
56
+ );
57
+ } catch {
58
+ return undefined;
59
+ }
60
+ }
61
+
62
+ override toJSON(
63
+ _defaultOptions?: UrlIdAttributeProviderOptions,
64
+ ): UrlIdAttributeProviderOptions {
65
+ const config: Partial<UrlIdAttributeProviderOptions> = super.toJSON(
66
+ _defaultOptions,
67
+ );
68
+
69
+ config.urlTemplate = this._urlTemplate;
70
+
71
+ if (this._headers) {
72
+ config.headers = structuredClone(this._headers);
73
+ }
74
+
75
+ return config as UrlIdAttributeProviderOptions;
76
+ }
77
+ }
78
+
79
+ featureProviderClassRegistry.registerClass(
80
+ UrlIdAttributeProvider.className,
81
+ UrlIdAttributeProvider,
82
+ );
@@ -16,7 +16,7 @@ import type { Options as WMSGetFeatureInfoOptions } from 'ol/format/WMSGetFeatur
16
16
  import { containsCoordinate } from 'ol/extent.js';
17
17
  import { parseInteger } from '@vcsuite/parsers';
18
18
  import { getLogger } from '@vcsuite/logger';
19
- import type { AbstractFeatureProviderOptions } from './abstractFeatureProvider.js';
19
+ import { type AbstractFeatureProviderOptions } from './abstractFeatureProvider.js';
20
20
  import AbstractFeatureProvider from './abstractFeatureProvider.js';
21
21
  import type { ProjectionOptions } from '../util/projection.js';
22
22
  import Projection, { mercatorProjection } from '../util/projection.js';
@@ -27,6 +27,7 @@ import Extent from '../util/extent.js';
27
27
  import { getInitForUrl, requestUrl } from '../util/fetch.js';
28
28
  import { featureProviderClassRegistry } from '../classRegistry.js';
29
29
  import { TilingScheme } from '../layer/rasterLayer.js';
30
+ import type Layer from '../layer/layer.js';
30
31
 
31
32
  export type FormatOptions = GeoJSONOptions &
32
33
  GMLOptions &
@@ -78,6 +79,10 @@ export type WMSFeatureProviderOptions = AbstractFeatureProviderOptions & {
78
79
  */
79
80
  version?: string;
80
81
  htmlPositionFeatureTitle?: string;
82
+ /**
83
+ * Optional headers to include in GetFeatureInfo requests. Overrides layer headers.
84
+ */
85
+ headers?: Record<string, string>;
81
86
  };
82
87
 
83
88
  const gmlFormats = { GML: GML3, GML2, GML3, GML32 };
@@ -191,6 +196,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
191
196
  tileSize: [256, 256],
192
197
  parameters: {},
193
198
  extent: undefined,
199
+ headers: undefined,
194
200
  };
195
201
  }
196
202
 
@@ -233,9 +239,14 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
233
239
 
234
240
  htmlPositionFeatureTitle?: string;
235
241
 
236
- constructor(layerName: string, options: WMSFeatureProviderOptions) {
237
- super(layerName, options);
242
+ /**
243
+ * Optional headers to include in GetFeatureInfo requests.
244
+ */
245
+ headers?: Record<string, string>;
246
+
247
+ constructor(options: WMSFeatureProviderOptions) {
238
248
  const defaultOptions = WMSFeatureProvider.getDefaultOptions();
249
+ super({ ...defaultOptions, ...options });
239
250
 
240
251
  if (options.extent) {
241
252
  if (options.extent instanceof Extent) {
@@ -271,6 +282,9 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
271
282
  ? new Projection(options.projection)
272
283
  : undefined;
273
284
  this.htmlPositionFeatureTitle = options.htmlPositionFeatureTitle;
285
+ this.headers = options.headers
286
+ ? structuredClone(options.headers)
287
+ : undefined;
274
288
  }
275
289
 
276
290
  get wmsSource(): TileWMS {
@@ -324,7 +338,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
324
338
  async getFeaturesByCoordinate(
325
339
  coordinate: Coordinate,
326
340
  resolution: number,
327
- headers?: Record<string, string>,
341
+ layer: Layer,
328
342
  ): Promise<Feature[]> {
329
343
  if (
330
344
  this.extent?.isValid() &&
@@ -354,10 +368,10 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
354
368
 
355
369
  if (this.featureInfoResponseType === 'text/html') {
356
370
  return this.featureResponseCallback(null, coordinate).map((f) =>
357
- this.getProviderFeature(f),
371
+ this.getProviderFeature(f, layer),
358
372
  );
359
373
  } else if (url) {
360
- const init = getInitForUrl(url, headers);
374
+ const init = getInitForUrl(url, this.headers ?? layer.headers);
361
375
  let data: string;
362
376
  try {
363
377
  const response = await requestUrl(url, init);
@@ -367,15 +381,19 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
367
381
  return [];
368
382
  }
369
383
  return this.featureResponseCallback(data, coordinate).map((f) =>
370
- this.getProviderFeature(f),
384
+ this.getProviderFeature(f, layer),
371
385
  );
372
386
  }
373
387
  return [];
374
388
  }
375
389
 
376
- toJSON(): WMSFeatureProviderOptions {
377
- const config: Partial<WMSFeatureProviderOptions> = super.toJSON();
378
- const defaultOptions = WMSFeatureProvider.getDefaultOptions();
390
+ toJSON(
391
+ defaultOptions = WMSFeatureProvider.getDefaultOptions(),
392
+ ): WMSFeatureProviderOptions {
393
+ const config: Partial<WMSFeatureProviderOptions> = super.toJSON(
394
+ defaultOptions,
395
+ );
396
+
379
397
  if (this.featureInfoResponseType !== defaultOptions.responseType) {
380
398
  config.responseType = this.featureInfoResponseType;
381
399
  }
@@ -423,6 +441,9 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
423
441
  if (this.htmlPositionFeatureTitle) {
424
442
  config.htmlPositionFeatureTitle = this.htmlPositionFeatureTitle;
425
443
  }
444
+ if (this.headers) {
445
+ config.headers = structuredClone(this.headers);
446
+ }
426
447
 
427
448
  return config as WMSFeatureProviderOptions;
428
449
  }
package/src/global.d.ts CHANGED
@@ -12,6 +12,8 @@ declare global {
12
12
  createModuleFromConfig: (config: VcsModuleConfig) => VcsModule;
13
13
  getFirstApp: () => VcsApp | undefined;
14
14
  workerBase?: string;
15
+ scriptNonce?: string;
16
+ styleNonce?: string;
15
17
  };
16
18
  opera?: string;
17
19
  }
@@ -27,7 +27,8 @@ async function getCoordinateFromPanoramaMap(
27
27
  event: InteractionEvent,
28
28
  ): Promise<InteractionEvent> {
29
29
  const image = map.currentPanoramaImage;
30
- let position = [0, 0, 0];
30
+ event.ray = map.getCesiumWidget().camera.getPickRay(event.windowPosition);
31
+ let position;
31
32
  if (image) {
32
33
  const { camera } = map.getCesiumWidget();
33
34
  const imageCoordinate = windowPositionToImageSpherical(
@@ -36,8 +37,6 @@ async function getCoordinateFromPanoramaMap(
36
37
  image.invModelMatrix,
37
38
  );
38
39
 
39
- event.positionOrPixel = imageCoordinate;
40
-
41
40
  if (imageCoordinate) {
42
41
  const cartesian = await image.getPositionAtImageCoordinate(
43
42
  imageCoordinate,
@@ -50,6 +49,7 @@ async function getCoordinateFromPanoramaMap(
50
49
  }
51
50
 
52
51
  event.position = position;
52
+ event.positionOrPixel = position;
53
53
  return event;
54
54
  }
55
55
 
@@ -93,9 +93,7 @@ class CoordinateAtPixel extends AbstractInteraction {
93
93
  scene,
94
94
  this._scratchCartesian,
95
95
  );
96
- if (!pickResult) {
97
- event.position = [0, 0, 0];
98
- } else {
96
+ if (pickResult) {
99
97
  this._scratchCartographic = Cartographic.fromCartesian(
100
98
  pickResult,
101
99
  scene.globe.ellipsoid,
@@ -0,0 +1,50 @@
1
+ import type { Coordinate } from 'ol/coordinate.js';
2
+ import AbstractInteraction, {
3
+ type InteractionEvent,
4
+ } from './abstractInteraction.js';
5
+ import {
6
+ EventType,
7
+ ModificationKeyType,
8
+ PointerKeyType,
9
+ } from './interactionType.js';
10
+
11
+ /**
12
+ * An interaction that ensures events without a position are stopped.
13
+ * It will set event.stopPropagation = true if event.position is undefined.
14
+ * Furthermore, it ensures the integrity of drag events by: a) remembering the last position
15
+ * on DRAGSTART and reusing it on DRAGEND if no position is provided and b) stopping propagation of drag events, if
16
+ * drag start did not provide a position.
17
+ */
18
+ class EnsurePositionInteraction extends AbstractInteraction {
19
+ private _lastDragPosition: Coordinate | undefined;
20
+
21
+ constructor() {
22
+ super(EventType.ALL, ModificationKeyType.ALL, PointerKeyType.ALL);
23
+
24
+ this.setActive();
25
+ }
26
+
27
+ pipe(event: InteractionEvent): Promise<InteractionEvent> {
28
+ if (event.type & EventType.DRAGSTART) {
29
+ this._lastDragPosition = event.position?.slice();
30
+ } else if (event.type & EventType.DRAG) {
31
+ if (this._lastDragPosition && event.position) {
32
+ this._lastDragPosition = event.position.slice();
33
+ } else if (!this._lastDragPosition) {
34
+ event.stopPropagation = true;
35
+ }
36
+ } else if (event.type & EventType.DRAGEND) {
37
+ if (this._lastDragPosition && !event.position) {
38
+ event.position = this._lastDragPosition;
39
+ } else if (!this._lastDragPosition) {
40
+ event.stopPropagation = true;
41
+ }
42
+ this._lastDragPosition = undefined;
43
+ }
44
+
45
+ event.stopPropagation = event.stopPropagation || !event.position;
46
+ return Promise.resolve(event);
47
+ }
48
+ }
49
+
50
+ export default EnsurePositionInteraction;
@@ -13,6 +13,7 @@ import {
13
13
  PointerEventType,
14
14
  } from './interactionType.js';
15
15
  import FeatureProviderInteraction from './featureProviderInteraction.js';
16
+ import EnsurePositionInteraction from './ensurePositionInteraction.js';
16
17
  import VcsEvent from '../vcsEvent.js';
17
18
 
18
19
  type EventHandlerExclusiveInteraction = {
@@ -35,6 +36,8 @@ class EventHandler {
35
36
 
36
37
  private _featureInteraction: FeatureAtPixelInteraction;
37
38
 
39
+ private _ensurePositionInteraction: EnsurePositionInteraction;
40
+
38
41
  private _featureProviderInteraction: FeatureProviderInteraction;
39
42
 
40
43
  private _interactionChain: InteractionChain;
@@ -72,10 +75,12 @@ class EventHandler {
72
75
  constructor() {
73
76
  this._positionInteraction = new CoordinateAtPixel();
74
77
  this._featureInteraction = new FeatureAtPixelInteraction();
78
+ this._ensurePositionInteraction = new EnsurePositionInteraction();
75
79
  this._featureProviderInteraction = new FeatureProviderInteraction();
76
80
  this._interactionChain = new InteractionChain([
77
81
  this._positionInteraction,
78
82
  this._featureInteraction,
83
+ this._ensurePositionInteraction,
79
84
  this._featureProviderInteraction,
80
85
  ]);
81
86
 
@@ -126,6 +131,10 @@ class EventHandler {
126
131
  return this._featureInteraction;
127
132
  }
128
133
 
134
+ get ensurePositionInteraction(): EnsurePositionInteraction {
135
+ return this._ensurePositionInteraction;
136
+ }
137
+
129
138
  get featureProviderInteraction(): FeatureProviderInteraction {
130
139
  return this._featureProviderInteraction;
131
140
  }
@@ -255,7 +264,7 @@ class EventHandler {
255
264
  */
256
265
  addPersistentInteraction(
257
266
  interaction: AbstractInteraction,
258
- index = 3,
267
+ index = 4,
259
268
  ): () => number {
260
269
  check(interaction, AbstractInteraction);
261
270
  check(index, Number);
@@ -440,6 +449,8 @@ class EventHandler {
440
449
  this._interactionChain.destroy();
441
450
  this._positionInteraction.destroy();
442
451
  this._featureInteraction.destroy();
452
+ this._ensurePositionInteraction.destroy();
453
+ this._featureProviderInteraction.destroy();
443
454
  this._eventQueue = [];
444
455
  window.removeEventListener('keydown', this._boundKeyListener);
445
456
  window.removeEventListener('keyup', this._boundKeyListener);
@@ -4,6 +4,8 @@ import type {
4
4
  Ray,
5
5
  Billboard,
6
6
  Label,
7
+ I3SNode,
8
+ I3SDataProvider,
7
9
  } from '@vcmap-cesium/engine';
8
10
  import {
9
11
  Cartesian3,
@@ -12,7 +14,9 @@ import {
12
14
  Entity,
13
15
  } from '@vcmap-cesium/engine';
14
16
  import type OLMap from 'ol/Map.js';
15
- import type { Feature } from 'ol/index.js';
17
+ import Feature from 'ol/Feature.js';
18
+ import { Point } from 'ol/geom.js';
19
+ import { v4 as uuid } from 'uuid';
16
20
  import AbstractInteraction, {
17
21
  type EventFeature,
18
22
  type InteractionEvent,
@@ -22,15 +26,16 @@ import {
22
26
  ModificationKeyType,
23
27
  PointerKeyType,
24
28
  } from './interactionType.js';
25
- import { allowPicking, vcsLayerName } from '../layer/layerSymbols.js';
29
+ import { allowPicking, i3sData, vcsLayerName } from '../layer/layerSymbols.js';
26
30
  import { originalFeatureSymbol, primitives } from '../layer/vectorSymbols.js';
27
31
  import type OpenlayersMap from '../map/openlayersMap.js';
28
32
  import type ObliqueMap from '../map/obliqueMap.js';
29
- import type CesiumMap from '../map/cesiumMap.js';
30
33
  import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
31
- import { cartesianToMercator } from '../util/math.js';
34
+ import { cartesian3DDistance, cartesianToMercator } from '../util/math.js';
32
35
  import type { PrimitiveType } from '../util/featureconverter/convert.js';
36
+ import type BaseCesiumMap from '../map/baseCesiumMap.js';
33
37
  import type PanoramaMap from '../map/panoramaMap.js';
38
+ import { isProvidedFeature } from '../featureProvider/featureProviderSymbols.js';
34
39
 
35
40
  /**
36
41
  * This is the return from cesium scene.pick and scene.drillPick, which returns "any". We cast to this type.
@@ -45,6 +50,11 @@ type CesiumPickObject = {
45
50
  olFeature?: Feature;
46
51
  [vcsLayerName]?: string;
47
52
  };
53
+ content?: {
54
+ tile?: {
55
+ i3sNode: I3SNode;
56
+ };
57
+ };
48
58
  };
49
59
 
50
60
  function getFeatureFromOlMap(
@@ -81,6 +91,12 @@ function getFeatureFromOlMap(
81
91
  return feature;
82
92
  }
83
93
 
94
+ export function isI3SFeature(f: EventFeature): f is Feature & {
95
+ [i3sData]: { i3sNode: I3SNode; cartesianPosition?: Cartesian3 };
96
+ } {
97
+ return !!(f != null && (f as Feature)[i3sData]);
98
+ }
99
+
84
100
  export function getFeatureFromPickObject(
85
101
  object: CesiumPickObject,
86
102
  ): EventFeature | undefined {
@@ -114,8 +130,24 @@ export function getFeatureFromPickObject(
114
130
  ) {
115
131
  // entity
116
132
  feature = object.id;
133
+ } else if (object.content?.tile?.i3sNode) {
134
+ // i3s feature
135
+ const dataProvider =
136
+ // @ts-expect-error eslint-disable-next-line no-underscore-dangle, @typescript-eslint/ban-ts-comment
137
+ // eslint-disable-next-line no-underscore-dangle
138
+ object.content.tile.i3sNode._dataProvider as I3SDataProvider;
139
+ const layername = dataProvider[vcsLayerName];
140
+ if (object instanceof Cesium3DTileFeature) {
141
+ feature = object;
142
+ feature[vcsLayerName] = layername;
143
+ } else if (dataProvider[allowPicking] !== false) {
144
+ feature = new Feature({});
145
+ feature.setId(uuid());
146
+ feature[vcsLayerName] = layername;
147
+ feature[i3sData] = { i3sNode: object.content.tile.i3sNode };
148
+ feature[isProvidedFeature] = true;
149
+ }
117
150
  }
118
-
119
151
  return feature;
120
152
  }
121
153
 
@@ -283,7 +315,7 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
283
315
  }
284
316
 
285
317
  private _cesiumHandler(event: InteractionEvent): Promise<InteractionEvent> {
286
- const cesiumMap = event.map as CesiumMap | PanoramaMap;
318
+ const cesiumMap = event.map as BaseCesiumMap;
287
319
  const { scene } = cesiumMap.getCesiumWidget()!;
288
320
 
289
321
  if (!scene) {
@@ -301,14 +333,10 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
301
333
  }
302
334
 
303
335
  const { pickTranslucentDepth } = scene;
304
- if (!(event.type & this.pickPosition)) {
305
- return Promise.resolve(event);
306
- }
307
-
308
336
  if (
337
+ !!(event.type & this.pickPosition) &&
309
338
  pickObject &&
310
- scene.pickPositionSupported &&
311
- event.map.className === 'CesiumMap'
339
+ scene.pickPositionSupported
312
340
  ) {
313
341
  if (this.pickTranslucent) {
314
342
  scene.pickTranslucentDepth = true;
@@ -334,30 +362,62 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
334
362
  );
335
363
 
336
364
  if (
337
- !cartesianPosition ||
338
- Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
365
+ cartesianPosition &&
366
+ !Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
339
367
  ) {
340
- return Promise.resolve(event);
341
- }
368
+ if (this.pullPickedPosition && event.ray) {
369
+ const pulledCartesian = Cartesian3.multiplyByScalar(
370
+ event.ray.direction,
371
+ this.pullPickedPosition,
372
+ new Cartesian3(),
373
+ );
374
+
375
+ Cartesian3.subtract(
376
+ cartesianPosition,
377
+ pulledCartesian,
378
+ cartesianPosition,
379
+ );
380
+ }
342
381
 
343
- if (this.pullPickedPosition && event.ray) {
344
- const pulledCartesian = Cartesian3.multiplyByScalar(
345
- event.ray.direction,
346
- this.pullPickedPosition,
347
- new Cartesian3(),
348
- );
349
-
350
- Cartesian3.subtract(
351
- cartesianPosition,
352
- pulledCartesian,
353
- cartesianPosition,
354
- );
382
+ if (event.map.className === 'CesiumMap') {
383
+ event.position = cartesianToMercator(cartesianPosition);
384
+ event.positionOrPixel = event.position.slice();
385
+ if (
386
+ feature instanceof Feature &&
387
+ feature[isProvidedFeature] &&
388
+ isI3SFeature(feature)
389
+ ) {
390
+ feature.setGeometry(new Point(event.position));
391
+ feature.set('olcs_altitudeMode', 'absolute');
392
+ feature[i3sData].cartesianPosition = cartesianPosition;
393
+ }
394
+ } else {
395
+ const currentImage = (event.map as PanoramaMap).currentPanoramaImage;
396
+ if (currentImage) {
397
+ const imageCenter = cartesianToMercator(currentImage.position);
398
+ const newPosition = cartesianToMercator(cartesianPosition);
399
+ const newDistance = cartesian3DDistance(imageCenter, newPosition);
400
+ const currentDistance = event.position
401
+ ? cartesian3DDistance(imageCenter, event.position)
402
+ : undefined;
403
+
404
+ if (currentDistance == null || newDistance < currentDistance) {
405
+ event.position = newPosition;
406
+ event.positionOrPixel = event.position.slice();
407
+ if (
408
+ feature instanceof Feature &&
409
+ feature[isProvidedFeature] &&
410
+ isI3SFeature(feature)
411
+ ) {
412
+ feature.setGeometry(new Point(event.position));
413
+ feature.set('olcs_altitudeMode', 'absolute');
414
+ feature[i3sData].cartesianPosition = cartesianPosition;
415
+ }
416
+ }
417
+ }
418
+ }
355
419
  }
356
-
357
- event.position = cartesianToMercator(cartesianPosition);
358
- event.positionOrPixel = event.position.slice();
359
420
  scene.pickTranslucentDepth = pickTranslucentDepth;
360
- return Promise.resolve(event);
361
421
  }
362
422
 
363
423
  return Promise.resolve(event);