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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/index.d.ts +5 -5
  2. package/package.json +1 -1
  3. package/src/vcs/vcm/layer/cesiumTileset.js +3 -3
  4. package/src/vcs/vcm/layer/czml.js +2 -2
  5. package/src/vcs/vcm/layer/dataSource.js +2 -2
  6. package/src/vcs/vcm/layer/featureLayer.js +2 -2
  7. package/src/vcs/vcm/layer/featureStore.js +4 -4
  8. package/src/vcs/vcm/layer/geojson.js +4 -4
  9. package/src/vcs/vcm/layer/layer.js +3 -3
  10. package/src/vcs/vcm/layer/openStreetMap.js +2 -2
  11. package/src/vcs/vcm/layer/pointCloud.js +2 -2
  12. package/src/vcs/vcm/layer/rasterLayer.js +2 -2
  13. package/src/vcs/vcm/layer/singleImage.js +2 -2
  14. package/src/vcs/vcm/layer/terrain.js +2 -2
  15. package/src/vcs/vcm/layer/tileProvider/tileProvider.js +2 -2
  16. package/src/vcs/vcm/layer/tms.js +2 -2
  17. package/src/vcs/vcm/layer/vector.js +4 -4
  18. package/src/vcs/vcm/layer/vectorTile.js +3 -3
  19. package/src/vcs/vcm/layer/wfs.js +3 -3
  20. package/src/vcs/vcm/layer/wms.js +3 -3
  21. package/src/vcs/vcm/layer/wmts.js +2 -2
  22. package/src/vcs/vcm/maps/cameraLimiter.js +1 -1
  23. package/src/vcs/vcm/maps/cesium.js +3 -3
  24. package/src/vcs/vcm/maps/map.js +2 -2
  25. package/src/vcs/vcm/maps/oblique.js +2 -2
  26. package/src/vcs/vcm/maps/openlayers.js +2 -2
  27. package/src/vcs/vcm/object.js +1 -1
  28. package/src/vcs/vcm/util/extent.js +3 -3
  29. package/src/vcs/vcm/util/featureProvider/abstractFeatureProvider.js +2 -2
  30. package/src/vcs/vcm/util/featureProvider/wmsFeatureProvider.js +4 -4
  31. package/src/vcs/vcm/util/projection.js +1 -1
  32. package/src/vcs/vcm/util/style/styleItem.js +17 -0
  33. package/src/vcs/vcm/util/viewpoint.js +3 -3
package/index.d.ts CHANGED
@@ -4763,7 +4763,7 @@ export class CameraLimiter {
4763
4763
  * Limits the given camera based on this limiters specs.
4764
4764
  */
4765
4765
  limitCamera(camera: import("@vcmap/cesium").Camera): Promise<void>;
4766
- getConfigObject(): CameraLimiterOptions;
4766
+ toJSON(): CameraLimiterOptions;
4767
4767
  }
4768
4768
 
4769
4769
  /**
@@ -5326,7 +5326,7 @@ export class VcsObject {
5326
5326
  properties: any;
5327
5327
  readonly className: string;
5328
5328
  getLogger(): import("@vcsuite/logger").Logger;
5329
- getConfigObject(): VcsObjectOptions;
5329
+ toJSON(): VcsObjectOptions;
5330
5330
  destroy(): void;
5331
5331
  dispose(): void;
5332
5332
  }
@@ -6189,7 +6189,7 @@ export class Extent {
6189
6189
  * @returns true if extent is valid
6190
6190
  */
6191
6191
  isValid(): boolean;
6192
- getConfigObject(): ExtentOptions;
6192
+ toJSON(): ExtentOptions;
6193
6193
  clone(): Extent;
6194
6194
  equals(extent: Extent): boolean;
6195
6195
  /**
@@ -6278,7 +6278,7 @@ export class AbstractFeatureProvider {
6278
6278
  /**
6279
6279
  * Returns the object required to configure this feature provider.
6280
6280
  */
