@vcmap/core 5.0.0-rc.2 → 5.0.0-rc.22

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 (204) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +3 -2
  3. package/index.d.ts +2567 -1914
  4. package/index.js +154 -131
  5. package/package.json +16 -23
  6. package/src/category/appBackedCategory.js +89 -0
  7. package/src/category/category.js +444 -0
  8. package/src/category/categoryCollection.js +145 -0
  9. package/src/cesium/cesium3DTileFeature.js +1 -1
  10. package/src/cesium/entity.js +27 -0
  11. package/src/classRegistry.js +162 -0
  12. package/src/context.js +89 -0
  13. package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +6 -7
  14. package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderHelpers.js +4 -5
  15. package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderSymbols.js +0 -0
  16. package/src/{vcs/vcm/util/featureProvider → featureProvider}/tileProviderFeatureProvider.js +4 -2
  17. package/src/{vcs/vcm/util/featureProvider → featureProvider}/wmsFeatureProvider.js +22 -14
  18. package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +27 -19
  19. package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +7 -10
  20. package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +55 -4
  21. package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +17 -26
  22. package/src/{vcs/vcm/interaction → interaction}/featureProviderInteraction.js +3 -14
  23. package/src/{vcs/vcm/interaction → interaction}/interactionChain.js +23 -34
  24. package/src/{vcs/vcm/interaction → interaction}/interactionType.js +1 -5
  25. package/src/{vcs/vcm/layer/cesium/cesiumTilesetCesium.js → layer/cesium/cesiumTilesetCesiumImpl.js} +10 -13
  26. package/src/{vcs/vcm/layer → layer}/cesium/clusterContext.js +0 -0
  27. package/src/{vcs/vcm/layer/cesium/dataSourceCesium.js → layer/cesium/dataSourceCesiumImpl.js} +6 -4
  28. package/src/{vcs/vcm/layer/cesium/openStreetMapCesium.js → layer/cesium/openStreetMapCesiumImpl.js} +6 -7
  29. package/src/{vcs/vcm/layer/cesium/rasterLayerCesium.js → layer/cesium/rasterLayerCesiumImpl.js} +5 -6
  30. package/src/{vcs/vcm/layer/cesium/singleImageCesium.js → layer/cesium/singleImageCesiumImpl.js} +5 -6
  31. package/src/{vcs/vcm/layer/cesium/terrainCesium.js → layer/cesium/terrainCesiumImpl.js} +4 -5
  32. package/src/{vcs/vcm/layer/cesium/tmsCesium.js → layer/cesium/tmsCesiumImpl.js} +6 -7
  33. package/src/{vcs/vcm/layer/cesium/vectorCesium.js → layer/cesium/vectorCesiumImpl.js} +6 -7
  34. package/src/{vcs/vcm/layer → layer}/cesium/vectorContext.js +0 -0
  35. package/src/{vcs/vcm/layer/cesium/vectorRasterTileCesium.js → layer/cesium/vectorRasterTileCesiumImpl.js} +5 -6
  36. package/src/{vcs/vcm/layer → layer}/cesium/vectorTileImageryProvider.js +1 -2
  37. package/src/{vcs/vcm/layer/cesium/wmsCesium.js → layer/cesium/wmsCesiumImpl.js} +6 -7
  38. package/src/{vcs/vcm/layer/cesium/wmtsCesium.js → layer/cesium/wmtsCesiumImpl.js} +6 -7
  39. package/src/{vcs/vcm/layer → layer}/cesium/x3dmHelper.js +1 -1
  40. package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +31 -35
  41. package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +12 -15
  42. package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +36 -27
  43. package/src/{vcs/vcm/layer → layer}/featureLayer.js +25 -29
  44. package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +51 -51
  45. package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +100 -82
  46. package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -2
  47. package/src/{vcs/vcm/layer → layer}/featureVisibility.js +9 -6
  48. package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +15 -41
  49. package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +15 -18
  50. package/src/{vcs/vcm/layer → layer}/globalHider.js +8 -32
  51. package/src/{vcs/vcm/layer → layer}/layer.js +92 -46
  52. package/src/{vcs/vcm/layer → layer}/layerImplementation.js +2 -3
  53. package/src/{vcs/vcm/layer → layer}/layerState.js +0 -1
  54. package/src/{vcs/vcm/layer → layer}/layerSymbols.js +0 -0
  55. package/src/{vcs/vcm/layer/oblique/layerOblique.js → layer/oblique/layerObliqueImpl.js} +4 -4
  56. package/src/{vcs/vcm/layer → layer}/oblique/obliqueHelpers.js +2 -2
  57. package/src/{vcs/vcm/layer/oblique/vectorOblique.js → layer/oblique/vectorObliqueImpl.js} +18 -12
  58. package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +30 -31
  59. package/src/{vcs/vcm/layer/openlayers/layerOpenlayers.js → layer/openlayers/layerOpenlayersImpl.js} +5 -6
  60. package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +26 -0
  61. package/src/{vcs/vcm/layer/openlayers/rasterLayerOpenlayers.js → layer/openlayers/rasterLayerOpenlayersImpl.js} +15 -14
  62. package/src/{vcs/vcm/layer/openlayers/singleImageOpenlayers.js → layer/openlayers/singleImageOpenlayersImpl.js} +6 -7
  63. package/src/{vcs/vcm/layer/openlayers/tileDebugOpenlayers.js → layer/openlayers/tileDebugOpenlayersImpl.js} +5 -6
  64. package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js} +7 -8
  65. package/src/{vcs/vcm/layer/openlayers/vectorOpenlayers.js → layer/openlayers/vectorOpenlayersImpl.js} +8 -9
  66. package/src/{vcs/vcm/layer/openlayers/vectorTileOpenlayers.js → layer/openlayers/vectorTileOpenlayersImpl.js} +7 -8
  67. package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js} +7 -8
  68. package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js} +8 -8
  69. package/src/{vcs/vcm/layer/pointCloud.js → layer/pointCloudLayer.js} +24 -32
  70. package/src/{vcs/vcm/layer → layer}/rasterLayer.js +16 -18
  71. package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +18 -18
  72. package/src/{vcs/vcm/layer → layer}/terrainHelpers.js +13 -49
  73. package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +11 -12
  74. package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +5 -5
  75. package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +43 -6
  76. package/src/layer/tileProvider/staticGeojsonTileProvider.js +81 -0
  77. package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +41 -6
  78. package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +46 -11
  79. package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +17 -18
  80. package/src/{vcs/vcm/layer → layer}/vectorHelpers.js +6 -7
  81. package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +35 -45
  82. package/src/{vcs/vcm/layer → layer}/vectorProperties.js +3 -4
  83. package/src/{vcs/vcm/layer → layer}/vectorSymbols.js +8 -0
  84. package/src/{vcs/vcm/layer/vectorTile.js → layer/vectorTileLayer.js} +75 -52
  85. package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +16 -17
  86. package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +1 -1
  87. package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +19 -20
  88. package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +24 -25
  89. package/src/{vcs/vcm/maps → map}/baseOLMap.js +5 -6
  90. package/src/{vcs/vcm/maps → map}/cameraLimiter.js +10 -16
  91. package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +42 -44
  92. package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
  93. package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +59 -74
  94. package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +24 -22
  95. package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +48 -29
  96. package/src/oblique/defaultObliqueCollection.js +62 -0
  97. package/src/{vcs/vcm/oblique → oblique}/helpers.js +13 -44
  98. package/src/{vcs/vcm/oblique/ObliqueCollection.js → oblique/obliqueCollection.js} +117 -37
  99. package/src/{vcs/vcm/oblique/ObliqueDataSet.js → oblique/obliqueDataSet.js} +67 -26
  100. package/src/{vcs/vcm/oblique/ObliqueImage.js → oblique/obliqueImage.js} +1 -2
  101. package/src/{vcs/vcm/oblique/ObliqueImageMeta.js → oblique/obliqueImageMeta.js} +4 -5
  102. package/src/{vcs/vcm/oblique/ObliqueProvider.js → oblique/obliqueProvider.js} +19 -14
  103. package/src/{vcs/vcm/oblique/ObliqueView.js → oblique/obliqueView.js} +31 -2
  104. package/src/{vcs/vcm/oblique/ObliqueViewDirection.js → oblique/obliqueViewDirection.js} +0 -3
  105. package/src/{vcs/vcm/oblique → oblique}/parseImageJson.js +20 -12
  106. package/src/ol/geom/circle.js +2 -2
  107. package/src/ol/geom/geometryCollection.js +3 -4
  108. package/src/ol/render/canvas/canvasTileRenderer.js +0 -1
  109. package/src/overrideClassRegistry.js +204 -0
  110. package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +37 -20
  111. package/src/{vcs/vcm/util/style → style}/shapesCategory.js +0 -2
  112. package/src/style/styleFactory.js +29 -0
  113. package/src/{vcs/vcm/util/style → style}/styleHelpers.js +3 -14
  114. package/src/{vcs/vcm/util/style → style}/styleItem.js +18 -105
  115. package/src/{vcs/vcm/util/style → style}/vectorStyleItem.js +73 -85
  116. package/src/{vcs/vcm/util/style → style}/writeStyle.js +4 -7
  117. package/src/{vcs/vcm/util → util}/clipping/clippingObject.js +10 -12
  118. package/src/{vcs/vcm/util → util}/clipping/clippingObjectManager.js +2 -3
  119. package/src/{vcs/vcm/util → util}/clipping/clippingPlaneHelper.js +6 -12
  120. package/src/{vcs/vcm/util → util}/collection.js +16 -4
  121. package/src/util/editor/createFeatureSession.js +182 -0
  122. package/src/util/editor/editGeometrySession.js +401 -0
  123. package/src/util/editor/editorHelpers.js +109 -0
  124. package/src/util/editor/editorSessionHelpers.js +107 -0
  125. package/src/util/editor/editorSymbols.js +10 -0
  126. package/src/util/editor/interactions/createBBoxInteraction.js +140 -0
  127. package/src/util/editor/interactions/createCircleInteraction.js +110 -0
  128. package/src/util/editor/interactions/createLineStringInteraction.js +108 -0
  129. package/src/util/editor/interactions/createPointInteraction.js +66 -0
  130. package/src/util/editor/interactions/createPolygonInteraction.js +125 -0
  131. package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +133 -0
  132. package/src/util/editor/interactions/insertVertexInteraction.js +92 -0
  133. package/src/util/editor/interactions/mapInteractionController.js +99 -0
  134. package/src/util/editor/interactions/removeVertexInteraction.js +39 -0
  135. package/src/util/editor/interactions/selectSingleFeatureInteraction.js +95 -0
  136. package/src/util/editor/interactions/translateVertexInteraction.js +61 -0
  137. package/src/util/editor/validateGeoemetry.js +22 -0
  138. package/src/{vcs/vcm/util → util}/exclusiveManager.js +0 -0
  139. package/src/{vcs/vcm/util → util}/extent.js +16 -10
  140. package/src/{vcs/vcm/util → util}/featureconverter/circleToCesium.js +1 -2
  141. package/src/{vcs/vcm/util → util}/featureconverter/convert.js +0 -0
  142. package/src/util/featureconverter/extent3D.js +180 -0
  143. package/src/{vcs/vcm/util → util}/featureconverter/featureconverterHelper.js +11 -5
  144. package/src/{vcs/vcm/util → util}/featureconverter/lineStringToCesium.js +1 -2
  145. package/src/{vcs/vcm/util → util}/featureconverter/pointToCesium.js +10 -8
  146. package/src/{vcs/vcm/util → util}/featureconverter/polygonToCesium.js +2 -3
  147. package/src/util/fetch.js +32 -0
  148. package/src/{vcs/vcm/util → util}/geometryHelpers.js +0 -0
  149. package/src/{vcs/vcm/util → util}/indexedCollection.js +24 -2
  150. package/src/{vcs/vcm/util → util}/isMobile.js +0 -0
  151. package/src/{vcs/vcm/util → util}/layerCollection.js +89 -12
  152. package/src/util/locale.js +12 -0
  153. package/src/{vcs/vcm/util → util}/mapCollection.js +102 -45
  154. package/src/{vcs/vcm/util → util}/math.js +9 -0
  155. package/src/util/overrideCollection.js +223 -0
  156. package/src/{vcs/vcm/util → util}/projection.js +38 -28
  157. package/src/{vcs/vcm/util → util}/splitScreen.js +11 -11
  158. package/src/{vcs/vcm/util → util}/urlHelpers.js +0 -0
  159. package/src/{vcs/vcm/util → util}/viewpoint.js +17 -21
  160. package/src/vcsApp.js +571 -0
  161. package/src/vcsAppContextHelpers.js +121 -0
  162. package/src/{vcs/vcm/event/vcsEvent.js → vcsEvent.js} +2 -3
  163. package/src/{vcs/vcm/object.js → vcsObject.js} +1 -9
  164. package/tests/data/dynamicPointCzml.json +64 -0
  165. package/tests/data/oblique/imageData/imagev34.json +352 -0
  166. package/tests/data/oblique/imageData/imagev35.json +54 -0
  167. package/tests/data/oblique/imageData/imagev35PerImageSize.json +53 -0
  168. package/tests/data/oblique/tiledImageData/12/2199/1342.json +1 -0
  169. package/tests/data/oblique/tiledImageData/12/2199/1343.json +1 -0
  170. package/tests/data/oblique/tiledImageData/12/2199/1344.json +1 -0
  171. package/tests/data/oblique/tiledImageData/12/2200/1342.json +1 -0
  172. package/tests/data/oblique/tiledImageData/12/2200/1343.json +1 -0
  173. package/tests/data/oblique/tiledImageData/12/2200/1344.json +1 -0
  174. package/tests/data/oblique/tiledImageData/12/2201/1342.json +1 -0
  175. package/tests/data/oblique/tiledImageData/12/2201/1343.json +1 -0
  176. package/tests/data/oblique/tiledImageData/12/2201/1344.json +1 -0
  177. package/tests/data/oblique/tiledImageData/image.json +1 -0
  178. package/tests/data/terrain/13/8800/6485.terrain +0 -0
  179. package/tests/data/terrain/13/8800/6486.terrain +0 -0
  180. package/tests/data/terrain/13/8801/6485.terrain +0 -0
  181. package/tests/data/terrain/13/8801/6486.terrain +0 -0
  182. package/tests/data/terrain/layer.json +136 -0
  183. package/tests/data/testGeoJSON.json +161 -0
  184. package/tests/data/tile.pbf +0 -0
  185. package/tests/unit/helpers/cesiumHelpers.js +289 -0
  186. package/tests/unit/helpers/getFileNameFromUrl.js +12 -0
  187. package/tests/unit/helpers/helpers.js +11 -0
  188. package/tests/unit/helpers/imageHelpers.js +20 -0
  189. package/tests/unit/helpers/importJSON.js +15 -0
  190. package/tests/unit/helpers/obliqueData.js +76 -0
  191. package/tests/unit/helpers/obliqueHelpers.js +112 -0
  192. package/tests/unit/helpers/openlayersHelpers.js +22 -0
  193. package/tests/unit/helpers/terrain/terrainData.js +46 -0
  194. package/src/vcs/vcm/classRegistry.js +0 -106
  195. package/src/vcs/vcm/globalCollections.js +0 -11
  196. package/src/vcs/vcm/layer/buildings.js +0 -17
  197. package/src/vcs/vcm/layer/cesium/pointCloudCesium.js +0 -58
  198. package/src/vcs/vcm/layer/openlayers/openStreetMapOpenlayers.js +0 -27
  199. package/src/vcs/vcm/layer/tileProvider/staticGeojsonTileProvider.js +0 -67
  200. package/src/vcs/vcm/layer/tileProvider/tileProviderFactory.js +0 -28
  201. package/src/vcs/vcm/util/dateTime.js +0 -60
  202. package/src/vcs/vcm/util/featureconverter/extent3d.js +0 -154
  203. package/src/vcs/vcm/util/locale.js +0 -53
  204. package/src/vcs/vcm/util/style/styleFactory.js +0 -48
