@vcmap/core 5.0.0-rc.3 → 5.0.0-rc.31

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 (236) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +12 -5
  3. package/build/postinstall.js +14 -3
  4. package/index.d.ts +3480 -2008
  5. package/index.js +169 -131
  6. package/package.json +25 -27
  7. package/src/category/category.js +483 -0
  8. package/src/category/categoryCollection.js +153 -0
  9. package/src/cesium/cesium3DTileFeature.js +2 -2
  10. package/src/cesium/cesium3DTilePointFeature.js +1 -1
  11. package/src/cesium/cesiumVcsCameraPrimitive.js +16 -8
  12. package/src/cesium/entity.js +29 -0
  13. package/src/cesium/wallpaperMaterial.js +5 -3
  14. package/src/classRegistry.js +169 -0
  15. package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +49 -46
  16. package/src/{vcs/vcm/util/featureProvider → featureProvider}/tileProviderFeatureProvider.js +13 -5
  17. package/src/{vcs/vcm/util/featureProvider → featureProvider}/wmsFeatureProvider.js +56 -26
  18. package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +33 -21
  19. package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +40 -21
  20. package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +131 -26
  21. package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +108 -53
  22. package/src/interaction/featureProviderInteraction.js +58 -0
  23. package/src/{vcs/vcm/interaction → interaction}/interactionChain.js +40 -41
  24. package/src/{vcs/vcm/interaction → interaction}/interactionType.js +24 -31
  25. package/src/{vcs/vcm/layer/cesium/cesiumTilesetCesium.js → layer/cesium/cesiumTilesetCesiumImpl.js} +83 -70
  26. package/src/{vcs/vcm/layer → layer}/cesium/clusterContext.js +33 -8
  27. package/src/{vcs/vcm/layer/cesium/dataSourceCesium.js → layer/cesium/dataSourceCesiumImpl.js} +24 -13
  28. package/src/layer/cesium/openStreetMapCesiumImpl.js +32 -0
  29. package/src/{vcs/vcm/layer/cesium/rasterLayerCesium.js → layer/cesium/rasterLayerCesiumImpl.js} +12 -9
  30. package/src/{vcs/vcm/layer/cesium/singleImageCesium.js → layer/cesium/singleImageCesiumImpl.js} +19 -9
  31. package/src/{vcs/vcm/layer/cesium/terrainCesium.js → layer/cesium/terrainCesiumImpl.js} +8 -9
  32. package/src/{vcs/vcm/layer/cesium/tmsCesium.js → layer/cesium/tmsCesiumImpl.js} +21 -10
  33. package/src/{vcs/vcm/layer/cesium/vectorCesium.js → layer/cesium/vectorCesiumImpl.js} +93 -35
  34. package/src/layer/cesium/vectorContext.js +363 -0
  35. package/src/{vcs/vcm/layer/cesium/vectorRasterTileCesium.js → layer/cesium/vectorRasterTileCesiumImpl.js} +21 -13
  36. package/src/{vcs/vcm/layer → layer}/cesium/vectorTileImageryProvider.js +58 -21
  37. package/src/{vcs/vcm/layer/cesium/wmsCesium.js → layer/cesium/wmsCesiumImpl.js} +20 -9
  38. package/src/{vcs/vcm/layer/cesium/wmtsCesium.js → layer/cesium/wmtsCesiumImpl.js} +24 -13
  39. package/src/{vcs/vcm/layer → layer}/cesium/x3dmHelper.js +6 -3
  40. package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +71 -112
  41. package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +23 -20
  42. package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +55 -90
  43. package/src/{vcs/vcm/layer → layer}/featureLayer.js +89 -74
  44. package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +197 -150
  45. package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +150 -92
  46. package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -2
  47. package/src/{vcs/vcm/layer → layer}/featureVisibility.js +114 -82
  48. package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +84 -69
  49. package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +30 -27
  50. package/src/{vcs/vcm/layer → layer}/globalHider.js +25 -39
  51. package/src/{vcs/vcm/layer → layer}/layer.js +171 -96
  52. package/src/{vcs/vcm/layer → layer}/layerImplementation.js +13 -6
  53. package/src/{vcs/vcm/layer → layer}/layerState.js +0 -1
  54. package/src/{vcs/vcm/layer → layer}/layerSymbols.js +2 -1
  55. package/src/{vcs/vcm/layer/oblique/layerOblique.js → layer/oblique/layerObliqueImpl.js} +7 -5
  56. package/src/{vcs/vcm/layer → layer}/oblique/obliqueHelpers.js +76 -31
  57. package/src/{vcs/vcm/layer/oblique/vectorOblique.js → layer/oblique/vectorObliqueImpl.js} +198 -80
  58. package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +59 -40
  59. package/src/layer/openlayers/layerOpenlayersImpl.js +165 -0
  60. package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +28 -0
  61. package/src/layer/openlayers/rasterLayerOpenlayersImpl.js +44 -0
  62. package/src/{vcs/vcm/layer/openlayers/singleImageOpenlayers.js → layer/openlayers/singleImageOpenlayersImpl.js} +8 -7
  63. package/src/{vcs/vcm/layer/openlayers/tileDebugOpenlayers.js → layer/openlayers/tileDebugOpenlayersImpl.js} +7 -6
  64. package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js} +12 -10
  65. package/src/{vcs/vcm/layer/openlayers/vectorOpenlayers.js → layer/openlayers/vectorOpenlayersImpl.js} +21 -12
  66. package/src/{vcs/vcm/layer/openlayers/vectorTileOpenlayers.js → layer/openlayers/vectorTileOpenlayersImpl.js} +18 -12
  67. package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js} +9 -8
  68. package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js} +19 -12
  69. package/src/{vcs/vcm/layer/pointCloud.js → layer/pointCloudLayer.js} +42 -39
  70. package/src/{vcs/vcm/layer → layer}/rasterLayer.js +86 -37
  71. package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +25 -22
  72. package/src/layer/terrainHelpers.js +95 -0
  73. package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +28 -21
  74. package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +13 -8
  75. package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +51 -8
  76. package/src/layer/tileProvider/staticGeojsonTileProvider.js +87 -0
  77. package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +200 -89
  78. package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +54 -13
  79. package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +22 -22
  80. package/src/layer/vectorHelpers.js +129 -0
  81. package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +124 -94
  82. package/src/{vcs/vcm/layer → layer}/vectorProperties.js +419 -107
  83. package/src/{vcs/vcm/layer → layer}/vectorSymbols.js +11 -1
  84. package/src/{vcs/vcm/layer/vectorTile.js → layer/vectorTileLayer.js} +181 -116
  85. package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +33 -23
  86. package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +14 -7
  87. package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +53 -32
  88. package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +56 -42
  89. package/src/{vcs/vcm/maps → map}/baseOLMap.js +83 -35
  90. package/src/{vcs/vcm/maps → map}/cameraLimiter.js +64 -37
  91. package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +431 -277
  92. package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
  93. package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +132 -97
  94. package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +69 -45
  95. package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +118 -46
  96. package/src/oblique/defaultObliqueCollection.js +62 -0
  97. package/src/{vcs/vcm/oblique → oblique}/helpers.js +221 -78
  98. package/src/{vcs/vcm/oblique/ObliqueCollection.js → oblique/obliqueCollection.js} +151 -55
  99. package/src/{vcs/vcm/oblique/ObliqueDataSet.js → oblique/obliqueDataSet.js} +77 -46
  100. package/src/{vcs/vcm/oblique/ObliqueImage.js → oblique/obliqueImage.js} +58 -26
  101. package/src/{vcs/vcm/oblique/ObliqueImageMeta.js → oblique/obliqueImageMeta.js} +9 -9
  102. package/src/{vcs/vcm/oblique/ObliqueProvider.js → oblique/obliqueProvider.js} +85 -35
  103. package/src/{vcs/vcm/oblique/ObliqueView.js → oblique/obliqueView.js} +45 -5
  104. package/src/{vcs/vcm/oblique/ObliqueViewDirection.js → oblique/obliqueViewDirection.js} +3 -5
  105. package/src/{vcs/vcm/oblique → oblique}/parseImageJson.js +62 -28
  106. package/src/ol/feature.js +34 -1
  107. package/src/ol/geom/circle.js +14 -5
  108. package/src/ol/geom/geometryCollection.js +14 -8
  109. package/src/ol/render/canvas/canvasTileRenderer.js +11 -10
  110. package/src/overrideClassRegistry.js +214 -0
  111. package/src/style/arcStyle.js +453 -0
  112. package/src/style/arrowStyle.js +304 -0
  113. package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +147 -82
  114. package/src/{vcs/vcm/util/style → style}/shapesCategory.js +8 -8
  115. package/src/style/styleFactory.js +32 -0
  116. package/src/{vcs/vcm/util/style → style}/styleHelpers.js +24 -26
  117. package/src/style/styleItem.js +174 -0
  118. package/src/{vcs/vcm/util/style → style}/vectorStyleItem.js +230 -156
  119. package/src/{vcs/vcm/util/style → style}/writeStyle.js +7 -12
  120. package/src/{vcs/vcm/util → util}/clipping/clippingObject.js +79 -49
  121. package/src/{vcs/vcm/util → util}/clipping/clippingObjectManager.js +56 -23
  122. package/src/{vcs/vcm/util → util}/clipping/clippingPlaneHelper.js +149 -88
  123. package/src/{vcs/vcm/util → util}/collection.js +28 -10
  124. package/src/util/editor/createFeatureSession.js +195 -0
  125. package/src/util/editor/editFeaturesSession.js +325 -0
  126. package/src/util/editor/editGeometrySession.js +452 -0
  127. package/src/util/editor/editorHelpers.js +300 -0
  128. package/src/util/editor/editorSessionHelpers.js +132 -0
  129. package/src/util/editor/editorSymbols.js +21 -0
  130. package/src/util/editor/interactions/createBBoxInteraction.js +154 -0
  131. package/src/util/editor/interactions/createCircleInteraction.js +119 -0
  132. package/src/util/editor/interactions/createLineStringInteraction.js +119 -0
  133. package/src/util/editor/interactions/createPointInteraction.js +73 -0
  134. package/src/util/editor/interactions/createPolygonInteraction.js +136 -0
  135. package/src/util/editor/interactions/editFeaturesMouseOverInteraction.js +88 -0
  136. package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +119 -0
  137. package/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +50 -0
  138. package/src/util/editor/interactions/insertVertexInteraction.js +103 -0
  139. package/src/util/editor/interactions/mapInteractionController.js +119 -0
  140. package/src/util/editor/interactions/removeVertexInteraction.js +42 -0
  141. package/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +152 -0
  142. package/src/util/editor/interactions/selectMultiFeatureInteraction.js +165 -0
  143. package/src/util/editor/interactions/selectSingleFeatureInteraction.js +120 -0
  144. package/src/util/editor/interactions/translateVertexInteraction.js +60 -0
  145. package/src/util/editor/selectFeaturesSession.js +303 -0
  146. package/src/util/editor/transformation/create2DHandlers.js +339 -0
  147. package/src/util/editor/transformation/create3DHandlers.js +678 -0
  148. package/src/util/editor/transformation/extrudeInteraction.js +106 -0
  149. package/src/util/editor/transformation/rotateInteraction.js +201 -0
  150. package/src/util/editor/transformation/scaleInteraction.js +201 -0
  151. package/src/util/editor/transformation/transformationHandler.js +178 -0
  152. package/src/util/editor/transformation/transformationTypes.js +88 -0
  153. package/src/util/editor/transformation/translateInteraction.js +263 -0
  154. package/src/util/editor/validateGeoemetry.js +24 -0
  155. package/src/{vcs/vcm/util → util}/exclusiveManager.js +6 -3
  156. package/src/{vcs/vcm/util → util}/extent.js +26 -20
  157. package/src/util/featureconverter/arcToCesium.js +121 -0
  158. package/src/{vcs/vcm/util → util}/featureconverter/circleToCesium.js +70 -37
  159. package/src/{vcs/vcm/util → util}/featureconverter/convert.js +94 -16
  160. package/src/util/featureconverter/extent3D.js +284 -0
  161. package/src/{vcs/vcm/util → util}/featureconverter/featureconverterHelper.js +253 -94
  162. package/src/util/featureconverter/lineStringToCesium.js +343 -0
  163. package/src/util/featureconverter/pointHelpers.js +413 -0
  164. package/src/{vcs/vcm/util → util}/featureconverter/pointToCesium.js +157 -107
  165. package/src/{vcs/vcm/util → util}/featureconverter/polygonToCesium.js +57 -24
  166. package/src/util/fetch.js +34 -0
  167. package/src/{vcs/vcm/util → util}/geometryHelpers.js +25 -17
  168. package/src/{vcs/vcm/util → util}/indexedCollection.js +27 -8
  169. package/src/{vcs/vcm/util → util}/isMobile.js +8 -2
  170. package/src/{vcs/vcm/util → util}/layerCollection.js +109 -19
  171. package/src/util/locale.js +12 -0
  172. package/src/{vcs/vcm/util → util}/mapCollection.js +170 -63
  173. package/src/util/math.js +193 -0
  174. package/src/util/overrideCollection.js +261 -0
  175. package/src/{vcs/vcm/util → util}/projection.js +23 -31
  176. package/src/{vcs/vcm/util → util}/urlHelpers.js +5 -3
  177. package/src/{vcs/vcm/util → util}/viewpoint.js +83 -57
  178. package/src/vcsApp.js +657 -0
  179. package/src/{vcs/vcm/event/vcsEvent.js → vcsEvent.js} +2 -3
  180. package/src/vcsModule.js +130 -0
  181. package/src/vcsModuleHelpers.js +136 -0
  182. package/src/{vcs/vcm/object.js → vcsObject.js} +3 -10
  183. package/tests/data/dynamicPointCzml.json +53 -0
  184. package/tests/data/oblique/imageData/imagev34.json +136 -0
  185. package/tests/data/oblique/imageData/imagev35.json +307 -0
  186. package/tests/data/oblique/imageData/imagev35PerImageSize.json +333 -0
  187. package/tests/data/oblique/tiledImageData/12/2199/1342.json +11056 -0
  188. package/tests/data/oblique/tiledImageData/12/2199/1343.json +11236 -0
  189. package/tests/data/oblique/tiledImageData/12/2199/1344.json +11077 -0
  190. package/tests/data/oblique/tiledImageData/12/2200/1342.json +11036 -0
  191. package/tests/data/oblique/tiledImageData/12/2200/1343.json +11277 -0
  192. package/tests/data/oblique/tiledImageData/12/2200/1344.json +11131 -0
  193. package/tests/data/oblique/tiledImageData/12/2201/1342.json +10870 -0
  194. package/tests/data/oblique/tiledImageData/12/2201/1343.json +11492 -0
  195. package/tests/data/oblique/tiledImageData/12/2201/1344.json +10909 -0
  196. package/tests/data/oblique/tiledImageData/image.json +70 -0
  197. package/tests/data/terrain/13/8800/6485.terrain +0 -0
  198. package/tests/data/terrain/13/8800/6486.terrain +0 -0
  199. package/tests/data/terrain/13/8801/6485.terrain +0 -0
  200. package/tests/data/terrain/13/8801/6486.terrain +0 -0
  201. package/tests/data/terrain/layer.json +127 -0
  202. package/tests/data/testGeoJSON.json +149 -0
  203. package/tests/data/tile.pbf +0 -0
  204. package/tests/unit/helpers/cesiumHelpers.js +326 -0
  205. package/tests/unit/helpers/getFileNameFromUrl.js +12 -0
  206. package/tests/unit/helpers/helpers.js +32 -0
  207. package/tests/unit/helpers/imageHelpers.js +24 -0
  208. package/tests/unit/helpers/importJSON.js +15 -0
  209. package/tests/unit/helpers/obliqueData.js +102 -0
  210. package/tests/unit/helpers/obliqueHelpers.js +115 -0
  211. package/tests/unit/helpers/openlayersHelpers.js +25 -0
  212. package/tests/unit/helpers/terrain/terrainData.js +45 -0
  213. package/src/vcs/vcm/classRegistry.js +0 -106
  214. package/src/vcs/vcm/globalCollections.js +0 -11
  215. package/src/vcs/vcm/interaction/featureProviderInteraction.js +0 -54
  216. package/src/vcs/vcm/layer/buildings.js +0 -17
  217. package/src/vcs/vcm/layer/cesium/openStreetMapCesium.js +0 -29
  218. package/src/vcs/vcm/layer/cesium/pointCloudCesium.js +0 -58
  219. package/src/vcs/vcm/layer/cesium/vectorContext.js +0 -167
  220. package/src/vcs/vcm/layer/openlayers/layerOpenlayers.js +0 -79
  221. package/src/vcs/vcm/layer/openlayers/openStreetMapOpenlayers.js +0 -27
  222. package/src/vcs/vcm/layer/openlayers/rasterLayerOpenlayers.js +0 -121
  223. package/src/vcs/vcm/layer/terrainHelpers.js +0 -119
  224. package/src/vcs/vcm/layer/tileProvider/staticGeojsonTileProvider.js +0 -67
  225. package/src/vcs/vcm/layer/tileProvider/tileProviderFactory.js +0 -28
  226. package/src/vcs/vcm/layer/vectorHelpers.js +0 -206
  227. package/src/vcs/vcm/util/dateTime.js +0 -60
  228. package/src/vcs/vcm/util/featureProvider/featureProviderHelpers.js +0 -51
  229. package/src/vcs/vcm/util/featureconverter/extent3d.js +0 -154
  230. package/src/vcs/vcm/util/featureconverter/lineStringToCesium.js +0 -171
  231. package/src/vcs/vcm/util/locale.js +0 -53
  232. package/src/vcs/vcm/util/math.js +0 -71
  233. package/src/vcs/vcm/util/splitScreen.js +0 -233
  234. package/src/vcs/vcm/util/style/styleFactory.js +0 -48
  235. package/src/vcs/vcm/util/style/styleItem.js +0 -243
  236. /package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderSymbols.js +0 -0
