@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
@@ -26,10 +26,10 @@ import { allowPicking, vcsLayerName } from '../layer/layerSymbols.js';
26
26
  import { originalFeatureSymbol, primitives } from '../layer/vectorSymbols.js';
27
27
  import type OpenlayersMap from '../map/openlayersMap.js';
28
28
  import type ObliqueMap from '../map/obliqueMap.js';
29
- import type CesiumMap from '../map/cesiumMap.js';
30
29
  import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
31
- import { cartesianToMercator } from '../util/math.js';
30
+ import { cartesian3DDistance, cartesianToMercator } from '../util/math.js';
32
31
  import type { PrimitiveType } from '../util/featureconverter/convert.js';
32
+ import type BaseCesiumMap from '../map/baseCesiumMap.js';
33
33
  import type PanoramaMap from '../map/panoramaMap.js';
34
34
 
35
35
  /**
@@ -283,7 +283,7 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
283
283
  }
284
284
 
285
285
  private _cesiumHandler(event: InteractionEvent): Promise<InteractionEvent> {
286
- const cesiumMap = event.map as CesiumMap | PanoramaMap;
286
+ const cesiumMap = event.map as BaseCesiumMap;
287
287
  const { scene } = cesiumMap.getCesiumWidget()!;
288
288
 
289
289
  if (!scene) {
@@ -301,14 +301,10 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
301
301
  }
302
302
 
303
303
  const { pickTranslucentDepth } = scene;
304
- if (!(event.type & this.pickPosition)) {
305
- return Promise.resolve(event);
306
- }
307
-
308
304
  if (
305
+ !!(event.type & this.pickPosition) &&
309
306
  pickObject &&
310
- scene.pickPositionSupported &&
311
- event.map.className === 'CesiumMap'
307
+ scene.pickPositionSupported
312
308
  ) {
313
309
  if (this.pickTranslucent) {
314
310
  scene.pickTranslucentDepth = true;
@@ -334,30 +330,44 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
334
330
  );
335
331
 
336
332
  if (
337
- !cartesianPosition ||
338
- Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
333
+ cartesianPosition &&
334
+ !Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
339
335
  ) {
340
- return Promise.resolve(event);
341
- }
336
+ if (this.pullPickedPosition && event.ray) {
337
+ const pulledCartesian = Cartesian3.multiplyByScalar(
338
+ event.ray.direction,
339
+ this.pullPickedPosition,
340
+ new Cartesian3(),
341
+ );
342
+
343
+ Cartesian3.subtract(
344
+ cartesianPosition,
345
+ pulledCartesian,
346
+ cartesianPosition,
347
+ );
348
+ }
342
349
 
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
- );
350
+ if (event.map.className === 'CesiumMap') {
351
+ event.position = cartesianToMercator(cartesianPosition);
352
+ event.positionOrPixel = event.position.slice();
353
+ } else {
354
+ const currentImage = (event.map as PanoramaMap).currentPanoramaImage;
355
+ if (currentImage) {
356
+ const imageCenter = cartesianToMercator(currentImage.position);
357
+ const newPosition = cartesianToMercator(cartesianPosition);
358
+ const newDistance = cartesian3DDistance(imageCenter, newPosition);
359
+ const currentDistance = event.position
360
+ ? cartesian3DDistance(imageCenter, event.position)
361
+ : undefined;
362
+
363
+ if (currentDistance == null || newDistance < currentDistance) {
364
+ event.position = newPosition;
365
+ event.positionOrPixel = event.position.slice();
366
+ }
367
+ }
368
+ }
355
369
  }
356
-
357
- event.position = cartesianToMercator(cartesianPosition);
358
- event.positionOrPixel = event.position.slice();
359
370
  scene.pickTranslucentDepth = pickTranslucentDepth;
360
- return Promise.resolve(event);
361
371
  }
362
372
 
363
373
  return Promise.resolve(event);
@@ -13,8 +13,10 @@ export default class PanoramaImageSelection extends AbstractInteraction {
13
13
 
14
14
  override async pipe(event: InteractionEvent): Promise<InteractionEvent> {
15
15
  if (event.feature && (event.feature as Feature)[panoramaFeature]) {
16
- const { dataset, name } = (event.feature as Feature)[panoramaFeature]!;
17
- const panoramaImage = await dataset.createPanoramaImage(name);
16
+ const { dataset, name, time } = (event.feature as Feature)[
17
+ panoramaFeature
18
+ ]!;
19
+ const panoramaImage = await dataset.createPanoramaImage(name, time);
18
20
  event.stopPropagation = true;
19
21
 
20
22
  if (event.map instanceof PanoramaMap) {
@@ -33,11 +33,11 @@ import type {
33
33
  CesiumTilesetImplementationOptions,
34
34
  CesiumTilesetTilesetProperties,
35
35
  } from '../cesiumTilesetLayer.js';
36
- import type CesiumMap from '../../map/cesiumMap.js';
37
36
  import type { FeatureLayerImplementation } from '../featureLayer.js';
38
37
  import type StyleItem from '../../style/styleItem.js';
39
38
  import type GlobalHider from '../globalHider.js';
40
39
  import { getResourceOrUrl } from './resourceHelper.js';
40
+ import type BaseCesiumMap from '../../map/baseCesiumMap.js';
41
41
 
42
42
  export const cesiumTilesetLastUpdated: unique symbol = Symbol(
43
43
  'cesiumTilesetLastUpdated',
@@ -84,7 +84,7 @@ export function getExtentFromTileset(
84
84
  * represents the cesium implementation for a {@link CesiumTilesetLayer} layer.
85
85
  */
