@vcmap/core 5.0.2 → 5.1.0-rc.1

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 (309) hide show
  1. package/dist/cesium.d.ts +257 -0
  2. package/dist/geojson.d.ts +27 -0
  3. package/dist/index.d.ts +15 -2
  4. package/dist/index.js +9 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/ol.d.ts +138 -0
  7. package/dist/src/classRegistry.js +2 -2
  8. package/dist/src/classRegistry.js.map +1 -1
  9. package/dist/src/featureProvider/abstractFeatureProvider.d.ts +2 -1
  10. package/dist/src/featureProvider/abstractFeatureProvider.js +2 -1
  11. package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
  12. package/dist/src/featureProvider/tileProviderFeatureProvider.d.ts +1 -1
  13. package/dist/src/featureProvider/tileProviderFeatureProvider.js +2 -2
  14. package/dist/src/featureProvider/tileProviderFeatureProvider.js.map +1 -1
  15. package/dist/src/featureProvider/wmsFeatureProvider.d.ts +1 -1
  16. package/dist/src/featureProvider/wmsFeatureProvider.js +4 -3
  17. package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
  18. package/dist/src/interaction/eventHandler.js +3 -3
  19. package/dist/src/interaction/eventHandler.js.map +1 -1
  20. package/dist/src/interaction/featureProviderInteraction.js +1 -1
  21. package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
  22. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +4 -1
  23. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js +31 -2
  24. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
  25. package/dist/src/layer/cesium/resourceHelper.d.ts +2 -0
  26. package/dist/src/layer/cesium/resourceHelper.js +12 -0
  27. package/dist/src/layer/cesium/resourceHelper.js.map +1 -0
  28. package/dist/src/layer/cesium/singleImageCesiumImpl.js +2 -1
  29. package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
  30. package/dist/src/layer/cesium/terrainCesiumImpl.js +1 -1
  31. package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
  32. package/dist/src/layer/cesium/tmsCesiumImpl.js +2 -1
  33. package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
  34. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +1 -0
  35. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
  36. package/dist/src/layer/cesium/vectorTileImageryProvider.d.ts +2 -0
  37. package/dist/src/layer/cesium/vectorTileImageryProvider.js +3 -1
  38. package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
  39. package/dist/src/layer/cesium/wmsCesiumImpl.js +2 -1
  40. package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
  41. package/dist/src/layer/cesium/wmtsCesiumImpl.js +2 -1
  42. package/dist/src/layer/cesium/wmtsCesiumImpl.js.map +1 -1
  43. package/dist/src/layer/cesiumTilesetLayer.d.ts +5 -1
  44. package/dist/src/layer/cesiumTilesetLayer.js +17 -7
  45. package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
  46. package/dist/src/layer/czmlLayer.js +2 -1
  47. package/dist/src/layer/czmlLayer.js.map +1 -1
  48. package/dist/src/layer/featureLayer.js +2 -2
  49. package/dist/src/layer/featureLayer.js.map +1 -1
  50. package/dist/src/layer/featureStoreLayer.js +8 -5
  51. package/dist/src/layer/featureStoreLayer.js.map +1 -1
  52. package/dist/src/layer/featureStoreLayerChanges.d.ts +20 -8
  53. package/dist/src/layer/featureStoreLayerChanges.js +26 -26
  54. package/dist/src/layer/featureStoreLayerChanges.js.map +1 -1
  55. package/dist/src/layer/featureStoreLayerState.d.ts +1 -5
  56. package/dist/src/layer/featureStoreLayerState.js +0 -9
  57. package/dist/src/layer/featureStoreLayerState.js.map +1 -1
  58. package/dist/src/layer/geojsonLayer.js +3 -2
  59. package/dist/src/layer/geojsonLayer.js.map +1 -1
  60. package/dist/src/layer/layer.d.ts +15 -0
  61. package/dist/src/layer/layer.js +30 -4
  62. package/dist/src/layer/layer.js.map +1 -1
  63. package/dist/src/layer/layerImplementation.d.ts +1 -0
  64. package/dist/src/layer/layerImplementation.js +2 -0
  65. package/dist/src/layer/layerImplementation.js.map +1 -1
  66. package/dist/src/layer/oblique/vectorObliqueImpl.js +9 -6
  67. package/dist/src/layer/oblique/vectorObliqueImpl.js.map +1 -1
  68. package/dist/src/layer/openlayers/loadFunctionHelpers.d.ts +2 -0
  69. package/dist/src/layer/openlayers/loadFunctionHelpers.js +20 -0
  70. package/dist/src/layer/openlayers/loadFunctionHelpers.js.map +1 -0
  71. package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js +25 -1
  72. package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
  73. package/dist/src/layer/openlayers/tmsOpenlayersImpl.js +9 -1
  74. package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
  75. package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +1 -1
  76. package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
  77. package/dist/src/layer/openlayers/wmsOpenlayersImpl.d.ts +4 -1
  78. package/dist/src/layer/openlayers/wmsOpenlayersImpl.js +20 -1
  79. package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
  80. package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js +9 -1
  81. package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
  82. package/dist/src/layer/pointCloudLayer.js +2 -2
  83. package/dist/src/layer/pointCloudLayer.js.map +1 -1
  84. package/dist/src/layer/terrainHelpers.d.ts +3 -3
  85. package/dist/src/layer/terrainHelpers.js +12 -7
  86. package/dist/src/layer/terrainHelpers.js.map +1 -1
  87. package/dist/src/layer/terrainLayer.js +1 -1
  88. package/dist/src/layer/terrainLayer.js.map +1 -1
  89. package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
  90. package/dist/src/layer/tileProvider/mvtTileProvider.js +4 -3
  91. package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
  92. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
  93. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +4 -3
  94. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
  95. package/dist/src/layer/tileProvider/tileProvider.d.ts +14 -11
  96. package/dist/src/layer/tileProvider/tileProvider.js +23 -20
  97. package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
  98. package/dist/src/layer/tileProvider/urlTemplateTileProvider.d.ts +1 -1
  99. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js +4 -3
  100. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
  101. package/dist/src/layer/vectorLayer.d.ts +1 -2
  102. package/dist/src/layer/vectorLayer.js +3 -3
  103. package/dist/src/layer/vectorLayer.js.map +1 -1
  104. package/dist/src/layer/vectorProperties.d.ts +11 -16
  105. package/dist/src/layer/vectorProperties.js +16 -13
  106. package/dist/src/layer/vectorProperties.js.map +1 -1
  107. package/dist/src/layer/wfsLayer.js +9 -6
  108. package/dist/src/layer/wfsLayer.js.map +1 -1
  109. package/dist/src/layer/wmsHelpers.d.ts +10 -0
  110. package/dist/src/layer/wmsHelpers.js +53 -12
  111. package/dist/src/layer/wmsHelpers.js.map +1 -1
  112. package/dist/src/layer/wmsLayer.d.ts +6 -0
  113. package/dist/src/layer/wmsLayer.js +5 -2
  114. package/dist/src/layer/wmsLayer.js.map +1 -1
  115. package/dist/src/map/cameraLimiter.d.ts +5 -0
  116. package/dist/src/map/cameraLimiter.js +11 -4
  117. package/dist/src/map/cameraLimiter.js.map +1 -1
  118. package/dist/src/map/cesiumMap.d.ts +20 -1
  119. package/dist/src/map/cesiumMap.js +51 -2
  120. package/dist/src/map/cesiumMap.js.map +1 -1
  121. package/dist/src/map/vcsMap.js +2 -2
  122. package/dist/src/map/vcsMap.js.map +1 -1
  123. package/dist/src/oblique/helpers.d.ts +1 -1
  124. package/dist/src/oblique/helpers.js +5 -9
  125. package/dist/src/oblique/helpers.js.map +1 -1
  126. package/dist/src/oblique/obliqueCollection.d.ts +1 -0
  127. package/dist/src/oblique/obliqueCollection.js +1 -1
  128. package/dist/src/oblique/obliqueCollection.js.map +1 -1
  129. package/dist/src/oblique/obliqueDataSet.d.ts +3 -1
  130. package/dist/src/oblique/obliqueDataSet.js +13 -6
  131. package/dist/src/oblique/obliqueDataSet.js.map +1 -1
  132. package/dist/src/oblique/obliqueImageMeta.d.ts +2 -0
  133. package/dist/src/oblique/obliqueImageMeta.js +2 -0
  134. package/dist/src/oblique/obliqueImageMeta.js.map +1 -1
  135. package/dist/src/oblique/obliqueView.d.ts +1 -0
  136. package/dist/src/oblique/obliqueView.js +12 -2
  137. package/dist/src/oblique/obliqueView.js.map +1 -1
  138. package/dist/src/oblique/parseImageJson.d.ts +6 -5
  139. package/dist/src/oblique/parseImageJson.js +7 -5
  140. package/dist/src/oblique/parseImageJson.js.map +1 -1
  141. package/dist/src/ol/geom/circle.js.map +1 -1
  142. package/dist/src/style/declarativeStyleItem.js +10 -2
  143. package/dist/src/style/declarativeStyleItem.js.map +1 -1
  144. package/dist/src/style/styleFactory.js +2 -2
  145. package/dist/src/style/styleFactory.js.map +1 -1
  146. package/dist/src/style/styleHelpers.js +13 -3
  147. package/dist/src/style/styleHelpers.js.map +1 -1
  148. package/dist/src/style/vectorStyleItem.js +29 -16
  149. package/dist/src/style/vectorStyleItem.js.map +1 -1
  150. package/dist/src/util/clipping/clippingPlaneHelper.js +3 -3
  151. package/dist/src/util/clipping/clippingPlaneHelper.js.map +1 -1
  152. package/dist/src/util/editor/createFeatureSession.d.ts +2 -2
  153. package/dist/src/util/editor/createFeatureSession.js +2 -2
  154. package/dist/src/util/editor/createFeatureSession.js.map +1 -1
  155. package/dist/src/util/editor/editFeaturesSession.d.ts +2 -2
  156. package/dist/src/util/editor/editGeometrySession.d.ts +2 -2
  157. package/dist/src/util/editor/editorSessionHelpers.d.ts +2 -2
  158. package/dist/src/util/editor/selectFeaturesSession.d.ts +2 -2
  159. package/dist/src/util/editor/selectFeaturesSession.js +2 -2
  160. package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
  161. package/dist/src/util/featureconverter/arcToCesium.d.ts +1 -1
  162. package/dist/src/util/featureconverter/arcToCesium.js +5 -2
  163. package/dist/src/util/featureconverter/arcToCesium.js.map +1 -1
  164. package/dist/src/util/featureconverter/circleToCesium.d.ts +4 -2
  165. package/dist/src/util/featureconverter/circleToCesium.js +8 -3
  166. package/dist/src/util/featureconverter/circleToCesium.js.map +1 -1
  167. package/dist/src/util/featureconverter/extent3D.js.map +1 -1
  168. package/dist/src/util/featureconverter/featureconverterHelper.js +2 -2
  169. package/dist/src/util/featureconverter/featureconverterHelper.js.map +1 -1
  170. package/dist/src/util/featureconverter/lineStringToCesium.d.ts +3 -1
  171. package/dist/src/util/featureconverter/lineStringToCesium.js +7 -2
  172. package/dist/src/util/featureconverter/lineStringToCesium.js.map +1 -1
  173. package/dist/src/util/featureconverter/pointToCesium.js +1 -1
  174. package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
  175. package/dist/src/util/featureconverter/polygonToCesium.d.ts +3 -3
  176. package/dist/src/util/featureconverter/polygonToCesium.js +9 -15
  177. package/dist/src/util/featureconverter/polygonToCesium.js.map +1 -1
  178. package/dist/src/util/fetch.d.ts +2 -0
  179. package/dist/src/util/fetch.js +16 -0
  180. package/dist/src/util/fetch.js.map +1 -1
  181. package/dist/src/util/flight/flightAnchor.d.ts +23 -0
  182. package/dist/src/util/flight/flightAnchor.js +152 -0
  183. package/dist/src/util/flight/flightAnchor.js.map +1 -0
  184. package/dist/src/util/flight/flightCollection.d.ts +25 -0
  185. package/dist/src/util/flight/flightCollection.js +63 -0
  186. package/dist/src/util/flight/flightCollection.js.map +1 -0
  187. package/dist/src/util/flight/flightHelpers.d.ts +29 -0
  188. package/dist/src/util/flight/flightHelpers.js +134 -0
  189. package/dist/src/util/flight/flightHelpers.js.map +1 -0
  190. package/dist/src/util/flight/flightInstance.d.ts +57 -0
  191. package/dist/src/util/flight/flightInstance.js +166 -0
  192. package/dist/src/util/flight/flightInstance.js.map +1 -0
  193. package/dist/src/util/flight/flightPlayer.d.ts +30 -0
  194. package/dist/src/util/flight/flightPlayer.js +247 -0
  195. package/dist/src/util/flight/flightPlayer.js.map +1 -0
  196. package/dist/src/util/flight/flightVisualizer.d.ts +18 -0
  197. package/dist/src/util/flight/flightVisualizer.js +151 -0
  198. package/dist/src/util/flight/flightVisualizer.js.map +1 -0
  199. package/dist/src/util/hiddenObjects.d.ts +8 -0
  200. package/dist/src/util/hiddenObjects.js +17 -0
  201. package/dist/src/util/hiddenObjects.js.map +1 -0
  202. package/dist/src/util/mapCollection.js +2 -2
  203. package/dist/src/util/mapCollection.js.map +1 -1
  204. package/dist/src/util/overrideCollection.d.ts +8 -3
  205. package/dist/src/util/overrideCollection.js +17 -0
  206. package/dist/src/util/overrideCollection.js.map +1 -1
  207. package/dist/src/util/projection.js +5 -2
  208. package/dist/src/util/projection.js.map +1 -1
  209. package/dist/src/util/viewpoint.d.ts +1 -0
  210. package/dist/src/util/viewpoint.js +24 -7
  211. package/dist/src/util/viewpoint.js.map +1 -1
  212. package/dist/src/vcsApp.d.ts +10 -3
  213. package/dist/src/vcsApp.js +34 -15
  214. package/dist/src/vcsApp.js.map +1 -1
  215. package/dist/src/vcsModule.d.ts +4 -0
  216. package/dist/src/vcsModule.js.map +1 -1
  217. package/dist/tests/unit/helpers/cesiumHelpers.d.ts +2 -2
  218. package/dist/tests/unit/helpers/cesiumHelpers.js +2 -1
  219. package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
  220. package/dist/tests/unit/helpers/terrain/terrainData.d.ts +7 -0
  221. package/dist/tests/unit/helpers/terrain/terrainData.js +2 -2
  222. package/dist/tests/unit/helpers/terrain/terrainData.js.map +1 -1
  223. package/index.ts +39 -1
  224. package/package.json +4 -2
  225. package/src/classRegistry.ts +2 -2
  226. package/src/featureProvider/abstractFeatureProvider.ts +2 -0
  227. package/src/featureProvider/tileProviderFeatureProvider.ts +2 -0
  228. package/src/featureProvider/wmsFeatureProvider.ts +4 -2
  229. package/src/interaction/eventHandler.ts +3 -3
  230. package/src/interaction/featureProviderInteraction.ts +1 -0
  231. package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +44 -5
  232. package/src/layer/cesium/resourceHelper.ts +15 -0
  233. package/src/layer/cesium/singleImageCesiumImpl.ts +2 -1
  234. package/src/layer/cesium/terrainCesiumImpl.ts +2 -1
  235. package/src/layer/cesium/tmsCesiumImpl.ts +2 -1
  236. package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +1 -0
  237. package/src/layer/cesium/vectorTileImageryProvider.ts +10 -1
  238. package/src/layer/cesium/wmsCesiumImpl.ts +2 -1
  239. package/src/layer/cesium/wmtsCesiumImpl.ts +4 -2
  240. package/src/layer/cesiumTilesetLayer.ts +25 -7
  241. package/src/layer/czmlLayer.ts +2 -1
  242. package/src/layer/featureLayer.ts +2 -2
  243. package/src/layer/featureStoreLayer.ts +8 -8
  244. package/src/layer/featureStoreLayerChanges.ts +63 -45
  245. package/src/layer/featureStoreLayerState.ts +6 -5
  246. package/src/layer/geojsonLayer.ts +3 -3
  247. package/src/layer/layer.ts +41 -4
  248. package/src/layer/layerImplementation.ts +3 -0
  249. package/src/layer/oblique/vectorObliqueImpl.ts +9 -8
  250. package/src/layer/openlayers/loadFunctionHelpers.ts +24 -0
  251. package/src/layer/openlayers/singleImageOpenlayersImpl.ts +25 -1
  252. package/src/layer/openlayers/tmsOpenlayersImpl.ts +8 -1
  253. package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +1 -0
  254. package/src/layer/openlayers/wmsOpenlayersImpl.ts +23 -2
  255. package/src/layer/openlayers/wmtsOpenlayersImpl.ts +8 -1
  256. package/src/layer/pointCloudLayer.ts +2 -2
  257. package/src/layer/terrainHelpers.ts +19 -6
  258. package/src/layer/terrainLayer.ts +8 -4
  259. package/src/layer/tileProvider/mvtTileProvider.ts +9 -3
  260. package/src/layer/tileProvider/staticGeojsonTileProvider.ts +9 -3
  261. package/src/layer/tileProvider/tileProvider.ts +49 -13
  262. package/src/layer/tileProvider/urlTemplateTileProvider.ts +10 -3
  263. package/src/layer/vectorLayer.ts +9 -9
  264. package/src/layer/vectorProperties.ts +46 -22
  265. package/src/layer/wfsLayer.ts +9 -6
  266. package/src/layer/wmsHelpers.ts +78 -10
  267. package/src/layer/wmsLayer.ts +11 -2
  268. package/src/map/cameraLimiter.ts +21 -2
  269. package/src/map/cesiumMap.ts +67 -2
  270. package/src/map/vcsMap.ts +2 -2
  271. package/src/oblique/helpers.ts +5 -13
  272. package/src/oblique/obliqueCollection.ts +2 -0
  273. package/src/oblique/obliqueDataSet.ts +16 -2
  274. package/src/oblique/obliqueImageMeta.ts +4 -0
  275. package/src/oblique/obliqueView.ts +12 -2
  276. package/src/oblique/parseImageJson.ts +7 -4
  277. package/src/ol/geojson.d.ts +1 -2
  278. package/src/ol/geom/circle.ts +1 -1
  279. package/src/style/declarativeStyleItem.ts +10 -2
  280. package/src/style/styleFactory.ts +2 -2
  281. package/src/style/styleHelpers.ts +13 -4
  282. package/src/style/vectorStyleItem.ts +32 -20
  283. package/src/util/clipping/clippingPlaneHelper.ts +3 -3
  284. package/src/util/editor/createFeatureSession.ts +9 -8
  285. package/src/util/editor/editFeaturesSession.ts +1 -1
  286. package/src/util/editor/editGeometrySession.ts +1 -1
  287. package/src/util/editor/editorSessionHelpers.ts +2 -2
  288. package/src/util/editor/selectFeaturesSession.ts +3 -3
  289. package/src/util/featureconverter/arcToCesium.ts +5 -1
  290. package/src/util/featureconverter/circleToCesium.ts +8 -2
  291. package/src/util/featureconverter/extent3D.ts +1 -1
  292. package/src/util/featureconverter/featureconverterHelper.ts +3 -5
  293. package/src/util/featureconverter/lineStringToCesium.ts +8 -1
  294. package/src/util/featureconverter/pointToCesium.ts +1 -1
  295. package/src/util/featureconverter/polygonToCesium.ts +6 -15
  296. package/src/util/fetch.ts +25 -0
  297. package/src/util/flight/flightAnchor.ts +195 -0
  298. package/src/util/flight/flightCollection.ts +78 -0
  299. package/src/util/flight/flightHelpers.ts +208 -0
  300. package/src/util/flight/flightInstance.ts +240 -0
  301. package/src/util/flight/flightPlayer.ts +326 -0
  302. package/src/util/flight/flightVisualizer.ts +202 -0
  303. package/src/util/hiddenObjects.ts +35 -0
  304. package/src/util/mapCollection.ts +2 -2
  305. package/src/util/overrideCollection.ts +26 -3
  306. package/src/util/projection.ts +5 -2
  307. package/src/util/viewpoint.ts +27 -7
  308. package/src/vcsApp.ts +56 -15
  309. package/src/vcsModule.ts +4 -0