@@ -1,13 +1,13 @@
1
- import { Math as CesiumMath } from '@vcmap/cesium';
1
+ import { Math as CesiumMath } from '@vcmap-cesium/engine';
2
2
  import View from 'ol/View.js';
3
3
  import { getTransform } from 'ol/proj.js';
4
4
  import { inAndOut } from 'ol/easing.js';
5
5
  import { boundingExtent, containsXY } from 'ol/extent.js';
6
6
  import { parseBoolean } from '@vcsuite/parsers';
7
- import ViewPoint from '../util/viewpoint.js';
7
+ import Viewpoint from '../util/viewpoint.js';
8
8
  import BaseOLMap from './baseOLMap.js';
9
- import VcsMap from './map.js';
10
- import { VcsClassRegistry } from '../classRegistry.js';
9
+ import VcsMap from './vcsMap.js';
10
+ import { mapClassRegistry } from '../classRegistry.js';
11
11
 
12
12
  /**
13
13
  * @typedef {VcsMapOptions} OpenlayersOptions
@@ -16,17 +16,18 @@ import { VcsClassRegistry } from '../classRegistry.js';
16
16
  */
17
17
 
18
18
  /**
19
- * Openlayers Map Class (2D map)
19
+ * OpenlayersMap Map Class (2D map)
20
20
  * @class
21
- * @export
22
21
  * @extends {BaseOLMap}
23
22
  * @api stable
24
23
  */
