@vcmap/core 5.0.0-rc.2 → 5.0.0-rc.20
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 +2221 -1992
- package/index.js +137 -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 +20 -19
- package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +7 -10
- package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +3 -3
- 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 +11 -32
- 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} +5 -3
- 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 +0 -0
- package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +36 -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} +7 -9
- 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} +6 -7
- 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} +7 -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 +5 -5
- 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 +0 -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} +18 -31
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +40 -55
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +15 -13
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +39 -20
- 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} +17 -12
- 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 +1 -1
- package/src/ol/render/canvas/canvasTileRenderer.js +0 -1
- package/src/overrideClassRegistry.js +204 -0
- package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +43 -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 +4 -8
- package/src/{vcs/vcm/util → util}/collection.js +16 -4
- 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 +0 -0
- package/src/{vcs/vcm/util → util}/featureconverter/convert.js +0 -0
- package/src/util/featureconverter/extent3D.js +181 -0
- package/src/{vcs/vcm/util → util}/featureconverter/featureconverterHelper.js +1 -1
- package/src/{vcs/vcm/util → util}/featureconverter/lineStringToCesium.js +0 -0
- package/src/{vcs/vcm/util → util}/featureconverter/pointToCesium.js +9 -6
- package/src/{vcs/vcm/util → util}/featureconverter/polygonToCesium.js +1 -1
- 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 +91 -34
- package/src/{vcs/vcm/util → util}/math.js +0 -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 +10 -10
- package/src/{vcs/vcm/util → util}/urlHelpers.js +0 -0
- package/src/{vcs/vcm/util → util}/viewpoint.js +2 -6
- 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 +290 -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
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SplitDirection } from '@vcmap/cesium';
|
|
2
2
|
|
|
3
3
|
import { parseNumberRange, parseInteger } from '@vcsuite/parsers';
|
|
4
4
|
import Layer from './layer.js';
|
|
5
|
-
import
|
|
6
|
-
import CesiumMap from '../
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import VcsEvent from '../
|
|
10
|
-
import {
|
|
5
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
6
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
7
|
+
import OpenStreetMapOpenlayersImpl from './openlayers/openStreetMapOpenlayersImpl.js';
|
|
8
|
+
import OpenStreetMapCesiumImpl from './cesium/openStreetMapCesiumImpl.js';
|
|
9
|
+
import VcsEvent from '../vcsEvent.js';
|
|
10
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {LayerOptions} OpenStreetMapOptions
|
|
@@ -18,15 +18,14 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* OpenStreetMapLayer Layer
|
|
22
22
|
* @class
|
|
23
|
-
* @export
|
|
24
23
|
* @extends {Layer}
|
|
25
24
|
* @api stable
|
|
26
25
|
* @implements {SplitLayer}
|
|
27
26
|
*/
|
|
28
|
-
class
|
|
29
|
-
static get className() { return '
|
|
27
|
+
class OpenStreetMapLayer extends Layer {
|
|
28
|
+
static get className() { return 'OpenStreetMapLayer'; }
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* @returns {OpenStreetMapOptions}
|
|
@@ -45,22 +44,22 @@ class OpenStreetMap extends Layer {
|
|
|
45
44
|
*/
|
|
46
45
|
constructor(options) {
|
|
47
46
|
super(options);
|
|
48
|
-
const defaultOptions =
|
|
47
|
+
const defaultOptions = OpenStreetMapLayer.getDefaultOptions();
|
|
49
48
|
/**
|
|
50
|
-
* @type {import("@vcmap/cesium").
|
|
49
|
+
* @type {import("@vcmap/cesium").SplitDirection}
|
|
51
50
|
* @private
|
|
52
51
|
*/
|
|
53
|
-
this._splitDirection =
|
|
52
|
+
this._splitDirection = SplitDirection.NONE;
|
|
54
53
|
|
|
55
54
|
if (options.splitDirection) {
|
|
56
55
|
this._splitDirection = options.splitDirection === 'left' ?
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
SplitDirection.LEFT :
|
|
57
|
+
SplitDirection.RIGHT;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
this._supportedMaps = [
|
|
62
61
|
CesiumMap.className,
|
|
63
|
-
|
|
62
|
+
OpenlayersMap.className,
|
|
64
63
|
];
|
|
65
64
|
|
|
66
65
|
/**
|
|
@@ -71,7 +70,7 @@ class OpenStreetMap extends Layer {
|
|
|
71
70
|
|
|
72
71
|
/**
|
|
73
72
|
* raised if the split direction changes, is passed the split direction as its only argument
|
|
74
|
-
* @type {VcsEvent<import("@vcmap/cesium").
|
|
73
|
+
* @type {VcsEvent<import("@vcmap/cesium").SplitDirection>}
|
|
75
74
|
* @api
|
|
76
75
|
*/
|
|
77
76
|
this.splitDirectionChanged = new VcsEvent();
|
|
@@ -86,18 +85,18 @@ class OpenStreetMap extends Layer {
|
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
87
|
* @api
|
|
89
|
-
* @type {import("@vcmap/cesium").
|
|
88
|
+
* @type {import("@vcmap/cesium").SplitDirection}
|
|
90
89
|
*/
|
|
91
90
|
get splitDirection() { return this._splitDirection; }
|
|
92
91
|
|
|
93
92
|
/**
|
|
94
|
-
* @param {import("@vcmap/cesium").
|
|
93
|
+
* @param {import("@vcmap/cesium").SplitDirection} direction
|
|
95
94
|
*/
|
|
96
95
|
set splitDirection(direction) {
|
|
97
96
|
if (direction !== this._splitDirection) {
|
|
98
97
|
this._splitDirection = direction;
|
|
99
98
|
this.getImplementations().forEach((impl) => {
|
|
100
|
-
/** @type {
|
|
99
|
+
/** @type {OpenStreetMapCesiumImpl|OpenStreetMapOpenlayersImpl} */
|
|
101
100
|
(impl).updateSplitDirection(this._splitDirection);
|
|
102
101
|
});
|
|
103
102
|
this.splitDirectionChanged.raiseEvent(this._splitDirection);
|
|
@@ -119,7 +118,7 @@ class OpenStreetMap extends Layer {
|
|
|
119
118
|
if (this._opacity !== parsedValue) {
|
|
120
119
|
this._opacity = parsedValue;
|
|
121
120
|
this.getImplementations().forEach((impl) => {
|
|
122
|
-
/** @type {
|
|
121
|
+
/** @type {OpenStreetMapCesiumImpl|OpenStreetMapOpenlayersImpl} */
|
|
123
122
|
(impl).updateOpacity(parsedValue);
|
|
124
123
|
});
|
|
125
124
|
}
|
|
@@ -143,15 +142,15 @@ class OpenStreetMap extends Layer {
|
|
|
143
142
|
/**
|
|
144
143
|
* @inheritDoc
|
|
145
144
|
* @param {import("@vcmap/core").VcsMap} map
|
|
146
|
-
* @returns {Array<
|
|
145
|
+
* @returns {Array<OpenStreetMapOpenlayersImpl|OpenStreetMapCesiumImpl>}
|
|
147
146
|
*/
|
|
148
147
|
createImplementationsForMap(map) {
|
|
149
|
-
if (map instanceof
|
|
150
|
-
return [new
|
|
148
|
+
if (map instanceof OpenlayersMap) {
|
|
149
|
+
return [new OpenStreetMapOpenlayersImpl(map, this.getImplementationOptions())];
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
if (map instanceof CesiumMap) {
|
|
154
|
-
return [new
|
|
153
|
+
return [new OpenStreetMapCesiumImpl(map, this.getImplementationOptions())];
|
|
155
154
|
}
|
|
156
155
|
return [];
|
|
157
156
|
}
|
|
@@ -162,10 +161,10 @@ class OpenStreetMap extends Layer {
|
|
|
162
161
|
*/
|
|
163
162
|
toJSON() {
|
|
164
163
|
const config = /** @type {OpenStreetMapOptions} */ (super.toJSON());
|
|
165
|
-
const defaultOptions =
|
|
164
|
+
const defaultOptions = OpenStreetMapLayer.getDefaultOptions();
|
|
166
165
|
|
|
167
|
-
if (this._splitDirection !==
|
|
168
|
-
config.splitDirection = this._splitDirection ===
|
|
166
|
+
if (this._splitDirection !== SplitDirection.NONE) {
|
|
167
|
+
config.splitDirection = this._splitDirection === SplitDirection.RIGHT ?
|
|
169
168
|
'right' :
|
|
170
169
|
'left';
|
|
171
170
|
}
|
|
@@ -190,5 +189,5 @@ class OpenStreetMap extends Layer {
|
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
|
|
194
|
-
export default
|
|
192
|
+
layerClassRegistry.registerClass(OpenStreetMapLayer.className, OpenStreetMapLayer);
|
|
193
|
+
export default OpenStreetMapLayer;
|
package/src/{vcs/vcm/layer/openlayers/layerOpenlayers.js → layer/openlayers/layerOpenlayersImpl.js}
RENAMED
|
@@ -4,14 +4,13 @@ import LayerImplementation from '../layerImplementation.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Layer implementation for {@link CesiumMap}.
|
|
6
6
|
* @class
|
|
7
|
-
* @
|
|
8
|
-
* @extends {LayerImplementation<import("@vcmap/core").Openlayers>}}
|
|
7
|
+
* @extends {LayerImplementation<import("@vcmap/core").OpenlayersMap>}}
|
|
9
8
|
*/
|
|
10
|
-
class
|
|
11
|
-
static get className() { return '
|
|
9
|
+
class LayerOpenlayersImpl extends LayerImplementation {
|
|
10
|
+
static get className() { return 'LayerOpenlayersImpl'; }
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
* @param {import("@vcmap/core").
|
|
13
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
15
14
|
* @param {LayerImplementationOptions} options
|
|
16
15
|
*/
|
|
17
16
|
constructor(map, options) {
|
|
@@ -76,4 +75,4 @@ class LayerOpenlayers extends LayerImplementation {
|
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
export default
|
|
78
|
+
export default LayerOpenlayersImpl;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Tile from 'ol/layer/Tile.js';
|
|
2
|
+
import OSM from 'ol/source/OSM.js';
|
|
3
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* represents a specific OpenStreetMapLayer layer for openlayers.
|
|
7
|
+
* @class
|
|
8
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
9
|
+
*/
|
|
10
|
+
class OpenStreetMapOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
11
|
+
static get className() { return 'OpenStreetMapOpenlayersImpl'; }
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @returns {import("ol/layer/Tile").default}
|
|
15
|
+
*/
|
|
16
|
+
getOLLayer() {
|
|
17
|
+
return new Tile({
|
|
18
|
+
opacity: this.opacity,
|
|
19
|
+
source: new OSM({
|
|
20
|
+
maxZoom: this.maxLevel,
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default OpenStreetMapOpenlayersImpl;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SplitDirection } from '@vcmap/cesium';
|
|
2
2
|
import { unByKey } from 'ol/Observable.js';
|
|
3
|
-
import
|
|
3
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* RasterLayer implementation for {@link Openlayers}
|
|
7
7
|
* @class
|
|
8
|
-
* @extends {
|
|
8
|
+
* @extends {LayerOpenlayersImpl}
|
|
9
9
|
* @implements {RasterLayerImplementation}
|
|
10
10
|
* @abstract
|
|
11
11
|
*/
|
|
12
|
-
class
|
|
13
|
-
static get className() { return '
|
|
12
|
+
class RasterLayerOpenlayersImpl extends LayerOpenlayersImpl {
|
|
13
|
+
static get className() { return 'RasterLayerOpenlayersImpl'; }
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {import("@vcmap/core").
|
|
16
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
17
17
|
* @param {RasterLayerImplementationOptions} options
|
|
18
18
|
*/
|
|
19
19
|
constructor(map, options) {
|
|
20
20
|
super(map, options);
|
|
21
|
-
/** @type {import("@vcmap/cesium").
|
|
21
|
+
/** @type {import("@vcmap/cesium").SplitDirection} */
|
|
22
22
|
this.splitDirection = options.splitDirection;
|
|
23
23
|
/** @type {number} */
|
|
24
24
|
this.minLevel = options.minLevel;
|
|
@@ -59,16 +59,16 @@ class RasterLayerOpenlayers extends LayerOpenlayers {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* @param {import("@vcmap/cesium").
|
|
62
|
+
* @param {import("@vcmap/cesium").SplitDirection} splitDirection
|
|
63
63
|
*/
|
|
64
64
|
updateSplitDirection(splitDirection) {
|
|
65
65
|
this.splitDirection = splitDirection;
|
|
66
66
|
if (this.initialized) {
|
|
67
|
-
if (this.splitDirection ===
|
|
67
|
+
if (this.splitDirection === SplitDirection.NONE && this._splitDirectionRenderListeners) {
|
|
68
68
|
unByKey(this._splitDirectionRenderListeners);
|
|
69
69
|
this._splitDirectionRenderListeners = null;
|
|
70
70
|
this.olLayer.changed();
|
|
71
|
-
} else if (splitDirection !==
|
|
71
|
+
} else if (splitDirection !== SplitDirection.NONE && !this._splitDirectionRenderListeners) {
|
|
72
72
|
this._splitDirectionRenderListeners = [];
|
|
73
73
|
this._splitDirectionRenderListeners
|
|
74
74
|
.push(/** @type {import("ol/events").EventsKey} */
|
|
@@ -77,7 +77,7 @@ class RasterLayerOpenlayers extends LayerOpenlayers {
|
|
|
77
77
|
this._splitDirectionRenderListeners
|
|
78
78
|
.push(/** @type {import("ol/events").EventsKey} */
|
|
79
79
|
(this.olLayer.on('postrender', (/** @type {import("ol/render/Event").default} */ event) => {
|
|
80
|
-
event.context.restore();
|
|
80
|
+
/** @type {CanvasRenderingContext2D} */ (event.context).restore();
|
|
81
81
|
})),
|
|
82
82
|
);
|
|
83
83
|
this.olLayer.changed();
|
|
@@ -93,12 +93,13 @@ class RasterLayerOpenlayers extends LayerOpenlayers {
|
|
|
93
93
|
if (!this.map.splitScreen) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
// eslint-disable-next-line prefer-destructuring
|
|
97
|
+
const context = /** @type {CanvasRenderingContext2D} */ (event.context);
|
|
97
98
|
const width = context.canvas.width * this.map.splitScreen.position;
|
|
98
99
|
context.save();
|
|
99
100
|
context.beginPath();
|
|
100
101
|
|
|
101
|
-
if (this.splitDirection ===
|
|
102
|
+
if (this.splitDirection === SplitDirection.LEFT) {
|
|
102
103
|
context.rect(0, 0, width, context.canvas.height);
|
|
103
104
|
} else {
|
|
104
105
|
context.rect(width, 0, context.canvas.width - width, context.canvas.height);
|
|
@@ -118,4 +119,4 @@ class RasterLayerOpenlayers extends LayerOpenlayers {
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
export default
|
|
122
|
+
export default RasterLayerOpenlayersImpl;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import ImageLayer from 'ol/layer/Image.js';
|
|
2
2
|
import ImageStatic from 'ol/source/ImageStatic.js';
|
|
3
|
-
import
|
|
3
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
4
4
|
import { wgs84Projection } from '../../util/projection.js';
|
|
5
5
|
import { isSameOrigin } from '../../util/urlHelpers.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* represents a specific OpenLayers SingleImageLayer Layer class.
|
|
9
9
|
* @class
|
|
10
|
-
* @
|
|
11
|
-
* @extends {RasterLayerOpenlayers}
|
|
10
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
12
11
|
*/
|
|
13
|
-
class
|
|
14
|
-
static get className() { return '
|
|
12
|
+
class SingleImageOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
13
|
+
static get className() { return 'SingleImageOpenlayersImpl'; }
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
|
-
* @param {import("@vcmap/core").
|
|
16
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
18
17
|
* @param {SingleImageImplementationOptions} options
|
|
19
18
|
*/
|
|
20
19
|
constructor(map, options) {
|
|
@@ -46,4 +45,4 @@ class SingleImageOpenlayers extends RasterLayerOpenlayers {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
export default
|
|
48
|
+
export default SingleImageOpenlayersImpl;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import Tile from 'ol/layer/Tile.js';
|
|
2
2
|
import TileDebug from 'ol/source/TileDebug.js';
|
|
3
|
-
import
|
|
3
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* layer Implementation to render tile boundaries.
|
|
7
7
|
* @class
|
|
8
|
-
* @
|
|
9
|
-
* @extends {LayerOpenlayers}
|
|
8
|
+
* @extends {LayerOpenlayersImpl}
|
|
10
9
|
* @implements {VectorTileImplementation}
|
|
11
10
|
*/
|
|
12
|
-
class
|
|
13
|
-
static get className() { return '
|
|
11
|
+
class TileDebugOpenlayersImpl extends LayerOpenlayersImpl {
|
|
12
|
+
static get className() { return 'TileDebugOpenlayersImpl'; }
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* @returns {import("ol/layer/Tile").default}
|
|
@@ -36,4 +35,4 @@ class TileDebugOpenlayers extends LayerOpenlayers {
|
|
|
36
35
|
updateTiles(args) {}
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
export default
|
|
38
|
+
export default TileDebugOpenlayersImpl;
|
package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js}
RENAMED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import XYZ from 'ol/source/XYZ.js';
|
|
2
2
|
import Tile from 'ol/layer/Tile.js';
|
|
3
3
|
import { mercatorProjection } from '../../util/projection.js';
|
|
4
|
-
import
|
|
4
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
5
5
|
import { TilingScheme } from '../rasterLayer.js';
|
|
6
6
|
import { isSameOrigin } from '../../util/urlHelpers.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* TmsLayer implementation for {@link Openlayers}.
|
|
10
10
|
* @class
|
|
11
|
-
* @
|
|
12
|
-
* @extends {RasterLayerOpenlayers}
|
|
11
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
13
12
|
*/
|
|
14
|
-
class
|
|
15
|
-
static get className() { return '
|
|
13
|
+
class TmsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
14
|
+
static get className() { return 'TmsOpenlayersImpl'; }
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* @param {import("@vcmap/core").
|
|
17
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
19
18
|
* @param {TMSImplementationOptions} options
|
|
20
19
|
*/
|
|
21
20
|
constructor(map, options) {
|
|
@@ -59,4 +58,4 @@ class TMSOpenlayers extends RasterLayerOpenlayers {
|
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
export default
|
|
61
|
+
export default TmsOpenlayersImpl;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import OLVectorLayer from 'ol/layer/Vector.js';
|
|
2
|
-
import
|
|
2
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
3
3
|
import { synchronizeFeatureVisibilityWithSource } from '../vectorHelpers.js';
|
|
4
|
-
import { getGlobalHider } from '../globalHider.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* represents a specific vectorlayer for openlayers.
|
|
8
7
|
* @class
|
|
9
|
-
* @export
|
|
10
8
|
* @implements {FeatureLayerImplementation}
|
|
11
|
-
* @extends {
|
|
9
|
+
* @extends {LayerOpenlayersImpl}
|
|
12
10
|
*/
|
|
13
|
-
class
|
|
14
|
-
static get className() { return '
|
|
11
|
+
class VectorOpenlayersImpl extends LayerOpenlayersImpl {
|
|
12
|
+
static get className() { return 'VectorOpenlayersImpl'; }
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
|
-
* @param {import("@vcmap/core").
|
|
15
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
18
16
|
* @param {VectorImplementationOptions} options
|
|
19
17
|
*/
|
|
20
18
|
constructor(map, options) {
|
|
@@ -36,7 +34,8 @@ class VectorOpenlayers extends LayerOpenlayers {
|
|
|
36
34
|
this._featureVisibilityListeners = [];
|
|
37
35
|
/** @type {import("ol/layer/Vector").default<import("ol/source").Vector<import("ol/geom/Geometry").default>>|null} */
|
|
38
36
|
this.olLayer = null;
|
|
39
|
-
|
|
37
|
+
/** @type {import("@vcmap/core").GlobalHider} */
|
|
38
|
+
this.globalHider = options.globalHider;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
/**
|
|
@@ -115,4 +114,4 @@ class VectorOpenlayers extends LayerOpenlayers {
|
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
export default
|
|
117
|
+
export default VectorOpenlayersImpl;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import OLVectorTileLayer from 'ol/layer/VectorTile.js';
|
|
2
2
|
import VectorTileSource from 'ol/source/VectorTile.js';
|
|
3
3
|
import TileState from 'ol/TileState.js';
|
|
4
|
-
import
|
|
4
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
5
5
|
import { mercatorProjection } from '../../util/projection.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* represents a specific vectorTileLayer for openlayers.
|
|
9
9
|
* @class
|
|
10
|
-
* @export
|
|
11
10
|
* @implements {VectorTileImplementation}
|
|
12
|
-
* @extends {
|
|
11
|
+
* @extends {LayerOpenlayersImpl}
|
|
13
12
|
*/
|
|
14
|
-
class
|
|
15
|
-
static get className() { return '
|
|
13
|
+
class VectorTileOpenlayersImpl extends LayerOpenlayersImpl {
|
|
14
|
+
static get className() { return 'VectorTileOpenlayersImpl'; }
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* @param {import("@vcmap/core").
|
|
17
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
19
18
|
* @param {VectorTileImplementationOptions} options
|
|
20
19
|
*/
|
|
21
20
|
constructor(map, options) {
|
|
@@ -174,4 +173,4 @@ class VectorTileOpenlayers extends LayerOpenlayers {
|
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
175
|
|
|
177
|
-
export default
|
|
176
|
+
export default VectorTileOpenlayersImpl;
|
package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js}
RENAMED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import Tile from 'ol/layer/Tile.js';
|
|
2
|
-
import
|
|
2
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
3
3
|
import { getWMSSource } from '../wmsHelpers.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* represents a specific Cesium
|
|
6
|
+
* represents a specific Cesium WmsOpenlayersImpl Layer class.
|
|
7
7
|
* @class
|
|
8
|
-
* @
|
|
9
|
-
* @extends {RasterLayerOpenlayers}
|
|
8
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
10
9
|
*/
|
|
11
|
-
class
|
|
12
|
-
static get className() { return '
|
|
10
|
+
class WmsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
11
|
+
static get className() { return 'WmsOpenlayersImpl'; }
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
|
-
* @param {import("@vcmap/core").
|
|
14
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
16
15
|
* @param {WMSImplementationOptions} options
|
|
17
16
|
*/
|
|
18
17
|
constructor(map, options) {
|
|
@@ -52,4 +51,4 @@ class WMSOpenlayers extends RasterLayerOpenlayers {
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
export default
|
|
54
|
+
export default WmsOpenlayersImpl;
|
package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js}
RENAMED
|
@@ -3,21 +3,20 @@ import WMTSTileGrid from 'ol/tilegrid/WMTS.js';
|
|
|
3
3
|
import Tile from 'ol/layer/Tile.js';
|
|
4
4
|
import WMTSSource from 'ol/source/WMTS.js';
|
|
5
5
|
import { wgs84Projection, mercatorProjection } from '../../util/projection.js';
|
|
6
|
-
import
|
|
6
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
7
7
|
import { TilingScheme } from '../rasterLayer.js';
|
|
8
8
|
import { isSameOrigin } from '../../util/urlHelpers.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* WmtsLayer implementation for {@link Openlayers}.
|
|
12
12
|
* @class
|
|
13
|
-
* @
|
|
14
|
-
* @extends {RasterLayerOpenlayers}
|
|
13
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
15
14
|
*/
|
|
16
|
-
class
|
|
17
|
-
static get className() { return '
|
|
15
|
+
class WmtsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
16
|
+
static get className() { return 'WmtsOpenlayersImpl'; }
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
|
-
* @param {import("@vcmap/core").
|
|
19
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
21
20
|
* @param {WMTSImplementationOptions} options
|
|
22
21
|
*/
|
|
23
22
|
constructor(map, options) {
|
|
@@ -138,4 +137,4 @@ class WMTSOpenlayers extends RasterLayerOpenlayers {
|
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
export default
|
|
140
|
+
export default WmtsOpenlayersImpl;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { checkMaybe } from '@vcsuite/check';
|
|
2
|
-
import
|
|
3
|
-
import DeclarativeStyleItem from '../
|
|
4
|
-
import VectorStyleItem from '../
|
|
5
|
-
import CesiumMap from '../
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
2
|
+
import CesiumTilesetLayer from './cesiumTilesetLayer.js';
|
|
3
|
+
import DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
4
|
+
import VectorStyleItem from '../style/vectorStyleItem.js';
|
|
5
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
6
|
+
import CesiumTilesetCesiumImpl from './cesium/cesiumTilesetCesiumImpl.js';
|
|
7
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {CesiumTilesetOptions} PointCloudOptions
|
|
@@ -24,7 +24,7 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
24
24
|
export const defaultPointCloudStyle = new DeclarativeStyleItem({});
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* represents a specific
|
|
27
|
+
* represents a specific PointCloudLayer layer for cesium.
|
|
28
28
|
* <h3>Config Parameter</h3>
|
|
29
29
|
* <ul>
|
|
30
30
|
* <li>url: string: url to the p3dm dataset
|
|
@@ -32,19 +32,18 @@ export const defaultPointCloudStyle = new DeclarativeStyleItem({});
|
|
|
32
32
|
* </ul>
|
|
33
33
|
*
|
|
34
34
|
* @class
|
|
35
|
-
* @
|
|
36
|
-
* @extends {CesiumTileset}
|
|
35
|
+
* @extends {CesiumTilesetLayer}
|
|
37
36
|
* @api stable
|
|
38
37
|
*/
|
|
39
|
-
class
|
|
40
|
-
static get className() { return '
|
|
38
|
+
class PointCloudLayer extends CesiumTilesetLayer {
|
|
39
|
+
static get className() { return 'PointCloudLayer'; }
|
|
41
40
|
|
|
42
41
|
/**
|
|
43
42
|
* @returns {PointCloudOptions}
|
|
44
43
|
*/
|
|
45
44
|
static getDefaultOptions() {
|
|
46
45
|
return {
|
|
47
|
-
...
|
|
46
|
+
...CesiumTilesetLayer.getDefaultOptions(),
|
|
48
47
|
pointSize: null,
|
|
49
48
|
};
|
|
50
49
|
}
|
|
@@ -55,7 +54,7 @@ class PointCloud extends CesiumTileset {
|
|
|
55
54
|
constructor(options) {
|
|
56
55
|
super(options);
|
|
57
56
|
|
|
58
|
-
const defaultOptions =
|
|
57
|
+
const defaultOptions = PointCloudLayer.getDefaultOptions();
|
|
59
58
|
/**
|
|
60
59
|
* The default point size to fall back on, if no point size is given. Uses Cesium default of 1 if null.
|
|
61
60
|
* @api
|
|
@@ -72,7 +71,7 @@ class PointCloud extends CesiumTileset {
|
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
73
|
* @inheritDoc
|
|
75
|
-
* @param {(
|
|
74
|
+
* @param {(DeclarativeStyleItemOptions|VectorStyleItemOptions|import("@vcmap/core").StyleItem)=} styleOptions
|
|
76
75
|
* @param {(VectorStyleItem|DeclarativeStyleItem)=} defaultStyle
|
|
77
76
|
* @returns {import("@vcmap/core").StyleItem}
|
|
78
77
|
*/
|
|
@@ -92,28 +91,21 @@ class PointCloud extends CesiumTileset {
|
|
|
92
91
|
set pointSize(size) {
|
|
93
92
|
checkMaybe(size, [Number, String]);
|
|
94
93
|
this._pointSize = size;
|
|
95
|
-
this.
|
|
96
|
-
/** @type {PointCloudCesium} */ (impl).updatePointSize(size);
|
|
97
|
-
});
|
|
94
|
+
/** @type {DeclarativeStyleItem} */ (this.style).pointSize = size?.toString();
|
|
98
95
|
}
|
|
99
96
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
getImplementationOptions() {
|
|
104
|
-
return {
|
|
105
|
-
...super.getImplementationOptions(),
|
|
106
|
-
pointSize: this.pointSize,
|
|
107
|
-
};
|
|
97
|
+
async initialize() {
|
|
98
|
+
await super.initialize();
|
|
99
|
+
this.pointSize = this._pointSize;
|
|
108
100
|
}
|
|
109
101
|
|
|
110
102
|
/**
|
|
111
103
|
* @param {import("@vcmap/core").VcsMap} map
|
|
112
|
-
* @returns {Array<
|
|
104
|
+
* @returns {Array<CesiumTilesetCesiumImpl>}
|
|
113
105
|
*/
|
|
114
106
|
createImplementationsForMap(map) {
|
|
115
107
|
if (map instanceof CesiumMap) {
|
|
116
|
-
return [new
|
|
108
|
+
return [new CesiumTilesetCesiumImpl(map, this.getImplementationOptions())];
|
|
117
109
|
}
|
|
118
110
|
|
|
119
111
|
return [];
|
|
@@ -129,8 +121,8 @@ class PointCloud extends CesiumTileset {
|
|
|
129
121
|
}
|
|
130
122
|
|
|
131
123
|
/**
|
|
132
|
-
* Sets a new declarative style. Cannot set a
|
|
133
|
-
* @param {
|
|
124
|
+
* Sets a new declarative style. Cannot set a VectorLayer style on PointCloudLayer layers.
|
|
125
|
+
* @param {import("ol/style/Style").default|import("ol/style/Style").StyleFunction|import("@vcmap/core").StyleItem} style
|
|
134
126
|
* @param {boolean=} silent
|
|
135
127
|
* @api
|
|
136
128
|
*/
|
|
@@ -148,7 +140,7 @@ class PointCloud extends CesiumTileset {
|
|
|
148
140
|
*/
|
|
149
141
|
toJSON() {
|
|
150
142
|
const config = /** @type {PointCloudOptions} */ (super.toJSON());
|
|
151
|
-
const defaultOptions =
|
|
143
|
+
const defaultOptions = PointCloudLayer.getDefaultOptions();
|
|
152
144
|
|
|
153
145
|
if (this.defaultPointSize !== defaultOptions.pointSize) {
|
|
154
146
|
config.pointSize = this.defaultPointSize;
|
|
@@ -158,5 +150,5 @@ class PointCloud extends CesiumTileset {
|
|
|
158
150
|
}
|
|
159
151
|
}
|
|
160
152
|
|
|
161
|
-
|
|
162
|
-
export default
|
|
153
|
+
layerClassRegistry.registerClass(PointCloudLayer.className, PointCloudLayer);
|
|
154
|
+
export default PointCloudLayer;
|