@@ -5,18 +5,16 @@ import convert from '../../util/featureconverter/convert.js';
5
5
  import VectorContext from './vectorContext.js';
6
6
  import { vcsLayerName } from '../layerSymbols.js';
7
7
  import LayerImplementation from '../layerImplementation.js';
8
- import { getGlobalHider } from '../globalHider.js';
9
8
  import { synchronizeFeatureVisibilityWithSource } from '../vectorHelpers.js';
10
9
 
11
10
  /**
12
11
  * represents a specific vector layer for cesium.
13
12
  * @class
14
- * @export
15
13
  * @extends {LayerImplementation<import("@vcmap/core").CesiumMap>}}
16
14
  * @implements {FeatureLayerImplementation}
17
15
  */
18
- class VectorCesium extends LayerImplementation {
19
- static get className() { return 'vcs.vcm.layer.cesium.VectorCesium'; }
16
+ class VectorCesiumImpl extends LayerImplementation {
17
+ static get className() { return 'VectorCesiumImpl'; }
20
18
 
21
19
  /**
22
20
  * @param {import("@vcmap/core").CesiumMap} map
@@ -72,7 +70,8 @@ class VectorCesium extends LayerImplementation {
72
70
  * @private
73
71
  */
74
72
  this._scene = null;
75
- this.globalHider = getGlobalHider();
73
+ /** @type {import("@vcmap/core").GlobalHider} */
74
+ this.globalHider = options.globalHider;
76
75
  }
77
76
 
78
77
  /**
@@ -116,9 +115,9 @@ class VectorCesium extends LayerImplementation {
116
115
  async initialize() {
117
116
  if (!this.initialized) {
118
117
  this._scene = this.map.getScene();
119
- await this._setupContext(this.map);
120
118
  this._addListeners();
121
119
  this._addFeatures(this.source.getFeatures());
120
+ await this._setupContext(this.map);
122
121
  }
123
122
  await super.initialize();
124
123
  }
@@ -252,4 +251,4 @@ class VectorCesium extends LayerImplementation {
252
251
  }
253
252
  }
254
253
 
255
- export default VectorCesium;
254
+ export default VectorCesiumImpl;
@@ -1,18 +1,17 @@
1
1
  import { ImageryLayer as CesiumImageryLayer, Rectangle } from '@vcmap/cesium';
2
2
  import VectorTileImageryProvider from './vectorTileImageryProvider.js';
3
- import RasterLayerCesium from './rasterLayerCesium.js';
3
+ import RasterLayerCesiumImpl from './rasterLayerCesiumImpl.js';
4
4
  import { wgs84Projection } from '../../util/projection.js';
5
5
 
6
6
  /**
7
7
  * represents a rasterized tiled vector layer implementation for cesium.
8
8
  * @class
9
- * @export
10
- * @extends {RasterLayerCesium}
9
+ * @extends {RasterLayerCesiumImpl}
11
10
  * @implements {VectorTileImplementation}
12
11
  */
13
- class VectorRasterTileCesium extends RasterLayerCesium {
12
+ class VectorRasterTileCesiumImpl extends RasterLayerCesiumImpl {
14
13
  static get className() {
15
- return 'vcs.vcm.layer.cesium.VectorRasterTileCesium';
14
+ return 'VectorRasterTileCesiumImpl';
16
15
  }
17
16
 
18
17
  /**
@@ -113,4 +112,4 @@ class VectorRasterTileCesium extends RasterLayerCesium {
113
112
  }
114
113
  }
115
114
 
116
- export default VectorRasterTileCesium;
115
+ export default VectorRasterTileCesiumImpl;
@@ -2,7 +2,7 @@ import { Event as CesiumEvent, Rectangle, Math as CesiumMath } from '@vcmap/cesi
2
2
  import { compose, create as createTransform, scale as scaleTransform } from 'ol/transform.js';
3
3
  import { rectangleToExtent } from '../tileProvider/tileProvider.js';
4
4
  import { wgs84ToMercatorTransformer } from '../../util/projection.js';
5
- import CanvasTileRenderer from '../../../../ol/render/canvas/canvasTileRenderer.js';
5
+ import CanvasTileRenderer from '../../ol/render/canvas/canvasTileRenderer.js';
6
6
 
7
7
  /**
8
8
  * @param {import("ol/extent").Extent} extent
@@ -64,7 +64,6 @@ export function getCanvasFromFeatures(features, extent, center, tileSize) {
64
64
  /**
65
65
  * implementation of Cesium ImageryProvider Interface
66
66
  * @class
67
- * @export
68
67
  */
69
68
  class VectorTileImageryProvider {
70
69
  /**
@@ -1,16 +1,15 @@
1
1
  import { ImageryLayer as CesiumImageryLayer, Rectangle, WebMercatorTilingScheme, WebMapServiceImageryProvider } from '@vcmap/cesium';
2
2
 
3
- import RasterLayerCesium from './rasterLayerCesium.js';
3
+ import RasterLayerCesiumImpl from './rasterLayerCesiumImpl.js';
4
4
  import { wgs84Projection } from '../../util/projection.js';
5
5
 
6
6
  /**
7
- * represents a specific Cesium WMSCesium Layer class.
7
+ * represents a specific Cesium WmsCesiumImpl Layer class.
8
8
  * @class
9
- * @export
10
- * @extends {RasterLayerCesium}
9
+ * @extends {RasterLayerCesiumImpl}
11
10
  */
12
- class WMSCesium extends RasterLayerCesium {
13
- static get className() { return 'vcs.vcm.layer.cesium.WMSCesium'; }
11
+ class WmsCesiumImpl extends RasterLayerCesiumImpl {
12
+ static get className() { return 'WmsCesiumImpl'; }
14
13
 
15
14
  /**
16
15
  * @param {import("@vcmap/core").CesiumMap} map
@@ -68,4 +67,4 @@ class WMSCesium extends RasterLayerCesium {
68
67
  }
69
68
  }
70
69
 
71
- export default WMSCesium;
70
+ export default WmsCesiumImpl;
@@ -1,16 +1,15 @@
1
1
  import { Rectangle, WebMapTileServiceImageryProvider, ImageryLayer as CesiumImageryLayer } from '@vcmap/cesium';
2
- import RasterLayerCesium from './rasterLayerCesium.js';
2
+ import RasterLayerCesiumImpl from './rasterLayerCesiumImpl.js';
3
3
  import { wgs84Projection } from '../../util/projection.js';
4
4
  import { getTilingScheme } from '../rasterLayer.js';
5
5
 
6
6
  /**
7
- * represents a specific WMTS Implementation for {@link CesiumMap}.
7
+ * represents a specific WmtsLayer Implementation for {@link CesiumMap}.
8
8
  * @class
9
- * @export
10
- * @extends {RasterLayerCesium}
9
+ * @extends {RasterLayerCesiumImpl}
11
10
  */
12
- class WMTSCesium extends RasterLayerCesium {
13
- static get className() { return 'vcs.vcm.layer.cesium.WMTSCesium'; }
11
+ class WmtsCesiumImpl extends RasterLayerCesiumImpl {
12
+ static get className() { return 'WmtsCesiumImpl'; }
14
13
 
15
14
  /**
16
15
  * @param {import("@vcmap/core").CesiumMap} map
@@ -98,4 +97,4 @@ class WMTSCesium extends RasterLayerCesium {
98
97
  }
99
98
  }
100
99
 
101
- export default WMTSCesium;
100
+ export default WmtsCesiumImpl;
@@ -3,7 +3,7 @@
3
3
  * @returns {Object}
4
4
  */
5
5
  export default function getJSONObjectFromObject(feature) {
6
- const properties = feature.getPropertyNames();
6
+ const properties = feature.getPropertyIds();
7
7
  const JSONObject = {};
8
8
  for (let i = 0; i < properties.length; i++) {
9
9
  JSONObject[properties[i]] = feature.getProperty(properties[i]);
@@ -1,18 +1,17 @@
1
- import { ImagerySplitDirection, Matrix4 } from '@vcmap/cesium';
1
+ import { SplitDirection, Matrix4 } from '@vcmap/cesium';
2
2
 
3
3
  import { checkMaybe } from '@vcsuite/check';
4
4
  import { parseInteger } from '@vcsuite/parsers';
5
5
  import getJSONObjectFromObject from './cesium/x3dmHelper.js';
6
- import VectorStyleItem from '../util/style/vectorStyleItem.js';
6
+ import VectorStyleItem from '../style/vectorStyleItem.js';
7
7
  import FeatureLayer from './featureLayer.js';
8
- import CesiumTilesetCesium, { getExtentFromTileset } from './cesium/cesiumTilesetCesium.js';
9
- import CesiumMap from '../maps/cesium.js';
10
- import VcsEvent from '../event/vcsEvent.js';
8
+ import CesiumTilesetCesiumImpl, { getExtentFromTileset } from './cesium/cesiumTilesetCesiumImpl.js';
9
+ import CesiumMap from '../map/cesiumMap.js';
10
+ import VcsEvent from '../vcsEvent.js';
11
11
  import Extent from '../util/extent.js';
12
12
  import { mercatorProjection } from '../util/projection.js';
13
13
  import { isMobile } from '../util/isMobile.js';
14
- import { referenceableStyleSymbol } from '../util/style/styleItem.js';
15
- import { VcsClassRegistry } from '../classRegistry.js';
14
+ import { layerClassRegistry } from '../classRegistry.js';
16
15
 
17
16
  /**
18
17
  * @typedef {LayerOptions} CesiumTilesetOptions
@@ -37,7 +36,7 @@ import { VcsClassRegistry } from '../classRegistry.js';
37
36
  /**
38
37
  * @typedef {FeatureLayerImplementationOptions} CesiumTilesetImplementationOptions
39
38
  * @property {Object|undefined} tilesetOptions
40
- * @property {import("@vcmap/cesium").ImagerySplitDirection} splitDirection
39
+ * @property {import("@vcmap/cesium").SplitDirection} splitDirection
41
40
  * @property {Array<CesiumTilesetTilesetProperties>|undefined} tilesetProperties
42
41
  * @property {import("@vcmap/cesium").Matrix4|undefined} modelMatrix
43
42
  * @property {import("ol/coordinate").Coordinate|undefined} offset
@@ -50,11 +49,10 @@ import { VcsClassRegistry } from '../classRegistry.js';
50
49
  * @extends {FeatureLayer}
51
50
  * @implements {SplitLayer}
52
51
  * @api stable
53
- * @export
54
52
  */
55
- class CesiumTileset extends FeatureLayer {
53
+ class CesiumTilesetLayer extends FeatureLayer {
56
54
  /** @type {string} */
57
- static get className() { return 'vcs.vcm.layer.CesiumTileset'; }
55
+ static get className() { return 'CesiumTilesetLayer'; }
58
56
 
59
57
  /**
60
58
  * @returns {CesiumTilesetOptions}
@@ -80,7 +78,7 @@ class CesiumTileset extends FeatureLayer {
80
78
  this._supportedMaps = [
81
79
  CesiumMap.className,
82
80
  ];
83
- const defaultOptions = CesiumTileset.getDefaultOptions();
81
+ const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
84
82
  if (this.url && !/\.json$/.test(this.url)) {
85
83
  this.url = `${this.url.replace(/\/$/, '')}/tileset.json`;
86
84
  }
@@ -111,18 +109,18 @@ class CesiumTileset extends FeatureLayer {
111
109
  ...tilesetOptions,
112
110
  };
113
111
 
114
- /** @type {import("@vcmap/cesium").ImagerySplitDirection} */
115
- this._splitDirection = ImagerySplitDirection.NONE;
112
+ /** @type {import("@vcmap/cesium").SplitDirection} */
113
+ this._splitDirection = SplitDirection.NONE;
116
114
 
117
115
  if (options.splitDirection) {
118
116
  this._splitDirection = options.splitDirection === 'left' ?
119
- ImagerySplitDirection.LEFT :
120
- ImagerySplitDirection.RIGHT;
117
+ SplitDirection.LEFT :
118
+ SplitDirection.RIGHT;
121
119
  }
122
120
 
123
121
  /**
124
122
  * raised if the split direction changes, is passed the split direction as its only argument
125
- * @type {VcsEvent<import("@vcmap/cesium").ImagerySplitDirection>}
123
+ * @type {VcsEvent<import("@vcmap/cesium").SplitDirection>}
126
124
  * @api
127
125
  */
128
126
  this.splitDirectionChanged = new VcsEvent();
@@ -158,7 +156,7 @@ class CesiumTileset extends FeatureLayer {
158
156
 
159
157
  this._modelMatrix = modelMatrix;
160
158
  this.getImplementations()
161
- .forEach(/** @param {CesiumTilesetCesium} impl */ (impl) => {
159
+ .forEach(/** @param {CesiumTilesetCesiumImpl} impl */ (impl) => {
162
160
  impl.updateModelMatrix(modelMatrix);
163
161
  });
164
162
  }
@@ -182,24 +180,24 @@ class CesiumTileset extends FeatureLayer {
182
180
 
183
181
  this._offset = offset;
184
182
  this.getImplementations()
185
- .forEach(/** @param {CesiumTilesetCesium} impl */ (impl) => {
183
+ .forEach(/** @param {CesiumTilesetCesiumImpl} impl */ (impl) => {
186
184
  impl.updateOffset(offset);
187
185
  });
188
186
  }
189
187
 
190
188
  /**
191
189
  * @api
192
- * @type {import("@vcmap/cesium").ImagerySplitDirection}
190
+ * @type {import("@vcmap/cesium").SplitDirection}
193
191
  */
194
192
  get splitDirection() { return this._splitDirection; }
195
193
 
196
194
  /**
197
- * @param {import("@vcmap/cesium").ImagerySplitDirection} direction
195
+ * @param {import("@vcmap/cesium").SplitDirection} direction
198
196
  */
199
197
  set splitDirection(direction) {
200
198
  if (direction !== this._splitDirection) {
201
199
  this.getImplementations().forEach((impl) => {
202
- /** @type {CesiumTilesetCesium} */ (impl).updateSplitDirection(direction);
200
+ /** @type {CesiumTilesetCesiumImpl} */ (impl).updateSplitDirection(direction);
203
201
  });
204
202
  this._splitDirection = direction;
205
203
  this.splitDirectionChanged.raiseEvent(this._splitDirection);
@@ -223,11 +221,11 @@ class CesiumTileset extends FeatureLayer {
223
221
  /**
224
222
  * @inheritDoc
225
223
  * @param {import("@vcmap/core").VcsMap} map
226
- * @returns {Array<CesiumTilesetCesium>}
224
+ * @returns {Array<CesiumTilesetCesiumImpl>}
227
225
  */
228
226
  createImplementationsForMap(map) {
229
227
  if (map instanceof CesiumMap) {
230
- return [new CesiumTilesetCesium(map, this.getImplementationOptions())];
228
+ return [new CesiumTilesetCesiumImpl(map, this.getImplementationOptions())];
231
229
  }
232
230
  return [];
233
231
  }
@@ -261,12 +259,12 @@ class CesiumTileset extends FeatureLayer {
261
259
  if (metaExtent) {
262
260
  return metaExtent;
263
261
  }
264
- const impl = /** @type {CesiumTilesetCesium} */ (this.getImplementations()[0]);
262
+ const impl = /** @type {CesiumTilesetCesiumImpl} */ (this.getImplementations()[0]);
265
263
  if (impl) {
266
264
  const threeDimExtent = getExtentFromTileset(impl.cesium3DTileset);
267
265
 
268
266
  const actualExtent = new Extent({
269
- ...mercatorProjection.toJSON(),
267
+ projection: mercatorProjection.toJSON(),
270
268
  coordinates: threeDimExtent,
271
269
  });
272
270
 
@@ -299,7 +297,7 @@ class CesiumTileset extends FeatureLayer {
299
297
  */
300
298
  setMaximumScreenSpaceError(value) {
301
299
  this.getImplementations()
302
- .forEach(/** @param {CesiumTilesetCesium} impl */(impl) => {
300
+ .forEach(/** @param {CesiumTilesetCesiumImpl} impl */(impl) => {
303
301
  if (impl.cesium3DTileset) {
304
302
  impl.cesium3DTileset.maximumScreenSpaceError = value;
305
303
  }
@@ -312,11 +310,9 @@ class CesiumTileset extends FeatureLayer {
312
310
  toJSON() {
313
311
  /** @type {CesiumTilesetOptions} */
314
312
  const config = super.toJSON();
315
- const defaultOptions = CesiumTileset.getDefaultOptions();
313
+ const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
316
314
  if (this.highlightStyle) {
317
- config.highlightStyle = this.highlightStyle[referenceableStyleSymbol] ?
318
- this.highlightStyle.getReference() :
319
- this.highlightStyle.getOptions();
315
+ config.highlightStyle = this.highlightStyle.toJSON();
320
316
  }
321
317
 
322
318
  if (this.screenSpaceError !== defaultOptions.screenSpaceError) {
@@ -349,8 +345,8 @@ class CesiumTileset extends FeatureLayer {
349
345
  config.tilesetOptions = tilesetOptions;
350
346
  }
351
347
 
352
- if (this._splitDirection !== ImagerySplitDirection.NONE) {
353
- config.splitDirection = this._splitDirection === ImagerySplitDirection.RIGHT ?
348
+ if (this._splitDirection !== SplitDirection.NONE) {
349
+ config.splitDirection = this._splitDirection === SplitDirection.RIGHT ?
354
350
  'right' :
355
351
  'left';
356
352
  }
@@ -372,5 +368,5 @@ class CesiumTileset extends FeatureLayer {
372
368
  }
373
369
  }
374
370
 
375
- VcsClassRegistry.registerClass(CesiumTileset.className, CesiumTileset);
376
- export default CesiumTileset;
371
+ layerClassRegistry.registerClass(CesiumTilesetLayer.className, CesiumTilesetLayer);
372
+ export default CesiumTilesetLayer;
@@ -1,8 +1,8 @@
1
1
  import { CzmlDataSource } from '@vcmap/cesium';
2
2
 
3
- import DataSource from './dataSource.js';
3
+ import DataSourceLayer from './dataSourceLayer.js';
4
4
  import { vcsLayerName } from './layerSymbols.js';
5
- import { VcsClassRegistry } from '../classRegistry.js';
5
+ import { layerClassRegistry } from '../classRegistry.js';
6
6
 
7
7
  /**
8
8
  * @typedef {DataSourceOptions} CzmlOptions
@@ -12,18 +12,17 @@ import { VcsClassRegistry } from '../classRegistry.js';
12
12
 
13
13
  /**
14
14
  * @class
15
- * @export
16
- * @extends {DataSource}
15
+ * @extends {DataSourceLayer}
17
16
  */
18
- class Czml extends DataSource {
19
- static get className() { return 'vcs.vcm.layer.Czml'; }
17
+ class CzmlLayer extends DataSourceLayer {
18
+ static get className() { return 'CzmlLayer'; }
20
19
 
21
20
  /**
22
21
  * @returns {CzmlOptions}
23
22
  */
24
23
  static getDefaultOptions() {
25
24
  return {
26
- ...DataSource.getDefaultOptions(),
25
+ ...DataSourceLayer.getDefaultOptions(),
27
26
  sourceUri: undefined,
28
27
  };
29
28
  }
@@ -36,7 +35,7 @@ class Czml extends DataSource {
36
35
  this.dataSource = new CzmlDataSource();
37
36
  this.entities = this.dataSource.entities;
38
37
 
39
- const defaultOptions = Czml.getDefaultOptions();
38
+ const defaultOptions = CzmlLayer.getDefaultOptions();
40
39
  /** @type {string|null} */
41
40
  this.sourceUri = options.sourceUri || defaultOptions.sourceUri;
42
41
  /** @type {Function} */
@@ -44,7 +43,7 @@ class Czml extends DataSource {
44
43
  /** @type {Function} */
45
44
  this._loadedReject = () => {};
46
45
  /**
47
- * A Promise resolving with the DataSource on load
46
+ * A Promise resolving with the DataSourceLayer on load
48
47
  * @type {Promise<void>}
49
48
  * @api stable
50
49
  */
@@ -77,11 +76,9 @@ class Czml extends DataSource {
77
76
  * @private
78
77
  */
79
78
  async _loadData() {
80
- const loaded = /** @type {import("@vcmap/cesium").CzmlDataSource} */ (this.dataSource)
79
+ await /** @type {import("@vcmap/cesium").CzmlDataSource} */ (this.dataSource)
81
80
  .load(this.url, this.sourceUri ? { sourceUri: this.sourceUri } : undefined);
82
- await new Promise((resolve, reject) => {
83
- loaded.then(resolve, reject);
84
- });
81
+
85
82
  this.entities.values.forEach((entity) => {
86
83
  entity[vcsLayerName] = this.name;
87
84
  });
@@ -137,5 +134,5 @@ class Czml extends DataSource {
137
134
  }
138
135
  }
139
136
 
140
- VcsClassRegistry.registerClass(Czml.className, Czml);
141
- export default Czml;
137
+ layerClassRegistry.registerClass(CzmlLayer.className, CzmlLayer);
138
+ export default CzmlLayer;
@@ -1,11 +1,10 @@
1
1
  import { EntityCollection } from '@vcmap/cesium';
2
2
  import Layer from './layer.js';
3
- import CesiumMap from '../maps/cesium.js';
4
- import DataSourceCesium from './cesium/dataSourceCesium.js';
3
+ import CesiumMap from '../map/cesiumMap.js';
4
+ import DataSourceCesiumImpl from './cesium/dataSourceCesiumImpl.js';
5
5
  import { vcsLayerName } from './layerSymbols.js';
6
6
  import FeatureVisibility, { FeatureVisibilityAction } from './featureVisibility.js';
7
- import { getGlobalHider } from './globalHider.js';
8
- import { VcsClassRegistry } from '../classRegistry.js';
7
+ import { layerClassRegistry } from '../classRegistry.js';
9
8
 
10
9
  /**
11
10
  * @typedef {LayerOptions} DataSourceOptions
@@ -30,12 +29,11 @@ import { VcsClassRegistry } from '../classRegistry.js';
30
29
  /**
31
30
  * Represents a layer of Cesium.Entity
32
31
  * @class
33
- * @export
34
32
  * @extends {Layer}
35
33
  * @api stable
36
34
  */
37
- class DataSource extends Layer {
38
- static get className() { return 'vcs.vcm.layer.DataSource'; }
35
+ class DataSourceLayer extends Layer {
36
+ static get className() { return 'DataSourceLayer'; }
39
37
 
40
38
  /**
41
39
  * @returns {DataSourceOptions}
@@ -52,7 +50,7 @@ class DataSource extends Layer {
52
50
  */
53
51
  constructor(options) {
54
52
  super(options);
55
- const defaultOptions = DataSource.getDefaultOptions();
53
+ const defaultOptions = DataSourceLayer.getDefaultOptions();
56
54
  /**
57
55
  * The entities of this layer. Use the `addEntity` API to add Enitities to ensure interoperability with vcm interfaces
58
56
  * @type {import("@vcmap/cesium").EntityCollection}
@@ -86,12 +84,21 @@ class DataSource extends Layer {
86
84
  ];
87
85
  }
88
86
 
87
+ /**
88
+ * @param {import("@vcmap/core").GlobalHider} globalHider
89
+ */
90
+ setGlobalHider(globalHider) {
91
+ super.setGlobalHider(globalHider);
92
+ this._setUpFeatureVisibility();
93
+ }
94
+
89
95
  /**
90
96
  * Sets up listeners for featureVisibility and global hider
91
97
  * @private
92
98
  */
93
99
  _setUpFeatureVisibility() {
94
- const globalHider = getGlobalHider();
100
+ this._featureVisibilityListeners.forEach((cb) => { cb(); });
101
+
95
102
  this._featureVisibilityListeners = [
96
103
  this.featureVisibility.changed.addEventListener(({ action, ids }) => {
97
104
  if (action === FeatureVisibilityAction.HIDE) {
@@ -103,28 +110,30 @@ class DataSource extends Layer {
103
110
  });
104
111
  } // highlight is _possible_ but very tricky with all the possible entity values with potential materials
105
112
  }),
106
- globalHider.changed.addEventListener(({ action, ids }) => {
107
- if (action === FeatureVisibilityAction.HIDE) {
108
- ids.forEach((id) => {
109
- const entity = this.entities.getById(id);
110
- if (entity) {
111
- globalHider.addFeature(id, entity);
112
- }
113
- });
114
- }
115
- }),
116
113
  this.entities.collectionChanged.addEventListener((c, added) => {
117
114
  added.forEach((entity) => {
118
115
  if (this.featureVisibility.hiddenObjects[entity.id]) {
119
116
  this.featureVisibility.addHiddenFeature(entity.id, entity);
120
117
  }
121
-
122
- if (globalHider.hiddenObjects[entity.id]) {
123
- globalHider.addFeature(entity.id, entity);
118
+ if (this.globalHider && this.globalHider.hiddenObjects[entity.id]) {
119
+ this.globalHider.addFeature(entity.id, entity);
124
120
  }
125
121
  });
126
122
  }),
127
123
  ];
124
+
125
+ if (this.globalHider) {
126
+ this._featureVisibilityListeners.push(this.globalHider.changed.addEventListener(({ action, ids }) => {
127
+ if (action === FeatureVisibilityAction.HIDE) {
128
+ ids.forEach((id) => {
129
+ const entity = this.entities.getById(id);
130
+ if (entity) {
131
+ this.globalHider.addFeature(id, entity);
132
+ }
133
+ });
134
+ }
135
+ }));
136
+ }
128
137
  }
129
138
 
130
139
  /**
@@ -151,11 +160,11 @@ class DataSource extends Layer {
151
160
 
152
161
  /**
153
162
  * @param {CesiumMap} map
154
- * @returns {Array<DataSourceCesium>}
163
+ * @returns {Array<DataSourceCesiumImpl>}
155
164
  */
156
165
  createImplementationsForMap(map) {
157
166
  if (map instanceof CesiumMap) {
158
- return [new DataSourceCesium(map, this.getImplementationOptions())];
167
+ return [new DataSourceCesiumImpl(map, this.getImplementationOptions())];
159
168
  }
160
169
  return [];
161
170
  }
@@ -183,7 +192,7 @@ class DataSource extends Layer {
183
192
  */
184
193
  flyToEntity(id) {
185
194
  this.getImplementations().forEach((impl) => {
186
- /** @type {DataSourceCesium} */ (impl).flyToEntity(id);
195
+ /** @type {DataSourceCesiumImpl} */ (impl).flyToEntity(id);
187
196
  });
188
197
  }
189
198
 
@@ -255,5 +264,5 @@ class DataSource extends Layer {
255
264
  }
256
265
  }
257
266
 
258
- VcsClassRegistry.registerClass(DataSource.className, DataSource);
259
- export default DataSource;
267
+ layerClassRegistry.registerClass(DataSourceLayer.className, DataSourceLayer);
268
+ export default DataSourceLayer;