@vcmap/core 5.0.0-rc.1 → 5.0.0-rc.10
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 +2208 -2072
- package/index.js +137 -131
- package/package.json +10 -22
- package/src/category/appBackedCategory.js +76 -0
- package/src/category/category.js +401 -0
- package/src/category/categoryCollection.js +145 -0
- package/src/cesium/cesium3DTileFeature.js +1 -1
- package/src/classRegistry.js +168 -0
- package/src/context.js +73 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +8 -8
- 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 +25 -17
- package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +19 -17
- package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +6 -9
- package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +3 -3
- package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +6 -19
- package/src/{vcs/vcm/interaction → interaction}/featureProviderInteraction.js +2 -13
- package/src/{vcs/vcm/interaction → interaction}/interactionChain.js +11 -31
- package/src/{vcs/vcm/interaction → interaction}/interactionType.js +0 -0
- package/src/{vcs/vcm/layer/cesium/cesiumTilesetCesium.js → layer/cesium/cesiumTilesetCesiumImpl.js} +8 -10
- package/src/{vcs/vcm/layer → layer}/cesium/clusterContext.js +0 -0
- package/src/{vcs/vcm/layer/cesium/dataSourceCesium.js → layer/cesium/dataSourceCesiumImpl.js} +5 -2
- package/src/{vcs/vcm/layer/cesium/openStreetMapCesium.js → layer/cesium/openStreetMapCesiumImpl.js} +6 -6
- package/src/{vcs/vcm/layer/cesium/rasterLayerCesium.js → layer/cesium/rasterLayerCesiumImpl.js} +5 -5
- package/src/{vcs/vcm/layer/cesium/singleImageCesium.js → layer/cesium/singleImageCesiumImpl.js} +5 -5
- package/src/{vcs/vcm/layer/cesium/terrainCesium.js → layer/cesium/terrainCesiumImpl.js} +4 -4
- package/src/{vcs/vcm/layer/cesium/tmsCesium.js → layer/cesium/tmsCesiumImpl.js} +6 -6
- package/src/{vcs/vcm/layer/cesium/vectorCesium.js → layer/cesium/vectorCesiumImpl.js} +3 -3
- package/src/{vcs/vcm/layer → layer}/cesium/vectorContext.js +0 -0
- package/src/{vcs/vcm/layer/cesium/vectorRasterTileCesium.js → layer/cesium/vectorRasterTileCesiumImpl.js} +5 -5
- package/src/{vcs/vcm/layer → layer}/cesium/vectorTileImageryProvider.js +1 -1
- package/src/{vcs/vcm/layer/cesium/wmsCesium.js → layer/cesium/wmsCesiumImpl.js} +6 -6
- package/src/{vcs/vcm/layer/cesium/wmtsCesium.js → layer/cesium/wmtsCesiumImpl.js} +6 -6
- package/src/{vcs/vcm/layer → layer}/cesium/x3dmHelper.js +0 -0
- package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +38 -36
- package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +14 -16
- package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +13 -13
- package/src/{vcs/vcm/layer → layer}/featureLayer.js +17 -30
- package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +53 -53
- package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +98 -82
- package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -1
- package/src/{vcs/vcm/layer → layer}/featureVisibility.js +6 -5
- package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +15 -37
- package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +19 -21
- package/src/{vcs/vcm/layer → layer}/globalHider.js +1 -11
- package/src/{vcs/vcm/layer → layer}/layer.js +11 -11
- package/src/{vcs/vcm/layer → layer}/layerImplementation.js +2 -2
- package/src/{vcs/vcm/layer → layer}/layerState.js +0 -0
- 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} +6 -6
- package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +32 -32
- package/src/{vcs/vcm/layer/openlayers/layerOpenlayers.js → layer/openlayers/layerOpenlayersImpl.js} +5 -5
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +27 -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 -6
- package/src/{vcs/vcm/layer/openlayers/tileDebugOpenlayers.js → layer/openlayers/tileDebugOpenlayersImpl.js} +5 -5
- package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js} +7 -7
- package/src/{vcs/vcm/layer/openlayers/vectorOpenlayers.js → layer/openlayers/vectorOpenlayersImpl.js} +6 -6
- package/src/{vcs/vcm/layer/openlayers/vectorTileOpenlayers.js → layer/openlayers/vectorTileOpenlayersImpl.js} +6 -6
- package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js} +7 -7
- package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js} +7 -7
- package/src/{vcs/vcm/layer/pointCloud.js → layer/pointCloudLayer.js} +26 -33
- package/src/{vcs/vcm/layer → layer}/rasterLayer.js +18 -18
- package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +20 -19
- package/src/{vcs/vcm/layer → layer}/terrainHelpers.js +13 -49
- package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +13 -13
- package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +5 -5
- package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +22 -4
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +82 -0
- package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +16 -7
- package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +20 -5
- package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +19 -19
- package/src/{vcs/vcm/layer → layer}/vectorHelpers.js +5 -5
- package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +38 -47
- package/src/{vcs/vcm/layer → layer}/vectorProperties.js +3 -3
- package/src/{vcs/vcm/layer → layer}/vectorSymbols.js +0 -0
- package/src/{vcs/vcm/layer/vectorTile.js → layer/vectorTileLayer.js} +32 -41
- package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +19 -19
- package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +1 -1
- package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +22 -22
- package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +20 -20
- package/src/{vcs/vcm/maps → map}/baseOLMap.js +5 -5
- package/src/{vcs/vcm/maps → map}/cameraLimiter.js +11 -16
- package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +21 -33
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -0
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +42 -56
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +17 -14
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +35 -20
- package/src/oblique/defaultObliqueCollection.js +62 -0
- package/src/{vcs/vcm/oblique → oblique}/helpers.js +13 -41
- package/src/{vcs/vcm/oblique/ObliqueCollection.js → oblique/obliqueCollection.js} +117 -36
- package/src/{vcs/vcm/oblique/ObliqueDataSet.js → oblique/obliqueDataSet.js} +67 -24
- package/src/{vcs/vcm/oblique/ObliqueImage.js → oblique/obliqueImage.js} +1 -1
- package/src/{vcs/vcm/oblique/ObliqueImageMeta.js → oblique/obliqueImageMeta.js} +4 -4
- package/src/{vcs/vcm/oblique/ObliqueProvider.js → oblique/obliqueProvider.js} +17 -11
- package/src/{vcs/vcm/oblique/ObliqueView.js → oblique/obliqueView.js} +31 -1
- package/src/{vcs/vcm/oblique/ObliqueViewDirection.js → oblique/obliqueViewDirection.js} +0 -0
- package/src/{vcs/vcm/oblique → oblique}/parseImageJson.js +20 -12
- package/src/ol/geom/circle.js +1 -1
- package/src/overrideClassRegistry.js +204 -0
- package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +43 -19
- package/src/{vcs/vcm/util/style → style}/shapesCategory.js +0 -0
- package/src/style/styleFactory.js +29 -0
- package/src/{vcs/vcm/util/style → style}/styleHelpers.js +3 -3
- package/src/{vcs/vcm/util/style → style}/styleItem.js +23 -85
- package/src/{vcs/vcm/util/style → style}/vectorStyleItem.js +73 -81
- package/src/{vcs/vcm/util/style → style}/writeStyle.js +4 -7
- package/src/{vcs/vcm/util → util}/clipping/clippingObject.js +10 -10
- package/src/{vcs/vcm/util → util}/clipping/clippingObjectManager.js +2 -2
- package/src/{vcs/vcm/util → util}/clipping/clippingPlaneHelper.js +4 -4
- package/src/{vcs/vcm/util → util}/collection.js +1 -1
- package/src/{vcs/vcm/util → util}/dateTime.js +0 -0
- package/src/{vcs/vcm/util → util}/exclusiveManager.js +0 -0
- package/src/{vcs/vcm/util → util}/extent.js +18 -11
- 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 +3 -3
- 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 -1
- package/src/{vcs/vcm/util → util}/isMobile.js +0 -0
- package/src/{vcs/vcm/util → util}/layerCollection.js +11 -6
- package/src/{vcs/vcm/util → util}/locale.js +1 -1
- package/src/{vcs/vcm/util → util}/mapCollection.js +63 -21
- package/src/{vcs/vcm/util → util}/math.js +0 -0
- package/src/util/overrideCollection.js +224 -0
- package/src/{vcs/vcm/util → util}/projection.js +39 -24
- 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 +5 -5
- package/src/vcsApp.js +471 -0
- package/src/vcsAppContextHelpers.js +121 -0
- package/src/{vcs/vcm/event/vcsEvent.js → vcsEvent.js} +2 -2
- package/src/{vcs/vcm/object.js → vcsObject.js} +2 -10
- 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/featureconverter/extent3d.js +0 -154
- package/src/vcs/vcm/util/style/styleFactory.js +0 -48
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
wgs84Projection,
|
|
11
11
|
wgs84ToMercatorTransformer,
|
|
12
12
|
} from '../../util/projection.js';
|
|
13
|
-
import VcsObject from '../../
|
|
14
|
-
import VcsEvent from '../../
|
|
13
|
+
import VcsObject from '../../vcsObject.js';
|
|
14
|
+
import VcsEvent from '../../vcsEvent.js';
|
|
15
|
+
import { tileProviderClassRegistry } from '../../classRegistry.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* @typedef {Object} tileProviderRTreeEntry
|
|
@@ -82,7 +83,7 @@ class TileProvider extends VcsObject {
|
|
|
82
83
|
* @readonly
|
|
83
84
|
* @returns {string}
|
|
84
85
|
*/
|
|
85
|
-
static get className() { return '
|
|
86
|
+
static get className() { return 'TileProvider'; }
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
89
|
* @returns {TileProviderOptions}
|
|
@@ -494,7 +495,7 @@ class TileProvider extends VcsObject {
|
|
|
494
495
|
}
|
|
495
496
|
|
|
496
497
|
/**
|
|
497
|
-
* Public API to load features from a source (for example a rest API, or
|
|
498
|
+
* Public API to load features from a source (for example a rest API, or WfsLayer)
|
|
498
499
|
*
|
|
499
500
|
* Can be used to write custom TileProvider to provide an interface to a "feature Source"
|
|
500
501
|
* Can also be used to manipulate the features, for example setting an ID Prefix or filter the features.
|
|
@@ -530,21 +531,28 @@ class TileProvider extends VcsObject {
|
|
|
530
531
|
* @returns {TileProviderOptions}
|
|
531
532
|
* @api
|
|
532
533
|
*/
|
|
533
|
-
|
|
534
|
-
const config = /** @type {TileProviderOptions} */ (super.
|
|
534
|
+
toJSON() {
|
|
535
|
+
const config = /** @type {TileProviderOptions} */ (super.toJSON());
|
|
535
536
|
const defaultOptions = TileProvider.getDefaultOptions();
|
|
536
537
|
|
|
537
538
|
if (defaultOptions.tileCacheSize !== this.tileCacheSize) {
|
|
538
539
|
config.tileCacheSize = this.tileCacheSize;
|
|
539
540
|
}
|
|
540
541
|
|
|
541
|
-
if (
|
|
542
|
+
if (!(
|
|
543
|
+
this.baseLevels.length === defaultOptions.baseLevels.length &&
|
|
544
|
+
this.baseLevels.every(level => defaultOptions.baseLevels.includes(level))
|
|
545
|
+
)) {
|
|
542
546
|
config.baseLevels = this.baseLevels.slice();
|
|
543
547
|
}
|
|
544
548
|
|
|
545
549
|
if (defaultOptions.trackFeaturesToTiles !== this.trackFeaturesToTiles) {
|
|
546
550
|
config.trackFeaturesToTiles = this.trackFeaturesToTiles;
|
|
547
551
|
}
|
|
552
|
+
|
|
553
|
+
if (defaultOptions.allowTileAggregation !== this.allowTileAggregation) {
|
|
554
|
+
config.allowTileAggregation = this.allowTileAggregation;
|
|
555
|
+
}
|
|
548
556
|
return config;
|
|
549
557
|
}
|
|
550
558
|
|
|
@@ -582,3 +590,4 @@ class TileProvider extends VcsObject {
|
|
|
582
590
|
}
|
|
583
591
|
|
|
584
592
|
export default TileProvider;
|
|
593
|
+
tileProviderClassRegistry.registerClass(TileProvider.className, TileProvider);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
1
|
import { Math as CesiumMath, Rectangle } from '@vcmap/cesium';
|
|
3
2
|
import { parseGeoJSON } from '../geojsonHelpers.js';
|
|
4
3
|
import TileProvider from './tileProvider.js';
|
|
5
4
|
import { getCurrentLocale } from '../../util/locale.js';
|
|
5
|
+
import { requestJson } from '../../util/fetch.js';
|
|
6
|
+
import { tileProviderClassRegistry } from '../../classRegistry.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @typedef {TileProviderOptions} URLTemplateTileProviderOptions
|
|
@@ -47,7 +48,7 @@ export function getURL(url, x, y, z, tilingExtent) {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
* TileProvider loads
|
|
51
|
+
* TileProvider loads GeojsonLayer from the provided URL. The URL has placeholders:
|
|
51
52
|
* the extent in latitude/longitude via: {minx}, {miny}, {maxx}, {maxy}
|
|
52
53
|
* tile Coordinates in x, y, z(level) via: {x}, {y}, {z}
|
|
53
54
|
* {locale} can be used to request locale aware content.
|
|
@@ -62,7 +63,7 @@ class URLTemplateTileProvider extends TileProvider {
|
|
|
62
63
|
* @readonly
|
|
63
64
|
* @returns {string}
|
|
64
65
|
*/
|
|
65
|
-
static get className() { return '
|
|
66
|
+
static get className() { return 'URLTemplateTileProvider'; }
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
69
|
* @returns {URLTemplateTileProviderOptions}
|
|
@@ -97,10 +98,24 @@ class URLTemplateTileProvider extends TileProvider {
|
|
|
97
98
|
async loader(x, y, z) {
|
|
98
99
|
const rectangle = this.tilingScheme.tileXYToRectangle(x, y, z);
|
|
99
100
|
const url = getURL(this.url, x, y, z, rectangle);
|
|
100
|
-
const
|
|
101
|
-
const { features } = parseGeoJSON(
|
|
101
|
+
const data = await requestJson(url);
|
|
102
|
+
const { features } = parseGeoJSON(data, { dynamicStyle: true });
|
|
102
103
|
return features;
|
|
103
104
|
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @returns {URLTemplateTileProviderOptions}
|
|
108
|
+
*/
|
|
109
|
+
toJSON() {
|
|
110
|
+
const config = /** @type {URLTemplateTileProviderOptions} */ (super.toJSON());
|
|
111
|
+
|
|
112
|
+
if (this.url) {
|
|
113
|
+
config.url = this.url;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return config;
|
|
117
|
+
}
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
export default URLTemplateTileProvider;
|
|
121
|
+
tileProviderClassRegistry.registerClass(URLTemplateTileProvider.className, URLTemplateTileProvider);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import RasterLayer from './rasterLayer.js';
|
|
2
|
-
import
|
|
3
|
-
import CesiumMap from '../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
3
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
4
|
+
import TmsOpenlayersImpl from './openlayers/tmsOpenlayersImpl.js';
|
|
5
|
+
import TmsCesiumImpl from './cesium/tmsCesiumImpl.js';
|
|
6
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @typedef {RasterLayerOptions} TMSOptions
|
|
@@ -19,14 +19,14 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* TmsLayer Layer
|
|
23
23
|
* @class
|
|
24
24
|
* @export
|
|
25
25
|
* @extends {RasterLayer}
|
|
26
26
|
* @api stable
|
|
27
27
|
*/
|
|
28
|
-
class
|
|
29
|
-
static get className() { return '
|
|
28
|
+
class TMSLayer extends RasterLayer {
|
|
29
|
+
static get className() { return 'TMSLayer'; }
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* @returns {TMSOptions}
|
|
@@ -44,12 +44,12 @@ class TMS extends RasterLayer {
|
|
|
44
44
|
* @param {TMSOptions} options
|
|
45
45
|
*/
|
|
46
46
|
constructor(options) {
|
|
47
|
-
const defaultOptions =
|
|
47
|
+
const defaultOptions = TMSLayer.getDefaultOptions();
|
|
48
48
|
options.tilingSchema = options.tilingSchema || defaultOptions.tilingSchema;
|
|
49
49
|
super(options);
|
|
50
50
|
|
|
51
51
|
this._supportedMaps = [
|
|
52
|
-
|
|
52
|
+
OpenlayersMap.className,
|
|
53
53
|
CesiumMap.className,
|
|
54
54
|
];
|
|
55
55
|
|
|
@@ -75,15 +75,15 @@ class TMS extends RasterLayer {
|
|
|
75
75
|
/**
|
|
76
76
|
* @inheritDoc
|
|
77
77
|
* @param {import("@vcmap/core").VcsMap} map
|
|
78
|
-
* @returns {Array<
|
|
78
|
+
* @returns {Array<TmsOpenlayersImpl|TmsCesiumImpl>}
|
|
79
79
|
*/
|
|
80
80
|
createImplementationsForMap(map) {
|
|
81
|
-
if (map instanceof
|
|
82
|
-
return [new
|
|
81
|
+
if (map instanceof OpenlayersMap) {
|
|
82
|
+
return [new TmsOpenlayersImpl(map, this.getImplementationOptions())];
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
if (map instanceof CesiumMap) {
|
|
86
|
-
return [new
|
|
86
|
+
return [new TmsCesiumImpl(map, this.getImplementationOptions())];
|
|
87
87
|
}
|
|
88
88
|
return [];
|
|
89
89
|
}
|
|
@@ -92,9 +92,9 @@ class TMS extends RasterLayer {
|
|
|
92
92
|
* @inheritDoc
|
|
93
93
|
* @returns {TMSOptions}
|
|
94
94
|
*/
|
|
95
|
-
|
|
96
|
-
const config = /** @type {TMSOptions} */ (super.
|
|
97
|
-
const defaultOptions =
|
|
95
|
+
toJSON() {
|
|
96
|
+
const config = /** @type {TMSOptions} */ (super.toJSON());
|
|
97
|
+
const defaultOptions = TMSLayer.getDefaultOptions();
|
|
98
98
|
|
|
99
99
|
if (this.tilingSchema !== defaultOptions.tilingSchema) {
|
|
100
100
|
config.tilingSchema = this.tilingSchema;
|
|
@@ -117,5 +117,5 @@ class TMS extends RasterLayer {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
export default
|
|
120
|
+
layerClassRegistry.registerClass(TMSLayer.className, TMSLayer);
|
|
121
|
+
export default TMSLayer;
|
|
@@ -6,7 +6,7 @@ import { FeatureVisibilityAction } from './featureVisibility.js';
|
|
|
6
6
|
import Projection from '../util/projection.js';
|
|
7
7
|
import { getHeightInfo } from '../util/featureconverter/featureconverterHelper.js';
|
|
8
8
|
import { getFlatCoordinatesFromGeometry } from '../util/geometryHelpers.js';
|
|
9
|
-
import
|
|
9
|
+
import Extent3D from '../util/featureconverter/extent3D.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Added to ol.source.Vector to determine, when the source has last had an update to its features visibility.
|
|
@@ -128,7 +128,7 @@ export function synchronizeFeatureVisibilityWithSource(featureVisibility, source
|
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* @param {VectorClickedObject} object
|
|
131
|
-
* @param {import("@vcmap/core").
|
|
131
|
+
* @param {import("@vcmap/core").VectorLayer|import("@vcmap/core").VectorTileLayer} layer
|
|
132
132
|
* @returns {?GenericFeature}
|
|
133
133
|
*/
|
|
134
134
|
export function getGenericFeatureFromClickedObject(object, layer) {
|
|
@@ -170,9 +170,9 @@ export function getGenericFeatureFromClickedObject(object, layer) {
|
|
|
170
170
|
const coordinates = getFlatCoordinatesFromGeometry(geometry);
|
|
171
171
|
const heightInfo = getHeightInfo(object, layer.vectorProperties, coordinates);
|
|
172
172
|
if (heightInfo.perPositionHeight || heightInfo.extruded) {
|
|
173
|
-
const extent =
|
|
174
|
-
|
|
175
|
-
heightOffset = extent
|
|
173
|
+
const extent = Extent3D.fromGeometry(geometry);
|
|
174
|
+
extent.extendWithHeightInfo(heightInfo);
|
|
175
|
+
heightOffset = extent.maxZ;
|
|
176
176
|
}
|
|
177
177
|
// edge case points are rendered depending on the terrain, so we set relativeToGround to true.
|
|
178
178
|
// In this case the heightAboveGroundAdjustment is also just an Offset.
|
|
@@ -6,9 +6,9 @@ import { check } from '@vcsuite/check';
|
|
|
6
6
|
import { parseBoolean } from '@vcsuite/parsers';
|
|
7
7
|
import Projection, { getDefaultProjection, mercatorProjection } from '../util/projection.js';
|
|
8
8
|
import Layer, { vcsMetaVersion } from './layer.js';
|
|
9
|
-
import VectorStyleItem, { defaultVectorStyle, vectorStyleSymbol } from '../
|
|
10
|
-
import DeclarativeStyleItem from '../
|
|
11
|
-
import writeStyle from '../
|
|
9
|
+
import VectorStyleItem, { defaultVectorStyle, vectorStyleSymbol } from '../style/vectorStyleItem.js';
|
|
10
|
+
import DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
11
|
+
import writeStyle from '../style/writeStyle.js';
|
|
12
12
|
import {
|
|
13
13
|
alreadyTransformedToImage,
|
|
14
14
|
alreadyTransformedToMercator,
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
import Extent from '../util/extent.js';
|
|
20
20
|
import VectorProperties from './vectorProperties.js';
|
|
21
21
|
import FeatureLayer from './featureLayer.js';
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import CesiumMap from '../
|
|
22
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
23
|
+
import VectorOpenlayersImpl from './openlayers/vectorOpenlayersImpl.js';
|
|
24
|
+
import VectorCesiumImpl from './cesium/vectorCesiumImpl.js';
|
|
25
|
+
import VectorObliqueImpl from './oblique/vectorObliqueImpl.js';
|
|
26
|
+
import ObliqueMap from '../map/obliqueMap.js';
|
|
27
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
28
28
|
import { originalStyle, updateOriginalStyle } from './featureVisibility.js';
|
|
29
|
-
import StyleItem
|
|
29
|
+
import StyleItem from '../style/styleItem.js';
|
|
30
30
|
import { getGenericFeatureFromClickedObject } from './vectorHelpers.js';
|
|
31
|
-
import {
|
|
31
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @typedef {FeatureLayerOptions} VectorOptions
|
|
@@ -82,18 +82,18 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
82
82
|
*/
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* VectorLayer Layer for OpenlayersMap, Cesium and ObliqueMap
|
|
86
86
|
* @class
|
|
87
87
|
* @export
|
|
88
88
|
* @extends {FeatureLayer}
|
|
89
89
|
* @api stable
|
|
90
90
|
*/
|
|
91
|
-
class
|
|
91
|
+
class VectorLayer extends FeatureLayer {
|
|
92
92
|
/**
|
|
93
93
|
* @readonly
|
|
94
94
|
* @returns {string}
|
|
95
95
|
*/
|
|
96
|
-
static get className() { return '
|
|
96
|
+
static get className() { return 'VectorLayer'; }
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* @returns {symbol}
|
|
@@ -150,11 +150,11 @@ class Vector extends FeatureLayer {
|
|
|
150
150
|
|
|
151
151
|
this._supportedMaps = [
|
|
152
152
|
CesiumMap.className,
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
ObliqueMap.className,
|
|
154
|
+
OpenlayersMap.className,
|
|
155
155
|
];
|
|
156
156
|
|
|
157
|
-
const defaultOptions =
|
|
157
|
+
const defaultOptions = VectorLayer.getDefaultOptions();
|
|
158
158
|
/** @type {import("ol/source").Vector<import("ol/geom/Geometry").default>} */
|
|
159
159
|
this.source = new VectorSource({});
|
|
160
160
|
|
|
@@ -213,17 +213,12 @@ class Vector extends FeatureLayer {
|
|
|
213
213
|
});
|
|
214
214
|
|
|
215
215
|
let initialStyle = options.style;
|
|
216
|
-
if (options.
|
|
217
|
-
initialStyle =
|
|
218
|
-
type: StyleType.REFERENCE,
|
|
219
|
-
name: options.activeStyleName,
|
|
220
|
-
};
|
|
221
|
-
} else if (options.style instanceof StyleItem) {
|
|
222
|
-
initialStyle = options.style.getOptions();
|
|
216
|
+
if (options.style instanceof StyleItem) {
|
|
217
|
+
initialStyle = options.style.toJSON();
|
|
223
218
|
}
|
|
224
219
|
|
|
225
220
|
/**
|
|
226
|
-
* @type {
|
|
221
|
+
* @type {StyleItemOptions}
|
|
227
222
|
* @private
|
|
228
223
|
*/
|
|
229
224
|
this._initialStyle = initialStyle;
|
|
@@ -321,30 +316,30 @@ class Vector extends FeatureLayer {
|
|
|
321
316
|
/**
|
|
322
317
|
* @inheritDoc
|
|
323
318
|
* @param {import("@vcmap/core").VcsMap} map
|
|
324
|
-
* @returns {Array<
|
|
319
|
+
* @returns {Array<VectorObliqueImpl|VectorCesiumImpl|VectorOpenlayersImpl>}
|
|
325
320
|
*/
|
|
326
321
|
createImplementationsForMap(map) {
|
|
327
322
|
if (!this.visibility) {
|
|
328
323
|
return [];
|
|
329
324
|
}
|
|
330
325
|
|
|
331
|
-
if (map instanceof
|
|
332
|
-
return [new
|
|
326
|
+
if (map instanceof OpenlayersMap) {
|
|
327
|
+
return [new VectorOpenlayersImpl(map, this.getImplementationOptions())];
|
|
333
328
|
}
|
|
334
329
|
|
|
335
330
|
if (map instanceof CesiumMap) {
|
|
336
|
-
return [new
|
|
331
|
+
return [new VectorCesiumImpl(map, this.getImplementationOptions())];
|
|
337
332
|
}
|
|
338
333
|
|
|
339
|
-
if (map instanceof
|
|
340
|
-
return [new
|
|
334
|
+
if (map instanceof ObliqueMap) {
|
|
335
|
+
return [new VectorObliqueImpl(map, this.getImplementationOptions())];
|
|
341
336
|
}
|
|
342
337
|
|
|
343
338
|
return [];
|
|
344
339
|
}
|
|
345
340
|
|
|
346
341
|
/**
|
|
347
|
-
* @param {(
|
|
342
|
+
* @param {(DeclarativeStyleItemOptions|VectorStyleItemOptions|import("@vcmap/core").StyleItem)=} styleOptions
|
|
348
343
|
* @param {import("@vcmap/core").VectorStyleItem=} defaultStyle
|
|
349
344
|
* @returns {import("@vcmap/core").StyleItem}
|
|
350
345
|
*/
|
|
@@ -354,7 +349,7 @@ class Vector extends FeatureLayer {
|
|
|
354
349
|
|
|
355
350
|
/**
|
|
356
351
|
* sets the style of this layer
|
|
357
|
-
* @param {import("ol/style/Style").default|import("ol/style/Style").StyleFunction|import("@vcmap/core").StyleItem
|
|
352
|
+
* @param {import("ol/style/Style").default|import("ol/style/Style").StyleFunction|import("@vcmap/core").StyleItem} style
|
|
358
353
|
* @param {boolean=} silent
|
|
359
354
|
*/
|
|
360
355
|
setStyle(style, silent) {
|
|
@@ -453,9 +448,9 @@ class Vector extends FeatureLayer {
|
|
|
453
448
|
if (this.projection.epsg !== mercatorProjection.epsg) {
|
|
454
449
|
const geometry = feature.getGeometry();
|
|
455
450
|
if (geometry) {
|
|
456
|
-
if (!geometry[
|
|
451
|
+
if (!geometry[VectorLayer.alreadyTransformedToMercator]) {
|
|
457
452
|
geometry.transform(this.projection.proj, mercatorProjection.proj);
|
|
458
|
-
geometry[
|
|
453
|
+
geometry[VectorLayer.alreadyTransformedToMercator] = true;
|
|
459
454
|
}
|
|
460
455
|
}
|
|
461
456
|
}
|
|
@@ -538,7 +533,7 @@ class Vector extends FeatureLayer {
|
|
|
538
533
|
return metaExtent;
|
|
539
534
|
}
|
|
540
535
|
const extent = new Extent({
|
|
541
|
-
|
|
536
|
+
projection: mercatorProjection.toJSON(),
|
|
542
537
|
coordinates: this.source.getExtent(),
|
|
543
538
|
});
|
|
544
539
|
if (extent.isValid()) {
|
|
@@ -573,12 +568,12 @@ class Vector extends FeatureLayer {
|
|
|
573
568
|
/**
|
|
574
569
|
* @returns {VectorOptions}
|
|
575
570
|
*/
|
|
576
|
-
|
|
577
|
-
const config = /** @type {VectorOptions} */ (super.
|
|
578
|
-
const defaultOptions =
|
|
571
|
+
toJSON() {
|
|
572
|
+
const config = /** @type {VectorOptions} */ (super.toJSON());
|
|
573
|
+
const defaultOptions = VectorLayer.getDefaultOptions();
|
|
579
574
|
|
|
580
575
|
if (this.projection.epsg !== getDefaultProjection().epsg) {
|
|
581
|
-
config.projection = this.projection.
|
|
576
|
+
config.projection = this.projection.toJSON();
|
|
582
577
|
}
|
|
583
578
|
|
|
584
579
|
if (this.maxResolution !== defaultOptions.maxResolution) {
|
|
@@ -594,9 +589,7 @@ class Vector extends FeatureLayer {
|
|
|
594
589
|
}
|
|
595
590
|
|
|
596
591
|
if (this.highlightStyle) {
|
|
597
|
-
config.highlightStyle = this.highlightStyle
|
|
598
|
-
this.highlightStyle.getReference() :
|
|
599
|
-
this.highlightStyle.getOptions();
|
|
592
|
+
config.highlightStyle = this.highlightStyle.toJSON();
|
|
600
593
|
}
|
|
601
594
|
|
|
602
595
|
if (this.isDynamic !== defaultOptions.isDynamic) {
|
|
@@ -608,8 +601,6 @@ class Vector extends FeatureLayer {
|
|
|
608
601
|
config.vectorProperties = vectorPropertiesConfig;
|
|
609
602
|
}
|
|
610
603
|
|
|
611
|
-
// XXX missing style
|
|
612
|
-
|
|
613
604
|
return config;
|
|
614
605
|
}
|
|
615
606
|
|
|
@@ -628,5 +619,5 @@ class Vector extends FeatureLayer {
|
|
|
628
619
|
}
|
|
629
620
|
}
|
|
630
621
|
|
|
631
|
-
|
|
632
|
-
export default
|
|
622
|
+
layerClassRegistry.registerClass(VectorLayer.className, VectorLayer);
|
|
623
|
+
export default VectorLayer;
|
|
@@ -3,13 +3,13 @@ import { HeightReference, ClassificationType, NearFarScalar, Cartesian3 } from '
|
|
|
3
3
|
import { check, checkMaybe } from '@vcsuite/check';
|
|
4
4
|
import { parseBoolean, parseEnumKey, parseNumber, parseInteger } from '@vcsuite/parsers';
|
|
5
5
|
import { getLogger as getLoggerByName } from '@vcsuite/logger';
|
|
6
|
-
import VcsEvent from '../
|
|
6
|
+
import VcsEvent from '../vcsEvent.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @returns {import("@vcsuite/logger").Logger}
|
|
10
10
|
*/
|
|
11
11
|
function getLogger() {
|
|
12
|
-
return getLoggerByName('
|
|
12
|
+
return getLoggerByName('VectorProperties');
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -162,7 +162,7 @@ export function getCartesian3Options(cartesian3) {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
|
-
* Properties Collection for
|
|
165
|
+
* Properties Collection for VectorLayer Features
|
|
166
166
|
* @class
|
|
167
167
|
* @export
|
|
168
168
|
* @api stable
|
|
File without changes
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import Style from 'ol/style/Style.js';
|
|
2
2
|
import { parseInteger } from '@vcsuite/parsers';
|
|
3
|
-
import CesiumMap from '../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
4
|
+
import VectorRasterTileCesiumImpl from './cesium/vectorRasterTileCesiumImpl.js';
|
|
5
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
6
|
+
import VectorTileOpenlayersImpl from './openlayers/vectorTileOpenlayersImpl.js';
|
|
7
7
|
import FeatureLayer from './featureLayer.js';
|
|
8
|
-
import VectorStyleItem, { defaultVectorStyle } from '../
|
|
8
|
+
import VectorStyleItem, { defaultVectorStyle } from '../style/vectorStyleItem.js';
|
|
9
9
|
import VectorProperties from './vectorProperties.js';
|
|
10
|
-
import DeclarativeStyleItem from '../
|
|
10
|
+
import DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
11
11
|
import { FeatureVisibilityAction, globalHidden, hidden, highlighted } from './featureVisibility.js';
|
|
12
12
|
import { getStylesArray } from '../util/featureconverter/convert.js';
|
|
13
13
|
import { vcsLayerName } from './layerSymbols.js';
|
|
14
|
-
import TileProviderFeatureProvider from '../
|
|
15
|
-
import tileProviderFactory from './tileProvider/tileProviderFactory.js';
|
|
14
|
+
import TileProviderFeatureProvider from '../featureProvider/tileProviderFeatureProvider.js';
|
|
16
15
|
import { getGenericFeatureFromClickedObject } from './vectorHelpers.js';
|
|
17
16
|
import { originalFeatureSymbol } from './vectorSymbols.js';
|
|
18
|
-
import {
|
|
17
|
+
import { getObjectFromClassRegistry, layerClassRegistry, tileProviderClassRegistry } from '../classRegistry.js';
|
|
18
|
+
import TileProvider from './tileProvider/tileProvider.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* synchronizes featureVisibility Symbols on the feature;
|
|
@@ -44,7 +44,7 @@ function synchronizeFeatureVisibility(featureVisibility, globalHider, feature) {
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* @typedef {FeatureLayerOptions} VectorTileOptions
|
|
47
|
-
* @property {TileProviderOptions} tileProvider
|
|
47
|
+
* @property {TileProviderOptions|import("@vcmap/core").TileProvider} tileProvider
|
|
48
48
|
* @property {VectorStyleItemOptions|import("@vcmap/core").VectorStyleItem|undefined} highlightStyle
|
|
49
49
|
* @property {VectorPropertiesOptions|undefined} vectorProperties
|
|
50
50
|
* @property {number|undefined} minLevel used to restrict the zoom level visibility (minlevel does not allow rendering above tileProvider baseLevel)
|
|
@@ -67,18 +67,18 @@ function synchronizeFeatureVisibility(featureVisibility, globalHider, feature) {
|
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* VectorTileLayer Layer for tiled vector Data. Can be connected to data with a TileProvider
|
|
71
71
|
* @class
|
|
72
72
|
* @export
|
|
73
73
|
* @extends {FeatureLayer}
|
|
74
74
|
* @api stable
|
|
75
75
|
*/
|
|
76
|
-
class
|
|
76
|
+
class VectorTileLayer extends FeatureLayer {
|
|
77
77
|
/**
|
|
78
78
|
* @readonly
|
|
79
79
|
* @returns {string}
|
|
80
80
|
*/
|
|
81
|
-
static get className() { return '
|
|
81
|
+
static get className() { return 'VectorTileLayer'; }
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* @returns {VectorTileOptions}
|
|
@@ -103,10 +103,10 @@ class VectorTile extends FeatureLayer {
|
|
|
103
103
|
|
|
104
104
|
this._supportedMaps = [
|
|
105
105
|
CesiumMap.className,
|
|
106
|
-
|
|
106
|
+
OpenlayersMap.className,
|
|
107
107
|
];
|
|
108
108
|
|
|
109
|
-
const defaultOptions =
|
|
109
|
+
const defaultOptions = VectorTileLayer.getDefaultOptions();
|
|
110
110
|
|
|
111
111
|
/** @type {VectorStyleItem} */
|
|
112
112
|
this.highlightStyle = /** @type {undefined} */ (defaultOptions.highlightStyle);
|
|
@@ -132,17 +132,13 @@ class VectorTile extends FeatureLayer {
|
|
|
132
132
|
...options.vectorProperties,
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
/**
|
|
136
|
-
* @type {TileProviderOptions}
|
|
137
|
-
* @private
|
|
138
|
-
*/
|
|
139
|
-
this._tileProviderOptions = options.tileProvider;
|
|
140
|
-
|
|
141
135
|
/**
|
|
142
136
|
* @type {import("@vcmap/core").TileProvider}
|
|
143
137
|
* @api
|
|
144
138
|
*/
|
|
145
|
-
this.tileProvider =
|
|
139
|
+
this.tileProvider = options.tileProvider instanceof TileProvider ? // XXX this now throws if not passing in a tileProvider.
|
|
140
|
+
options.tileProvider :
|
|
141
|
+
getObjectFromClassRegistry(tileProviderClassRegistry, options.tileProvider);
|
|
146
142
|
|
|
147
143
|
/**
|
|
148
144
|
* @type {number|undefined}
|
|
@@ -187,21 +183,19 @@ class VectorTile extends FeatureLayer {
|
|
|
187
183
|
* @returns {Promise<void>}
|
|
188
184
|
*/
|
|
189
185
|
async initialize() {
|
|
190
|
-
|
|
191
|
-
if (!this.tileProvider) {
|
|
192
|
-
this.tileProvider = await tileProviderFactory(this._tileProviderOptions);
|
|
193
|
-
// this.tileProvider = await tileProviderFactory(this._tileProviderOptions);
|
|
186
|
+
if (!this.initialized) {
|
|
194
187
|
this._tileLoadEventListener =
|
|
195
188
|
this.tileProvider.tileLoadedEvent.addEventListener(event => this._handleTileLoaded(event));
|
|
196
189
|
this._vectorPropertiesChangedListener =
|
|
197
190
|
this.vectorProperties.propertyChanged.addEventListener(() => {
|
|
198
191
|
this.reload();
|
|
199
192
|
});
|
|
200
|
-
this.featureProvider = new TileProviderFeatureProvider(this.name, {
|
|
193
|
+
this.featureProvider = new TileProviderFeatureProvider(this.name, { // XXX this overwrites
|
|
201
194
|
tileProvider: this.tileProvider,
|
|
202
195
|
vectorProperties: this.vectorProperties,
|
|
203
196
|
});
|
|
204
197
|
}
|
|
198
|
+
await super.initialize();
|
|
205
199
|
}
|
|
206
200
|
|
|
207
201
|
|
|
@@ -375,16 +369,16 @@ class VectorTile extends FeatureLayer {
|
|
|
375
369
|
/**
|
|
376
370
|
* @inheritDoc
|
|
377
371
|
* @param {import("@vcmap/core").VcsMap} map
|
|
378
|
-
* @returns {Array<
|
|
372
|
+
* @returns {Array<VectorRasterTileCesiumImpl|VectorTileOpenlayersImpl>}
|
|
379
373
|
*/
|
|
380
374
|
createImplementationsForMap(map) {
|
|
381
375
|
if (map instanceof CesiumMap) {
|
|
382
|
-
return [new
|
|
376
|
+
return [new VectorRasterTileCesiumImpl(map, this.getImplementationOptions())];
|
|
383
377
|
}
|
|
384
378
|
|
|
385
|
-
if (map instanceof
|
|
379
|
+
if (map instanceof OpenlayersMap) {
|
|
386
380
|
return [
|
|
387
|
-
new
|
|
381
|
+
new VectorTileOpenlayersImpl(map, this.getImplementationOptions()),
|
|
388
382
|
];
|
|
389
383
|
}
|
|
390
384
|
|
|
@@ -392,7 +386,7 @@ class VectorTile extends FeatureLayer {
|
|
|
392
386
|
}
|
|
393
387
|
|
|
394
388
|
/**
|
|
395
|
-
* @param {(
|
|
389
|
+
* @param {(DeclarativeStyleItemOptions|VectorStyleItemOptions|import("@vcmap/core").StyleItem)=} styleOptions
|
|
396
390
|
* @param {VectorStyleItem=} defaultStyle
|
|
397
391
|
* @returns {import("@vcmap/core").StyleItem}
|
|
398
392
|
*/
|
|
@@ -448,9 +442,9 @@ class VectorTile extends FeatureLayer {
|
|
|
448
442
|
* @inheritDoc
|
|
449
443
|
* @returns {VectorTileOptions}
|
|
450
444
|
*/
|
|
451
|
-
|
|
452
|
-
const config = /** @type {VectorTileOptions} */ (super.
|
|
453
|
-
const defaultOptions =
|
|
445
|
+
toJSON() {
|
|
446
|
+
const config = /** @type {VectorTileOptions} */ (super.toJSON());
|
|
447
|
+
const defaultOptions = VectorTileLayer.getDefaultOptions();
|
|
454
448
|
|
|
455
449
|
if (this._maxLevel !== defaultOptions.maxLevel) {
|
|
456
450
|
config.maxLevel = this._maxLevel;
|
|
@@ -466,15 +460,12 @@ class VectorTile extends FeatureLayer {
|
|
|
466
460
|
}
|
|
467
461
|
|
|
468
462
|
if (this.tileProvider) {
|
|
469
|
-
|
|
470
|
-
config.tileProvider = tileProviderConfig;
|
|
471
|
-
} else if (this._tileProviderOptions) {
|
|
472
|
-
config.tileProvider = this._tileProviderOptions;
|
|
463
|
+
config.tileProvider = this.tileProvider.toJSON();
|
|
473
464
|
}
|
|
474
465
|
|
|
475
466
|
return config;
|
|
476
467
|
}
|
|
477
468
|
}
|
|
478
469
|
|
|
479
|
-
|
|
480
|
-
export default
|
|
470
|
+
layerClassRegistry.registerClass(VectorTileLayer.className, VectorTileLayer);
|
|
471
|
+
export default VectorTileLayer;
|