@vcmap/core 5.0.0-rc.1 → 5.0.0-rc.12
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 +2085 -1969
- package/index.js +137 -131
- package/package.json +14 -22
- package/src/category/appBackedCategory.js +76 -0
- package/src/category/category.js +417 -0
- package/src/category/categoryCollection.js +145 -0
- package/src/cesium/cesium3DTileFeature.js +1 -1
- package/src/classRegistry.js +162 -0
- package/src/context.js +72 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +8 -9
- 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 -18
- package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +19 -18
- 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 -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} +38 -37
- package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +14 -17
- package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +38 -29
- package/src/{vcs/vcm/layer → layer}/featureLayer.js +27 -31
- package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +54 -54
- package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +98 -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} +19 -22
- package/src/{vcs/vcm/layer → layer}/globalHider.js +8 -32
- package/src/{vcs/vcm/layer → layer}/layer.js +63 -20
- 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} +32 -33
- 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} +26 -34
- package/src/{vcs/vcm/layer → layer}/rasterLayer.js +18 -20
- package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +20 -20
- package/src/{vcs/vcm/layer → layer}/terrainHelpers.js +13 -49
- package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +13 -14
- package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +5 -5
- package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +22 -5
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +81 -0
- package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +16 -8
- package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +20 -6
- package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +19 -20
- package/src/{vcs/vcm/layer → layer}/vectorHelpers.js +5 -5
- package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +38 -48
- 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} +55 -54
- package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +19 -20
- package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +1 -1
- package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +22 -23
- package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +20 -21
- package/src/{vcs/vcm/maps → map}/baseOLMap.js +5 -6
- package/src/{vcs/vcm/maps → map}/cameraLimiter.js +11 -17
- package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +21 -34
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +42 -57
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +17 -15
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +41 -22
- 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 +23 -86
- 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}/dateTime.js +0 -0
- package/src/{vcs/vcm/util → util}/exclusiveManager.js +0 -0
- package/src/{vcs/vcm/util → util}/extent.js +18 -12
- 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 -2
- package/src/{vcs/vcm/util → util}/isMobile.js +0 -0
- package/src/{vcs/vcm/util → util}/layerCollection.js +49 -12
- package/src/{vcs/vcm/util → util}/locale.js +1 -1
- 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 +39 -29
- 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 -9
- package/src/vcsApp.js +471 -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} +2 -10
- package/tests/data/buildings/tileset.json +428 -0
- 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 +272 -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/featureconverter/extent3d.js +0 -154
- package/src/vcs/vcm/util/style/styleFactory.js +0 -48
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
1
|
import Feature from 'ol/Feature.js';
|
|
3
|
-
import { Cesium3DTileFeature, Cesium3DTilePointFeature,
|
|
2
|
+
import { Cesium3DTileFeature, Cesium3DTilePointFeature, SplitDirection } from '@vcmap/cesium';
|
|
4
3
|
import VectorSource from 'ol/source/Vector.js';
|
|
5
4
|
import { createEmpty, extend as extendExtent } from 'ol/extent.js';
|
|
6
5
|
|
|
7
|
-
import
|
|
8
|
-
import { featureStoreStateSymbol,
|
|
6
|
+
import VectorLayer from './vectorLayer.js';
|
|
7
|
+
import { featureStoreStateSymbol, FeatureStoreLayerState } from './featureStoreLayerState.js';
|
|
9
8
|
import { parseGeoJSON } from './geojsonHelpers.js';
|
|
10
9
|
import { mercatorProjection } from '../util/projection.js';
|
|
11
|
-
import
|
|
12
|
-
import VectorStyleItem, { defaultVectorStyle, vectorStyleSymbol } from '../
|
|
10
|
+
import FeatureStoreLayerChanges from './featureStoreLayerChanges.js';
|
|
11
|
+
import VectorStyleItem, { defaultVectorStyle, vectorStyleSymbol } from '../style/vectorStyleItem.js';
|
|
13
12
|
import FeatureVisibility, {
|
|
14
13
|
FeatureVisibilityAction,
|
|
15
14
|
originalStyle,
|
|
16
15
|
synchronizeFeatureVisibility,
|
|
17
16
|
updateOriginalStyle,
|
|
18
17
|
} from './featureVisibility.js';
|
|
19
|
-
import
|
|
20
|
-
import CesiumMap from '../
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
18
|
+
import CesiumTilesetCesiumImpl, { getExtentFromTileset } from './cesium/cesiumTilesetCesiumImpl.js';
|
|
19
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
20
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
21
|
+
import ObliqueMap from '../map/obliqueMap.js';
|
|
22
|
+
import CesiumTilesetLayer from './cesiumTilesetLayer.js';
|
|
24
23
|
import VectorProperties from './vectorProperties.js';
|
|
25
|
-
import
|
|
24
|
+
import VectorOpenlayersImpl from './openlayers/vectorOpenlayersImpl.js';
|
|
26
25
|
import Layer from './layer.js';
|
|
27
|
-
import DeclarativeStyleItem from '../
|
|
28
|
-
import
|
|
26
|
+
import DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
27
|
+
import VectorObliqueImpl from './oblique/vectorObliqueImpl.js';
|
|
29
28
|
import Extent from '../util/extent.js';
|
|
30
29
|
import { isMobile } from '../util/isMobile.js';
|
|
31
|
-
import {
|
|
30
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
31
|
+
import { requestJson } from '../util/fetch.js';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @typedef {Object} FeatureStoreStaticRepresentation
|
|
@@ -43,7 +43,7 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
43
43
|
* @property {Object} properties - the properties bag
|
|
44
44
|
* @property {Object} geometry
|
|
45
45
|
* @property {Object|undefined} vcsMeta
|
|
46
|
-
* @property {
|
|
46
|
+
* @property {FeatureStoreLayerState} state
|
|
47
47
|
* @property {string} type - the featureType
|
|
48
48
|
* @todo write vcsMeta for features
|
|
49
49
|
* @todo set type to be one of an enum
|
|
@@ -66,7 +66,7 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @typedef {FeatureStoreLayerSchema} FeatureStoreOptions
|
|
69
|
-
* @property {Function|undefined} injectedFetchDynamicFeatureFunc - injected function for fetching dynamic features from a remote
|
|
69
|
+
* @property {Function|undefined} injectedFetchDynamicFeatureFunc - injected function for fetching dynamic features from a remote FeatureStoreLayer server
|
|
70
70
|
* @api
|
|
71
71
|
*/
|
|
72
72
|
|
|
@@ -74,14 +74,13 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
74
74
|
export const isTiledFeature = Symbol('isTiledFeature');
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* FeatureStoreLayer Layer
|
|
78
78
|
* @class
|
|
79
|
-
* @
|
|
80
|
-
* @extends {Vector}
|
|
79
|
+
* @extends {VectorLayer}
|
|
81
80
|
* @api
|
|
82
81
|
*/
|
|
83
|
-
class
|
|
84
|
-
static get className() { return '
|
|
82
|
+
class FeatureStoreLayer extends VectorLayer {
|
|
83
|
+
static get className() { return 'FeatureStoreLayer'; }
|
|
85
84
|
|
|
86
85
|
/**
|
|
87
86
|
* @returns {FeatureStoreOptions}
|
|
@@ -89,11 +88,11 @@ class FeatureStore extends Vector {
|
|
|
89
88
|
static getDefaultOptions() {
|
|
90
89
|
return {
|
|
91
90
|
id: '',
|
|
92
|
-
type: '
|
|
91
|
+
type: 'FeatureStoreLayer',
|
|
93
92
|
featureType: 'simple',
|
|
94
93
|
features: [],
|
|
95
|
-
...
|
|
96
|
-
projection: mercatorProjection.
|
|
94
|
+
...VectorLayer.getDefaultOptions(),
|
|
95
|
+
projection: mercatorProjection.toJSON(),
|
|
97
96
|
staticRepresentation: {},
|
|
98
97
|
hiddenStaticFeatureIds: [],
|
|
99
98
|
vcsMeta: {
|
|
@@ -108,7 +107,7 @@ class FeatureStore extends Vector {
|
|
|
108
107
|
* @param {FeatureStoreOptions} options
|
|
109
108
|
*/
|
|
110
109
|
constructor(options) {
|
|
111
|
-
const defaultOptions =
|
|
110
|
+
const defaultOptions = FeatureStoreLayer.getDefaultOptions();
|
|
112
111
|
const vectorOptions = {
|
|
113
112
|
projection: defaultOptions.projection,
|
|
114
113
|
...options,
|
|
@@ -116,8 +115,8 @@ class FeatureStore extends Vector {
|
|
|
116
115
|
super(vectorOptions);
|
|
117
116
|
this._supportedMaps = [
|
|
118
117
|
CesiumMap.className,
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
OpenlayersMap.className,
|
|
119
|
+
ObliqueMap.className,
|
|
121
120
|
];
|
|
122
121
|
|
|
123
122
|
/**
|
|
@@ -136,10 +135,10 @@ class FeatureStore extends Vector {
|
|
|
136
135
|
this.hiddenStaticFeatureIds = new Set(options.hiddenStaticFeatureIds || defaultOptions.hiddenStaticFeatureIds);
|
|
137
136
|
|
|
138
137
|
/**
|
|
139
|
-
* @type {
|
|
138
|
+
* @type {FeatureStoreLayerChanges}
|
|
140
139
|
* @api
|
|
141
140
|
*/
|
|
142
|
-
this.changeTracker = new
|
|
141
|
+
this.changeTracker = new FeatureStoreLayerChanges(this);
|
|
143
142
|
|
|
144
143
|
const { vcsMeta } = defaultOptions;
|
|
145
144
|
if (options.vcsMeta) {
|
|
@@ -249,7 +248,7 @@ class FeatureStore extends Vector {
|
|
|
249
248
|
_loadTwoDim() {
|
|
250
249
|
if (!this._twoDimLoaded) {
|
|
251
250
|
this._twoDimLoaded = (async () => {
|
|
252
|
-
const
|
|
251
|
+
const data = await requestJson(this.staticRepresentation.twoDim);
|
|
253
252
|
const { features } = parseGeoJSON(data, {
|
|
254
253
|
targetProjection: mercatorProjection,
|
|
255
254
|
dynamicStyle: true,
|
|
@@ -288,14 +287,14 @@ class FeatureStore extends Vector {
|
|
|
288
287
|
|
|
289
288
|
/**
|
|
290
289
|
* @param {import("@vcmap/core").VcsMap} map
|
|
291
|
-
* @returns {Array<
|
|
290
|
+
* @returns {Array<VectorObliqueImpl|import("@vcmap/core").VectorCesiumImpl|VectorOpenlayersImpl|CesiumTilesetCesiumImpl>}
|
|
292
291
|
*/
|
|
293
292
|
// @ts-ignore
|
|
294
293
|
createImplementationsForMap(map) {
|
|
295
294
|
const impls = /** @type {Array<import("@vcmap/core").LayerImplementation>} */
|
|
296
295
|
(super.createImplementationsForMap(map));
|
|
297
296
|
if (map instanceof CesiumMap && this.staticRepresentation && this.staticRepresentation.threeDim) {
|
|
298
|
-
impls.push(new
|
|
297
|
+
impls.push(new CesiumTilesetCesiumImpl(map, /** @type {CesiumTilesetImplementationOptions} */ ({
|
|
299
298
|
url: this.staticRepresentation.threeDim,
|
|
300
299
|
tilesetOptions: {
|
|
301
300
|
maximumScreenSpaceError: isMobile() ? this.screenSpaceErrorMobile : this.screenSpaceError,
|
|
@@ -310,19 +309,20 @@ class FeatureStore extends Vector {
|
|
|
310
309
|
name: this.name,
|
|
311
310
|
style: this.style,
|
|
312
311
|
featureVisibility: this._staticFeatureVisibility,
|
|
313
|
-
|
|
312
|
+
globalHider: this.globalHider,
|
|
313
|
+
splitDirection: SplitDirection.NONE,
|
|
314
314
|
jumpToLocation: false,
|
|
315
315
|
})));
|
|
316
316
|
} else if (this.staticRepresentation && this.staticRepresentation.twoDim) {
|
|
317
317
|
this._loadTwoDim();
|
|
318
|
-
if (map instanceof
|
|
319
|
-
impls.push(new
|
|
320
|
-
} else if (map instanceof
|
|
321
|
-
impls.push(new
|
|
318
|
+
if (map instanceof OpenlayersMap) {
|
|
319
|
+
impls.push(new VectorOpenlayersImpl(map, this._getTwoDimStaticImplOptions()));
|
|
320
|
+
} else if (map instanceof ObliqueMap) {
|
|
321
|
+
impls.push(new VectorObliqueImpl(map, this._getTwoDimStaticImplOptions()));
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
// eslint-disable-next-line max-len
|
|
325
|
-
return /** @type {Array<
|
|
325
|
+
return /** @type {Array<VectorObliqueImpl|import("@vcmap/core").VectorCesiumImpl|VectorOpenlayersImpl|CesiumTilesetCesiumImpl>} */ (impls);
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
/**
|
|
@@ -371,7 +371,7 @@ class FeatureStore extends Vector {
|
|
|
371
371
|
|
|
372
372
|
/**
|
|
373
373
|
* @inheritDoc
|
|
374
|
-
* @param {
|
|
374
|
+
* @param {import("ol/style/Style").default|import("ol/style/Style").StyleFunction|import("@vcmap/core").StyleItem} style
|
|
375
375
|
* @param {boolean=} silent
|
|
376
376
|
* @api
|
|
377
377
|
*/
|
|
@@ -409,7 +409,7 @@ class FeatureStore extends Vector {
|
|
|
409
409
|
*/
|
|
410
410
|
setEditing(symbol, featureType) {
|
|
411
411
|
this.getImplementations().forEach((impl) => {
|
|
412
|
-
if (impl instanceof
|
|
412
|
+
if (impl instanceof CesiumTilesetCesiumImpl) {
|
|
413
413
|
if (impl.initialized) {
|
|
414
414
|
if (featureType != null) {
|
|
415
415
|
impl.cesium3DTileset[symbol] = featureType;
|
|
@@ -447,7 +447,7 @@ class FeatureStore extends Vector {
|
|
|
447
447
|
*/
|
|
448
448
|
objectClickedHandler(feature) {
|
|
449
449
|
if ((feature instanceof Cesium3DTileFeature || feature instanceof Cesium3DTilePointFeature)) {
|
|
450
|
-
return
|
|
450
|
+
return CesiumTilesetLayer.prototype.objectClickedHandler.call(this, feature);
|
|
451
451
|
} else if (feature instanceof Feature) {
|
|
452
452
|
return super.objectClickedHandler(feature);
|
|
453
453
|
}
|
|
@@ -463,7 +463,7 @@ class FeatureStore extends Vector {
|
|
|
463
463
|
// @ts-ignore
|
|
464
464
|
return super.getGenericFeatureFromClickedObject(/** @type {VectorClickedObject} */ (object));
|
|
465
465
|
}
|
|
466
|
-
const generic =
|
|
466
|
+
const generic = CesiumTilesetLayer.prototype.getGenericFeatureFromClickedObject.call(this, object);
|
|
467
467
|
generic.layerName = this.name;
|
|
468
468
|
generic.layerClass = this.className;
|
|
469
469
|
return generic;
|
|
@@ -481,9 +481,9 @@ class FeatureStore extends Vector {
|
|
|
481
481
|
const extent = super.getZoomToExtent();
|
|
482
482
|
const mercatorExtent = extent ? extent.getCoordinatesInProjection(mercatorProjection) : createEmpty();
|
|
483
483
|
if (this.staticRepresentation.threeDim) {
|
|
484
|
-
const threeDImpl = /** @type {
|
|
484
|
+
const threeDImpl = /** @type {CesiumTilesetCesiumImpl} */ (this.getImplementations()
|
|
485
485
|
.find((impl) => {
|
|
486
|
-
return impl instanceof
|
|
486
|
+
return impl instanceof CesiumTilesetCesiumImpl && impl.cesium3DTileset;
|
|
487
487
|
}));
|
|
488
488
|
|
|
489
489
|
if (threeDImpl) {
|
|
@@ -497,7 +497,7 @@ class FeatureStore extends Vector {
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
const actualExtent = new Extent({
|
|
500
|
-
|
|
500
|
+
projection: mercatorProjection.toJSON(),
|
|
501
501
|
coordinates: mercatorExtent,
|
|
502
502
|
});
|
|
503
503
|
|
|
@@ -522,7 +522,7 @@ class FeatureStore extends Vector {
|
|
|
522
522
|
|
|
523
523
|
this.getImplementations()
|
|
524
524
|
.forEach((impl) => {
|
|
525
|
-
if (impl instanceof
|
|
525
|
+
if (impl instanceof CesiumTilesetCesiumImpl && impl.cesium3DTileset) {
|
|
526
526
|
impl.cesium3DTileset.maximumScreenSpaceError = value;
|
|
527
527
|
}
|
|
528
528
|
});
|
|
@@ -530,7 +530,7 @@ class FeatureStore extends Vector {
|
|
|
530
530
|
|
|
531
531
|
/**
|
|
532
532
|
* switch an array of static features to dynamic features
|
|
533
|
-
* This is done by hiding the static features and adding their dynamic counterparts to the
|
|
533
|
+
* This is done by hiding the static features and adding their dynamic counterparts to the FeatureStoreLayer layer
|
|
534
534
|
* @param {string|number} [featureId] input static feature ID
|
|
535
535
|
* @returns {Promise<import("ol").Feature<import("ol/geom/Geometry").default>>}
|
|
536
536
|
* @api
|
|
@@ -573,7 +573,7 @@ class FeatureStore extends Vector {
|
|
|
573
573
|
this.hiddenStaticFeatureIds.add(featureId);
|
|
574
574
|
const feature = new Feature();
|
|
575
575
|
feature.setId(featureId);
|
|
576
|
-
feature[featureStoreStateSymbol] =
|
|
576
|
+
feature[featureStoreStateSymbol] = FeatureStoreLayerState.STATIC;
|
|
577
577
|
this.changeTracker.removeFeature(feature);
|
|
578
578
|
}
|
|
579
579
|
|
|
@@ -596,9 +596,9 @@ class FeatureStore extends Vector {
|
|
|
596
596
|
* @inheritDoc
|
|
597
597
|
* @returns {FeatureStoreOptions}
|
|
598
598
|
*/
|
|
599
|
-
|
|
600
|
-
const config = /** @type {FeatureStoreOptions} */ (super.
|
|
601
|
-
const defaultOptions =
|
|
599
|
+
toJSON() {
|
|
600
|
+
const config = /** @type {FeatureStoreOptions} */ (super.toJSON());
|
|
601
|
+
const defaultOptions = FeatureStoreLayer.getDefaultOptions();
|
|
602
602
|
|
|
603
603
|
delete config.projection;
|
|
604
604
|
config.vcsMeta = this.vectorProperties
|
|
@@ -643,5 +643,5 @@ class FeatureStore extends Vector {
|
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
-
|
|
647
|
-
export default
|
|
646
|
+
layerClassRegistry.registerClass(FeatureStoreLayer.className, FeatureStoreLayer);
|
|
647
|
+
export default FeatureStoreLayer;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
1
|
import { unByKey } from 'ol/Observable.js';
|
|
3
2
|
import Feature from 'ol/Feature.js';
|
|
4
3
|
import { check } from '@vcsuite/check';
|
|
5
|
-
import {
|
|
4
|
+
import { FeatureStoreLayerState, featureStoreStateSymbol } from './featureStoreLayerState.js';
|
|
6
5
|
import { parseGeoJSON, writeGeoJSONFeature } from './geojsonHelpers.js';
|
|
7
|
-
import VcsObject from '../
|
|
6
|
+
import VcsObject from '../vcsObject.js';
|
|
7
|
+
import { requestJson } from '../util/fetch.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {Object} FeatureStoreTrackResults
|
|
@@ -26,22 +26,81 @@ import VcsObject from '../object.js';
|
|
|
26
26
|
* @property {boolean} changed
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {Object} CommitAction
|
|
31
|
+
* @property {string} action
|
|
32
|
+
* @property {import("ol/format/GeoJSON").GeoJSONFeature} feature
|
|
33
|
+
* @property {import("ol").Feature<import("ol/geom/Geometry").default>} original
|
|
34
|
+
* @property {function(string=):void} success
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {Set<import("ol").Feature<import("ol/geom/Geometry").default>>} added
|
|
39
|
+
* @param {Set<import("ol").Feature<import("ol/geom/Geometry").default>>} edited
|
|
40
|
+
* @param {Set<import("ol").Feature<import("ol/geom/Geometry").default>>} removed
|
|
41
|
+
* @returns {Array<CommitAction>}
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
export function createCommitActions(added, edited, removed) {
|
|
45
|
+
const actions = [];
|
|
46
|
+
added.forEach((f) => {
|
|
47
|
+
const feature = writeGeoJSONFeature(f, { writeStyle: true });
|
|
48
|
+
actions.push({
|
|
49
|
+
action: 'add',
|
|
50
|
+
feature,
|
|
51
|
+
original: f,
|
|
52
|
+
success(data) {
|
|
53
|
+
f.setId(data);
|
|
54
|
+
f[featureStoreStateSymbol] = FeatureStoreLayerState.DYNAMIC;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
edited.forEach((f) => {
|
|
60
|
+
const feature = writeGeoJSONFeature(f, { writeStyle: true });
|
|
61
|
+
feature._id = f.getId();
|
|
62
|
+
feature.geomety = 'test'; // XXX why test???
|
|
63
|
+
actions.push({
|
|
64
|
+
action: 'edit',
|
|
65
|
+
original: f,
|
|
66
|
+
feature,
|
|
67
|
+
success() {
|
|
68
|
+
if (f[featureStoreStateSymbol] === FeatureStoreLayerState.STATIC) {
|
|
69
|
+
f[featureStoreStateSymbol] = FeatureStoreLayerState.EDITED;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
removed.forEach((f) => {
|
|
76
|
+
const _id = f.getId();
|
|
77
|
+
actions.push({
|
|
78
|
+
original: f,
|
|
79
|
+
action: 'remove',
|
|
80
|
+
feature: { _id },
|
|
81
|
+
success() {},
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return actions;
|
|
86
|
+
}
|
|
87
|
+
|
|
29
88
|
/**
|
|
30
89
|
* do not construct directly, use the layers .changeTracker instead
|
|
31
90
|
* @class
|
|
32
91
|
* @extends {VcsObject}
|
|
33
92
|
* @api
|
|
34
93
|
*/
|
|
35
|
-
class
|
|
36
|
-
static get className() { return '
|
|
94
|
+
class FeatureStoreLayerChanges extends VcsObject {
|
|
95
|
+
static get className() { return 'FeatureStoreLayerChanges'; }
|
|
37
96
|
|
|
38
97
|
/**
|
|
39
|
-
* @param {import("@vcmap/core").
|
|
98
|
+
* @param {import("@vcmap/core").FeatureStoreLayer} layer
|
|
40
99
|
*/
|
|
41
100
|
constructor(layer) {
|
|
42
101
|
super({});
|
|
43
102
|
|
|
44
|
-
/** @type {import("@vcmap/core").
|
|
103
|
+
/** @type {import("@vcmap/core").FeatureStoreLayer} */
|
|
45
104
|
this.layer = layer;
|
|
46
105
|
/** @type {FeatureStoreChangesListeners} */
|
|
47
106
|
this._changesListeners = {
|
|
@@ -107,85 +166,42 @@ class FeatureStoreChanges extends VcsObject {
|
|
|
107
166
|
* @returns {Promise<void>}
|
|
108
167
|
* @api
|
|
109
168
|
*/
|
|
110
|
-
commitChanges(url) {
|
|
111
|
-
const actions =
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
original: f,
|
|
118
|
-
success(data) {
|
|
119
|
-
f.setId(data);
|
|
120
|
-
f[featureStoreStateSymbol] = featureStoreState.DYNAMIC;
|
|
169
|
+
async commitChanges(url) {
|
|
170
|
+
const actions = createCommitActions(this._addedFeatures, this._editedFeatures, this._removedFeatures);
|
|
171
|
+
if (actions.length > 0) {
|
|
172
|
+
const data = await requestJson(url.toString(), {
|
|
173
|
+
method: 'POST',
|
|
174
|
+
headers: {
|
|
175
|
+
'Content-Type': 'application/json',
|
|
121
176
|
},
|
|
177
|
+
body: JSON.stringify(actions.map(a => ({ action: a.action, feature: a.feature }))),
|
|
122
178
|
});
|
|
123
|
-
});
|
|
124
179
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
action: 'edit',
|
|
131
|
-
original: f,
|
|
132
|
-
feature,
|
|
133
|
-
success() {
|
|
134
|
-
if (f[featureStoreStateSymbol] === featureStoreState.STATIC) {
|
|
135
|
-
f[featureStoreStateSymbol] = featureStoreState.EDITED;
|
|
136
|
-
}
|
|
137
|
-
},
|
|
180
|
+
const failures = data.failedActions.map(({ index, error }) => {
|
|
181
|
+
const action = actions[index];
|
|
182
|
+
this.getLogger().log(`failed action ${action.action}: ${error}`);
|
|
183
|
+
actions[index] = null;
|
|
184
|
+
return this._resetFeature(action.original);
|
|
138
185
|
});
|
|
139
|
-
});
|
|
140
186
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
/** @type {Promise<void>} */
|
|
151
|
-
let promise = Promise.resolve();
|
|
152
|
-
if (actions.length) {
|
|
153
|
-
// @ts-ignore
|
|
154
|
-
promise = axios.post(url.toString(), actions.map(a => ({ action: a.action, feature: a.feature })))
|
|
155
|
-
.then(({ data }) => {
|
|
156
|
-
const failures = data.failedActions.map(({ index, error }) => {
|
|
157
|
-
const action = actions[index];
|
|
158
|
-
this.getLogger().log(`failed action ${action.action}: ${error}`);
|
|
159
|
-
actions[index] = null;
|
|
160
|
-
return this._resetFeature(action.original);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
actions
|
|
164
|
-
.filter(a => a)
|
|
165
|
-
.forEach(({ action, success }) => {
|
|
166
|
-
if (action === 'add') {
|
|
167
|
-
success(data.insertedIds.shift()._id); // XXX should this be shift or should we find the index?
|
|
168
|
-
} else {
|
|
169
|
-
success();
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
return Promise.all(failures);
|
|
187
|
+
actions
|
|
188
|
+
.filter(a => a)
|
|
189
|
+
.forEach(({ action, success }) => {
|
|
190
|
+
if (action === 'add') {
|
|
191
|
+
success(data.insertedIds.shift()._id); // XXX should this be shift or should we find the index?
|
|
192
|
+
} else {
|
|
193
|
+
success();
|
|
194
|
+
}
|
|
173
195
|
});
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this._convertedFeatures.forEach((f) => { promises.push(this._resetFeature(f)); });
|
|
180
|
-
return Promise.all(promises);
|
|
181
|
-
})
|
|
182
|
-
.then(() => {
|
|
183
|
-
this._resetValues();
|
|
184
|
-
})
|
|
185
|
-
.catch((err) => {
|
|
186
|
-
this._resetValues();
|
|
196
|
+
await Promise.all(failures);
|
|
197
|
+
} else {
|
|
198
|
+
try {
|
|
199
|
+
await Promise.all([...this._convertedFeatures].map(async (f) => { await this._resetFeature(f); }));
|
|
200
|
+
} catch (err) {
|
|
187
201
|
this.getLogger().error(err.message);
|
|
188
|
-
}
|
|
202
|
+
}
|
|
203
|
+
this._resetValues();
|
|
204
|
+
}
|
|
189
205
|
}
|
|
190
206
|
|
|
191
207
|
/**
|
|
@@ -222,7 +238,7 @@ class FeatureStoreChanges extends VcsObject {
|
|
|
222
238
|
return Promise.resolve();
|
|
223
239
|
}
|
|
224
240
|
|
|
225
|
-
if (feature[featureStoreStateSymbol] ===
|
|
241
|
+
if (feature[featureStoreStateSymbol] === FeatureStoreLayerState.STATIC) {
|
|
226
242
|
this.layer.resetStaticFeature(featureId);
|
|
227
243
|
return Promise.resolve();
|
|
228
244
|
}
|
|
@@ -279,7 +295,7 @@ class FeatureStoreChanges extends VcsObject {
|
|
|
279
295
|
if (!feature[featureStoreStateSymbol]) {
|
|
280
296
|
this._addedFeatures.add(feature);
|
|
281
297
|
this.values.changed = true;
|
|
282
|
-
} else if (feature[featureStoreStateSymbol] ===
|
|
298
|
+
} else if (feature[featureStoreStateSymbol] === FeatureStoreLayerState.STATIC) {
|
|
283
299
|
this._convertedFeatures.add(feature);
|
|
284
300
|
this.values.changed = true;
|
|
285
301
|
}
|
|
@@ -357,4 +373,4 @@ class FeatureStoreChanges extends VcsObject {
|
|
|
357
373
|
}
|
|
358
374
|
}
|
|
359
375
|
|
|
360
|
-
export default
|
|
376
|
+
export default FeatureStoreLayerChanges;
|
|
@@ -10,9 +10,8 @@ export const featureStoreStateSymbol = Symbol('vcsFeatureType');
|
|
|
10
10
|
* @property {string} STATIC
|
|
11
11
|
* @property {string} EDITED
|
|
12
12
|
* @api
|
|
13
|
-
* @export
|
|
14
13
|
*/
|
|
15
|
-
export const
|
|
14
|
+
export const FeatureStoreLayerState = {
|
|
16
15
|
DYNAMIC: 'dynamic',
|
|
17
16
|
STATIC: 'static',
|
|
18
17
|
EDITED: 'edited',
|
|
@@ -2,9 +2,9 @@ import { Color, Cesium3DTileFeature, Cesium3DTilePointFeature, Entity as CesiumE
|
|
|
2
2
|
import Feature from 'ol/Feature.js';
|
|
3
3
|
import Style from 'ol/style/Style.js';
|
|
4
4
|
|
|
5
|
-
import VectorStyleItem, { fromCesiumColor } from '../
|
|
6
|
-
import { emptyStyle } from '../
|
|
7
|
-
import VcsEvent from '../
|
|
5
|
+
import VectorStyleItem, { fromCesiumColor } from '../style/vectorStyleItem.js';
|
|
6
|
+
import { emptyStyle } from '../style/styleHelpers.js';
|
|
7
|
+
import VcsEvent from '../vcsEvent.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Set on an ol.Feature or Cesium.Cesium3DTileFeature to indicate its style before it was hidden or highlighted.
|
|
@@ -181,7 +181,6 @@ export function showFeature(feature, symbol) {
|
|
|
181
181
|
/**
|
|
182
182
|
* Enumeration of feature visibility actions.
|
|
183
183
|
* @enum {number}
|
|
184
|
-
* @export
|
|
185
184
|
* @api
|
|
186
185
|
* @property {number} HIGHLIGHT
|
|
187
186
|
* @property {number} UNHIGHLIGHT
|
|
@@ -232,6 +231,9 @@ export function synchronizeFeatureVisibility(source, destination) {
|
|
|
232
231
|
}
|
|
233
232
|
|
|
234
233
|
/**
|
|
234
|
+
* FeatureVisibility handles the visibility and highlighting of features of a specific {@link FeatureLayer} or {@link DataSourceLayer}
|
|
235
|
+
* and its {@link FeatureLayerImplementation} resp. {@link DataSourceCesiumImpl}.
|
|
236
|
+
* The visibility is being synchronized with the {@link GlobalHider}.
|
|
235
237
|
* @class
|
|
236
238
|
*/
|
|
237
239
|
class FeatureVisibility {
|
|
@@ -264,8 +266,9 @@ class FeatureVisibility {
|
|
|
264
266
|
usedStyle = fromCesiumColor(style);
|
|
265
267
|
} else if (style instanceof Style) {
|
|
266
268
|
usedStyle = new VectorStyleItem({});
|
|
267
|
-
if (style.getText() && style.getText().getText()) {
|
|
268
|
-
|
|
269
|
+
if (style.getText() && style.getText().getText() && !Array.isArray(style.getText().getText())) {
|
|
270
|
+
// getText can return a rich Text Array<string> We do not support this at the moment.
|
|
271
|
+
usedStyle.label = String(style.getText().getText());
|
|
269
272
|
}
|
|
270
273
|
usedStyle.style = style;
|
|
271
274
|
}
|