25
- class Openlayers extends BaseOLMap {
24
+ class OpenlayersMap extends BaseOLMap {
26
25
  /**
27
26
  * @type {string}
28
27
  */
29
- static get className() { return 'vcs.vcm.maps.Openlayers'; }
28
+ static get className() {
29
+ return 'OpenlayersMap';
30
+ }
30
31
 
31
32
  /**
32
33
  * @returns {OpenlayersOptions}
@@ -44,10 +45,13 @@ class Openlayers extends BaseOLMap {
44
45
  constructor(options) {
45
46
  super(options);
46
47
 
47
- const defaultOptions = Openlayers.getDefaultOptions();
48
+ const defaultOptions = OpenlayersMap.getDefaultOptions();
48
49
 
49
50
  /** @type {boolean} */
50
- this.fixedNorthOrientation = parseBoolean(options.fixedNorthOrientation, defaultOptions.fixedNorthOrientation);
51
+ this.fixedNorthOrientation = parseBoolean(
52
+ options.fixedNorthOrientation,
53
+ defaultOptions.fixedNorthOrientation,
54
+ );
51
55
  }
52
56
 
53
57
  /**
@@ -56,27 +60,29 @@ class Openlayers extends BaseOLMap {
56
60
  async initialize() {
57
61
  if (!this.initialized) {
58
62
  await super.initialize();
59
- this.olMap.setView(new View({
60
- center: [1230922.6203948376, 6350766.117974091],
61
- zoom: 13,
62
- }));
63
+ this.olMap.setView(
64
+ new View({
65
+ center: [1230922.6203948376, 6350766.117974091],
66
+ zoom: 13,
67
+ }),
68
+ );
63
69
  this.initialized = true;
64
70
  }
65
71
  }
66
72
 
67
73
  /**
68
74
  * @inheritDoc
69
- * @returns {Promise<ViewPoint>}
75
+ * @returns {Promise<Viewpoint>}
70
76
  */
71
- async getViewPoint() {
72
- return this.getViewPointSync();
77
+ async getViewpoint() {
78
+ return this.getViewpointSync();
73
79
  }
74
80
 
75
81
  /**
76
82
  * @inheritDoc
77
- * @returns {ViewPoint}
83
+ * @returns {Viewpoint}
78
84
  */
79
- getViewPointSync() {
85
+ getViewpointSync() {
80
86
  const view = this.olMap.getView();
81
87
  const coord = view.getCenter();
82
88
  const toLatLon = getTransform(view.getProjection(), 'EPSG:4326');
@@ -87,20 +93,24 @@ class Openlayers extends BaseOLMap {
87
93
  size.width = viewport.offsetWidth || 1;
88
94
  const aspectRatio = size.width / size.height;
89
95
  const fovy = Math.atan(Math.tan(fov * 0.5) / aspectRatio) * 2.0;
90
- const latlon = toLatLon(coord.slice(0, 2));
96
+ // error in TransformFunction type definition, remove undefined after openlayer fixed the type
97
+ const latlon = toLatLon(coord.slice(0, 2), undefined, undefined);
91
98
  const metersPerUnit = view.getProjection().getMetersPerUnit();
92
99
 
93
100
  const resolution = view.getResolution();
94
101
  const visibleMapUnits = resolution * size.height;
95
- const relativeCircumference = Math.cos(Math.abs(CesiumMath.toRadians(latlon[1])));
96
- const visibleMeters = visibleMapUnits * metersPerUnit * relativeCircumference;
97
- const height = Math.abs((visibleMeters / 2) / Math.tan(fovy / 2));
102
+ const relativeCircumference = Math.cos(
103
+ Math.abs(CesiumMath.toRadians(latlon[1])),
104
+ );
105
+ const visibleMeters =
106
+ visibleMapUnits * metersPerUnit * relativeCircumference;
107
+ const height = Math.abs(visibleMeters / 2 / Math.tan(fovy / 2));
98
108
 
99
109
  const heading = -CesiumMath.toDegrees(view.getRotation());
100
110
  // don't add 0;
101
111
  const groundPosition = latlon; // .concat([0]);
102
112
  const pitch = -90;
103
- return new ViewPoint({
113
+ return new Viewpoint({
104
114
  groundPosition,
105
115
  pitch,
106
116
  heading,
@@ -109,16 +119,17 @@ class Openlayers extends BaseOLMap {
109
119
  }
110
120
 
111
121
  /**
112
- * @param {ViewPoint} viewpoint
122
+ * @param {Viewpoint} viewpoint
113
123
  * @returns {Promise<void>}
114
124
  * @inheritDoc
115
125
  */
116
- gotoViewPoint(viewpoint) {
126
+ gotoViewpoint(viewpoint) {
117
127
  if (this.movementDisabled || !viewpoint.isValid()) {
118
128
  return Promise.resolve();
119
129
  }
130
+ let { heading } = viewpoint;
120
131
  if (this.fixedNorthOrientation) {
121
- viewpoint.heading = 0;
132
+ heading = 0;
122
133
  }
123
134
  const view = this.olMap.getView();
124
135
  const fromLatLon = getTransform('EPSG:4326', view.getProjection());
@@ -129,7 +140,8 @@ class Openlayers extends BaseOLMap {
129
140
  coords = viewpoint.cameraPosition.slice(0, 2);
130
141
  }
131
142
  const { distance } = viewpoint;
132
- const center = fromLatLon(coords);
143
+ // error in TransformFunction type definition, remove undefined after openlayer fixed the type
144
+ const center = fromLatLon(coords, undefined, undefined);
133
145
 
134
146
  const fov = Math.PI / 3.0;
135
147
  const viewport = this.olMap.getViewport();
@@ -140,30 +152,38 @@ class Openlayers extends BaseOLMap {
140
152
  const fovy = Math.atan(Math.tan(fov * 0.5) / aspectRatio) * 2.0;
141
153
  const visibleMeters = 2 * distance * Math.tan(fovy / 2);
142
154
  const metersPerUnit = view.getProjection().getMetersPerUnit();
143
- const relativeCircumference = Math.cos(Math.abs(CesiumMath.toRadians(coords[1])));
144
- const visibleMapUnits = visibleMeters / metersPerUnit / relativeCircumference;
155
+ const relativeCircumference = Math.cos(
156
+ Math.abs(CesiumMath.toRadians(coords[1])),
157
+ );
158
+ const visibleMapUnits =
159
+ visibleMeters / metersPerUnit / relativeCircumference;
145
160
 
146
161
  const resolution = visibleMapUnits / size.height;
147
162
 
148
163
  if (viewpoint.animate) {
149
164
  let rotation = 0;
150
- if (!this.fixedNorthOrientation && viewpoint.heading != null) {
151
- rotation = -CesiumMath.toRadians(viewpoint.heading);
165
+ if (!this.fixedNorthOrientation && heading != null) {
166
+ rotation = -CesiumMath.toRadians(heading);
152
167
  }
153
168
  return new Promise((resolve) => {
154
- view.animate({
155
- duration: viewpoint.duration ? viewpoint.duration * 1000 : 100,
156
- center,
157
- easing: inAndOut, // XXX map to viewpoint easingFunctionName?
158
- resolution,
159
- rotation,
160
- }, () => { resolve(); });
169
+ view.animate(
170
+ {
171
+ duration: viewpoint.duration ? viewpoint.duration * 1000 : 100,
172
+ center,
173
+ easing: inAndOut, // XXX map to viewpoint easingFunctionName?
174
+ resolution,
175
+ rotation,
176
+ },
177
+ () => {
178
+ resolve();
179
+ },
180
+ );
161
181
  });
162
182
  } else {
163
183
  view.setCenter(center);
164
184
  view.setResolution(resolution);
165
- if (!this.fixedNorthOrientation && viewpoint.heading != null) {
166
- view.setRotation(-CesiumMath.toRadians(viewpoint.heading));
185
+ if (!this.fixedNorthOrientation && heading != null) {
186
+ view.setRotation(-CesiumMath.toRadians(heading));
167
187
  }
168
188
  }
169
189
  return Promise.resolve();
@@ -180,7 +200,11 @@ class Openlayers extends BaseOLMap {
180
200
  const toLatLon = getTransform(view.getProjection(), 'EPSG:4326');
181
201
  const topLeft = [extent[0], extent[3]];
182
202
  const bottomRight = [extent[2], extent[1]];
183
- const bbox = [toLatLon(topLeft), toLatLon(bottomRight)];
203
+ // error in TransformFunction type definition, remove undefined after openlayer fixed the type
204
+ const bbox = [
205
+ toLatLon(topLeft, undefined, undefined),
206
+ toLatLon(bottomRight, undefined, undefined),
207
+ ];
184
208
 
185
209
  return containsXY(boundingExtent(bbox), coords[0], coords[1]);
186
210
  }
@@ -192,7 +216,7 @@ class Openlayers extends BaseOLMap {
192
216
  toJSON() {
193
217
  const config = /** @type {OpenlayersOptions} */ (super.toJSON());
194
218
 
195
- const defaultOptions = Openlayers.getDefaultOptions();
219
+ const defaultOptions = OpenlayersMap.getDefaultOptions();
196
220
  if (this.fixedNorthOrientation !== defaultOptions.fixedNorthOrientation) {
197
221
  config.fixedNorthOrientation = this.fixedNorthOrientation;
198
222
  }
@@ -201,5 +225,5 @@ class Openlayers extends BaseOLMap {
201
225
  }
202
226
  }
203
227
 
204
- VcsClassRegistry.registerClass(Openlayers.className, Openlayers);
205
- export default Openlayers;
228
+ mapClassRegistry.registerClass(OpenlayersMap.className, OpenlayersMap);
229
+ export default OpenlayersMap;
@@ -1,11 +1,11 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
2
  import { check, checkMaybe } from '@vcsuite/check';
3
- import VcsObject from '../object.js';
3
+ import VcsObject from '../vcsObject.js';
4
4
  import LayerCollection from '../util/layerCollection.js';
5
5
  import MapState from './mapState.js';
6
6
  import { vcsLayerName } from '../layer/layerSymbols.js';
7
- import VcsEvent from '../event/vcsEvent.js';
8
- import { VcsClassRegistry } from '../classRegistry.js';
7
+ import VcsEvent from '../vcsEvent.js';
8
+ import { mapClassRegistry } from '../classRegistry.js';
9
9
 
10
10
  /**
11
11
  * @namespace maps
@@ -31,6 +31,12 @@ import { VcsClassRegistry } from '../classRegistry.js';
31
31
  * @api stable
32
32
  */
33
33
 
34
+ /**
35
+ * @typedef {Object} VcsMapRenderEvent
36
+ * @property {VcsMap} map
37
+ * @property {import("ol").MapEvent|CesiumMapEvent} originalEvent
38
+ */
39
+
34
40
  /**
35
41
  * @type {Object}
36
42
  */
@@ -44,9 +50,13 @@ const specificLayerImpl = {};
44
50
  * @api stable
45
51
  */
46
52
  class VcsMap extends VcsObject {
47
- static get className() { return 'vcs.vcm.maps.VcsMap'; }
53
+ static get className() {
54
+ return 'VcsMap';
55
+ }
48
56
 
49
- static get specificLayerImpl() { return specificLayerImpl; }
57
+ static get specificLayerImpl() {
58
+ return specificLayerImpl;
59
+ }
50
60
 
51
61
  /**
52
62
  * @returns {VcsMapOptions}
@@ -101,17 +111,9 @@ class VcsMap extends VcsObject {
101
111
  * @type {Array<Function>}
102
112
  * @private
103
113
  */
104
- this._collectionListeners = [
105
- this.layerCollection.moved.addEventListener((layer) => {
106
- this.indexChanged(layer);
107
- }),
108
- this.layerCollection.added.addEventListener((layer) => {
109
- this._layerAdded(layer);
110
- }),
111
- this.layerCollection.removed.addEventListener((layer) => {
112
- this._layerRemoved(layer);
113
- }),
114
- ];
114
+ this._collectionListeners = [];
115
+
116
+ this._setLayerCollectionListeners();
115
117
 
116
118
  /** @type {boolean} */
117
119
  this.initialized = false;
@@ -131,7 +133,7 @@ class VcsMap extends VcsObject {
131
133
  this.fallbackMap = options.fallbackMap || null;
132
134
 
133
135
  /**
134
- * @type {Map<string, Set<import("@vcmap/cesium").CustomDataSource|import("@vcmap/cesium").CzmlDataSource|import("@vcmap/cesium").PrimitiveCollection|import("@vcmap/cesium").Cesium3DTileset|import("@vcmap/cesium").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>>>}
136
+ * @type {Map<string, Set<import("@vcmap-cesium/engine").CustomDataSource|import("@vcmap-cesium/engine").CzmlDataSource|import("@vcmap-cesium/engine").PrimitiveCollection|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>>>}
135
137
  * @private
136
138
  */
137
139
  this._visualizations = new Map();
@@ -155,11 +157,15 @@ class VcsMap extends VcsObject {
155
157
  */
156
158
  this.pointerInteractionEvent = new VcsEvent();
157
159
  /**
158
- * If present, the split screen to use on this map. Is set by the mapCollection
159
- * @type {import("@vcmap/core").SplitScreen|null}
160
- * @api
160
+ * The split position to use on this map. Is set by the mapCollection
161
+ * @type {number}
161
162
  */
162
- this.splitScreen = null;
163
+ this._splitPosition = 0.5;
164
+ /**
165
+ * @type {VcsEvent<VcsMapRenderEvent>}
166
+ * @private
167
+ */
168
+ this._postRender = new VcsEvent();
163
169
  }
164
170
 
165
171
  /**
@@ -221,11 +227,63 @@ class VcsMap extends VcsObject {
221
227
  l.mapActivated(this);
222
228
  });
223
229
  }
230
+
231
+ this._setLayerCollectionListeners();
232
+ }
233
+
234
+ /**
235
+ * @type {number}
236
+ */
237
+ get splitPosition() {
238
+ return this._splitPosition;
239
+ }
240
+
241
+ /**
242
+ * The splitPosition should always be aligned with the mapCollection's splitPosition.
243
+ * Use mapCollection to change splitPosition.
244
+ * @param {number} position
245
+ */
246
+ set splitPosition(position) {
247
+ check(position, Number);
248
+ if (position < 0 || position > 1) {
249
+ throw new Error('Position must be between 0 and 1');
250
+ }
251
+ this._splitPosition = position;
252
+ }
253
+
254
+ /**
255
+ * An event raised on the maps post render
256
+ * @type {VcsEvent<VcsMapRenderEvent>}
257
+ * @readonly
258
+ */
259
+ get postRender() {
260
+ return this._postRender;
261
+ }
262
+
263
+ /**
264
+ * @private
265
+ */
266
+ _setLayerCollectionListeners() {
267
+ this._collectionListeners.forEach((cb) => {
268
+ cb();
269
+ });
270
+
271
+ this._collectionListeners = [
272
+ this.layerCollection.moved.addEventListener((layer) => {
273
+ this.indexChanged(layer);
274
+ }),
275
+ this.layerCollection.added.addEventListener((layer) => {
276
+ this._layerAdded(layer);
277
+ }),
278
+ this.layerCollection.removed.addEventListener((layer) => {
279
+ this._layerRemoved(layer);
280
+ }),
281
+ ];
224
282
  }
225
283
 
226
284
  /**
227
285
  * Determines whether this map can show this viewpoint. Returns true in any other map then {@link Oblique}
228
- * @param {import("@vcmap/core").ViewPoint} viewpoint
286
+ * @param {import("@vcmap/core").Viewpoint} viewpoint
229
287
  * @returns {Promise<boolean>}
230
288
  * @api
231
289
  */
@@ -246,7 +304,8 @@ class VcsMap extends VcsObject {
246
304
  this._target.removeChild(this.mapElement);
247
305
  }
248
306
 
249
- this._target = typeof target === 'string' ? document.getElementById(target) : target;
307
+ this._target =
308
+ typeof target === 'string' ? document.getElementById(target) : target;
250
309
  if (this._target) {
251
310
  this._target.appendChild(this.mapElement);
252
311
  }
@@ -288,7 +347,7 @@ class VcsMap extends VcsObject {
288
347
  /**
289
348
  * Validates a visualization. A visualization must have the vcsLayeName symbol set and a layer with said name must be
290
349
  * part of the maps layerCollection.
291
- * @param {import("@vcmap/cesium").CustomDataSource|import("@vcmap/cesium").PrimitiveCollection|import("@vcmap/cesium").Cesium3DTileset|import("@vcmap/cesium").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>} item
350
+ * @param {import("@vcmap-cesium/engine").CustomDataSource|import("@vcmap-cesium/engine").PrimitiveCollection|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>} item
292
351
  * @returns {boolean}
293
352
  */
294
353
  validateVisualization(item) {
@@ -303,11 +362,13 @@ class VcsMap extends VcsObject {
303
362
 
304
363
  /**
305
364
  * Adds a visualization to the visualizations map for its layer. The visualization must be valid, use validateVisualization first
306
- * @param {import("@vcmap/cesium").CustomDataSource|import("@vcmap/cesium").PrimitiveCollection|import("@vcmap/cesium").Cesium3DTileset|import("@vcmap/cesium").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>} item
365
+ * @param {import("@vcmap-cesium/engine").CustomDataSource|import("@vcmap-cesium/engine").PrimitiveCollection|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>} item
307
366
  */
308
367
  addVisualization(item) {
309
368
  if (!this.validateVisualization(item)) {
310
- throw new Error('Visualization item is not valid, validate before adding');
369
+ throw new Error(
370
+ 'Visualization item is not valid, validate before adding',
371
+ );
311
372
  }
312
373
  const layerName = item[vcsLayerName];
313
374
  if (!this._visualizations.has(layerName)) {
@@ -318,7 +379,7 @@ class VcsMap extends VcsObject {
318
379
 
319
380
  /**
320
381
  * Removes a visualization
321
- * @param {import("@vcmap/cesium").PrimitiveCollection|import("@vcmap/cesium").Cesium3DTileset|import("@vcmap/cesium").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>|import("@vcmap/cesium").CustomDataSource} item
382
+ * @param {import("@vcmap-cesium/engine").PrimitiveCollection|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>|import("@vcmap-cesium/engine").CustomDataSource} item
322
383
  */
323
384
  removeVisualization(item) {
324
385
  const layerName = item[vcsLayerName];
@@ -334,7 +395,7 @@ class VcsMap extends VcsObject {
334
395
  /**
335
396
  * Gets the visualizations for a specific layer.
336
397
  * @param {import("@vcmap/core").Layer} layer
337
- * @returns {Set<import("@vcmap/cesium").PrimitiveCollection|import("@vcmap/cesium").Cesium3DTileset|import("@vcmap/cesium").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>|import("@vcmap/cesium").CustomDataSource>}
398
+ * @returns {Set<import("@vcmap-cesium/engine").PrimitiveCollection|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>|import("@vcmap-cesium/engine").CustomDataSource>}
338
399
  * @api
339
400
  */
340
401
  getVisualizationsForLayer(layer) {
@@ -343,12 +404,12 @@ class VcsMap extends VcsObject {
343
404
 
344
405
  /**
345
406
  * Get all visualizations added to this map.
346
- * @returns {Array<import("@vcmap/cesium").PrimitiveCollection|import("@vcmap/cesium").Cesium3DTileset|import("@vcmap/cesium").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>|import("@vcmap/cesium").CustomDataSource>}
407
+ * @returns {Array<import("@vcmap-cesium/engine").PrimitiveCollection|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").ImageryLayer|import("ol/layer/Layer").default<import("ol/source").Source>|import("@vcmap-cesium/engine").CustomDataSource>}
347
408
  * @api
348
409
  */
349
410
  getVisualizations() {
350
411
  return [...this._visualizations.values()]
351
- .map(layerVisualizations => [...layerVisualizations])
412
+ .map((layerVisualizations) => [...layerVisualizations])
352
413
  .flat();
353
414
  }
354
415
 
@@ -368,7 +429,9 @@ class VcsMap extends VcsObject {
368
429
  return;
369
430
  }
370
431
  this._state = MapState.ACTIVE;
371
- await Promise.all([...this.layerCollection].map(layer => layer.mapActivated(this)));
432
+ await Promise.all(
433
+ [...this.layerCollection].map((layer) => layer.mapActivated(this)),
434
+ );
372
435
  if (this._state !== MapState.ACTIVE) {
373
436
  return;
374
437
  }
@@ -392,7 +455,7 @@ class VcsMap extends VcsObject {
392
455
  }
393
456
 
394
457
  /**
395
- * prevent all movement, including navigation controls, gotoViewPoint & setting of oblique images
458
+ * prevent all movement, including navigation controls, gotoViewpoint & setting of oblique images
396
459
  * @param {boolean} prevent
397
460
  * @api
398
461
  */
@@ -402,35 +465,35 @@ class VcsMap extends VcsObject {
402
465
 
403
466
  /**
404
467
  * sets the view to the given viewpoint
405
- * @param {import("@vcmap/core").ViewPoint} viewpoint
468
+ * @param {import("@vcmap/core").Viewpoint} viewpoint
406
469
  * @param {number=} optMaximumHeight during animation (can be used to get rid of the bunny hop)
407
- * gotoViewPoint
470
+ * gotoViewpoint
408
471
  * @returns {Promise<void>}
409
472
  * @api stable
410
473
  */
411
474
  // eslint-disable-next-line no-unused-vars,class-methods-use-this
412
- gotoViewPoint(viewpoint, optMaximumHeight) {
475
+ gotoViewpoint(viewpoint, optMaximumHeight) {
413
476
  return Promise.resolve();
414
477
  }
415
478
 
416
479
  // eslint-disable-next-line jsdoc/require-returns-check
417
480
  /**
418
- * Returns the most precise viewpoint possible in Oblique.
481
+ * Returns the most precise viewpoint possible in ObliqueMap.
419
482
  * @api
420
- * @returns {Promise<import("@vcmap/core").ViewPoint|null>}
483
+ * @returns {Promise<import("@vcmap/core").Viewpoint|null>}
421
484
  */
422
485
  // eslint-disable-next-line class-methods-use-this
423
- async getViewPoint() {
486
+ async getViewpoint() {
424
487
  return null;
425
488
  }
426
489
 
427
490
  /**
428
- * Returns an approximate viewpoint in Oblique, not requesting terrain.
491
+ * Returns an approximate viewpoint in ObliqueMap, not requesting terrain.
429
492
  * @api
430
- * @returns {import("@vcmap/core").ViewPoint|null}
493
+ * @returns {import("@vcmap/core").Viewpoint|null}
431
494
  */
432
495
  // eslint-disable-next-line class-methods-use-this
433
- getViewPointSync() {
496
+ getViewpointSync() {
434
497
  return null;
435
498
  }
436
499
 
@@ -451,7 +514,9 @@ class VcsMap extends VcsObject {
451
514
  * @api
452
515
  */
453
516
  // eslint-disable-next-line no-unused-vars,class-methods-use-this
454
- pointIsVisible(coords) { return false; }
517
+ pointIsVisible(coords) {
518
+ return false;
519
+ }
455
520
 
456
521
  /**
457
522
  * Requests this map to render when possible
@@ -486,16 +551,22 @@ class VcsMap extends VcsObject {
486
551
  }
487
552
  this._target = null;
488
553
 
489
- this._collectionListeners.forEach((cb) => { cb(); });
554
+ this._collectionListeners.forEach((cb) => {
555
+ cb();
556
+ });
490
557
  this._collectionListeners = [];
491
558
 
492
- [...this.layerCollection].forEach((l) => { l.removedFromMap(this); });
559
+ if (this.layerCollection) {
560
+ [...this.layerCollection].forEach((l) => {
561
+ l.removedFromMap(this);
562
+ });
563
+ }
493
564
  if (this.stateChanged) {
494
565
  this.stateChanged.destroy();
495
566
  this.stateChanged = null;
496
567
  }
497
568
 
498
- if (this.destroyLayerCollection) {
569
+ if (this.destroyLayerCollection && this.layerCollection) {
499
570
  this.layerCollection.destroy();
500
571
  }
501
572
 
@@ -504,8 +575,9 @@ class VcsMap extends VcsObject {
504
575
  this.pointerInteractionEvent = null;
505
576
  }
506
577
  this._layerCollection = null;
578
+ this._postRender.destroy();
507
579
  }
508
580
  }
509
581
 
510
- VcsClassRegistry.registerClass(VcsMap.className, VcsMap);
582
+ mapClassRegistry.registerClass(VcsMap.className, VcsMap);
511
583
  export default VcsMap;
@@ -0,0 +1,62 @@
1
+ import ObliqueCollection from './obliqueCollection.js';
2
+ import ObliqueImage from './obliqueImage.js';
3
+ import ObliqueImageMeta from './obliqueImageMeta.js';
4
+ import { ObliqueViewDirection } from './obliqueViewDirection.js';
5
+ import { mercatorProjection } from '../util/projection.js';
6
+
7
+ const defaultMeta = new ObliqueImageMeta({
8
+ name: 'defaultObliqueMeta',
9
+ size: [512, 512],
10
+ tileSize: [512, 512],
11
+ tileResolution: [1],
12
+ projection: mercatorProjection,
13
+ format: 'png',
14
+ url: '',
15
+ });
16
+
17
+ /**
18
+ * @type {symbol}
19
+ * @private
20
+ */
21
+ export const isDefaultImageSymbol = Symbol('isDefaultImage');
22
+
23
+ /**
24
+ * This is a special oblique collection wich is shown, if no other oblique collection is set on an ObliqueMap map.
25
+ * It will render a single image which indicates that no images can be loaded.
26
+ * @class
27
+ * @extends {ObliqueCollection}
28
+ */
29
+ class DefaultObliqueCollection extends ObliqueCollection {
30
+ constructor() {
31
+ super({});
32
+ }
33
+
34
+ /**
35
+ * @param {import("ol/coordinate").Coordinate} mercatorCoordinate
36
+ * @param {ObliqueViewDirection} viewDirection
37
+ * @returns {ObliqueImage}
38
+ */
39
+ // eslint-disable-next-line no-unused-vars
40
+ getImageForCoordinate(mercatorCoordinate, viewDirection) {
41
+ const groundCoordinates = [
42
+ [mercatorCoordinate[0] - 100, mercatorCoordinate[1] - 100, 0],
43
+ [mercatorCoordinate[0] + 100, mercatorCoordinate[1] - 100, 0],
44
+ [mercatorCoordinate[0] + 100, mercatorCoordinate[1] + 100, 0],
45
+ [mercatorCoordinate[0] - 100, mercatorCoordinate[1] + 100, 0],
46
+ ];
47
+
48
+ const image = new ObliqueImage({
49
+ meta: defaultMeta,
50
+ viewDirection: ObliqueViewDirection.NORTH,
51
+ viewDirectionAngle: 0,
52
+ name: this.name,
53
+ groundCoordinates,
54
+ centerPointOnGround: mercatorCoordinate,
55
+ });
56
+
57
+ image[isDefaultImageSymbol] = true;
58
+ return image;
59
+ }
60
+ }
61
+
62
+ export default DefaultObliqueCollection;