6281
- getConfigObject(): AbstractFeatureProviderOptions;
6281
+ toJSON(): AbstractFeatureProviderOptions;
6282
6282
  /**
6283
6283
  * Destroys this feature provider and detaches its resources
6284
6284
  */
@@ -6792,7 +6792,7 @@ export class Projection {
6792
6792
  /**
6793
6793
  * Returns the object literal representation of this object
6794
6794
  */
6795
- getConfigObject(): ProjectionOptions;
6795
+ toJSON(): ProjectionOptions;
6796
6796
  /**
6797
6797
  * Fast transform from Web-Mercator to WGS84
6798
6798
  * @param [inPlace] - whether to transform in place
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/core",
3
- "version": "5.0.0-rc.1",
3
+ "version": "5.0.0-rc.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -266,7 +266,7 @@ class CesiumTileset extends FeatureLayer {
266
266
  const threeDimExtent = getExtentFromTileset(impl.cesium3DTileset);
267
267
 
268
268
  const actualExtent = new Extent({
269
- ...mercatorProjection.getConfigObject(),
269
+ ...mercatorProjection.toJSON(),
270
270
  coordinates: threeDimExtent,
271
271
  });
272
272
 
@@ -309,9 +309,9 @@ class CesiumTileset extends FeatureLayer {
309
309
  /**
310
310
  * @returns {CesiumTilesetOptions}
311
311
  */
312
- getConfigObject() {
312
+ toJSON() {
313
313
  /** @type {CesiumTilesetOptions} */
314
- const config = super.getConfigObject();
314
+ const config = super.toJSON();
315
315
  const defaultOptions = CesiumTileset.getDefaultOptions();
316
316
  if (this.highlightStyle) {
317
317
  config.highlightStyle = this.highlightStyle[referenceableStyleSymbol] ?
@@ -102,8 +102,8 @@ class Czml extends DataSource {
102
102
  * @inheritDoc
103
103
  * @returns {CzmlOptions}
104
104
  */
105
- getConfigObject() {
106
- const config = /** @type {CzmlOptions} */ (super.getConfigObject());
105
+ toJSON() {
106
+ const config = /** @type {CzmlOptions} */ (super.toJSON());
107
107
  if (this.sourceUri) {
108
108
  config.sourceUri = this.sourceUri;
109
109
  }
@@ -235,8 +235,8 @@ class DataSource extends Layer {
235
235
  * @inheritDoc
236
236
  * @returns {DataSourceOptions}
237
237
  */
238
- getConfigObject() {
239
- const config = /** @type {DataSourceOptions} */ (super.getConfigObject());
238
+ toJSON() {
239
+ const config = /** @type {DataSourceOptions} */ (super.toJSON());
240
240
  if (Object.keys(this._genericFeatureProperties).length > 0) {
241
241
  config.genericFeatureProperties = { ...this._genericFeatureProperties };
242
242
  }
@@ -229,8 +229,8 @@ class FeatureLayer extends Layer {
229
229
  /**
230
230
  * @returns {FeatureLayerOptions}
231
231
  */
232
- getConfigObject() {
233
- const config = /** @type {FeatureLayerOptions} */ (super.getConfigObject());
232
+ toJSON() {
233
+ const config = /** @type {FeatureLayerOptions} */ (super.toJSON());
234
234
  if (!this.getStyleOrDefaultStyle().equals(this._style)) {
235
235
  if (this._style[referenceableStyleSymbol]) {
236
236
  config.style = this.style.getReference();
@@ -93,7 +93,7 @@ class FeatureStore extends Vector {
93
93
  featureType: 'simple',
94
94
  features: [],
95
95
  ...Vector.getDefaultOptions(),
96
- projection: mercatorProjection.getConfigObject(),
96
+ projection: mercatorProjection.toJSON(),
97
97
  staticRepresentation: {},
98
98
  hiddenStaticFeatureIds: [],
99
99
  vcsMeta: {
@@ -497,7 +497,7 @@ class FeatureStore extends Vector {
497
497
  }
498
498
 
499
499
  const actualExtent = new Extent({
500
- ...mercatorProjection.getConfigObject(),
500
+ ...mercatorProjection.toJSON(),
501
501
  coordinates: mercatorExtent,
502
502
  });
503
503
 
@@ -596,8 +596,8 @@ class FeatureStore extends Vector {
596
596
  * @inheritDoc
597
597
  * @returns {FeatureStoreOptions}
598
598
  */
599
- getConfigObject() {
600
- const config = /** @type {FeatureStoreOptions} */ (super.getConfigObject());
599
+ toJSON() {
600
+ const config = /** @type {FeatureStoreOptions} */ (super.toJSON());
601
601
  const defaultOptions = FeatureStore.getDefaultOptions();
602
602
 
603
603
  delete config.projection;
@@ -33,7 +33,7 @@ class GeoJSON extends Vector {
33
33
  static getDefaultOptions() {
34
34
  return {
35
35
  ...Vector.getDefaultOptions(),
36
- projection: wgs84Projection.getConfigObject(),
36
+ projection: wgs84Projection.toJSON(),
37
37
  features: undefined,
38
38
  };
39
39
  }
@@ -149,13 +149,13 @@ class GeoJSON extends Vector {
149
149
  * @inheritDoc
150
150
  * @returns {GeoJSONOptions}
151
151
  */
152
- getConfigObject() {
153
- const config = /** @type {GeoJSONOptions} */ (super.getConfigObject());
152
+ toJSON() {
153
+ const config = /** @type {GeoJSONOptions} */ (super.toJSON());
154
154
  const defaultOptions = GeoJSON.getDefaultOptions();
155
155
 
156
156
  const defaultProjection = new Projection(defaultOptions.projection);
157
157
  if (!this.projection.equals(defaultProjection)) {
158
- config.projection = this.projection.getConfigObject();
158
+ config.projection = this.projection.toJSON();
159
159
  } else {
160
160
  delete config.projection;
161
161
  }
@@ -680,9 +680,9 @@ class Layer extends VcsObject {
680
680
  /**
681
681
  * @returns {LayerOptions}
682
682
  */
683
- getConfigObject() {
683
+ toJSON() {
684
684
  /** @type {LayerOptions} */
685
- const config = super.getConfigObject();
685
+ const config = super.toJSON();
686
686
  const defaultOptions = Layer.getDefaultOptions();
687
687
 
688
688
  if (this.activeOnStartup !== defaultOptions.activeOnStartup) {
@@ -706,7 +706,7 @@ class Layer extends VcsObject {
706
706
  }
707
707
 
708
708
  if (this.extent && this.extent.isValid()) {
709
- config.extent = this.extent.getConfigObject();
709
+ config.extent = this.extent.toJSON();
710
710
  }
711
711
 
712
712
  if (this._exclusiveGroups.length > 0) {
@@ -160,8 +160,8 @@ class OpenStreetMap extends Layer {
160
160
  * @inheritDoc
161
161
  * @returns {OpenStreetMapOptions}
162
162
  */
163
- getConfigObject() {
164
- const config = /** @type {OpenStreetMapOptions} */ (super.getConfigObject());
163
+ toJSON() {
164
+ const config = /** @type {OpenStreetMapOptions} */ (super.toJSON());
165
165
  const defaultOptions = OpenStreetMap.getDefaultOptions();
166
166
 
167
167
  if (this._splitDirection !== ImagerySplitDirection.NONE) {
@@ -146,8 +146,8 @@ class PointCloud extends CesiumTileset {
146
146
  * @inheritDoc
147
147
  * @returns {PointCloudOptions}
148
148
  */
149
- getConfigObject() {
150
- const config = /** @type {PointCloudOptions} */ (super.getConfigObject());
149
+ toJSON() {
150
+ const config = /** @type {PointCloudOptions} */ (super.toJSON());
151
151
  const defaultOptions = PointCloud.getDefaultOptions();
152
152
 
153
153
  if (this.defaultPointSize !== defaultOptions.pointSize) {
@@ -248,8 +248,8 @@ class RasterLayer extends Layer {
248
248
  * @inheritDoc
249
249
  * @returns {RasterLayerOptions}
250
250
  */
251
- getConfigObject() {
252
- const config = /** @type {RasterLayerOptions} */ (super.getConfigObject());
251
+ toJSON() {
252
+ const config = /** @type {RasterLayerOptions} */ (super.toJSON());
253
253
  const defaultOptions = RasterLayer.getDefaultOptions();
254
254
 
255
255
  if (this.extent.equals(new Extent())) {
@@ -103,8 +103,8 @@ class SingleImage extends RasterLayer {
103
103
  * @inheritDoc
104
104
  * @returns {SingleImageOptions}
105
105
  */
106
- getConfigObject() {
107
- const config = /** @type {SingleImageOptions} */ (super.getConfigObject());
106
+ toJSON() {
107
+ const config = /** @type {SingleImageOptions} */ (super.toJSON());
108
108
  delete config.tilingSchema;
109
109
 
110
110
  if (this.credit) {
@@ -104,8 +104,8 @@ class Terrain extends Layer {
104
104
  /**
105
105
  * @returns {TerrainOptions}
106
106
  */
107
- getConfigObject() {
108
- const config = /** @type {TerrainOptions} */ (super.getConfigObject());
107
+ toJSON() {
108
+ const config = /** @type {TerrainOptions} */ (super.toJSON());
109
109
  const defaultOptions = Terrain.getDefaultOptions();
110
110
 
111
111
  if (this.requestVertexNormals !== defaultOptions.requestVertexNormals) {
@@ -530,8 +530,8 @@ class TileProvider extends VcsObject {
530
530
  * @returns {TileProviderOptions}
531
531
  * @api
532
532
  */
533
- getConfigObject() {
534
- const config = /** @type {TileProviderOptions} */ (super.getConfigObject());
533
+ toJSON() {
534
+ const config = /** @type {TileProviderOptions} */ (super.toJSON());
535
535
  const defaultOptions = TileProvider.getDefaultOptions();
536
536
 
537
537
  if (defaultOptions.tileCacheSize !== this.tileCacheSize) {
@@ -92,8 +92,8 @@ class TMS extends RasterLayer {
92
92
  * @inheritDoc
93
93
  * @returns {TMSOptions}
94
94
  */
95
- getConfigObject() {
96
- const config = /** @type {TMSOptions} */ (super.getConfigObject());
95
+ toJSON() {
96
+ const config = /** @type {TMSOptions} */ (super.toJSON());
97
97
  const defaultOptions = TMS.getDefaultOptions();
98
98
 
99
99
  if (this.tilingSchema !== defaultOptions.tilingSchema) {
@@ -538,7 +538,7 @@ class Vector extends FeatureLayer {
538
538
  return metaExtent;
539
539
  }
540
540
  const extent = new Extent({
541
- ...mercatorProjection.getConfigObject(),
541
+ ...mercatorProjection.toJSON(),
542
542
  coordinates: this.source.getExtent(),
543
543
  });
544
544
  if (extent.isValid()) {
@@ -573,12 +573,12 @@ class Vector extends FeatureLayer {
573
573
  /**
574
574
  * @returns {VectorOptions}
575
575
  */
576
- getConfigObject() {
577
- const config = /** @type {VectorOptions} */ (super.getConfigObject());
576
+ toJSON() {
577
+ const config = /** @type {VectorOptions} */ (super.toJSON());
578
578
  const defaultOptions = Vector.getDefaultOptions();
579
579
 
580
580
  if (this.projection.epsg !== getDefaultProjection().epsg) {
581
- config.projection = this.projection.getConfigObject();
581
+ config.projection = this.projection.toJSON();
582
582
  }
583
583
 
584
584
  if (this.maxResolution !== defaultOptions.maxResolution) {
@@ -448,8 +448,8 @@ class VectorTile extends FeatureLayer {
448
448
  * @inheritDoc
449
449
  * @returns {VectorTileOptions}
450
450
  */
451
- getConfigObject() {
452
- const config = /** @type {VectorTileOptions} */ (super.getConfigObject());
451
+ toJSON() {
452
+ const config = /** @type {VectorTileOptions} */ (super.toJSON());
453
453
  const defaultOptions = VectorTile.getDefaultOptions();
454
454
 
455
455
  if (this._maxLevel !== defaultOptions.maxLevel) {
@@ -466,7 +466,7 @@ class VectorTile extends FeatureLayer {
466
466
  }
467
467
 
468
468
  if (this.tileProvider) {
469
- const tileProviderConfig = this.tileProvider.getConfigObject();
469
+ const tileProviderConfig = this.tileProvider.toJSON();
470
470
  config.tileProvider = tileProviderConfig;
471
471
  } else if (this._tileProviderOptions) {
472
472
  config.tileProvider = this._tileProviderOptions;
@@ -40,7 +40,7 @@ class WFS extends Vector {
40
40
  * @param {WFSOptions} options
41
41
  */
42
42
  constructor(options) {
43
- const proj = new Projection(options.projection).getConfigObject();
43
+ const proj = new Projection(options.projection).toJSON();
44
44
  proj.alias = [`http://www.opengis.net/gml/srs/epsg.xml#${/** @type {string} */ (proj.epsg).match(/\d+/)[0]}`];
45
45
  options.projection = proj;
46
46
  super(options);
@@ -148,8 +148,8 @@ class WFS extends Vector {
148
148
  * @inheritDoc
149
149
  * @returns {WFSOptions}
150
150
  */
151
- getConfigObject() {
152
- const config = /** @type {WFSOptions} */ (super.getConfigObject());
151
+ toJSON() {
152
+ const config = /** @type {WFSOptions} */ (super.toJSON());
153
153
 
154
154
  config.featureType = this.featureType.slice();
155
155
  config.featureNS = this.featureNS;
@@ -192,8 +192,8 @@ class WMS extends RasterLayer {
192
192
  /**
193
193
  * @returns {WMSOptions}
194
194
  */
195
- getConfigObject() {
196
- const config = /** @type {WMSOptions} */ (super.getConfigObject());
195
+ toJSON() {
196
+ const config = /** @type {WMSOptions} */ (super.toJSON());
197
197
  const defaultOptions = WMS.getDefaultOptions();
198
198
 
199
199
  if (this.parameters.LAYERS) {
@@ -229,7 +229,7 @@ class WMS extends RasterLayer {
229
229
  }
230
230
 
231
231
  if (this.featureProvider && this.featureProvider instanceof WMSFeatureProvider) {
232
- const featureInfoConfig = this.featureProvider.getConfigObject();
232
+ const featureInfoConfig = this.featureProvider.toJSON();
233
233
  if (this.tileSize[0] === featureInfoConfig.tileSize[0] || this.tileSize[1] === featureInfoConfig.tileSize[1]) {
234
234
  delete featureInfoConfig.tileSize;
235
235
  }
@@ -176,8 +176,8 @@ class WMTS extends RasterLayer {
176
176
  * @inheritDoc
177
177
  * @returns {WMTSOptions}
178
178
  */
179
- getConfigObject() {
180
- const config = /** @type {WMTSOptions} */ (super.getConfigObject());
179
+ toJSON() {
180
+ const config = /** @type {WMTSOptions} */ (super.toJSON());
181
181
  const defaultOptions = WMTS.getDefaultOptions();
182
182
 
183
183
  if (this.tilingSchema !== defaultOptions.tilingSchema) {
@@ -194,7 +194,7 @@ class CameraLimiter {
194
194
  /**
195
195
  * @returns {CameraLimiterOptions}
196
196
  */
197
- getConfigObject() {
197
+ toJSON() {
198
198
  const config = {};
199
199
  const defaultOptions = CameraLimiter.getDefaultOptions();
200
200
  if (this.terrainUrl) {
@@ -1096,8 +1096,8 @@ class CesiumMap extends VcsMap {
1096
1096
  * @returns {CesiumMapOptions}
1097
1097
  * @api
1098
1098
  */
1099
- getConfigObject() {
1100
- const config = /** @type {CesiumMapOptions} */ (super.getConfigObject());
1099
+ toJSON() {
1100
+ const config = /** @type {CesiumMapOptions} */ (super.toJSON());
1101
1101
  const defaultOptions = CesiumMap.getDefaultOptions();
1102
1102
 
1103
1103
  if (this.enableLightning !== defaultOptions.enableLightning) {
@@ -1117,7 +1117,7 @@ class CesiumMap extends VcsMap {
1117
1117
  }
1118
1118
 
1119
1119
  if (this._cameraLimiter) {
1120
- config.cameraLimiter = this._cameraLimiter.getConfigObject();
1120
+ config.cameraLimiter = this._cameraLimiter.toJSON();
1121
1121
  } else if (this._cameraLimiterOptions && !this.initialized) {
1122
1122
  config.cameraLimiter = this._cameraLimiterOptions;
1123
1123
  }
@@ -464,8 +464,8 @@ class VcsMap extends VcsObject {
464
464
  * @returns {VcsMapOptions}
465
465
  * @api
466
466
  */
467
- getConfigObject() {
468
- const config = /** @type {VcsMapOptions} */ (super.getConfigObject());
467
+ toJSON() {
468
+ const config = /** @type {VcsMapOptions} */ (super.toJSON());
469
469
  if (this.fallbackMap) {
470
470
  config.fallbackMap = this.fallbackMap;
471
471
  }
@@ -497,8 +497,8 @@ class Oblique extends BaseOLMap {
497
497
  * @returns {ObliqueOptions}
498
498
  * @api
499
499
  */
500
- getConfigObject() {
501
- const config = /** @type {ObliqueOptions} */ (super.getConfigObject());
500
+ toJSON() {
501
+ const config = /** @type {ObliqueOptions} */ (super.toJSON());
502
502
  const defaultOptions = Oblique.getDefaultOptions();
503
503
 
504
504
  if (this.mapChangeEvent === 'movened') {
@@ -189,8 +189,8 @@ class Openlayers extends BaseOLMap {
189
189
  * @returns {OpenlayersOptions}
190
190
  * @api
191
191
  */
192
- getConfigObject() {
193
- const config = /** @type {OpenlayersOptions} */ (super.getConfigObject());
192
+ toJSON() {
193
+ const config = /** @type {OpenlayersOptions} */ (super.toJSON());
194
194
 
195
195
  const defaultOptions = Openlayers.getDefaultOptions();
196
196
  if (this.fixedNorthOrientation !== defaultOptions.fixedNorthOrientation) {
@@ -59,7 +59,7 @@ class VcsObject {
59
59
  * @returns {VcsObjectOptions}
60
60
  * @api
61
61
  */
62
- getConfigObject() {
62
+ toJSON() {
63
63
  const config = {
64
64
  type: this.className,
65
65
  name: this.name,
@@ -78,15 +78,15 @@ class Extent {
78
78
  /**
79
79
  * @returns {ExtentOptions}
80
80
  */
81
- getConfigObject() {
82
- return { coordinates: this.extent.slice(), ...this.projection.getConfigObject() };
81
+ toJSON() {
82
+ return { coordinates: this.extent.slice(), ...this.projection.toJSON() };
83
83
  }
84
84
 
85
85
  /**
86
86
  * @returns {Extent}
87
87
  */
88
88
  clone() {
89
- return new Extent(this.getConfigObject());
89
+ return new Extent(this.toJSON());
90
90
  }
91
91
 
92
92
  /**
@@ -154,9 +154,9 @@ class AbstractFeatureProvider extends VcsObject {
154
154
  * @returns {AbstractFeatureProviderOptions}
155
155
  * @api
156
156
  */
157
- getConfigObject() {
157
+ toJSON() {
158
158
  const config =
159
- /** @type {AbstractFeatureProviderOptions} */ (super.getConfigObject());
159
+ /** @type {AbstractFeatureProviderOptions} */ (super.toJSON());
160
160
 
161
161
  const defaultOptions = AbstractFeatureProvider.getDefaultOptions();
162
162
  delete config.name; // the name is irrelevant, since its the layers name
@@ -222,8 +222,8 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
222
222
  * @inheritDoc
223
223
  * @returns {WMSFeatureProviderOptions}
224
224
  */
225
- getConfigObject() {
226
- const config = /** @type {WMSFeatureProviderOptions} */ (super.getConfigObject());
225
+ toJSON() {
226
+ const config = /** @type {WMSFeatureProviderOptions} */ (super.toJSON());
227
227
  const defaultOptions = WMSFeatureProvider.getDefaultOptions();
228
228
  if (this.featureInfoResponseType !== defaultOptions.responseType) {
229
229
  config.responseType = this.featureInfoResponseType;
@@ -234,7 +234,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
234
234
  }
235
235
 
236
236
  if (this.projection !== defaultOptions.projection) {
237
- config.projection = this.projection.getConfigObject();
237
+ config.projection = this.projection.toJSON();
238
238
  }
239
239
 
240
240
  config.url = this._wmsSourceOptions.url;
@@ -259,7 +259,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
259
259
  config.tileSize = this._wmsSourceOptions.tileSize.slice();
260
260
  }
261
261
  if (this.extent) {
262
- config.extent = this.extent.getConfigObject();
262
+ config.extent = this.extent.toJSON();
263
263
  }
264
264
 
265
265
  return config;
@@ -262,7 +262,7 @@ class Projection {
262
262
  * @returns {ProjectionOptions}
263
263
  * @api stable
264
264
  */
265
- getConfigObject() {
265
+ toJSON() {
266
266
  const configObject = {
267
267
  epsg: this.epsg,
268
268
  };
@@ -162,6 +162,23 @@ class StyleItem extends VcsObject {
162
162
  return {};
163
163
  }
164
164
 
165
+ /**
166
+ * @inheritDoc
167
+ * @returns {StyleItemOptions}
168
+ */
169
+ toJSON() {
170
+ const config = { ...super.toJSON(), ...this.getOptions() };
171
+ if (this.title) {
172
+ config.title = this.title;
173
+ }
174
+
175
+ if (this.legend.length > 0) {
176
+ config.legend = this.legend.slice();
177
+ }
178
+
179
+ return config;
180
+ }
181
+
165
182
  /**
166
183
  * Clones this style
167
184
  * @param {StyleItem=} result
@@ -158,9 +158,9 @@ class ViewPoint extends VcsObject {
158
158
  * @returns {ViewPointOptions} returns a options object. This object can be used to reconstruct a new viewpoint
159
159
  * @api stable
160
160
  */
161
- getConfigObject() {
161
+ toJSON() {
162
162
  return {
163
- ...super.getConfigObject(),
163
+ ...super.toJSON(),
164
164
  distance: this.distance,
165
165
  cameraPosition: this.cameraPosition ? this.cameraPosition.slice() : null,
166
166
  groundPosition: this.groundPosition ? this.groundPosition.slice() : null,
@@ -179,7 +179,7 @@ class ViewPoint extends VcsObject {
179
179
  * @api stable
180
180
  */
181
181
  clone() {
182
- return new ViewPoint(this.getConfigObject());
182
+ return new ViewPoint(this.toJSON());
183
183
  }
184
184
 
185
185
  /**