@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.
- package/LICENSE.md +1 -1
- package/README.md +3 -2
- package/index.d.ts +2567 -1914
- package/index.js +154 -131
- package/package.json +16 -23
- package/src/category/appBackedCategory.js +89 -0
- package/src/category/category.js +444 -0
- package/src/category/categoryCollection.js +145 -0
- package/src/cesium/cesium3DTileFeature.js +1 -1
- package/src/cesium/entity.js +27 -0
- package/src/classRegistry.js +162 -0
- package/src/context.js +89 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +6 -7
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderHelpers.js +4 -5
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderSymbols.js +0 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/tileProviderFeatureProvider.js +4 -2
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/wmsFeatureProvider.js +22 -14
- package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +27 -19
- package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +7 -10
- package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +55 -4
- package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +17 -26
- package/src/{vcs/vcm/interaction → interaction}/featureProviderInteraction.js +3 -14
- package/src/{vcs/vcm/interaction → interaction}/interactionChain.js +23 -34
- package/src/{vcs/vcm/interaction → interaction}/interactionType.js +1 -5
- package/src/{vcs/vcm/layer/cesium/cesiumTilesetCesium.js → layer/cesium/cesiumTilesetCesiumImpl.js} +10 -13
- package/src/{vcs/vcm/layer → layer}/cesium/clusterContext.js +0 -0
- package/src/{vcs/vcm/layer/cesium/dataSourceCesium.js → layer/cesium/dataSourceCesiumImpl.js} +6 -4
- package/src/{vcs/vcm/layer/cesium/openStreetMapCesium.js → layer/cesium/openStreetMapCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer/cesium/rasterLayerCesium.js → layer/cesium/rasterLayerCesiumImpl.js} +5 -6
- package/src/{vcs/vcm/layer/cesium/singleImageCesium.js → layer/cesium/singleImageCesiumImpl.js} +5 -6
- package/src/{vcs/vcm/layer/cesium/terrainCesium.js → layer/cesium/terrainCesiumImpl.js} +4 -5
- package/src/{vcs/vcm/layer/cesium/tmsCesium.js → layer/cesium/tmsCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer/cesium/vectorCesium.js → layer/cesium/vectorCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer → layer}/cesium/vectorContext.js +0 -0
- package/src/{vcs/vcm/layer/cesium/vectorRasterTileCesium.js → layer/cesium/vectorRasterTileCesiumImpl.js} +5 -6
- package/src/{vcs/vcm/layer → layer}/cesium/vectorTileImageryProvider.js +1 -2
- package/src/{vcs/vcm/layer/cesium/wmsCesium.js → layer/cesium/wmsCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer/cesium/wmtsCesium.js → layer/cesium/wmtsCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer → layer}/cesium/x3dmHelper.js +1 -1
- package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +31 -35
- package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +12 -15
- package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +36 -27
- package/src/{vcs/vcm/layer → layer}/featureLayer.js +25 -29
- package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +51 -51
- package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +100 -82
- package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -2
- package/src/{vcs/vcm/layer → layer}/featureVisibility.js +9 -6
- package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +15 -41
- package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +15 -18
- package/src/{vcs/vcm/layer → layer}/globalHider.js +8 -32
- package/src/{vcs/vcm/layer → layer}/layer.js +92 -46
- package/src/{vcs/vcm/layer → layer}/layerImplementation.js +2 -3
- package/src/{vcs/vcm/layer → layer}/layerState.js +0 -1
- package/src/{vcs/vcm/layer → layer}/layerSymbols.js +0 -0
- package/src/{vcs/vcm/layer/oblique/layerOblique.js → layer/oblique/layerObliqueImpl.js} +4 -4
- package/src/{vcs/vcm/layer → layer}/oblique/obliqueHelpers.js +2 -2
- package/src/{vcs/vcm/layer/oblique/vectorOblique.js → layer/oblique/vectorObliqueImpl.js} +18 -12
- package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +30 -31
- package/src/{vcs/vcm/layer/openlayers/layerOpenlayers.js → layer/openlayers/layerOpenlayersImpl.js} +5 -6
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +26 -0
- package/src/{vcs/vcm/layer/openlayers/rasterLayerOpenlayers.js → layer/openlayers/rasterLayerOpenlayersImpl.js} +15 -14
- package/src/{vcs/vcm/layer/openlayers/singleImageOpenlayers.js → layer/openlayers/singleImageOpenlayersImpl.js} +6 -7
- package/src/{vcs/vcm/layer/openlayers/tileDebugOpenlayers.js → layer/openlayers/tileDebugOpenlayersImpl.js} +5 -6
- package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js} +7 -8
- package/src/{vcs/vcm/layer/openlayers/vectorOpenlayers.js → layer/openlayers/vectorOpenlayersImpl.js} +8 -9
- package/src/{vcs/vcm/layer/openlayers/vectorTileOpenlayers.js → layer/openlayers/vectorTileOpenlayersImpl.js} +7 -8
- package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js} +7 -8
- package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js} +8 -8
- package/src/{vcs/vcm/layer/pointCloud.js → layer/pointCloudLayer.js} +24 -32
- package/src/{vcs/vcm/layer → layer}/rasterLayer.js +16 -18
- package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +18 -18
- package/src/{vcs/vcm/layer → layer}/terrainHelpers.js +13 -49
- package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +11 -12
- package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +5 -5
- package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +43 -6
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +81 -0
- package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +41 -6
- package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +46 -11
- package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +17 -18
- package/src/{vcs/vcm/layer → layer}/vectorHelpers.js +6 -7
- package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +35 -45
- package/src/{vcs/vcm/layer → layer}/vectorProperties.js +3 -4
- package/src/{vcs/vcm/layer → layer}/vectorSymbols.js +8 -0
- package/src/{vcs/vcm/layer/vectorTile.js → layer/vectorTileLayer.js} +75 -52
- package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +16 -17
- package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +1 -1
- package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +19 -20
- package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +24 -25
- package/src/{vcs/vcm/maps → map}/baseOLMap.js +5 -6
- package/src/{vcs/vcm/maps → map}/cameraLimiter.js +10 -16
- package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +42 -44
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +59 -74
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +24 -22
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +48 -29
- package/src/oblique/defaultObliqueCollection.js +62 -0
- package/src/{vcs/vcm/oblique → oblique}/helpers.js +13 -44
- package/src/{vcs/vcm/oblique/ObliqueCollection.js → oblique/obliqueCollection.js} +117 -37
- package/src/{vcs/vcm/oblique/ObliqueDataSet.js → oblique/obliqueDataSet.js} +67 -26
- package/src/{vcs/vcm/oblique/ObliqueImage.js → oblique/obliqueImage.js} +1 -2
- package/src/{vcs/vcm/oblique/ObliqueImageMeta.js → oblique/obliqueImageMeta.js} +4 -5
- package/src/{vcs/vcm/oblique/ObliqueProvider.js → oblique/obliqueProvider.js} +19 -14
- package/src/{vcs/vcm/oblique/ObliqueView.js → oblique/obliqueView.js} +31 -2
- package/src/{vcs/vcm/oblique/ObliqueViewDirection.js → oblique/obliqueViewDirection.js} +0 -3
- package/src/{vcs/vcm/oblique → oblique}/parseImageJson.js +20 -12
- package/src/ol/geom/circle.js +2 -2
- package/src/ol/geom/geometryCollection.js +3 -4
- package/src/ol/render/canvas/canvasTileRenderer.js +0 -1
- package/src/overrideClassRegistry.js +204 -0
- package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +37 -20
- package/src/{vcs/vcm/util/style → style}/shapesCategory.js +0 -2
- package/src/style/styleFactory.js +29 -0
- package/src/{vcs/vcm/util/style → style}/styleHelpers.js +3 -14
- package/src/{vcs/vcm/util/style → style}/styleItem.js +18 -105
- package/src/{vcs/vcm/util/style → style}/vectorStyleItem.js +73 -85
- package/src/{vcs/vcm/util/style → style}/writeStyle.js +4 -7
- package/src/{vcs/vcm/util → util}/clipping/clippingObject.js +10 -12
- package/src/{vcs/vcm/util → util}/clipping/clippingObjectManager.js +2 -3
- package/src/{vcs/vcm/util → util}/clipping/clippingPlaneHelper.js +6 -12
- package/src/{vcs/vcm/util → util}/collection.js +16 -4
- package/src/util/editor/createFeatureSession.js +182 -0
- package/src/util/editor/editGeometrySession.js +401 -0
- package/src/util/editor/editorHelpers.js +109 -0
- package/src/util/editor/editorSessionHelpers.js +107 -0
- package/src/util/editor/editorSymbols.js +10 -0
- package/src/util/editor/interactions/createBBoxInteraction.js +140 -0
- package/src/util/editor/interactions/createCircleInteraction.js +110 -0
- package/src/util/editor/interactions/createLineStringInteraction.js +108 -0
- package/src/util/editor/interactions/createPointInteraction.js +66 -0
- package/src/util/editor/interactions/createPolygonInteraction.js +125 -0
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +133 -0
- package/src/util/editor/interactions/insertVertexInteraction.js +92 -0
- package/src/util/editor/interactions/mapInteractionController.js +99 -0
- package/src/util/editor/interactions/removeVertexInteraction.js +39 -0
- package/src/util/editor/interactions/selectSingleFeatureInteraction.js +95 -0
- package/src/util/editor/interactions/translateVertexInteraction.js +61 -0
- package/src/util/editor/validateGeoemetry.js +22 -0
- package/src/{vcs/vcm/util → util}/exclusiveManager.js +0 -0
- package/src/{vcs/vcm/util → util}/extent.js +16 -10
- package/src/{vcs/vcm/util → util}/featureconverter/circleToCesium.js +1 -2
- package/src/{vcs/vcm/util → util}/featureconverter/convert.js +0 -0
- package/src/util/featureconverter/extent3D.js +180 -0
- package/src/{vcs/vcm/util → util}/featureconverter/featureconverterHelper.js +11 -5
- package/src/{vcs/vcm/util → util}/featureconverter/lineStringToCesium.js +1 -2
- package/src/{vcs/vcm/util → util}/featureconverter/pointToCesium.js +10 -8
- package/src/{vcs/vcm/util → util}/featureconverter/polygonToCesium.js +2 -3
- package/src/util/fetch.js +32 -0
- package/src/{vcs/vcm/util → util}/geometryHelpers.js +0 -0
- package/src/{vcs/vcm/util → util}/indexedCollection.js +24 -2
- package/src/{vcs/vcm/util → util}/isMobile.js +0 -0
- package/src/{vcs/vcm/util → util}/layerCollection.js +89 -12
- package/src/util/locale.js +12 -0
- package/src/{vcs/vcm/util → util}/mapCollection.js +102 -45
- package/src/{vcs/vcm/util → util}/math.js +9 -0
- package/src/util/overrideCollection.js +223 -0
- package/src/{vcs/vcm/util → util}/projection.js +38 -28
- package/src/{vcs/vcm/util → util}/splitScreen.js +11 -11
- package/src/{vcs/vcm/util → util}/urlHelpers.js +0 -0
- package/src/{vcs/vcm/util → util}/viewpoint.js +17 -21
- package/src/vcsApp.js +571 -0
- package/src/vcsAppContextHelpers.js +121 -0
- package/src/{vcs/vcm/event/vcsEvent.js → vcsEvent.js} +2 -3
- package/src/{vcs/vcm/object.js → vcsObject.js} +1 -9
- package/tests/data/dynamicPointCzml.json +64 -0
- package/tests/data/oblique/imageData/imagev34.json +352 -0
- package/tests/data/oblique/imageData/imagev35.json +54 -0
- package/tests/data/oblique/imageData/imagev35PerImageSize.json +53 -0
- package/tests/data/oblique/tiledImageData/12/2199/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2199/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2199/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/image.json +1 -0
- package/tests/data/terrain/13/8800/6485.terrain +0 -0
- package/tests/data/terrain/13/8800/6486.terrain +0 -0
- package/tests/data/terrain/13/8801/6485.terrain +0 -0
- package/tests/data/terrain/13/8801/6486.terrain +0 -0
- package/tests/data/terrain/layer.json +136 -0
- package/tests/data/testGeoJSON.json +161 -0
- package/tests/data/tile.pbf +0 -0
- package/tests/unit/helpers/cesiumHelpers.js +289 -0
- package/tests/unit/helpers/getFileNameFromUrl.js +12 -0
- package/tests/unit/helpers/helpers.js +11 -0
- package/tests/unit/helpers/imageHelpers.js +20 -0
- package/tests/unit/helpers/importJSON.js +15 -0
- package/tests/unit/helpers/obliqueData.js +76 -0
- package/tests/unit/helpers/obliqueHelpers.js +112 -0
- package/tests/unit/helpers/openlayersHelpers.js +22 -0
- package/tests/unit/helpers/terrain/terrainData.js +46 -0
- package/src/vcs/vcm/classRegistry.js +0 -106
- package/src/vcs/vcm/globalCollections.js +0 -11
- package/src/vcs/vcm/layer/buildings.js +0 -17
- package/src/vcs/vcm/layer/cesium/pointCloudCesium.js +0 -58
- package/src/vcs/vcm/layer/openlayers/openStreetMapOpenlayers.js +0 -27
- package/src/vcs/vcm/layer/tileProvider/staticGeojsonTileProvider.js +0 -67
- package/src/vcs/vcm/layer/tileProvider/tileProviderFactory.js +0 -28
- package/src/vcs/vcm/util/dateTime.js +0 -60
- package/src/vcs/vcm/util/featureconverter/extent3d.js +0 -154
- package/src/vcs/vcm/util/locale.js +0 -53
- 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
|
|
19
|
-
static get className() { return '
|
|
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
|
-
|
|
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
|
|
254
|
+
export default VectorCesiumImpl;
|
|
File without changes
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ImageryLayer as CesiumImageryLayer, Rectangle } from '@vcmap/cesium';
|
|
2
2
|
import VectorTileImageryProvider from './vectorTileImageryProvider.js';
|
|
3
|
-
import
|
|
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
|
-
* @
|
|
10
|
-
* @extends {RasterLayerCesium}
|
|
9
|
+
* @extends {RasterLayerCesiumImpl}
|
|
11
10
|
* @implements {VectorTileImplementation}
|
|
12
11
|
*/
|
|
13
|
-
class
|
|
12
|
+
class VectorRasterTileCesiumImpl extends RasterLayerCesiumImpl {
|
|
14
13
|
static get className() {
|
|
15
|
-
return '
|
|
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
|
|
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 '
|
|
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
|
|
3
|
+
import RasterLayerCesiumImpl from './rasterLayerCesiumImpl.js';
|
|
4
4
|
import { wgs84Projection } from '../../util/projection.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* represents a specific Cesium
|
|
7
|
+
* represents a specific Cesium WmsCesiumImpl Layer class.
|
|
8
8
|
* @class
|
|
9
|
-
* @
|
|
10
|
-
* @extends {RasterLayerCesium}
|
|
9
|
+
* @extends {RasterLayerCesiumImpl}
|
|
11
10
|
*/
|
|
12
|
-
class
|
|
13
|
-
static get className() { return '
|
|
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
|
|
70
|
+
export default WmsCesiumImpl;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Rectangle, WebMapTileServiceImageryProvider, ImageryLayer as CesiumImageryLayer } from '@vcmap/cesium';
|
|
2
|
-
import
|
|
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
|
|
7
|
+
* represents a specific WmtsLayer Implementation for {@link CesiumMap}.
|
|
8
8
|
* @class
|
|
9
|
-
* @
|
|
10
|
-
* @extends {RasterLayerCesium}
|
|
9
|
+
* @extends {RasterLayerCesiumImpl}
|
|
11
10
|
*/
|
|
12
|
-
class
|
|
13
|
-
static get className() { return '
|
|
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
|
|
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.
|
|
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 {
|
|
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 '../
|
|
6
|
+
import VectorStyleItem from '../style/vectorStyleItem.js';
|
|
7
7
|
import FeatureLayer from './featureLayer.js';
|
|
8
|
-
import
|
|
9
|
-
import CesiumMap from '../
|
|
10
|
-
import VcsEvent from '../
|
|
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 {
|
|
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").
|
|
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
|
|
53
|
+
class CesiumTilesetLayer extends FeatureLayer {
|
|
56
54
|
/** @type {string} */
|
|
57
|
-
static get className() { return '
|
|
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 =
|
|
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").
|
|
115
|
-
this._splitDirection =
|
|
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
|
-
|
|
120
|
-
|
|
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").
|
|
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 {
|
|
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 {
|
|
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").
|
|
190
|
+
* @type {import("@vcmap/cesium").SplitDirection}
|
|
193
191
|
*/
|
|
194
192
|
get splitDirection() { return this._splitDirection; }
|
|
195
193
|
|
|
196
194
|
/**
|
|
197
|
-
* @param {import("@vcmap/cesium").
|
|
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 {
|
|
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<
|
|
224
|
+
* @returns {Array<CesiumTilesetCesiumImpl>}
|
|
227
225
|
*/
|
|
228
226
|
createImplementationsForMap(map) {
|
|
229
227
|
if (map instanceof CesiumMap) {
|
|
230
|
-
return [new
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
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 =
|
|
313
|
+
const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
|
|
316
314
|
if (this.highlightStyle) {
|
|
317
|
-
config.highlightStyle = this.highlightStyle
|
|
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 !==
|
|
353
|
-
config.splitDirection = this._splitDirection ===
|
|
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
|
-
|
|
376
|
-
export default
|
|
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
|
|
3
|
+
import DataSourceLayer from './dataSourceLayer.js';
|
|
4
4
|
import { vcsLayerName } from './layerSymbols.js';
|
|
5
|
-
import {
|
|
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
|
-
* @
|
|
16
|
-
* @extends {DataSource}
|
|
15
|
+
* @extends {DataSourceLayer}
|
|
17
16
|
*/
|
|
18
|
-
class
|
|
19
|
-
static get className() { return '
|
|
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
|
-
...
|
|
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 =
|
|
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
|
|
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
|
-
|
|
79
|
+
await /** @type {import("@vcmap/cesium").CzmlDataSource} */ (this.dataSource)
|
|
81
80
|
.load(this.url, this.sourceUri ? { sourceUri: this.sourceUri } : undefined);
|
|
82
|
-
|
|
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
|
-
|
|
141
|
-
export default
|
|
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 '../
|
|
4
|
-
import
|
|
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 {
|
|
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
|
|
38
|
-
static get className() { return '
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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<
|
|
163
|
+
* @returns {Array<DataSourceCesiumImpl>}
|
|
155
164
|
*/
|
|
156
165
|
createImplementationsForMap(map) {
|
|
157
166
|
if (map instanceof CesiumMap) {
|
|
158
|
-
return [new
|
|
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 {
|
|
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
|
-
|
|
259
|
-
export default
|
|
267
|
+
layerClassRegistry.registerClass(DataSourceLayer.className, DataSourceLayer);
|
|
268
|
+
export default DataSourceLayer;
|