86
86
  class CesiumTilesetCesiumImpl
87
- extends LayerImplementation<CesiumMap>
87
+ extends LayerImplementation<BaseCesiumMap>
88
88
  implements FeatureLayerImplementation
89
89
  {
90
90
  static get className(): string {
@@ -121,7 +121,7 @@ class CesiumTilesetCesiumImpl
121
121
 
122
122
  private _customShader: CustomShader | undefined;
123
123
 
124
- constructor(map: CesiumMap, options: CesiumTilesetImplementationOptions) {
124
+ constructor(map: BaseCesiumMap, options: CesiumTilesetImplementationOptions) {
125
125
  super(map, options);
126
126
 
127
127
  this.cesium3DTileset = null;
@@ -98,6 +98,10 @@ export default class COGImageryProvider {
98
98
  level: number,
99
99
  ) => Promise<ImageryTypes>;
100
100
 
101
+ readonly tileWidth: number = 256;
102
+
103
+ readonly tileHeight: number = 256;
104
+
101
105
  constructor(private _source: GeoTIFFSource) {
102
106
  this._emptyCanvas = createEmptyCanvas(this.tileWidth, this.tileHeight);
103
107
  this._projection = this._source.getProjection()!;
@@ -108,6 +112,11 @@ export default class COGImageryProvider {
108
112
  } else {
109
113
  this._boundTileLoader = this._loadUnalignedTile.bind(this);
110
114
  }
115
+
116
+ // @ts-expect-error protected
117
+ const [width, height] = this._source.getTileSize(0);
118
+ this.tileWidth = Math.round(width);
119
+ this.tileHeight = Math.round(height);
111
120
  }
112
121
 
113
122
  // eslint-disable-next-line class-methods-use-this,@typescript-eslint/naming-convention
@@ -140,32 +149,6 @@ export default class COGImageryProvider {
140
149
  return undefined;
141
150
  }
142
151
 
143
- get tileWidth(): number {
144
- const tileGrid = this._source.getTileGrid();
145
- if (tileGrid) {
146
- const tileSizeAtZoom0 = tileGrid.getTileSize(0);
147
- if (Array.isArray(tileSizeAtZoom0)) {
148
- return Math.round(tileSizeAtZoom0[0]);
149
- } else {
150
- return Math.round(tileSizeAtZoom0); // same width and height
151
- }
152
- }
153
- return 256;
154
- }
155
-
156
- get tileHeight(): number {
157
- const tileGrid = this._source.getTileGrid();
158
- if (tileGrid) {
159
- const tileSizeAtZoom0 = tileGrid.getTileSize(0);
160
- if (Array.isArray(tileSizeAtZoom0)) {
161
- return Math.round(tileSizeAtZoom0[1]);
162
- } else {
163
- return Math.round(tileSizeAtZoom0); // same width and height
164
- }
165
- }
166
- return 256;
167
- }
168
-
169
152
  get maximumLevel(): number {
170
153
  const tileGrid = this._source.getTileGrid();
171
154
  if (tileGrid) {
@@ -1,16 +1,16 @@
1
1
  import type { ImageryLayer, SplitDirection } from '@vcmap-cesium/engine';
2
2
  import { vcsLayerName } from '../layerSymbols.js';
3
3
  import LayerImplementation from '../layerImplementation.js';
4
- import type CesiumMap from '../../map/cesiumMap.js';
5
4
  import type {
6
5
  RasterLayerImplementation,
7
6
  RasterLayerImplementationOptions,
8
7
  TilingScheme,
9
8
  } from '../rasterLayer.js';
10
9
  import type Extent from '../../util/extent.js';
10
+ import type BaseCesiumMap from '../../map/baseCesiumMap.js';
11
11
 
12
12
  class RasterLayerCesiumImpl
13
- extends LayerImplementation<CesiumMap>
13
+ extends LayerImplementation<BaseCesiumMap>
14
14
  implements RasterLayerImplementation
15
15
  {
16
16
  static get className(): string {
@@ -37,7 +37,7 @@ class RasterLayerCesiumImpl
37
37
 
38
38
  imageryLayerOptions: ImageryLayer.ConstructorOptions | undefined;
39
39
 
40
- constructor(map: CesiumMap, options: RasterLayerImplementationOptions) {
40
+ constructor(map: BaseCesiumMap, options: RasterLayerImplementationOptions) {
41
41
  super(map, options);
42
42
  this.splitDirection = options.splitDirection;
43
43
  this.minLevel = options.minLevel;
@@ -2,13 +2,13 @@ import type { CesiumTerrainProvider } from '@vcmap-cesium/engine';
2
2
  import LayerImplementation from '../layerImplementation.js';
3
3
  import { vcsLayerName } from '../layerSymbols.js';
4
4
  import { getTerrainProviderForUrl } from '../terrainHelpers.js';
5
- import type CesiumMap from '../../map/cesiumMap.js';
6
5
  import type { TerrainImplementationOptions } from '../terrainLayer.js';
6
+ import type BaseCesiumMap from '../../map/baseCesiumMap.js';
7
7
 
8
8
  /**
9
9
  * TerrainLayer implementation for {@link CesiumMap}
10
10
  */
11
- class TerrainCesiumImpl extends LayerImplementation<CesiumMap> {
11
+ class TerrainCesiumImpl extends LayerImplementation<BaseCesiumMap> {
12
12
  static get className(): string {
13
13
  return 'TerrainCesiumImpl';
14
14
  }
@@ -19,7 +19,7 @@ class TerrainCesiumImpl extends LayerImplementation<CesiumMap> {
19
19
 
20
20
  terrainProvider: CesiumTerrainProvider | undefined = undefined;
21
21
 
22
- constructor(map: CesiumMap, options: TerrainImplementationOptions) {
22
+ constructor(map: BaseCesiumMap, options: TerrainImplementationOptions) {
23
23
  super(map, options);
24
24
 
25
25
  this.requestVertexNormals = options.requestVertexNormals;
@@ -31,7 +31,7 @@ import {
31
31
  scaleSymbol,
32
32
  } from '../vectorSymbols.js';
33
33
  import type PanoramaMap from '../../map/panoramaMap.js';
34
- import { getResolution } from '../../map/cesiumMapHelpers.js';
34
+ import { getResolution } from '../../map/baseCesiumMap.js';
35
35
 
36
36
  export function setReferenceForPicking(
37
37
  feature: Feature,
@@ -23,6 +23,8 @@ import type { LayerOptions } from './layer.js';
23
23
  import type FeatureVisibility from './featureVisibility.js';
24
24
  import type VcsMap from '../map/vcsMap.js';
25
25
  import { cesiumColorToColor, getStringColor } from '../style/styleHelpers.js';
26
+ import PanoramaMap from '../map/panoramaMap.js';
27
+ import BaseCesiumMap from '../map/baseCesiumMap.js';
26
28
 
27
29
  export type CesiumTilesetOptions = LayerOptions & {
28
30
  /**
@@ -94,14 +96,13 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
94
96
 
95
97
  private _offset: Coordinate | undefined;
96
98
 
97
- protected _supportedMaps = [CesiumMap.className];
99
+ protected _supportedMaps = [CesiumMap.className, PanoramaMap.className];
98
100
 
99
101
  private _customShader: CustomShader | undefined = undefined;
100
102
 
101
103
  constructor(options: CesiumTilesetOptions) {
102
- super(options);
103
- this._supportedMaps = [CesiumMap.className];
104
104
  const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
105
+ super({ ...defaultOptions, ...options });
105
106
 
106
107
  this.highlightStyle = null;
107
108
  if (options.highlightStyle) {
@@ -199,7 +200,7 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
199
200
  }
200
201
 
201
202
  createImplementationsForMap(map: VcsMap): CesiumTilesetCesiumImpl[] {
202
- if (map instanceof CesiumMap) {
203
+ if (map instanceof BaseCesiumMap) {
203
204
  return [
204
205
  new CesiumTilesetCesiumImpl(map, this.getImplementationOptions()),
205
206
  ];
@@ -244,9 +245,10 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
244
245
  });
245
246
  }
246
247
 
247
- toJSON(): CesiumTilesetOptions {
248
- const config: CesiumTilesetOptions = super.toJSON();
249
- const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
248
+ toJSON(
249
+ defaultOptions = CesiumTilesetLayer.getDefaultOptions(),
250
+ ): CesiumTilesetOptions {
251
+ const config: CesiumTilesetOptions = super.toJSON(defaultOptions);
250
252
  if (this.highlightStyle) {
251
253
  config.highlightStyle = this.highlightStyle.toJSON();
252
254
  }
@@ -1,4 +1,7 @@
1
- import GeoTIFF, { type Options as GeoTIFFOptions } from 'ol/source/GeoTIFF.js';
1
+ import GeoTIFF, {
2
+ type GeoTIFFSourceOptions,
3
+ type Options as GeoTIFFOptions,
4
+ } from 'ol/source/GeoTIFF.js';
2
5
  import type { EventsKey } from 'ol/events.js';
3
6
  import { unByKey } from 'ol/Observable.js';
4
7
  import RasterLayer, {
@@ -28,6 +31,11 @@ export type COGLayerOptions = Omit<RasterLayerOptions, 'tilingSchema'> & {
28
31
  * Passed directly to the GeoTIFF source.
29
32
  */
30
33
  interpolate?: boolean;
34
+ /**
35
+ * Passed directly to the GeoTIFF.js source options see
36
+ * https://openlayers.org/en/latest/apidoc/module-ol_source_GeoTIFF.html#~GeoTIFFSourceOptions
37
+ */
38
+ sourceOptions?: GeoTIFFSourceOptions;
31
39
  };
32
40
 
33
41
  export type COGLayerImplementationOptions = RasterLayerImplementationOptions & {
@@ -72,6 +80,7 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
72
80
  convertToRGB: 'auto',
73
81
  normalize: undefined,
74
82
  interpolate: undefined,
83
+ sourceOptions: undefined,
75
84
  };
76
85
  }
77
86
 
@@ -79,12 +88,15 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
79
88
  private _source: GeoTIFF | undefined;
80
89
 
81
90
  constructor(options: COGLayerOptions) {
82
- super(options);
83
91
  const defaultOptions = COGLayer.getDefaultOptions();
92
+ super({ ...defaultOptions, ...options });
84
93
  this._sourceOptions = {
85
94
  convertToRGB: options.convertToRGB ?? defaultOptions.convertToRGB,
86
95
  normalize: options.normalize,
87
96
  interpolate: options.interpolate,
97
+ sourceOptions: options.sourceOptions
98
+ ? structuredClone(options.sourceOptions)
99
+ : defaultOptions.sourceOptions,
88
100
  };
89
101
 
90
102
  this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
@@ -120,10 +132,10 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
120
132
  return [];
121
133
  }
122
134
 
123
- toJSON(): COGLayerOptions {
124
- const config: Partial<COGLayerOptions> & RasterLayerOptions =
125
- super.toJSON();
126
- const defaultOptions = COGLayer.getDefaultOptions();
135
+ toJSON(defaultOptions = COGLayer.getDefaultOptions()): COGLayerOptions {
136
+ const config: Partial<COGLayerOptions> & RasterLayerOptions = super.toJSON(
137
+ defaultOptions,
138
+ );
127
139
 
128
140
  delete config.tilingSchema;
129
141
  if (this._sourceOptions.convertToRGB !== defaultOptions.convertToRGB) {
@@ -138,6 +150,10 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
138
150
  config.interpolate = this._sourceOptions.interpolate;
139
151
  }
140
152
 
153
+ if (this._sourceOptions.sourceOptions != null) {
154
+ config.sourceOptions = structuredClone(this._sourceOptions.sourceOptions);
155
+ }
156
+
141
157
  return config;
142
158
  }
143
159
 
@@ -49,10 +49,10 @@ class CzmlLayer extends DataSourceLayer {
49
49
  * @param options
50
50
  */
51
51
  constructor(options: CzmlOptions) {
52
- super(options);
52
+ const defaultOptions = CzmlLayer.getDefaultOptions();
53
+ super({ ...defaultOptions, ...options });
53
54
  this.entities = this.dataSource.entities;
54
55
 
55
- const defaultOptions = CzmlLayer.getDefaultOptions();
56
56
  this.sourceUri = options.sourceUri || defaultOptions.sourceUri;
57
57
  }
58
58
 
@@ -99,8 +99,8 @@ class CzmlLayer extends DataSourceLayer {
99
99
  await this.forceRedraw();
100
100
  }
101
101
 
102
- toJSON(): CzmlOptions {
103
- const config: CzmlOptions = super.toJSON();
102
+ toJSON(defaultOptions = CzmlLayer.getDefaultOptions()): CzmlOptions {
103
+ const config: CzmlOptions = super.toJSON(defaultOptions);
104
104
  if (this.sourceUri) {
105
105
  config.sourceUri = this.sourceUri;
106
106
  }
@@ -1,7 +1,6 @@
1
1
  import Style, { type StyleFunction } from 'ol/style/Style.js';
2
2
 
3
3
  import { check, oneOf } from '@vcsuite/check';
4
- import { parseInteger } from '@vcsuite/parsers';
5
4
  import { SplitDirection } from '@vcmap-cesium/engine';
6
5
  import type {
7
6
  LayerImplementationOptions,
@@ -25,7 +24,6 @@ import type { DeclarativeStyleItemOptions } from '../style/declarativeStyleItem.
25
24
 
26
25
  export type FeatureLayerOptions = LayerOptions & {
27
26
  style?: VectorStyleItemOptions | DeclarativeStyleItemOptions | StyleItem;
28
- balloonHeightOffset?: number;
29
27
  splitDirection?: string;
30
28
  featureVisibility?: FeatureVisibility;
31
29
  };
@@ -60,7 +58,6 @@ class FeatureLayer<
60
58
  return {
61
59
  ...Layer.getDefaultOptions(),
62
60
  style: undefined,
63
- balloonHeightOffset: 10,
64
61
  splitDirection: undefined,
65
62
  };
66
63
  }
@@ -74,11 +71,6 @@ class FeatureLayer<
74
71
  */
75
72
  readonly styleChanged = new VcsEvent<StyleItem>();
76
73
 
77
- /**
78
- * a height offset for rendering of a balloon for a feature of this layer.
79
- */
80
- balloonHeightOffset: number;
81
-
82
74
  private _splitDirection: SplitDirection = SplitDirection.NONE;
83
75
 
84
76
  /**
@@ -95,17 +87,12 @@ class FeatureLayer<
95
87
  * @param options
96
88
  */
97
89
  constructor(options: FeatureLayerOptions) {
98
- super(options);
99
90
  const defaultOptions = FeatureLayer.getDefaultOptions();
91
+ super({ ...defaultOptions, ...options });
100
92
 
101
93
  this._style = this.getStyleOrDefaultStyle(options.style);
102
94
  this._defaultStyle = this._style;
103
95
 
104
- this.balloonHeightOffset = parseInteger(
105
- options.balloonHeightOffset,
106
- defaultOptions.balloonHeightOffset,
107
- );
108
-
109
96
  if (options.splitDirection) {
110
97
  this._splitDirection =
111
98
  options.splitDirection === 'left'
@@ -201,8 +188,10 @@ class FeatureLayer<
201
188
  this.setStyle(this.defaultStyle);
202
189
  }
203
190
 
204
- toJSON(): FeatureLayerOptions {
205
- const config: FeatureLayerOptions = super.toJSON();
191
+ toJSON(
192
+ defaultOptions = FeatureLayer.getDefaultOptions(),
193
+ ): FeatureLayerOptions {
194
+ const config: FeatureLayerOptions = super.toJSON(defaultOptions);
206
195
  if (!this.getStyleOrDefaultStyle().equals(this._style)) {
207
196
  config.style = this.style.toJSON();
208
197
  }
@@ -46,6 +46,8 @@ import type StyleItem from '../style/styleItem.js';
46
46
  import type VcsMap from '../map/vcsMap.js';
47
47
  import type VectorCesiumImpl from './cesium/vectorCesiumImpl.js';
48
48
  import FeatureStoreFeatureVisibility from './featureStoreFeatureVisibility.js';
49
+ import BaseCesiumMap from '../map/baseCesiumMap.js';
50
+ import type VectorPanoramaImpl from './panorama/vectorPanoramaImpl.js';
49
51
 
50
52
  export type FeatureStoreStaticRepresentation = {
51
53
  /**
@@ -179,9 +181,10 @@ class FeatureStoreLayer extends VectorLayer {
179
181
  constructor(options: FeatureStoreOptions) {
180
182
  const defaultOptions = FeatureStoreLayer.getDefaultOptions();
181
183
  super({
182
- projection: defaultOptions.projection,
184
+ ...defaultOptions,
183
185
  ...options,
184
186
  });
187
+
185
188
  this._supportedMaps = [
186
189
  CesiumMap.className,
187
190
  OpenlayersMap.className,
@@ -315,10 +318,11 @@ class FeatureStoreLayer extends VectorLayer {
315
318
  | VectorOpenlayersImpl
316
319
  | VectorCesiumImpl
317
320
  | CesiumTilesetCesiumImpl
321
+ | VectorPanoramaImpl
318
322
  )[] {
319
323
  const impls = super.createImplementationsForMap(map);
320
324
  if (
321
- map instanceof CesiumMap &&
325
+ map instanceof BaseCesiumMap &&
322
326
  this.staticRepresentation &&
323
327
  this.staticRepresentation.threeDim
324
328
  ) {
@@ -588,9 +592,10 @@ class FeatureStoreLayer extends VectorLayer {
588
592
  }
589
593
  }
590
594
 
591
- toJSON(): FeatureStoreOptions {
592
- const config = super.toJSON() as Partial<FeatureStoreOptions>;
593
- const defaultOptions = FeatureStoreLayer.getDefaultOptions();
595
+ toJSON(
596
+ defaultOptions = FeatureStoreLayer.getDefaultOptions(),
597
+ ): FeatureStoreOptions {
598
+ const config = super.toJSON(defaultOptions) as Partial<FeatureStoreOptions>;
594
599
 
595
600
  delete config.projection;
596
601
  const vcsMeta = this.vectorProperties.getVcsMeta({
@@ -616,6 +621,7 @@ class FeatureStoreLayer extends VectorLayer {
616
621
  if (this.hiddenStaticFeatureIds.size > 0) {
617
622
  config.hiddenStaticFeatureIds = [...this.hiddenStaticFeatureIds];
618
623
  }
624
+
619
625
  return config as FeatureStoreOptions;
620
626
  }
621
627
 
@@ -18,11 +18,17 @@ export default class FlatGeobufLayer extends VectorLayer {
18
18
  return {
19
19
  ...super.getDefaultOptions(),
20
20
  url: '',
21
+ ignoreMapLayerTypes: false,
21
22
  };
22
23
  }
23
24
 
24
25
  private _dataFetchedPromise: Promise<void> | undefined;
25
26
 
27
+ constructor(options: FlatGeobufLayerOptions) {
28
+ const defaultOptions = FlatGeobufLayer.getDefaultOptions();
29
+ super({ ...defaultOptions, ...options });
30
+ }
31
+
26
32
  async initialize(): Promise<void> {
27
33
  if (!this.initialized) {
28
34
  await super.initialize();
@@ -63,5 +69,11 @@ export default class FlatGeobufLayer extends VectorLayer {
63
69
  }
64
70
  return this.forceRedraw();
65
71
  }
72
+
73
+ override toJSON(
74
+ defaultOptions = FlatGeobufLayer.getDefaultOptions(),
75
+ ): VectorOptions {
76
+ return super.toJSON(defaultOptions);
77
+ }
66
78
  }
67
79
  layerClassRegistry.registerClass(FlatGeobufLayer.className, FlatGeobufLayer);
@@ -3,7 +3,7 @@ import type { FeatureCollection } from 'geojson';
3
3
  import type { VectorOptions } from './vectorLayer.js';
4
4
  import VectorLayer from './vectorLayer.js';
5
5
  import { parseGeoJSON, writeGeoJSONFeature } from './geojsonHelpers.js';
6
- import Projection, { wgs84Projection } from '../util/projection.js';
6
+ import { wgs84Projection } from '../util/projection.js';
7
7
  import { layerClassRegistry } from '../classRegistry.js';
8
8
  import { getInitForUrl, requestJson } from '../util/fetch.js';
9
9
 
@@ -29,6 +29,7 @@ class GeoJSONLayer extends VectorLayer {
29
29
  ...VectorLayer.getDefaultOptions(),
30
30
  projection: wgs84Projection.toJSON(),
31
31
  features: undefined,
32
+ ignoreMapLayerTypes: false,
32
33
  };
33
34
  }
34
35
 
@@ -39,7 +40,7 @@ class GeoJSONLayer extends VectorLayer {
39
40
  constructor(options: GeoJSONOptions) {
40
41
  const defaultOptions = GeoJSONLayer.getDefaultOptions();
41
42
  super({
42
- projection: defaultOptions.projection,
43
+ ...defaultOptions,
43
44
  ...options,
44
45
  });
45
46
  this._featuresToLoad = options.features || defaultOptions.features;
@@ -120,16 +121,8 @@ class GeoJSONLayer extends VectorLayer {
120
121
  }
121
122
  }
122
123
 
123
- toJSON(): GeoJSONOptions {
124
- const config: GeoJSONOptions = super.toJSON();
125
- const defaultOptions = GeoJSONLayer.getDefaultOptions();
126
-
127
- const defaultProjection = new Projection(defaultOptions.projection);
128
- if (!this.projection.equals(defaultProjection)) {
129
- config.projection = this.projection.toJSON();
130
- } else {
131
- delete config.projection;
132
- }
124
+ toJSON(defaultOptions = GeoJSONLayer.getDefaultOptions()): GeoJSONOptions {
125
+ const config: GeoJSONOptions = super.toJSON(defaultOptions);
133
126
 
134
127
  if (Array.isArray(this._featuresToLoad)) {
135
128
  config.features = this._featuresToLoad.slice();