@@ -145,11 +145,13 @@ class AbstractFeatureProvider extends VcsObject {
145
145
  * to handle your feature is called: (e.g. <code>return features.map(f => this.getProviderFeature(f)</code>);
146
146
  * @param coordinate - in mercator
147
147
  * @param resolution - meters per pixel for the given location
148
+ * @param headers - headers optional request headers to be sent with the server request
148
149
  */
149
150
  // eslint-disable-next-line no-unused-vars,class-methods-use-this
150
151
  getFeaturesByCoordinate(
151
152
  _coordinate: Coordinate,
152
153
  _resolution: number,
154
+ _headers?: Record<string, string>,
153
155
  ): Promise<Feature[]> {
154
156
  return Promise.resolve([]);
155
157
  }
@@ -32,10 +32,12 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
32
32
  async getFeaturesByCoordinate(
33
33
  coordinate: Coordinate,
34
34
  resolution: number,
35
+ headers?: Record<string, string>,
35
36
  ): Promise<Feature[]> {
36
37
  const features = await this.tileProvider.getFeaturesByCoordinate(
37
38
  coordinate,
38
39
  resolution,
40
+ headers,
39
41
  );
40
42
  const checkShow = (feature: Feature): boolean =>
41
43
  this.style ? !!this.style.cesiumStyle.show.evaluate(feature) : true;
@@ -24,7 +24,7 @@ import Projection, {
24
24
  import type { WMSSourceOptions } from '../layer/wmsHelpers.js';
25
25
  import { getWMSSource } from '../layer/wmsHelpers.js';
26
26
  import Extent, { ExtentOptions } from '../util/extent.js';
27
- import { requestJson } from '../util/fetch.js';
27
+ import { getInitForUrl, requestJson } from '../util/fetch.js';
28
28
  import { featureProviderClassRegistry } from '../classRegistry.js';
29
29
  import { TilingScheme } from '../layer/rasterLayer.js';
30
30
 
@@ -239,6 +239,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
239
239
  async getFeaturesByCoordinate(
240
240
  coordinate: Coordinate,
241
241
  resolution: number,
242
+ headers?: Record<string, string>,
242
243
  ): Promise<Feature[]> {
243
244
  const projection = this.wmsSource.getProjection() as OLProjection;
244
245
  let coords = coordinate;
@@ -257,9 +258,10 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
257
258
  );
258
259
 
259
260
  if (url) {
261
+ const init = getInitForUrl(url, headers);
260
262
  let data: GeoJSONObject;
261
263
  try {
262
- data = await requestJson<GeoJSONObject>(url);
264
+ data = await requestJson<GeoJSONObject>(url, init);
263
265
  } catch (ex) {
264
266
  this.getLogger().error(`Failed fetching WMS FeatureInfo ${url}`);
265
267
  return [];
@@ -1,6 +1,6 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
2
  import { Cartesian2 } from '@vcmap-cesium/engine';
3
- import { check, checkMaybe } from '@vcsuite/check';
3
+ import { check, maybe } from '@vcsuite/check';
4
4
  import { getLogger as getLoggerByName, type Logger } from '@vcsuite/logger';
5
5
  import AbstractInteraction, {
6
6
  InteractionEvent,
@@ -165,8 +165,8 @@ class EventHandler {
165
165
  ): () => void {
166
166
  check(interaction, AbstractInteraction);
167
167
  check(removed, Function);
168
- checkMaybe(index, Number);
169
- checkMaybe(id, String);
168
+ check(index, maybe(Number));
169
+ check(id, maybe(String));
170
170
 
171
171
  if (this._exclusiveInteraction && this._exclusiveInteraction.id !== id) {
172
172
  this.removeExclusive();
@@ -44,6 +44,7 @@ class FeatureProviderInteraction extends AbstractInteraction {
44
44
  l.featureProvider?.getFeaturesByCoordinate?.(
45
45
  event.position as Coordinate,
46
46
  resolution,
47
+ l.headers,
47
48
  ),
48
49
  ),
49
50
  )
@@ -10,6 +10,7 @@ import {
10
10
  type SplitDirection,
11
11
  Cesium3DTile,
12
12
  Cesium3DTileContent,
13
+ type CustomShader,
13
14
  } from '@vcmap-cesium/engine';
14
15
  import { createEmpty, Extent as OLExtent } from 'ol/extent.js';
15
16
  import type { Coordinate } from 'ol/coordinate.js';
@@ -32,6 +33,7 @@ import type CesiumMap from '../../map/cesiumMap.js';
32
33
  import type { FeatureLayerImplementation } from '../featureLayer.js';
33
34
  import type StyleItem from '../../style/styleItem.js';
34
35
  import GlobalHider from '../globalHider.js';
36
+ import { getResourceOrUrl } from './resourceHelper.js';
35
37
 
36
38
  export const cesiumTilesetLastUpdated: unique symbol = Symbol(
37
39
  'cesiumTilesetLastUpdated',
@@ -111,6 +113,8 @@ class CesiumTilesetCesiumImpl
111
113
 
112
114
  private _onStyleChangeRemover: (() => void) | null = null;
113
115
 
116
+ private _customShader: CustomShader | undefined;
117
+
114
118
  constructor(map: CesiumMap, options: CesiumTilesetImplementationOptions) {
115
119
  super(map, options);
116
120
 
@@ -123,15 +127,43 @@ class CesiumTilesetCesiumImpl
123
127
  this.tilesetProperties = options.tilesetProperties;
124
128
  this.modelMatrix = options.modelMatrix;
125
129
  this.offset = options.offset;
130
+ this._customShader = options.customShader;
131
+ }
132
+
133
+ get customShader(): CustomShader | undefined {
134
+ return this._customShader;
126
135
  }
127
136
 
128
137
  async initialize(): Promise<void> {
129
138
  if (!this._initializedPromise) {
130
- this._initializedPromise = Cesium3DTileset.fromUrl(this.url as string, {
131
- ...this.tilesetOptions,
132
- show: false, // show is handled by activate
133
- });
134
- this.cesium3DTileset = await this._initializedPromise;
139
+ this._initializedPromise = Cesium3DTileset.fromUrl(
140
+ getResourceOrUrl(this.url!, this.headers),
141
+ {
142
+ ...this.tilesetOptions,
143
+ show: false, // show is handled by activate
144
+ },
145
+ );
146
+
147
+ // if url could not be loaded, we have a fallback and try again with a prefixed tileset.json.
148
+ try {
149
+ this.cesium3DTileset = await this._initializedPromise;
150
+ } catch (e) {
151
+ if (this.url && !/\.json$/.test(this.url)) {
152
+ this.url = `${this.url.replace(/\/$/, '')}/tileset.json`;
153
+ this._initializedPromise = Cesium3DTileset.fromUrl(
154
+ getResourceOrUrl(this.url, this.headers),
155
+ {
156
+ ...this.tilesetOptions,
157
+ show: false, // show is handled by activate
158
+ },
159
+ );
160
+ this.cesium3DTileset = await this._initializedPromise;
161
+ } else {
162
+ throw e;
163
+ }
164
+ }
165
+
166
+ this.cesium3DTileset.customShader = this._customShader;
135
167
  if (this.isDestroyed) {
136
168
  this.cesium3DTileset.destroy();
137
169
  return;
@@ -214,6 +246,13 @@ class CesiumTilesetCesiumImpl
214
246
  this._calculateOffset();
215
247
  }
216
248
 
249
+ updateCustomShader(shader?: CustomShader): void {
250
+ this._customShader = shader;
251
+ if (this.cesium3DTileset) {
252
+ this.cesium3DTileset.customShader = this._customShader;
253
+ }
254
+ }
255
+
217
256
  async activate(): Promise<void> {
218
257
  await super.activate();
219
258
  if (this.active && this.cesium3DTileset) {
@@ -0,0 +1,15 @@
1
+ import { Resource } from '@vcmap-cesium/engine';
2
+
3
+ // eslint-disable-next-line import/prefer-default-export
4
+ export function getResourceOrUrl(
5
+ url: string,
6
+ headers?: Record<string, string>,
7
+ ): string | Resource {
8
+ if (headers) {
9
+ return new Resource({
10
+ url,
11
+ headers,
12
+ });
13
+ }
14
+ return url;
15
+ }
@@ -7,6 +7,7 @@ import RasterLayerCesiumImpl from './rasterLayerCesiumImpl.js';
7
7
  import { wgs84Projection } from '../../util/projection.js';
8
8
  import type { SingleImageImplementationOptions } from '../singleImageLayer.js';
9
9
  import type CesiumMap from '../../map/cesiumMap.js';
10
+ import { getResourceOrUrl } from './resourceHelper.js';
10
11
 
11
12
  /**
12
13
  * represents a specific Cesium SingleTileImagery Layer class.
@@ -39,7 +40,7 @@ class SingleImageCesiumImpl extends RasterLayerCesiumImpl {
39
40
  }
40
41
 
41
42
  const imageryProvider = await SingleTileImageryProvider.fromUrl(
42
- this.url!,
43
+ getResourceOrUrl(this.url!, this.headers),
43
44
  options,
44
45
  );
45
46
  const layerOptions = {
@@ -29,11 +29,12 @@ class TerrainCesiumImpl extends LayerImplementation<CesiumMap> {
29
29
  async initialize(): Promise<void> {
30
30
  if (!this.initialized) {
31
31
  this.terrainProvider = await getTerrainProviderForUrl(
32
- this.url as string,
32
+ this.url!,
33
33
  {
34
34
  requestVertexNormals: this.requestVertexNormals,
35
35
  requestWaterMask: this.requestWaterMask,
36
36
  },
37
+ this.headers,
37
38
  );
38
39
  this.terrainProvider[vcsLayerName] = this.name;
39
40
  }
@@ -9,6 +9,7 @@ import { wgs84Projection } from '../../util/projection.js';
9
9
  import { TilingScheme } from '../rasterLayer.js';
10
10
  import type CesiumMap from '../../map/cesiumMap.js';
11
11
  import type { TMSImplementationOptions } from '../tmsLayer.js';
12
+ import { getResourceOrUrl } from './resourceHelper.js';
12
13
 
13
14
  /**
14
15
  * TmsLayer implementation for {@link CesiumMap}.
@@ -48,7 +49,7 @@ class TmsCesiumImpl extends RasterLayerCesiumImpl {
48
49
  options.tilingScheme = new GeographicTilingScheme();
49
50
  }
50
51
  const imageryProvider = await TileMapServiceImageryProvider.fromUrl(
51
- this.url!,
52
+ getResourceOrUrl(this.url!, this.headers),
52
53
  options,
53
54
  );
54
55
  const layerOptions = {
@@ -47,6 +47,7 @@ class VectorRasterTileCesiumImpl extends RasterLayerCesiumImpl {
47
47
  this.imageryProvider = new VectorTileImageryProvider({
48
48
  tileProvider: this.tileProvider,
49
49
  tileSize: this.tileSize,
50
+ headers: this.headers,
50
51
  });
51
52
 
52
53
  const layerOptions: CesiumImageryLayer.ConstructorOptions = {
@@ -96,6 +96,7 @@ export function getCanvasFromFeatures(
96
96
  export type VectorTileImageryProviderOptions = {
97
97
  tileProvider: TileProvider;
98
98
  tileSize: Size;
99
+ headers?: Record<string, string>;
99
100
  };
100
101
 
101
102
  /**
@@ -110,6 +111,8 @@ class VectorTileImageryProvider {
110
111
 
111
112
  private _errorEvent = new CesiumEvent();
112
113
 
114
+ headers?: Record<string, string>;
115
+
113
116
  emptyCanvas: HTMLCanvasElement;
114
117
 
115
118
  minLevel = 0;
@@ -127,6 +130,7 @@ class VectorTileImageryProvider {
127
130
  this.emptyCanvas = document.createElement('canvas');
128
131
  this.emptyCanvas.width = this.tileWidth;
129
132
  this.emptyCanvas.height = this.tileHeight;
133
+ this.headers = options.headers;
130
134
  }
131
135
 
132
136
  // eslint-disable-next-line class-methods-use-this
@@ -204,7 +208,12 @@ class VectorTileImageryProvider {
204
208
  y: number,
205
209
  level: number,
206
210
  ): Promise<HTMLImageElement | HTMLCanvasElement> {
207
- const features = await this.tileProvider.getFeaturesForTile(x, y, level);
211
+ const features = await this.tileProvider.getFeaturesForTile(
212
+ x,
213
+ y,
214
+ level,
215
+ this.headers,
216
+ );
208
217
  if (features.length === 0) {
209
218
  return this.emptyCanvas;
210
219
  }
@@ -10,6 +10,7 @@ import RasterLayerCesiumImpl from './rasterLayerCesiumImpl.js';
10
10
  import { wgs84Projection } from '../../util/projection.js';
11
11
  import type { WMSImplementationOptions } from '../wmsLayer.js';
12
12
  import type CesiumMap from '../../map/cesiumMap.js';
13
+ import { getResourceOrUrl } from './resourceHelper.js';
13
14
 
14
15
  /**
15
16
  * represents a specific Cesium WmsCesiumImpl Layer class.
@@ -39,7 +40,7 @@ class WmsCesiumImpl extends RasterLayerCesiumImpl {
39
40
  parameters.height = String(this.tileSize[1] * 2);
40
41
  }
41
42
  const options: WebMapServiceImageryProvider.ConstructorOptions = {
42
- url: this.url as string,
43
+ url: getResourceOrUrl(this.url!, this.headers),
43
44
  layers: parameters.LAYERS,
44
45
  minimumLevel: this.minLevel,
45
46
  maximumLevel: this.maxLevel,
@@ -9,6 +9,7 @@ import { wgs84Projection } from '../../util/projection.js';
9
9
  import { getTilingScheme } from '../rasterLayer.js';
10
10
  import type { WMTSImplementationOptions } from '../wmtsLayer.js';
11
11
  import type CesiumMap from '../../map/cesiumMap.js';
12
+ import { getResourceOrUrl } from './resourceHelper.js';
12
13
 
13
14
  /**
14
15
  * represents a specific WmtsLayer Implementation for {@link CesiumMap}.
@@ -50,13 +51,14 @@ class WmtsCesiumImpl extends RasterLayerCesiumImpl {
50
51
  getCesiumLayer(): Promise<CesiumImageryLayer> {
51
52
  const currentUrl = this.url as string;
52
53
  // This is a bug in Cesium, they cant cope with {Layer} placeholder..
53
- const url =
54
+ const url: string =
54
55
  currentUrl.indexOf('{Layer}') !== -1
55
56
  ? currentUrl.replace('{Layer}', this.layer)
56
57
  : currentUrl;
58
+
57
59
  const extent = this.extent!.getCoordinatesInProjection(wgs84Projection);
58
60
  const options: WebMapTileServiceImageryProvider.ConstructorOptions = {
59
- url,
61
+ url: getResourceOrUrl(url, this.headers),
60
62
  layer: this.layer,
61
63
  style: this.style,
62
64
  format: this.format,
@@ -1,6 +1,10 @@
1
- import { type Cesium3DTileset, Matrix4 } from '@vcmap-cesium/engine';
1
+ import {
2
+ type Cesium3DTileset,
3
+ type CustomShader,
4
+ Matrix4,
5
+ } from '@vcmap-cesium/engine';
2
6
 
3
- import { checkMaybe } from '@vcsuite/check';
7
+ import { check, maybe } from '@vcsuite/check';
4
8
  import { parseInteger } from '@vcsuite/parsers';
5
9
  import type { Coordinate } from 'ol/coordinate.js';
6
10
  import VectorStyleItem, {
@@ -50,6 +54,7 @@ export type CesiumTilesetImplementationOptions =
50
54
  tilesetProperties?: CesiumTilesetTilesetProperties[];
51
55
  modelMatrix?: Matrix4;
52
56
  offset?: Coordinate;
57
+ customShader?: CustomShader;
53
58
  };
54
59
 
55
60
  /**
@@ -86,13 +91,12 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
86
91
 
87
92
  protected _supportedMaps = [CesiumMap.className];
88
93
 
94
+ private _customShader: CustomShader | undefined = undefined;
95
+
89
96
  constructor(options: CesiumTilesetOptions) {
90
97
  super(options);
91
98
  this._supportedMaps = [CesiumMap.className];
92
99
  const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
93
- if (this.url && !/\.json$/.test(this.url)) {
94
- this.url = `${this.url.replace(/\/$/, '')}/tileset.json`;
95
- }
96
100
 
97
101
  this.highlightStyle = null;
98
102
  if (options.highlightStyle) {
@@ -136,7 +140,7 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
136
140
  }
137
141
 
138
142
  set modelMatrix(modelMatrix: Matrix4 | undefined) {
139
- checkMaybe(modelMatrix, Matrix4);
143
+ check(modelMatrix, maybe(Matrix4));
140
144
 
141
145
  this._modelMatrix = modelMatrix;
142
146
  this.getImplementations().forEach((impl) => {
@@ -154,7 +158,7 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
154
158
  }
155
159
 
156
160
  set offset(offset: Coordinate | undefined) {
157
- checkMaybe(offset, [Number]);
161
+ check(offset, maybe([Number]));
158
162
 
159
163
  this._offset = offset;
160
164
  this.getImplementations().forEach((impl) => {
@@ -162,12 +166,26 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
162
166
  });
163
167
  }
164
168
 
169
+ get customShader(): CustomShader | undefined {
170
+ return this._customShader;
171
+ }
172
+
173
+ set customShader(shader: CustomShader | undefined) {
174
+ if (this._customShader !== shader) {
175
+ this._customShader = shader;
176
+ this.getImplementations().forEach((impl) => {
177
+ impl.updateCustomShader(shader);
178
+ });
179
+ }
180
+ }
181
+
165
182
  getImplementationOptions(): CesiumTilesetImplementationOptions {
166
183
  return {
167
184
  ...super.getImplementationOptions(),
168
185
  tilesetOptions: this.tilesetOptions,
169
186
  modelMatrix: this.modelMatrix,
170
187
  offset: this.offset,
188
+ customShader: this.customShader,
171
189
  };
172
190
  }
173
191
 
@@ -4,6 +4,7 @@ import DataSourceLayer from './dataSourceLayer.js';
4
4
  import { vcsLayerName } from './layerSymbols.js';
5
5
  import { layerClassRegistry } from '../classRegistry.js';
6
6
  import type { LayerOptions } from './layer.js';
7
+ import { getResourceOrUrl } from './cesium/resourceHelper.js';
7
8
 
8
9
  export type CzmlOptions = LayerOptions & {
9
10
  sourceUri?: string;
@@ -82,7 +83,7 @@ class CzmlLayer extends DataSourceLayer {
82
83
 
83
84
  private async _loadData(): Promise<void> {
84
85
  await this.dataSource.load(
85
- this.url,
86
+ getResourceOrUrl(this.url, this.headers),
86
87
  this.sourceUri ? { sourceUri: this.sourceUri } : undefined,
87
88
  );
88
89
 
@@ -1,6 +1,6 @@
1
1
  import Style, { type StyleFunction } from 'ol/style/Style.js';
2
2
 
3
- import { check } from '@vcsuite/check';
3
+ import { check, oneOf } from '@vcsuite/check';
4
4
  import { parseInteger } from '@vcsuite/parsers';
5
5
  import { SplitDirection } from '@vcmap-cesium/engine';
6
6
  import Layer, {
@@ -176,7 +176,7 @@ class FeatureLayer<
176
176
  * Sets the style based on a styleName on a layer
177
177
  */
178
178
  setStyle(style: Style | StyleFunction | StyleItem, silent?: boolean): void {
179
- check(style, [Style, StyleItem, Function]);
179
+ check(style, oneOf(Style, StyleItem, Function));
180
180
 
181
181
  if (style instanceof StyleItem) {
182
182
  this._style = style;
@@ -10,10 +10,7 @@ import VectorLayer, {
10
10
  VectorImplementationOptions,
11
11
  VectorOptions,
12
12
  } from './vectorLayer.js';
13
- import {
14
- featureStoreStateSymbol,
15
- FeatureStoreLayerState,
16
- } from './featureStoreLayerState.js';
13
+ import { featureStoreStateSymbol } from './featureStoreLayerState.js';
17
14
  import { parseGeoJSON } from './geojsonHelpers.js';
18
15
  import { mercatorProjection } from '../util/projection.js';
19
16
  import FeatureStoreLayerChanges from './featureStoreLayerChanges.js';
@@ -206,7 +203,7 @@ class FeatureStoreLayer extends VectorLayer {
206
203
 
207
204
  this._removeVectorPropertiesChangeHandler =
208
205
  this.vectorProperties.propertyChanged.addEventListener(() => {
209
- this.changeTracker.values.changed = true;
206
+ this.changeTracker.changed.raiseEvent();
210
207
  });
211
208
 
212
209
  this.injectedFetchDynamicFeatureFunc =
@@ -264,7 +261,9 @@ class FeatureStoreLayer extends VectorLayer {
264
261
  const { twoDim } = this.staticRepresentation;
265
262
  if (!this._twoDimLoaded) {
266
263
  this._twoDimLoaded = (async (): Promise<void> => {
267
- const data = await requestJson<GeoJSONObject>(twoDim);
264
+ const data = await requestJson<GeoJSONObject>(twoDim, {
265
+ headers: this.headers,
266
+ });
268
267
  const { features } = parseGeoJSON(data, {
269
268
  targetProjection: mercatorProjection,
270
269
  dynamicStyle: true,
@@ -330,6 +329,7 @@ class FeatureStoreLayer extends VectorLayer {
330
329
  featureVisibility: this._staticFeatureVisibility,
331
330
  globalHider: this.globalHider,
332
331
  splitDirection: SplitDirection.NONE,
332
+ headers: this.headers,
333
333
  }),
334
334
  );
335
335
  } else if (this.staticRepresentation && this.staticRepresentation.twoDim) {
@@ -406,7 +406,7 @@ class FeatureStoreLayer extends VectorLayer {
406
406
  });
407
407
  if (changeTrackerActive) {
408
408
  this.changeTracker.track();
409
- this.changeTracker.values.changed = true;
409
+ this.changeTracker.changed.raiseEvent();
410
410
  }
411
411
  }
412
412
 
@@ -551,7 +551,7 @@ class FeatureStoreLayer extends VectorLayer {
551
551
  this.hiddenStaticFeatureIds.add(featureId);
552
552
  const feature = new Feature();
553
553
  feature.setId(featureId);
554
- feature[featureStoreStateSymbol] = FeatureStoreLayerState.STATIC;
554
+ feature[featureStoreStateSymbol] = 'static';
555
555
  this.changeTracker.removeFeature(feature);
556
556
  }
557
557