@vcmap/core 6.2.2 → 6.3.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 (293) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/category/category.d.ts +1 -1
  5. package/dist/src/category/category.js +3 -4
  6. package/dist/src/category/category.js.map +1 -1
  7. package/dist/src/featureProvider/abstractFeatureProvider.d.ts +1 -1
  8. package/dist/src/featureProvider/abstractFeatureProvider.js +3 -4
  9. package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
  10. package/dist/src/featureProvider/wmsFeatureProvider.d.ts +3 -1
  11. package/dist/src/featureProvider/wmsFeatureProvider.js +37 -9
  12. package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
  13. package/dist/src/interaction/coordinateAtPixel.js +4 -6
  14. package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
  15. package/dist/src/interaction/ensurePositionInteraction.d.ts +14 -0
  16. package/dist/src/interaction/ensurePositionInteraction.js +42 -0
  17. package/dist/src/interaction/ensurePositionInteraction.js.map +1 -0
  18. package/dist/src/interaction/eventHandler.d.ts +3 -0
  19. package/dist/src/interaction/eventHandler.js +10 -1
  20. package/dist/src/interaction/eventHandler.js.map +1 -1
  21. package/dist/src/interaction/featureAtPixelInteraction.js +29 -17
  22. package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
  23. package/dist/src/interaction/panoramaImageSelection.js +2 -2
  24. package/dist/src/interaction/panoramaImageSelection.js.map +1 -1
  25. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +3 -3
  26. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
  27. package/dist/src/layer/cesium/cogImageryProvider.d.ts +2 -2
  28. package/dist/src/layer/cesium/cogImageryProvider.js +6 -26
  29. package/dist/src/layer/cesium/cogImageryProvider.js.map +1 -1
  30. package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +3 -3
  31. package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
  32. package/dist/src/layer/cesium/terrainCesiumImpl.d.ts +3 -3
  33. package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
  34. package/dist/src/layer/cesium/vectorContext.js +1 -1
  35. package/dist/src/layer/cesium/vectorContext.js.map +1 -1
  36. package/dist/src/layer/cesiumTilesetLayer.d.ts +1 -1
  37. package/dist/src/layer/cesiumTilesetLayer.js +7 -7
  38. package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
  39. package/dist/src/layer/cogLayer.d.ts +7 -2
  40. package/dist/src/layer/cogLayer.js +10 -4
  41. package/dist/src/layer/cogLayer.js.map +1 -1
  42. package/dist/src/layer/czmlLayer.d.ts +1 -1
  43. package/dist/src/layer/czmlLayer.js +4 -4
  44. package/dist/src/layer/czmlLayer.js.map +1 -1
  45. package/dist/src/layer/featureLayer.d.ts +1 -6
  46. package/dist/src/layer/featureLayer.js +3 -10
  47. package/dist/src/layer/featureLayer.js.map +1 -1
  48. package/dist/src/layer/featureStoreLayer.d.ts +3 -2
  49. package/dist/src/layer/featureStoreLayer.js +5 -5
  50. package/dist/src/layer/featureStoreLayer.js.map +1 -1
  51. package/dist/src/layer/flatGeobufLayer.d.ts +2 -0
  52. package/dist/src/layer/flatGeobufLayer.js +8 -0
  53. package/dist/src/layer/flatGeobufLayer.js.map +1 -1
  54. package/dist/src/layer/geojsonLayer.d.ts +1 -1
  55. package/dist/src/layer/geojsonLayer.js +5 -12
  56. package/dist/src/layer/geojsonLayer.js.map +1 -1
  57. package/dist/src/layer/layer.d.ts +21 -7
  58. package/dist/src/layer/layer.js +107 -33
  59. package/dist/src/layer/layer.js.map +1 -1
  60. package/dist/src/layer/openStreetMapLayer.d.ts +1 -1
  61. package/dist/src/layer/openStreetMapLayer.js +11 -6
  62. package/dist/src/layer/openStreetMapLayer.js.map +1 -1
  63. package/dist/src/layer/panorama/vectorPanoramaImpl.d.ts +38 -0
  64. package/dist/src/layer/panorama/vectorPanoramaImpl.js +164 -0
  65. package/dist/src/layer/panorama/vectorPanoramaImpl.js.map +1 -0
  66. package/dist/src/layer/panoramaDatasetLayer.d.ts +5 -3
  67. package/dist/src/layer/panoramaDatasetLayer.js +13 -7
  68. package/dist/src/layer/panoramaDatasetLayer.js.map +1 -1
  69. package/dist/src/layer/pointCloudLayer.d.ts +1 -5
  70. package/dist/src/layer/pointCloudLayer.js +3 -15
  71. package/dist/src/layer/pointCloudLayer.js.map +1 -1
  72. package/dist/src/layer/rasterLayer.d.ts +1 -1
  73. package/dist/src/layer/rasterLayer.js +4 -4
  74. package/dist/src/layer/rasterLayer.js.map +1 -1
  75. package/dist/src/layer/singleImageLayer.d.ts +1 -1
  76. package/dist/src/layer/singleImageLayer.js +3 -3
  77. package/dist/src/layer/singleImageLayer.js.map +1 -1
  78. package/dist/src/layer/terrainLayer.d.ts +1 -1
  79. package/dist/src/layer/terrainLayer.js +8 -6
  80. package/dist/src/layer/terrainLayer.js.map +1 -1
  81. package/dist/src/layer/tileProvider/flatGeobufTileProvider.d.ts +1 -1
  82. package/dist/src/layer/tileProvider/flatGeobufTileProvider.js +4 -3
  83. package/dist/src/layer/tileProvider/flatGeobufTileProvider.js.map +1 -1
  84. package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
  85. package/dist/src/layer/tileProvider/mvtTileProvider.js +3 -3
  86. package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
  87. package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +1 -1
  88. package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +3 -3
  89. package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -1
  90. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
  91. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +7 -4
  92. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
  93. package/dist/src/layer/tileProvider/tileProvider.d.ts +1 -1
  94. package/dist/src/layer/tileProvider/tileProvider.js +3 -4
  95. package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
  96. package/dist/src/layer/tileProvider/urlTemplateTileProvider.d.ts +1 -1
  97. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js +3 -3
  98. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
  99. package/dist/src/layer/tmsLayer.d.ts +1 -1
  100. package/dist/src/layer/tmsLayer.js +3 -10
  101. package/dist/src/layer/tmsLayer.js.map +1 -1
  102. package/dist/src/layer/vectorLayer.d.ts +11 -5
  103. package/dist/src/layer/vectorLayer.js +19 -8
  104. package/dist/src/layer/vectorLayer.js.map +1 -1
  105. package/dist/src/layer/vectorTileLayer.d.ts +1 -1
  106. package/dist/src/layer/vectorTileLayer.js +4 -5
  107. package/dist/src/layer/vectorTileLayer.js.map +1 -1
  108. package/dist/src/layer/wfsLayer.d.ts +1 -1
  109. package/dist/src/layer/wfsLayer.js +5 -4
  110. package/dist/src/layer/wfsLayer.js.map +1 -1
  111. package/dist/src/layer/wmsLayer.d.ts +1 -1
  112. package/dist/src/layer/wmsLayer.js +3 -4
  113. package/dist/src/layer/wmsLayer.js.map +1 -1
  114. package/dist/src/layer/wmtsLayer.d.ts +1 -1
  115. package/dist/src/layer/wmtsLayer.js +3 -10
  116. package/dist/src/layer/wmtsLayer.js.map +1 -1
  117. package/dist/src/map/baseCesiumMap.d.ts +69 -0
  118. package/dist/src/map/baseCesiumMap.js +381 -0
  119. package/dist/src/map/baseCesiumMap.js.map +1 -0
  120. package/dist/src/map/cesiumMap.d.ts +6 -98
  121. package/dist/src/map/cesiumMap.js +32 -258
  122. package/dist/src/map/cesiumMap.js.map +1 -1
  123. package/dist/src/map/obliqueMap.d.ts +1 -1
  124. package/dist/src/map/obliqueMap.js +3 -4
  125. package/dist/src/map/obliqueMap.js.map +1 -1
  126. package/dist/src/map/openlayersMap.d.ts +1 -1
  127. package/dist/src/map/openlayersMap.js +3 -4
  128. package/dist/src/map/openlayersMap.js.map +1 -1
  129. package/dist/src/map/panoramaMap.d.ts +17 -29
  130. package/dist/src/map/panoramaMap.js +56 -100
  131. package/dist/src/map/panoramaMap.js.map +1 -1
  132. package/dist/src/map/vcsMap.d.ts +15 -2
  133. package/dist/src/map/vcsMap.js +26 -3
  134. package/dist/src/map/vcsMap.js.map +1 -1
  135. package/dist/src/oblique/obliqueCollection.d.ts +1 -1
  136. package/dist/src/oblique/obliqueCollection.js +3 -4
  137. package/dist/src/oblique/obliqueCollection.js.map +1 -1
  138. package/dist/src/panorama/panoramaCameraController.d.ts +4 -0
  139. package/dist/src/panorama/panoramaCameraController.js +8 -0
  140. package/dist/src/panorama/panoramaCameraController.js.map +1 -1
  141. package/dist/src/panorama/panoramaImage.d.ts +10 -1
  142. package/dist/src/panorama/panoramaImage.js +9 -4
  143. package/dist/src/panorama/panoramaImage.js.map +1 -1
  144. package/dist/src/panorama/panoramaImageView.d.ts +6 -1
  145. package/dist/src/panorama/panoramaImageView.js +11 -2
  146. package/dist/src/panorama/panoramaImageView.js.map +1 -1
  147. package/dist/src/panorama/panoramaTileMaterial.d.ts +6 -0
  148. package/dist/src/panorama/panoramaTileMaterial.js +14 -0
  149. package/dist/src/panorama/panoramaTileMaterial.js.map +1 -1
  150. package/dist/src/panorama/panoramaTileMaterialFS.shader.d.ts +1 -1
  151. package/dist/src/panorama/panoramaTileMaterialFS.shader.js +16 -1
  152. package/dist/src/panorama/panoramaTileMaterialFS.shader.js.map +1 -1
  153. package/dist/src/panorama/panoramaTilePrimitiveCollection.d.ts +6 -0
  154. package/dist/src/panorama/panoramaTilePrimitiveCollection.js +28 -0
  155. package/dist/src/panorama/panoramaTilePrimitiveCollection.js.map +1 -1
  156. package/dist/src/util/clipping/clippingPolygonObject.d.ts +1 -1
  157. package/dist/src/util/clipping/clippingPolygonObject.js +3 -4
  158. package/dist/src/util/clipping/clippingPolygonObject.js.map +1 -1
  159. package/dist/src/util/displayQuality/displayQuality.js +4 -4
  160. package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
  161. package/dist/src/util/editor/createFeatureSession.js +3 -1
  162. package/dist/src/util/editor/createFeatureSession.js.map +1 -1
  163. package/dist/src/util/editor/editFeaturesSession.js +9 -2
  164. package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
  165. package/dist/src/util/editor/editGeometrySession.js +3 -1
  166. package/dist/src/util/editor/editGeometrySession.js.map +1 -1
  167. package/dist/src/util/editor/editorSessionHelpers.d.ts +3 -3
  168. package/dist/src/util/editor/editorSessionHelpers.js +4 -2
  169. package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
  170. package/dist/src/util/editor/interactions/creationSnapping.js +4 -1
  171. package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -1
  172. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +2 -2
  173. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
  174. package/dist/src/util/editor/interactions/layerSnapping.js +4 -1
  175. package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -1
  176. package/dist/src/util/editor/interactions/mapInteractionController.js +12 -1
  177. package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
  178. package/dist/src/util/editor/interactions/translationSnapping.js +4 -2
  179. package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
  180. package/dist/src/util/editor/selectFeaturesSession.js +1 -1
  181. package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
  182. package/dist/src/util/editor/transformation/create3DHandlers.d.ts +2 -2
  183. package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
  184. package/dist/src/util/editor/transformation/transformationHandler.js +5 -2
  185. package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
  186. package/dist/src/util/editor/transformation/translateInteraction.js +2 -2
  187. package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
  188. package/dist/src/util/flight/flightInstance.d.ts +1 -1
  189. package/dist/src/util/flight/flightInstance.js +3 -4
  190. package/dist/src/util/flight/flightInstance.js.map +1 -1
  191. package/dist/src/util/mapCollection.d.ts +5 -0
  192. package/dist/src/util/mapCollection.js +14 -0
  193. package/dist/src/util/mapCollection.js.map +1 -1
  194. package/dist/src/util/renderScreenshot.js +2 -3
  195. package/dist/src/util/renderScreenshot.js.map +1 -1
  196. package/dist/src/util/viewpoint.js +1 -1
  197. package/dist/src/util/viewpoint.js.map +1 -1
  198. package/dist/src/vcsObject.d.ts +2 -1
  199. package/dist/src/vcsObject.js +9 -1
  200. package/dist/src/vcsObject.js.map +1 -1
  201. package/dist/src/vectorCluster/vectorClusterGroup.d.ts +1 -1
  202. package/dist/src/vectorCluster/vectorClusterGroup.js +3 -4
  203. package/dist/src/vectorCluster/vectorClusterGroup.js.map +1 -1
  204. package/dist/src/vectorCluster/vectorClusterStyleItem.d.ts +1 -1
  205. package/dist/src/vectorCluster/vectorClusterStyleItem.js +3 -4
  206. package/dist/src/vectorCluster/vectorClusterStyleItem.js.map +1 -1
  207. package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -1
  208. package/dist/tests/unit/helpers/cesiumHelpers.js +19 -2
  209. package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
  210. package/dist/tests/unit/helpers/panoramaHelpers.js +1 -1
  211. package/dist/tests/unit/helpers/panoramaHelpers.js.map +1 -1
  212. package/index.ts +3 -5
  213. package/package.json +2 -2
  214. package/src/category/category.ts +3 -4
  215. package/src/featureProvider/abstractFeatureProvider.ts +5 -4
  216. package/src/featureProvider/wmsFeatureProvider.ts +52 -14
  217. package/src/global.d.ts +0 -1
  218. package/src/interaction/coordinateAtPixel.ts +4 -6
  219. package/src/interaction/ensurePositionInteraction.ts +50 -0
  220. package/src/interaction/eventHandler.ts +12 -1
  221. package/src/interaction/featureAtPixelInteraction.ts +39 -29
  222. package/src/interaction/panoramaImageSelection.ts +4 -2
  223. package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +3 -3
  224. package/src/layer/cesium/cogImageryProvider.ts +9 -26
  225. package/src/layer/cesium/rasterLayerCesiumImpl.ts +3 -3
  226. package/src/layer/cesium/terrainCesiumImpl.ts +3 -3
  227. package/src/layer/cesium/vectorContext.ts +1 -1
  228. package/src/layer/cesiumTilesetLayer.ts +9 -7
  229. package/src/layer/cogLayer.ts +22 -6
  230. package/src/layer/czmlLayer.ts +4 -4
  231. package/src/layer/featureLayer.ts +5 -16
  232. package/src/layer/featureStoreLayer.ts +11 -5
  233. package/src/layer/flatGeobufLayer.ts +12 -0
  234. package/src/layer/geojsonLayer.ts +5 -12
  235. package/src/layer/layer.ts +148 -36
  236. package/src/layer/openStreetMapLayer.ts +13 -6
  237. package/src/layer/panorama/vectorPanoramaImpl.ts +238 -0
  238. package/src/layer/panoramaDatasetLayer.ts +25 -10
  239. package/src/layer/pointCloudLayer.ts +5 -20
  240. package/src/layer/rasterLayer.ts +4 -4
  241. package/src/layer/singleImageLayer.ts +5 -3
  242. package/src/layer/terrainLayer.ts +9 -6
  243. package/src/layer/tileProvider/flatGeobufTileProvider.ts +6 -3
  244. package/src/layer/tileProvider/mvtTileProvider.ts +7 -3
  245. package/src/layer/tileProvider/staticFeatureTileProvider.ts +5 -3
  246. package/src/layer/tileProvider/staticGeojsonTileProvider.ts +11 -4
  247. package/src/layer/tileProvider/tileProvider.ts +5 -4
  248. package/src/layer/tileProvider/urlTemplateTileProvider.ts +7 -3
  249. package/src/layer/tmsLayer.ts +3 -10
  250. package/src/layer/vectorLayer.ts +25 -9
  251. package/src/layer/vectorTileLayer.ts +6 -6
  252. package/src/layer/wfsLayer.ts +7 -4
  253. package/src/layer/wmsLayer.ts +3 -4
  254. package/src/layer/wmtsLayer.ts +3 -10
  255. package/src/map/baseCesiumMap.ts +576 -0
  256. package/src/map/cesiumMap.ts +103 -446
  257. package/src/map/obliqueMap.ts +3 -4
  258. package/src/map/openlayersMap.ts +5 -5
  259. package/src/map/panoramaMap.ts +74 -139
  260. package/src/map/vcsMap.ts +44 -4
  261. package/src/oblique/obliqueCollection.ts +5 -4
  262. package/src/panorama/panoramaCameraController.ts +13 -1
  263. package/src/panorama/panoramaImage.ts +17 -3
  264. package/src/panorama/panoramaImageView.ts +29 -3
  265. package/src/panorama/panoramaTileMaterial.ts +20 -0
  266. package/src/panorama/panoramaTileMaterialFS.glsl +16 -1
  267. package/src/panorama/panoramaTilePrimitiveCollection.ts +34 -0
  268. package/src/util/clipping/clippingPolygonObject.ts +5 -4
  269. package/src/util/displayQuality/displayQuality.ts +4 -4
  270. package/src/util/editor/createFeatureSession.ts +4 -1
  271. package/src/util/editor/editFeaturesSession.ts +14 -4
  272. package/src/util/editor/editGeometrySession.ts +3 -1
  273. package/src/util/editor/editorSessionHelpers.ts +5 -3
  274. package/src/util/editor/interactions/creationSnapping.ts +7 -1
  275. package/src/util/editor/interactions/ensureHandlerSelectionInteraction.ts +2 -2
  276. package/src/util/editor/interactions/layerSnapping.ts +7 -1
  277. package/src/util/editor/interactions/mapInteractionController.ts +12 -2
  278. package/src/util/editor/interactions/translationSnapping.ts +6 -4
  279. package/src/util/editor/selectFeaturesSession.ts +1 -1
  280. package/src/util/editor/transformation/create3DHandlers.ts +2 -2
  281. package/src/util/editor/transformation/transformationHandler.ts +5 -3
  282. package/src/util/editor/transformation/translateInteraction.ts +4 -4
  283. package/src/util/flight/flightInstance.ts +6 -5
  284. package/src/util/mapCollection.ts +18 -0
  285. package/src/util/renderScreenshot.ts +4 -8
  286. package/src/util/viewpoint.ts +2 -2
  287. package/src/vcsObject.ts +10 -1
  288. package/src/vectorCluster/vectorClusterGroup.ts +7 -4
  289. package/src/vectorCluster/vectorClusterStyleItem.ts +8 -4
  290. package/dist/src/map/cesiumMapHelpers.d.ts +0 -7
  291. package/dist/src/map/cesiumMapHelpers.js +0 -144
  292. package/dist/src/map/cesiumMapHelpers.js.map +0 -1
  293. package/src/map/cesiumMapHelpers.ts +0 -219
@@ -110,8 +110,8 @@ class ObliqueMap extends BaseOLMap {
110
110
  }
111
111
 
112
112
  constructor(options: ObliqueOptions) {
113
- super(options);
114
113
  const defaultOptions = ObliqueMap.getDefaultOptions();
114
+ super({ ...defaultOptions, ...options });
115
115
  this._loadingCollection = null;
116
116
 
117
117
  this._mapChangeEvent = options.changeOnMoveEnd ? 'moveend' : 'postrender';
@@ -483,9 +483,8 @@ class ObliqueMap extends BaseOLMap {
483
483
  return containsXY(transformedBbox, coords[0], coords[1]);
484
484
  }
485
485
 
486
- toJSON(): ObliqueOptions {
487
- const config: ObliqueOptions = super.toJSON();
488
- const defaultOptions = ObliqueMap.getDefaultOptions();
486
+ toJSON(defaultOptions = ObliqueMap.getDefaultOptions()): ObliqueOptions {
487
+ const config: ObliqueOptions = super.toJSON(defaultOptions);
489
488
 
490
489
  if (this.mapChangeEvent === 'moveend') {
491
490
  config.changeOnMoveEnd = true;
@@ -35,9 +35,8 @@ class OpenlayersMap extends BaseOLMap {
35
35
  * @param options
36
36
  */
37
37
  constructor(options: OpenlayersOptions) {
38
- super(options);
39
-
40
38
  const defaultOptions = OpenlayersMap.getDefaultOptions();
39
+ super({ ...defaultOptions, ...options });
41
40
 
42
41
  this.fixedNorthOrientation = parseBoolean(
43
42
  options.fixedNorthOrientation,
@@ -190,10 +189,11 @@ class OpenlayersMap extends BaseOLMap {
190
189
  return containsXY(boundingExtent(bbox), coords[0], coords[1]);
191
190
  }
192
191
 
193
- toJSON(): OpenlayersOptions {
194
- const config: OpenlayersOptions = super.toJSON();
192
+ toJSON(
193
+ defaultOptions = OpenlayersMap.getDefaultOptions(),
194
+ ): OpenlayersOptions {
195
+ const config: OpenlayersOptions = super.toJSON(defaultOptions);
195
196
 
196
- const defaultOptions = OpenlayersMap.getDefaultOptions();
197
197
  if (this.fixedNorthOrientation !== defaultOptions.fixedNorthOrientation) {
198
198
  config.fixedNorthOrientation = this.fixedNorthOrientation;
199
199
  }
@@ -1,9 +1,7 @@
1
- import type { JulianDate, Cesium3DTileset, Scene } from '@vcmap-cesium/engine';
1
+ import { parseNumber } from '@vcsuite/parsers';
2
2
  import {
3
3
  Color,
4
- PrimitiveCollection,
5
4
  CesiumWidget,
6
- ScreenSpaceEventHandler,
7
5
  ShadowMode,
8
6
  Math as CesiumMath,
9
7
  } from '@vcmap-cesium/engine';
@@ -13,20 +11,15 @@ import type { PanoramaImage } from '../panorama/panoramaImage.js';
13
11
  import { mapClassRegistry } from '../classRegistry.js';
14
12
  import type { PanoramaImageView } from '../panorama/panoramaImageView.js';
15
13
  import { createPanoramaImageView } from '../panorama/panoramaImageView.js';
16
- import {
17
- getViewpointFromScene,
18
- setupCesiumInteractions,
19
- } from './cesiumMapHelpers.js';
20
14
  import VcsEvent from '../vcsEvent.js';
21
15
  import type { PanoramaCameraController } from '../panorama/panoramaCameraController.js';
22
16
  import { createPanoramaCameraController } from '../panorama/panoramaCameraController.js';
23
17
  import type Viewpoint from '../util/viewpoint.js';
24
- import { ensureInCollection, indexChangedOnPrimitive } from './cesiumMap.js';
25
18
  import Projection from '../util/projection.js';
26
- import type Layer from '../layer/layer.js';
27
19
  import { defaultCursorColor } from '../panorama/panoramaTileMaterial.js';
28
20
  import LayerState from '../layer/layerState.js';
29
21
  import type PanoramaDatasetLayer from '../layer/panoramaDatasetLayer.js';
22
+ import BaseCesiumMap from './baseCesiumMap.js';
30
23
 
31
24
  export type PanoramaMapOptions = VcsMapOptions & {
32
25
  /**
@@ -37,9 +30,13 @@ export type PanoramaMapOptions = VcsMapOptions & {
37
30
  * Css color string to use for the cursor color.
38
31
  */
39
32
  cursorColor?: string;
33
+ /**
34
+ * The default field of view in degrees when loading a new image.
35
+ */
36
+ defaultFov?: number;
40
37
  };
41
38
 
42
- export default class PanoramaMap extends VcsMap {
39
+ export default class PanoramaMap extends BaseCesiumMap {
43
40
  static get className(): string {
44
41
  return 'PanoramaMap';
45
42
  }
@@ -50,6 +47,8 @@ export default class PanoramaMap extends VcsMap {
50
47
  overlayNaNColor: 'rgba(255, 0, 0, 1)',
51
48
  cursorColor: defaultCursorColor,
52
49
  fallbackToCurrentMap: false,
50
+ layerTypes: ['PanoramaDatasetLayer', 'TerrainLayer', 'VectorLayer'],
51
+ defaultFov: 90,
53
52
  };
54
53
  }
55
54
 
@@ -59,24 +58,20 @@ export default class PanoramaMap extends VcsMap {
59
58
  */
60
59
  readonly currentImageChanged = new VcsEvent<PanoramaImage | undefined>();
61
60
 
62
- private _cesiumWidget: CesiumWidget | undefined;
63
-
64
61
  private _imageView: PanoramaImageView | undefined;
65
62
 
66
63
  private _currentImage: PanoramaImage | undefined;
67
64
 
68
- private _screenSpaceListener: (() => void) | undefined;
69
-
70
- private _screenSpaceEventHandler: ScreenSpaceEventHandler | undefined;
71
-
72
65
  private _cameraController: PanoramaCameraController | undefined;
73
66
 
74
- private _listeners: (() => void)[] = [];
67
+ protected _listeners: (() => void)[] = [];
75
68
 
76
69
  private _overlayNaNColor: string | undefined;
77
70
 
78
71
  private _cursorColor: string | undefined;
79
72
 
73
+ private _defaultFov = 90;
74
+
80
75
  constructor(options: PanoramaMapOptions) {
81
76
  const defaultOptions = PanoramaMap.getDefaultOptions();
82
77
  super({ ...defaultOptions, ...options });
@@ -84,16 +79,10 @@ export default class PanoramaMap extends VcsMap {
84
79
  this._overlayNaNColor =
85
80
  options.overlayNaNColor ?? defaultOptions.overlayNaNColor;
86
81
  this._cursorColor = options.cursorColor ?? defaultOptions.cursorColor;
87
- }
88
-
89
- /**
90
- * Internal API. throws if not properly initialized
91
- */
92
- get screenSpaceEventHandler(): ScreenSpaceEventHandler {
93
- if (!this._screenSpaceEventHandler) {
94
- throw new Error('ScreenSpaceEventHandler not initialized');
95
- }
96
- return this._screenSpaceEventHandler;
82
+ this._defaultFov = parseNumber(
83
+ options.defaultFov,
84
+ defaultOptions.defaultFov,
85
+ );
97
86
  }
98
87
 
99
88
  get currentPanoramaImage(): PanoramaImage | undefined {
@@ -122,10 +111,27 @@ export default class PanoramaMap extends VcsMap {
122
111
  return this._cameraController;
123
112
  }
124
113
 
114
+ get defaultFov(): number {
115
+ if (!this._imageView) {
116
+ return this._defaultFov;
117
+ }
118
+ return CesiumMath.toDegrees(this._imageView.defaultFov);
119
+ }
120
+
121
+ /**
122
+ * Sets the default field of view in degrees when loading a new image.
123
+ */
124
+ set defaultFov(fov: number) {
125
+ this._defaultFov = fov;
126
+ if (this._imageView) {
127
+ this._imageView.defaultFov = CesiumMath.toRadians(fov);
128
+ }
129
+ }
130
+
125
131
  /**
126
132
  * Access to the raw cesium widget for finer control. Throws if not properly initialized.
127
133
  */
128
- getCesiumWidget(): CesiumWidget {
134
+ override getCesiumWidget(): CesiumWidget {
129
135
  if (!this._cesiumWidget) {
130
136
  throw new Error('CesiumWidget not initialized');
131
137
  }
@@ -134,31 +140,40 @@ export default class PanoramaMap extends VcsMap {
134
140
 
135
141
  override async initialize(): Promise<void> {
136
142
  if (!this.initialized) {
137
- this._cesiumWidget = new CesiumWidget(this.mapElement, {
143
+ const cesiumWidget = new CesiumWidget(this.mapElement, {
138
144
  requestRenderMode: false,
139
145
  scene3DOnly: true,
140
146
  baseLayer: false,
141
147
  shadows: false,
142
148
  skyBox: false,
143
149
  skyAtmosphere: false,
144
- globe: false,
145
150
  terrainShadows: ShadowMode.DISABLED,
146
151
  msaaSamples: 1,
147
152
  });
148
153
 
149
- this._cesiumWidget.scene.screenSpaceCameraController.enableInputs = false;
150
- this._cesiumWidget.scene.primitives.destroyPrimitives = false;
154
+ cesiumWidget.scene.globe.depthTestAgainstTerrain = true;
155
+ cesiumWidget.scene.globe.baseColor = Color.WHITE.withAlpha(0.01);
156
+ const defaultTranslucency = cesiumWidget.scene.globe.translucency;
157
+ defaultTranslucency.enabled = true;
158
+ defaultTranslucency.backFaceAlpha = 0.75;
159
+ defaultTranslucency.frontFaceAlpha = 0.75;
151
160
 
152
- this._screenSpaceEventHandler = new ScreenSpaceEventHandler(
153
- this._cesiumWidget.canvas,
154
- );
161
+ cesiumWidget.scene.screenSpaceCameraController.enableInputs = false;
162
+ cesiumWidget.scene.screenSpaceCameraController.enableCollisionDetection =
163
+ false;
164
+
165
+ cesiumWidget.scene.primitives.destroyPrimitives = false;
166
+
167
+ cesiumWidget.scene.highDynamicRange = true;
168
+ cesiumWidget.scene.gamma = 1.8;
169
+
170
+ this.initialized = true;
171
+ this._initializeCesiumWidget(cesiumWidget);
155
172
 
156
- this._screenSpaceListener = setupCesiumInteractions(
173
+ this._imageView = createPanoramaImageView(
157
174
  this,
158
- this._cesiumWidget.scene,
159
- this.screenSpaceEventHandler,
175
+ CesiumMath.toRadians(this._defaultFov),
160
176
  );
161
- this._imageView = createPanoramaImageView(this);
162
177
 
163
178
  if (this._overlayNaNColor) {
164
179
  this._imageView.tilePrimitiveCollection.overlayNaNColor =
@@ -171,48 +186,10 @@ export default class PanoramaMap extends VcsMap {
171
186
  }
172
187
 
173
188
  this._cameraController = createPanoramaCameraController(this);
174
- this.initialized = true;
175
-
176
- this._listeners.push(
177
- this._cesiumWidget.scene.postRender.addEventListener(
178
- (eventScene: Scene, time: JulianDate) => {
179
- this.postRender.raiseEvent({
180
- map: this,
181
- originalEvent: { scene: eventScene, time },
182
- });
183
- },
184
- ),
185
- );
186
189
  }
187
190
  await super.initialize();
188
191
  }
189
192
 
190
- override async activate(): Promise<void> {
191
- await super.activate();
192
- if (this.active && this._cesiumWidget) {
193
- this._cesiumWidget.useDefaultRenderLoop = true;
194
- this._cesiumWidget.resize();
195
- }
196
- }
197
-
198
- override deactivate(): void {
199
- super.deactivate();
200
- if (this._cesiumWidget) {
201
- this._cesiumWidget.useDefaultRenderLoop = false;
202
- }
203
- }
204
-
205
- override getViewpoint(): Promise<null | Viewpoint> {
206
- return Promise.resolve(this.getViewpointSync());
207
- }
208
-
209
- override getViewpointSync(): Viewpoint | null {
210
- if (!this._cesiumWidget || !this._cesiumWidget.scene || !this.target) {
211
- return null;
212
- }
213
- return getViewpointFromScene(this._cesiumWidget.scene);
214
- }
215
-
216
193
  /**
217
194
  * Sets the current image to the closest image to the given coordinate. Unsets the
218
195
  * current image, if there is no image within the default distance.
@@ -249,6 +226,15 @@ export default class PanoramaMap extends VcsMap {
249
226
  this.setCurrentImage(closestImage);
250
227
  }
251
228
 
229
+ override getViewpointSync(): Viewpoint | null {
230
+ const vp = super.getViewpointSync();
231
+ if (vp) {
232
+ vp.groundPosition = null;
233
+ vp.distance = 100;
234
+ }
235
+ return vp;
236
+ }
237
+
252
238
  /**
253
239
  * {@link getClosestImage} for the given viewpoint. Prefers the ground position
254
240
  * @param viewpoint
@@ -308,8 +294,8 @@ export default class PanoramaMap extends VcsMap {
308
294
  });
309
295
 
310
296
  if (closestIndex !== -1) {
311
- const { imageName, dataset } = images[closestIndex]!;
312
- return dataset.createPanoramaImage(imageName); // XXX position is a HACK to support frankenstein datasets
297
+ const { imageName, dataset, time } = images[closestIndex]!;
298
+ return dataset.createPanoramaImage(imageName, time);
313
299
  }
314
300
 
315
301
  return undefined;
@@ -328,55 +314,10 @@ export default class PanoramaMap extends VcsMap {
328
314
  }
329
315
  }
330
316
 
331
- override indexChanged(layer: Layer): void {
332
- const viz = this.getVisualizationsForLayer(layer);
333
- if (viz) {
334
- viz.forEach((item) => {
335
- if (item instanceof PrimitiveCollection) {
336
- indexChangedOnPrimitive(
337
- this.getCesiumWidget().scene.primitives,
338
- item,
339
- this.layerCollection,
340
- );
341
- }
342
- });
343
- }
344
- }
345
-
346
- /**
347
- * Internal API used to register visualizations from layer implementations
348
- * @param primitiveCollection
349
- */
350
- addPrimitiveCollection(
351
- primitiveCollection: PrimitiveCollection | Cesium3DTileset,
352
- ): void {
353
- if (!this._cesiumWidget) {
354
- throw new Error('Cannot add primitive to uninitialized map');
355
- }
356
- if (this.validateVisualization(primitiveCollection)) {
357
- this.addVisualization(primitiveCollection);
358
- ensureInCollection(
359
- this._cesiumWidget.scene.primitives,
360
- primitiveCollection,
361
- this.layerCollection,
362
- );
363
- }
364
- }
365
-
366
- /**
367
- * Internal API to unregister the visualization for a layers implementation
368
- * @param primitiveCollection
369
- */
370
- removePrimitiveCollection(
371
- primitiveCollection: PrimitiveCollection | Cesium3DTileset,
372
- ): void {
373
- this.removeVisualization(primitiveCollection);
374
- this._cesiumWidget?.scene.primitives.remove(primitiveCollection);
375
- }
376
-
377
- override toJSON(): PanoramaMapOptions {
378
- const config = super.toJSON() as Partial<PanoramaMapOptions>;
379
- const defaultOptions = PanoramaMap.getDefaultOptions();
317
+ override toJSON(
318
+ defaultOptions = PanoramaMap.getDefaultOptions(),
319
+ ): PanoramaMapOptions {
320
+ const config = super.toJSON(defaultOptions) as Partial<PanoramaMapOptions>;
380
321
 
381
322
  if (this._overlayNaNColor !== defaultOptions.overlayNaNColor) {
382
323
  config.overlayNaNColor = this._overlayNaNColor;
@@ -386,10 +327,11 @@ export default class PanoramaMap extends VcsMap {
386
327
  config.cursorColor = this._cursorColor;
387
328
  }
388
329
 
389
- if (this.fallbackToCurrentMap !== defaultOptions.fallbackToCurrentMap) {
390
- config.fallbackToCurrentMap = this.fallbackToCurrentMap;
391
- } else {
392
- delete config.fallbackToCurrentMap;
330
+ const defaultFov = this._imageView
331
+ ? CesiumMath.toDegrees(this._imageView.defaultFov)
332
+ : this._defaultFov;
333
+ if (defaultFov !== defaultOptions.defaultFov) {
334
+ config.defaultFov = defaultFov;
393
335
  }
394
336
 
395
337
  return config;
@@ -400,13 +342,6 @@ export default class PanoramaMap extends VcsMap {
400
342
  this._currentImage?.destroy();
401
343
  this._cameraController?.destroy();
402
344
  this._imageView?.destroy();
403
- this._screenSpaceListener?.();
404
- this._screenSpaceEventHandler?.destroy();
405
- this._cesiumWidget?.destroy();
406
- this._cesiumWidget = undefined;
407
- this._listeners.forEach((cb) => {
408
- cb();
409
- });
410
345
 
411
346
  super.destroy();
412
347
  }
package/src/map/vcsMap.ts CHANGED
@@ -14,13 +14,14 @@ import MapState from './mapState.js';
14
14
  import { vcsLayerName } from '../layer/layerSymbols.js';
15
15
  import VcsEvent from '../vcsEvent.js';
16
16
  import { mapClassRegistry } from '../classRegistry.js';
17
- import type { CesiumMapEvent, CesiumVisualisationType } from './cesiumMap.js';
17
+ import type { CesiumMapEvent } from './cesiumMap.js';
18
18
  import type Viewpoint from '../util/viewpoint.js';
19
19
  import type Layer from '../layer/layer.js';
20
20
  import type { MapEvent } from '../interaction/abstractInteraction.js';
21
21
  import type { DisableMapControlOptions } from '../util/mapCollection.js';
22
22
  import type VectorClusterGroup from '../vectorCluster/vectorClusterGroup.js';
23
23
  import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
24
+ import type { CesiumVisualisationType } from './baseCesiumMap.js';
24
25
 
25
26
  function getLogger(): Logger {
26
27
  return getLoggerByName('vcMap');
@@ -43,6 +44,10 @@ export type VcsMapOptions = VcsObjectOptions & {
43
44
  * the HTMLElement to render the map into
44
45
  */
45
46
  target?: string | HTMLElement;
47
+ /**
48
+ * The types of layers to display on this map.
49
+ */
50
+ layerTypes?: string[];
46
51
  };
47
52
 
48
53
  export type VisualisationType = CesiumVisualisationType | OLLayer;
@@ -67,6 +72,7 @@ class VcsMap<
67
72
  return {
68
73
  fallbackMap: undefined,
69
74
  fallbackToCurrentMap: false,
75
+ layerTypes: [],
70
76
  };
71
77
  }
72
78
 
@@ -142,12 +148,16 @@ class VcsMap<
142
148
 
143
149
  private _postRender = new VcsEvent<VcsMapRenderEvent<V>>();
144
150
 
151
+ private _layerTypes: string[];
152
+
153
+ readonly layerTypesChanged = new VcsEvent<string[]>();
154
+
145
155
  /**
146
156
  * @param options
147
157
  */
148
158
  constructor(options: VcsMapOptions) {
149
- super(options);
150
159
  const defaultOptions = VcsMap.getDefaultOptions();
160
+ super({ ...defaultOptions, ...options });
151
161
  this.mapElement = document.createElement('div');
152
162
  this.mapElement.setAttribute('id', uuidv4());
153
163
  this.mapElement.classList.add('mapElement');
@@ -188,6 +198,8 @@ class VcsMap<
188
198
  this.pointerInteractionEvent = new VcsEvent();
189
199
 
190
200
  this._splitPosition = 0.5;
201
+
202
+ this._layerTypes = options.layerTypes || defaultOptions.layerTypes || [];
191
203
  }
192
204
 
193
205
  /**
@@ -315,6 +327,26 @@ class VcsMap<
315
327
  return this._postRender;
316
328
  }
317
329
 
330
+ get layerTypes(): string[] {
331
+ return this._layerTypes.slice();
332
+ }
333
+
334
+ /**
335
+ * The types of layers to display on this map. An empty array means all types.
336
+ * @param types
337
+ */
338
+ set layerTypes(types: string[]) {
339
+ check(types, [String]);
340
+
341
+ if (
342
+ types.length !== this._layerTypes.length ||
343
+ !types.every((t) => this._layerTypes.includes(t))
344
+ ) {
345
+ this._layerTypes = types.slice();
346
+ this.layerTypesChanged.raiseEvent(this._layerTypes.slice());
347
+ }
348
+ }
349
+
318
350
  private _setLayerCollectionListeners(): void {
319
351
  this._collectionListeners.forEach((cb) => {
320
352
  cb();
@@ -597,14 +629,21 @@ class VcsMap<
597
629
  // eslint-disable-next-line class-methods-use-this
598
630
  requestRender(): void {}
599
631
 
600
- toJSON(): VcsMapOptions {
601
- const config: VcsMapOptions = super.toJSON();
632
+ toJSON(defaultOptions = VcsMap.getDefaultOptions()): VcsMapOptions {
633
+ const config: VcsMapOptions = super.toJSON(defaultOptions);
634
+
602
635
  if (this.fallbackMap) {
603
636
  config.fallbackMap = this.fallbackMap;
604
637
  }
638
+
605
639
  if (this.fallbackToCurrentMap) {
606
640
  config.fallbackToCurrentMap = this.fallbackToCurrentMap;
607
641
  }
642
+
643
+ if (this._layerTypes.some((l) => !defaultOptions.layerTypes?.includes(l))) {
644
+ config.layerTypes = this._layerTypes.slice();
645
+ }
646
+
608
647
  return config;
609
648
  }
610
649
 
@@ -625,6 +664,7 @@ class VcsMap<
625
664
  cb();
626
665
  });
627
666
  this._collectionListeners = [];
667
+ this.layerTypesChanged.destroy();
628
668
 
629
669
  if (this.layerCollection) {
630
670
  [...this.layerCollection].forEach((l) => {
@@ -183,8 +183,8 @@ class ObliqueCollection extends VcsObject {
183
183
  * @param options
184
184
  */
185
185
  constructor(options: ObliqueCollectionOptions) {
186
- super(options);
187
186
  const defaultOptions = ObliqueCollection.getDefaultOptions();
187
+ super({ ...defaultOptions, ...options });
188
188
 
189
189
  this.viewOptions = {
190
190
  maxZoom: parseInteger(options.maxZoom, defaultOptions.maxZoom),
@@ -607,9 +607,10 @@ class ObliqueCollection extends VcsObject {
607
607
  this._destroyed.destroy();
608
608
  }
609
609
 
610
- toJSON(): ObliqueCollectionOptions {
611
- const config: ObliqueCollectionOptions = super.toJSON();
612
- const defaultOptions = ObliqueCollection.getDefaultOptions();
610
+ toJSON(
611
+ defaultOptions = ObliqueCollection.getDefaultOptions(),
612
+ ): ObliqueCollectionOptions {
613
+ const config: ObliqueCollectionOptions = super.toJSON(defaultOptions);
613
614
  if (this.viewOptions.maxZoom !== defaultOptions.maxZoom) {
614
615
  config.maxZoom = this.viewOptions.maxZoom;
615
616
  }
@@ -46,6 +46,10 @@ const DECAY_FRAMES = 60;
46
46
  * by dragging the mouse and zooming in and out with the mouse wheel.
47
47
  */
48
48
  export type PanoramaCameraController = {
49
+ /**
50
+ * Whether the controller is enabled. If false, the camera will not respond to user input.
51
+ */
52
+ enabled: boolean;
49
53
  /**
50
54
  * Zooms in, until MIN_FOV of 10 degrees is reached
51
55
  * @param [step=0.1] - optional step in radians
@@ -63,6 +67,7 @@ export function createPanoramaCameraController(
63
67
  map: PanoramaMap,
64
68
  ): PanoramaCameraController {
65
69
  const widget = map.getCesiumWidget();
70
+ let enabled = true;
66
71
  const { camera } = widget;
67
72
  const frustum = camera.frustum as PerspectiveFrustum;
68
73
 
@@ -114,7 +119,7 @@ export function createPanoramaCameraController(
114
119
  }
115
120
  }
116
121
 
117
- map.screenSpaceEventHandler.setInputAction((event: number): void => {
122
+ map.screenSpaceEventHandler!.setInputAction((event: number): void => {
118
123
  if (!map.movementPointerEventsDisabled) {
119
124
  panoZoom(event);
120
125
  }
@@ -140,6 +145,7 @@ export function createPanoramaCameraController(
140
145
  const loop = (): void => {
141
146
  if (
142
147
  currentImage &&
148
+ enabled &&
143
149
  !widget.scene.screenSpaceCameraController.enableInputs &&
144
150
  !map.movementPointerEventsDisabled
145
151
  ) {
@@ -188,6 +194,12 @@ export function createPanoramaCameraController(
188
194
  loop();
189
195
 
190
196
  return {
197
+ get enabled(): boolean {
198
+ return enabled;
199
+ },
200
+ set enabled(value: boolean) {
201
+ enabled = value;
202
+ },
191
203
  zoomIn(step = 0.1): void {
192
204
  if (!map.movementApiCallsDisabled) {
193
205
  panoZoom(1, step);
@@ -68,6 +68,10 @@ export type PanoramaImage = Readonly<
68
68
  * The image name
69
69
  */
70
70
  readonly name: string;
71
+ /**
72
+ * The image time, if known
73
+ */
74
+ readonly time?: Date;
71
75
  readonly up: Cartesian3;
72
76
  readonly modelMatrix: Matrix4;
73
77
  readonly invModelMatrix: Matrix4;
@@ -122,6 +126,10 @@ export type CreatePanoramaImageOptions = {
122
126
  * The dataset an image may belong to
123
127
  */
124
128
  dataset?: PanoramaDatasetLayer;
129
+ /**
130
+ * The time of the image, if known
131
+ */
132
+ time?: Date;
125
133
  /**
126
134
  * The root URL for the image. This is used to load the intensity and depth images.
127
135
  */
@@ -333,9 +341,10 @@ export async function createPanoramaImage(
333
341
  hasIntensity,
334
342
  hasDepth,
335
343
  } = await loadRGBImages(rgbImage);
336
- const { name, absoluteRootUrl, intensityImage, depthImage, dataset } =
344
+ const { name, absoluteRootUrl, intensityImage, depthImage, dataset, time } =
337
345
  options;
338
346
 
347
+ const imageTime = time ? new Date(time) : undefined;
339
348
  const nameOrId = name ?? uuid();
340
349
  const modelMatrix = Transforms.headingPitchRollToFixedFrame(
341
350
  position,
@@ -449,7 +458,7 @@ export async function createPanoramaImage(
449
458
  imageCoordinate,
450
459
  )
451
460
  : await tileProvider.getDepthAtImageCoordinate(imageCoordinate);
452
- if (depthValue === undefined) {
461
+ if (depthValue === undefined || depthValue === 0) {
453
462
  return undefined;
454
463
  }
455
464
  const cartesian = imageSphericalToCartesian(imageCoordinate, result);
@@ -463,6 +472,9 @@ export async function createPanoramaImage(
463
472
  get name(): string {
464
473
  return nameOrId;
465
474
  },
475
+ get time(): Date | undefined {
476
+ return imageTime;
477
+ },
466
478
  get position(): Cartesian3 {
467
479
  return position;
468
480
  },
@@ -534,12 +546,14 @@ export async function createPanoramaImage(
534
546
  * Creates a panorama image from a URL. The URL must point to a RGB image with the name ending in "_rgb.tif".
535
547
  * @param rgbImageUrl - the url to the RGB image
536
548
  * @param [dataset] - the dataset to which the image belongs, if applicable
549
+ * @param [time] - the time of the image, if known
537
550
  */
538
551
  export async function createPanoramaImageFromURL(
539
552
  rgbImageUrl: string,
540
553
  dataset?: PanoramaDatasetLayer,
554
+ time?: Date,
541
555
  ): Promise<PanoramaImage> {
542
556
  const { name, absoluteRootUrl } = parseRgbUrl(rgbImageUrl);
543
557
  const image = await fromUrl(absoluteRootUrl);
544
- return createPanoramaImage(image, { dataset, absoluteRootUrl, name });
558
+ return createPanoramaImage(image, { dataset, absoluteRootUrl, name, time });
545
559
  }