@vcmap/core 5.0.0-rc.36 → 5.0.0-rc.38

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 (136) hide show
  1. package/dist/src/category/category.js +2 -4
  2. package/dist/src/category/category.js.map +1 -1
  3. package/dist/src/interaction/featureProviderInteraction.js +4 -2
  4. package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
  5. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +1 -0
  6. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js +50 -3
  7. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
  8. package/dist/src/layer/cesium/openStreetMapCesiumImpl.d.ts +1 -1
  9. package/dist/src/layer/cesium/openStreetMapCesiumImpl.js +2 -2
  10. package/dist/src/layer/cesium/openStreetMapCesiumImpl.js.map +1 -1
  11. package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +1 -1
  12. package/dist/src/layer/cesium/rasterLayerCesiumImpl.js +6 -2
  13. package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
  14. package/dist/src/layer/cesium/singleImageCesiumImpl.d.ts +1 -1
  15. package/dist/src/layer/cesium/singleImageCesiumImpl.js +2 -3
  16. package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
  17. package/dist/src/layer/cesium/tmsCesiumImpl.d.ts +1 -1
  18. package/dist/src/layer/cesium/tmsCesiumImpl.js +2 -3
  19. package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
  20. package/dist/src/layer/cesium/vectorCesiumImpl.d.ts +1 -1
  21. package/dist/src/layer/cesium/vectorCesiumImpl.js +17 -15
  22. package/dist/src/layer/cesium/vectorCesiumImpl.js.map +1 -1
  23. package/dist/src/layer/cesium/vectorContext.d.ts +1 -0
  24. package/dist/src/layer/cesium/vectorContext.js +17 -5
  25. package/dist/src/layer/cesium/vectorContext.js.map +1 -1
  26. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.d.ts +1 -1
  27. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +2 -3
  28. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
  29. package/dist/src/layer/cesium/wmsCesiumImpl.d.ts +1 -1
  30. package/dist/src/layer/cesium/wmsCesiumImpl.js +1 -1
  31. package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
  32. package/dist/src/layer/cesium/wmtsCesiumImpl.d.ts +1 -1
  33. package/dist/src/layer/cesium/wmtsCesiumImpl.js +1 -1
  34. package/dist/src/layer/cesium/wmtsCesiumImpl.js.map +1 -1
  35. package/dist/src/layer/featureVisibility.d.ts +2 -2
  36. package/dist/src/layer/featureVisibility.js +3 -2
  37. package/dist/src/layer/featureVisibility.js.map +1 -1
  38. package/dist/src/layer/layer.d.ts +10 -0
  39. package/dist/src/layer/layer.js +10 -0
  40. package/dist/src/layer/layer.js.map +1 -1
  41. package/dist/src/layer/vectorLayer.d.ts +1 -0
  42. package/dist/src/layer/vectorLayer.js.map +1 -1
  43. package/dist/src/layer/vectorProperties.d.ts +12 -0
  44. package/dist/src/layer/vectorProperties.js +134 -0
  45. package/dist/src/layer/vectorProperties.js.map +1 -1
  46. package/dist/src/layer/wfsLayer.d.ts +5 -0
  47. package/dist/src/layer/wfsLayer.js +13 -3
  48. package/dist/src/layer/wfsLayer.js.map +1 -1
  49. package/dist/src/map/cesiumMap.d.ts +6 -0
  50. package/dist/src/map/cesiumMap.js +4 -1
  51. package/dist/src/map/cesiumMap.js.map +1 -1
  52. package/dist/src/oblique/obliqueCollection.d.ts +4 -3
  53. package/dist/src/oblique/obliqueCollection.js +9 -5
  54. package/dist/src/oblique/obliqueCollection.js.map +1 -1
  55. package/dist/src/style/styleHelpers.d.ts +2 -0
  56. package/dist/src/style/styleHelpers.js +9 -0
  57. package/dist/src/style/styleHelpers.js.map +1 -1
  58. package/dist/src/style/vectorStyleItem.d.ts +1 -1
  59. package/dist/src/util/editor/createFeatureSession.js +7 -0
  60. package/dist/src/util/editor/createFeatureSession.js.map +1 -1
  61. package/dist/src/util/editor/editFeaturesSession.js +13 -1
  62. package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
  63. package/dist/src/util/editor/editGeometrySession.js +15 -1
  64. package/dist/src/util/editor/editGeometrySession.js.map +1 -1
  65. package/dist/src/util/editor/editorHelpers.d.ts +2 -1
  66. package/dist/src/util/editor/editorHelpers.js +5 -0
  67. package/dist/src/util/editor/editorHelpers.js.map +1 -1
  68. package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +8 -1
  69. package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
  70. package/dist/src/util/editor/interactions/mapInteractionController.d.ts +1 -0
  71. package/dist/src/util/editor/interactions/mapInteractionController.js +3 -0
  72. package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
  73. package/dist/src/util/featureconverter/arcToCesium.d.ts +1 -1
  74. package/dist/src/util/featureconverter/arcToCesium.js +2 -2
  75. package/dist/src/util/featureconverter/arcToCesium.js.map +1 -1
  76. package/dist/src/util/featureconverter/convert.d.ts +1 -1
  77. package/dist/src/util/featureconverter/convert.js +13 -13
  78. package/dist/src/util/featureconverter/convert.js.map +1 -1
  79. package/dist/src/util/featureconverter/featureconverterHelper.js +1 -1
  80. package/dist/src/util/featureconverter/featureconverterHelper.js.map +1 -1
  81. package/dist/src/util/featureconverter/lineStringToCesium.d.ts +2 -2
  82. package/dist/src/util/featureconverter/lineStringToCesium.js +6 -6
  83. package/dist/src/util/featureconverter/lineStringToCesium.js.map +1 -1
  84. package/dist/src/util/featureconverter/pointHelpers.d.ts +4 -4
  85. package/dist/src/util/featureconverter/pointHelpers.js +34 -23
  86. package/dist/src/util/featureconverter/pointHelpers.js.map +1 -1
  87. package/dist/src/util/featureconverter/pointToCesium.d.ts +1 -1
  88. package/dist/src/util/featureconverter/pointToCesium.js +11 -5
  89. package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
  90. package/dist/src/util/featureconverter/polygonToCesium.d.ts +2 -2
  91. package/dist/src/util/featureconverter/polygonToCesium.js +13 -4
  92. package/dist/src/util/featureconverter/polygonToCesium.js.map +1 -1
  93. package/dist/src/vcsApp.d.ts +13 -1
  94. package/dist/src/vcsApp.js +22 -11
  95. package/dist/src/vcsApp.js.map +1 -1
  96. package/dist/src/vcsModule.d.ts +4 -0
  97. package/dist/src/vcsModule.js +12 -5
  98. package/dist/src/vcsModule.js.map +1 -1
  99. package/package.json +3 -3
  100. package/src/category/category.ts +2 -5
  101. package/src/cesium/cesium.d.ts +5 -1
  102. package/src/interaction/featureProviderInteraction.ts +10 -8
  103. package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +58 -5
  104. package/src/layer/cesium/openStreetMapCesiumImpl.ts +9 -7
  105. package/src/layer/cesium/rasterLayerCesiumImpl.ts +7 -3
  106. package/src/layer/cesium/singleImageCesiumImpl.ts +6 -4
  107. package/src/layer/cesium/tmsCesiumImpl.ts +5 -3
  108. package/src/layer/cesium/vectorCesiumImpl.ts +17 -15
  109. package/src/layer/cesium/vectorContext.ts +46 -33
  110. package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +8 -7
  111. package/src/layer/cesium/wmsCesiumImpl.ts +4 -2
  112. package/src/layer/cesium/wmtsCesiumImpl.ts +4 -2
  113. package/src/layer/featureVisibility.ts +3 -11
  114. package/src/layer/layer.ts +19 -0
  115. package/src/layer/vectorLayer.ts +5 -0
  116. package/src/layer/vectorProperties.ts +191 -0
  117. package/src/layer/wfsLayer.ts +21 -6
  118. package/src/map/cesiumMap.ts +12 -1
  119. package/src/oblique/obliqueCollection.ts +10 -9
  120. package/src/style/styleHelpers.ts +11 -0
  121. package/src/style/vectorStyleItem.ts +1 -1
  122. package/src/util/editor/createFeatureSession.ts +8 -0
  123. package/src/util/editor/editFeaturesSession.ts +17 -1
  124. package/src/util/editor/editGeometrySession.ts +17 -1
  125. package/src/util/editor/editorHelpers.ts +9 -1
  126. package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +11 -1
  127. package/src/util/editor/interactions/mapInteractionController.ts +4 -0
  128. package/src/util/featureconverter/arcToCesium.ts +3 -3
  129. package/src/util/featureconverter/convert.ts +50 -32
  130. package/src/util/featureconverter/featureconverterHelper.ts +5 -1
  131. package/src/util/featureconverter/lineStringToCesium.ts +38 -36
  132. package/src/util/featureconverter/pointHelpers.ts +167 -140
  133. package/src/util/featureconverter/pointToCesium.ts +15 -8
  134. package/src/util/featureconverter/polygonToCesium.ts +16 -1
  135. package/src/vcsApp.ts +35 -15
  136. package/src/vcsModule.ts +16 -5
@@ -301,6 +301,8 @@ class VectorContext implements CesiumVectorContext {
301
301
 
302
302
  featureToLabelMap: Map<Feature, Array<Label>> = new Map();
303
303
 
304
+ features: Set<Feature> = new Set();
305
+
304
306
  splitDirection: SplitDirection;
305
307
 
306
308
  private _rootCollection: PrimitiveCollection;
@@ -346,14 +348,16 @@ class VectorContext implements CesiumVectorContext {
346
348
  feature: Feature,
347
349
  allowPicking = false,
348
350
  ): void {
349
- addPrimitiveToContext(
350
- primitives,
351
- feature,
352
- allowPicking,
353
- this.primitives,
354
- this.featureToPrimitiveMap,
355
- this.splitDirection,
356
- );
351
+ if (this.features.has(feature)) {
352
+ addPrimitiveToContext(
353
+ primitives,
354
+ feature,
355
+ allowPicking,
356
+ this.primitives,
357
+ this.featureToPrimitiveMap,
358
+ this.splitDirection,
359
+ );
360
+ }
357
361
  }
358
362
 
359
363
  addScaledPrimitives(
@@ -367,15 +371,17 @@ class VectorContext implements CesiumVectorContext {
367
371
  feature: Feature,
368
372
  allowPicking = false,
369
373
  ): void {
370
- addPrimitiveToContext(
371
- primitives,
372
- feature,
373
- allowPicking,
374
- this.scaledPrimitives,
375
- this.featureToScaledPrimitiveMap,
376
- this.splitDirection,
377
- );
378
- this._scaledDirty.value = true;
374
+ if (this.features.has(feature)) {
375
+ addPrimitiveToContext(
376
+ primitives,
377
+ feature,
378
+ allowPicking,
379
+ this.scaledPrimitives,
380
+ this.featureToScaledPrimitiveMap,
381
+ this.splitDirection,
382
+ );
383
+ this._scaledDirty.value = true;
384
+ }
379
385
  }
380
386
 
381
387
  addBillboards(
@@ -383,14 +389,16 @@ class VectorContext implements CesiumVectorContext {
383
389
  feature: Feature,
384
390
  allowPicking = false,
385
391
  ): void {
386
- addPrimitiveToContext(
387
- billboardOptions,
388
- feature,
389
- allowPicking,
390
- this.billboards,
391
- this.featureToBillboardMap,
392
- this.splitDirection,
393
- );
392
+ if (this.features.has(feature)) {
393
+ addPrimitiveToContext(
394
+ billboardOptions,
395
+ feature,
396
+ allowPicking,
397
+ this.billboards,
398
+ this.featureToBillboardMap,
399
+ this.splitDirection,
400
+ );
401
+ }
394
402
  }
395
403
 
396
404
  addLabels(
@@ -398,20 +406,23 @@ class VectorContext implements CesiumVectorContext {
398
406
  feature: Feature,
399
407
  allowPicking = false,
400
408
  ): void {
401
- addPrimitiveToContext(
402
- labelOptions,
403
- feature,
404
- allowPicking,
405
- this.labels,
406
- this.featureToLabelMap,
407
- this.splitDirection,
408
- );
409
+ if (this.features.has(feature)) {
410
+ addPrimitiveToContext(
411
+ labelOptions,
412
+ feature,
413
+ allowPicking,
414
+ this.labels,
415
+ this.featureToLabelMap,
416
+ this.splitDirection,
417
+ );
418
+ }
409
419
  }
410
420
 
411
421
  /**
412
422
  * @param feature
413
423
  */
414
424
  removeFeature(feature: Feature): void {
425
+ this.features.delete(feature);
415
426
  removeFeatureFromMap(feature, this.featureToPrimitiveMap, this.primitives);
416
427
  this._scaledDirty.value = removeFeatureFromMap(
417
428
  feature,
@@ -472,6 +483,7 @@ class VectorContext implements CesiumVectorContext {
472
483
  this.featureToPrimitiveMap.clear();
473
484
  this._scaledDirty.value = this.featureToScaledPrimitiveMap.size > 0;
474
485
  this.featureToScaledPrimitiveMap.clear();
486
+ this.features.clear();
475
487
  }
476
488
 
477
489
  /**
@@ -490,6 +502,7 @@ class VectorContext implements CesiumVectorContext {
490
502
  this.featureToBillboardMap.clear();
491
503
  this.featureToLabelMap.clear();
492
504
  this.featureToPrimitiveMap.clear();
505
+ this.features.clear();
493
506
  this.featureToScaledPrimitiveMap.clear();
494
507
  this._postRenderListener();
495
508
  }
@@ -43,7 +43,7 @@ class VectorRasterTileCesiumImpl extends RasterLayerCesiumImpl {
43
43
  this.tileSize = options.tileSize;
44
44
  }
45
45
 
46
- getCesiumLayer(): CesiumImageryLayer {
46
+ getCesiumLayer(): Promise<CesiumImageryLayer> {
47
47
  this.imageryProvider = new VectorTileImageryProvider({
48
48
  tileProvider: this.tileProvider,
49
49
  tileSize: this.tileSize,
@@ -64,13 +64,14 @@ class VectorRasterTileCesiumImpl extends RasterLayerCesiumImpl {
64
64
  extent[3],
65
65
  );
66
66
  }
67
- const imageryLayer = new CesiumImageryLayer(
68
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
69
- // @ts-ignore
70
- this.imageryProvider,
71
- layerOptions,
67
+ return Promise.resolve(
68
+ new CesiumImageryLayer(
69
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
70
+ // @ts-ignore
71
+ this.imageryProvider,
72
+ layerOptions,
73
+ ),
72
74
  );
73
- return imageryLayer;
74
75
  }
75
76
 
76
77
  /**
@@ -32,7 +32,7 @@ class WmsCesiumImpl extends RasterLayerCesiumImpl {
32
32
  this.tileSize = options.tileSize;
33
33
  }
34
34
 
35
- getCesiumLayer(): CesiumImageryLayer {
35
+ getCesiumLayer(): Promise<CesiumImageryLayer> {
36
36
  const parameters = { ...this.parameters };
37
37
  if (this.highResolution) {
38
38
  parameters.width = String(this.tileSize[0] * 2);
@@ -68,7 +68,9 @@ class WmsCesiumImpl extends RasterLayerCesiumImpl {
68
68
  alpha: this.opacity,
69
69
  splitDirection: this.splitDirection,
70
70
  };
71
- return new CesiumImageryLayer(imageryProvider, layerOptions);
71
+ return Promise.resolve(
72
+ new CesiumImageryLayer(imageryProvider, layerOptions),
73
+ );
72
74
  }
73
75
  }
74
76
 
@@ -47,7 +47,7 @@ class WmtsCesiumImpl extends RasterLayerCesiumImpl {
47
47
  this.matrixIds = options.matrixIds;
48
48
  }
49
49
 
50
- getCesiumLayer(): CesiumImageryLayer {
50
+ getCesiumLayer(): Promise<CesiumImageryLayer> {
51
51
  const currentUrl = this.url as string;
52
52
  // This is a bug in Cesium, they cant cope with {Layer} placeholder..
53
53
  const url =
@@ -85,7 +85,9 @@ class WmtsCesiumImpl extends RasterLayerCesiumImpl {
85
85
  alpha: this.opacity,
86
86
  splitDirection: this.splitDirection,
87
87
  };
88
- return new CesiumImageryLayer(imageryProvider, layerOptions);
88
+ return Promise.resolve(
89
+ new CesiumImageryLayer(imageryProvider, layerOptions),
90
+ );
89
91
  }
90
92
  }
91
93
 
@@ -105,6 +105,7 @@ export function resetOriginalStyle(feature: HighlightableFeature): void {
105
105
  if (!(feature[globalHidden] || feature[hidden] || feature[highlighted])) {
106
106
  const style = feature[originalStyle];
107
107
  if (
108
+ style &&
108
109
  (feature instanceof Cesium3DTileFeature ||
109
110
  feature instanceof Cesium3DTilePointFeature) &&
110
111
  featureExists(feature)
@@ -383,21 +384,12 @@ class FeatureVisibility {
383
384
 
384
385
  hasHiddenFeature(
385
386
  id: string | number,
386
- feature:
387
- | import('ol').Feature<import('ol/geom/Geometry.js').default>
388
- | import('@vcmap-cesium/engine').Cesium3DTileFeature
389
- | import('@vcmap-cesium/engine').Entity,
387
+ feature: HighlightableFeature,
390
388
  ): boolean {
391
389
  return this.hiddenObjects[id] && this.hiddenObjects[id].has(feature);
392
390
  }
393
391
 
394
- addHiddenFeature(
395
- id: string | number,
396
- feature:
397
- | import('ol').Feature<import('ol/geom/Geometry.js').default>
398
- | import('@vcmap-cesium/engine').Cesium3DTileFeature
399
- | import('@vcmap-cesium/engine').Entity,
400
- ): void {
392
+ addHiddenFeature(id: string | number, feature: HighlightableFeature): void {
401
393
  if (this.hiddenObjects[id]) {
402
394
  cacheOriginalStyle(feature);
403
395
  this.hiddenObjects[id].add(feature);
@@ -44,6 +44,12 @@ export type LayerOptions = VcsObjectOptions & {
44
44
  */
45
45
  hiddenObjectIds?: string[];
46
46
  copyright?: CopyrightOptions;
47
+
48
+ /**
49
+ * Optional Id to synchronize with the vcPublisher Datasources. This can also be used to track a connection
50
+ * to other sources of data.
51
+ */
52
+ datasourceId?: string;
47
53
  };
48
54
 
49
55
  export type LayerImplementationOptions = {
@@ -75,6 +81,7 @@ class Layer<
75
81
  url: undefined,
76
82
  hiddenObjectIds: [],
77
83
  copyright: undefined,
84
+ datasourceId: undefined,
78
85
  };
79
86
  }
80
87
 
@@ -138,6 +145,12 @@ class Layer<
138
145
 
139
146
  private _locale: string;
140
147
 
148
+ /**
149
+ * Optional Id to synchronize with the vcPublisher Datasources. This can also be used to track a connection
150
+ * to other sources of data.
151
+ */
152
+ datasourceId?: string;
153
+
141
154
  constructor(options: LayerOptions) {
142
155
  super(options);
143
156
  const defaultOptions = Layer.getDefaultOptions();
@@ -193,6 +206,8 @@ class Layer<
193
206
  this.featureProvider = undefined;
194
207
 
195
208
  this._locale = 'en';
209
+
210
+ this.datasourceId = options.datasourceId || defaultOptions.datasourceId;
196
211
  }
197
212
 
198
213
  /**
@@ -633,6 +648,10 @@ class Layer<
633
648
  config.copyright = { ...this.copyright };
634
649
  }
635
650
 
651
+ if (this.datasourceId !== defaultOptions.datasourceId) {
652
+ config.datasourceId = this.datasourceId;
653
+ }
654
+
636
655
  return config;
637
656
  }
638
657
 
@@ -101,6 +101,11 @@ export type VectorGeometryFactoryType = {
101
101
  style: Style,
102
102
  ): GroundPolylineGeometry[];
103
103
  createLineGeometries(obj: unknown, style: Style): PolylineGeometry[];
104
+ createLineGeometries(
105
+ obj: unknown,
106
+ style: Style,
107
+ groundLevel?: number,
108
+ ): PolylineGeometry[];
104
109
  };
105
110
 
106
111
  export type VectorHeightInfo = {
@@ -1279,6 +1279,197 @@ class VectorProperties {
1279
1279
  return values;
1280
1280
  }
1281
1281
 
1282
+ /**
1283
+ * The common vector properties for the input features.
1284
+ * @param features Features for which the vector property values should be returned.
1285
+ * @returns The common vector properties for the features. When a/all feature(s) does not has a property set, the layer or, if not set, the default value is returned. If features have different values for a property, the property key is not added to the returned obeject.
1286
+ */
1287
+ getValuesForFeatures(features: Feature[]): VectorPropertiesOptions {
1288
+ const values: VectorPropertiesOptions = {};
1289
+
1290
+ /**
1291
+ * Checks if all the values of the array are equal using fast-deep-equal.
1292
+ * @param propertyValues An array of values for a specific property from different features.
1293
+ * @returns Whether all values are equal.
1294
+ */
1295
+ function isAllEqual<T extends string | number | boolean | number[]>(
1296
+ propertyValues: (T | undefined)[],
1297
+ ): boolean {
1298
+ return propertyValues.every((curr, index, array) => {
1299
+ if (index === 0) {
1300
+ return true;
1301
+ }
1302
+ return deepEqual(curr, array[0]);
1303
+ });
1304
+ }
1305
+
1306
+ const altitudeModeValues = features.map((f) => this.getAltitudeMode(f));
1307
+ if (isAllEqual(altitudeModeValues)) {
1308
+ values.altitudeMode = getAltitudeModeOptions(altitudeModeValues[0]);
1309
+ }
1310
+
1311
+ const allowPickingValues = features.map((f) => this.getAllowPicking(f));
1312
+ if (isAllEqual(allowPickingValues)) {
1313
+ values.allowPicking = allowPickingValues[0];
1314
+ }
1315
+
1316
+ const classificationTypeValues = features.map((f) =>
1317
+ this.getClassificationType(f),
1318
+ );
1319
+ if (isAllEqual(classificationTypeValues)) {
1320
+ values.classificationType = getClassificationTypeOptions(
1321
+ classificationTypeValues[0],
1322
+ );
1323
+ }
1324
+
1325
+ const scaleByDistanceValues = features.map((f) =>
1326
+ getNearFarValueOptions(this.getScaleByDistance(f)),
1327
+ );
1328
+ if (isAllEqual(scaleByDistanceValues)) {
1329
+ values.scaleByDistance = scaleByDistanceValues[0];
1330
+ }
1331
+
1332
+ const eyeOffsetValues = features.map((f) =>
1333
+ getCartesian3Options(this.getEyeOffset(f)),
1334
+ );
1335
+ if (isAllEqual(eyeOffsetValues)) {
1336
+ values.eyeOffset = eyeOffsetValues[0];
1337
+ }
1338
+
1339
+ const heightAboveGroundValues = features.map((f) =>
1340
+ this.getHeightAboveGround(f),
1341
+ );
1342
+ if (isAllEqual(heightAboveGroundValues)) {
1343
+ values.heightAboveGround = heightAboveGroundValues[0];
1344
+ }
1345
+
1346
+ const skirtValues = features.map((f) => this.getSkirt(f));
1347
+ if (isAllEqual(skirtValues)) {
1348
+ values.skirt = skirtValues[0];
1349
+ }
1350
+
1351
+ const groundLevelValues = features.map((f) => this.getGroundLevel(f));
1352
+ if (isAllEqual(groundLevelValues)) {
1353
+ values.groundLevel = groundLevelValues[0];
1354
+ }
1355
+
1356
+ const extrudedHeightValues = features.map((f) => this.getExtrudedHeight(f));
1357
+ if (isAllEqual(extrudedHeightValues)) {
1358
+ values.extrudedHeight = extrudedHeightValues[0];
1359
+ }
1360
+
1361
+ const storeysAboveGroundValues = features.map((f) =>
1362
+ this.getStoreysAboveGround(f),
1363
+ );
1364
+ if (isAllEqual(storeysAboveGroundValues)) {
1365
+ values.storeysAboveGround = storeysAboveGroundValues[0];
1366
+ }
1367
+
1368
+ const storeysBelowGroundValues = features.map((f) =>
1369
+ this.getStoreysBelowGround(f),
1370
+ );
1371
+ if (isAllEqual(storeysBelowGroundValues)) {
1372
+ values.storeysBelowGround = storeysBelowGroundValues[0];
1373
+ }
1374
+
1375
+ const storeyHeightsAboveGroundValues = features.map((f) =>
1376
+ this.getStoreyHeightsAboveGround(f),
1377
+ );
1378
+ if (isAllEqual(storeyHeightsAboveGroundValues)) {
1379
+ values.storeyHeightsAboveGround = storeyHeightsAboveGroundValues[0];
1380
+ }
1381
+
1382
+ const storeyHeightsBelowGroundValues = features.map((f) =>
1383
+ this.getStoreyHeightsBelowGround(f),
1384
+ );
1385
+ if (isAllEqual(storeyHeightsBelowGroundValues)) {
1386
+ values.storeyHeightsBelowGround = storeyHeightsBelowGroundValues[0];
1387
+ }
1388
+
1389
+ const modelUrlValues = features.map((f) => this.getModelUrl(f));
1390
+ if (isAllEqual(modelUrlValues)) {
1391
+ values.modelUrl = modelUrlValues[0];
1392
+ }
1393
+
1394
+ const modelScaleXValues = features.map((f) => this.getModelScaleX(f));
1395
+ if (isAllEqual(modelScaleXValues)) {
1396
+ values.modelScaleX = modelScaleXValues[0];
1397
+ }
1398
+
1399
+ const modelScaleYValues = features.map((f) => this.getModelScaleY(f));
1400
+ if (isAllEqual(modelScaleYValues)) {
1401
+ values.modelScaleY = modelScaleYValues[0];
1402
+ }
1403
+
1404
+ const modelScaleZValues = features.map((f) => this.getModelScaleZ(f));
1405
+ if (isAllEqual(modelScaleZValues)) {
1406
+ values.modelScaleZ = modelScaleZValues[0];
1407
+ }
1408
+
1409
+ const modelHeadingValues = features.map((f) => this.getModelHeading(f));
1410
+ if (isAllEqual(modelHeadingValues)) {
1411
+ values.modelHeading = modelHeadingValues[0];
1412
+ }
1413
+
1414
+ const modelPitchValues = features.map((f) => this.getModelPitch(f));
1415
+ if (isAllEqual(modelPitchValues)) {
1416
+ values.modelPitch = modelPitchValues[0];
1417
+ }
1418
+
1419
+ const modelRollValues = features.map((f) => this.getModelRoll(f));
1420
+ if (isAllEqual(modelRollValues)) {
1421
+ values.modelRoll = modelRollValues[0];
1422
+ }
1423
+
1424
+ const baseUrlValues = features.map((f) => this.getBaseUrl(f));
1425
+ if (isAllEqual(baseUrlValues)) {
1426
+ values.baseUrl = baseUrlValues[0];
1427
+ }
1428
+
1429
+ return values;
1430
+ }
1431
+
1432
+ /**
1433
+ * Sets vector property options on a array of features. When a property equals the value that is returned from the getter of the VectorProperties instance, the property is unset from the feature(s).
1434
+ * @param options The vector property options to be set on the features.
1435
+ * @param features The features to set the vector property options on.
1436
+ */
1437
+ setValuesForFeatures(
1438
+ options: VectorPropertiesOptions,
1439
+ features: Feature[],
1440
+ ): void {
1441
+ const layerValues = this.getValues();
1442
+
1443
+ type UpdateConfig<
1444
+ T extends keyof VectorPropertiesOptions = keyof VectorPropertiesOptions,
1445
+ > = {
1446
+ key: T;
1447
+ set: boolean;
1448
+ value: VectorPropertiesOptions[T];
1449
+ };
1450
+
1451
+ const updates: UpdateConfig[] = [];
1452
+ Object.entries(options).forEach(([key, value]) => {
1453
+ const keyCast = key as keyof VectorPropertiesOptions;
1454
+ updates.push({
1455
+ key: keyCast,
1456
+ value,
1457
+ set: !deepEqual(value, layerValues[keyCast]),
1458
+ });
1459
+ });
1460
+
1461
+ features.forEach((f) => {
1462
+ updates.forEach(({ key, set, value }) => {
1463
+ const propertyName = `olcs_${key}`;
1464
+ if (set) {
1465
+ f.set(propertyName, value);
1466
+ } else {
1467
+ f.unset(propertyName);
1468
+ }
1469
+ });
1470
+ });
1471
+ }
1472
+
1282
1473
  // XXX ugly design, this does NOT return a VcsMeta (missing version) but is missued to get config objects too often to change
1283
1474
  getVcsMeta(
1284
1475
  defaultOptions?: VectorPropertiesOptions,
@@ -2,7 +2,7 @@ import WFSFormat from 'ol/format/WFS.js';
2
2
  import VectorLayer, { VectorOptions } from './vectorLayer.js';
3
3
  import Projection from '../util/projection.js';
4
4
  import { layerClassRegistry } from '../classRegistry.js';
5
- import { requestJson } from '../util/fetch.js';
5
+ import { requestUrl } from '../util/fetch.js';
6
6
 
7
7
  export type WFSOptions = VectorOptions & {
8
8
  /**
@@ -18,6 +18,11 @@ export type WFSOptions = VectorOptions & {
18
18
  * additional config for [ol/format/WFS/writeGetFeature]{@link https://openlayers.org/en/latest/apidoc/ol.format.WFS.html} excluding featureType, featureNS and featurePrefix
19
19
  */
20
20
  getFeatureOptions?: Record<string, unknown>;
21
+
22
+ /**
23
+ * Version of the WFS Service, will be forwarded to the openlayers WFS Format.
24
+ */
25
+ version?: string;
21
26
  };
22
27
 
23
28
  /**
@@ -34,6 +39,8 @@ class WFSLayer extends VectorLayer {
34
39
 
35
40
  featurePrefix: string;
36
41
 
42
+ version: string | undefined;
43
+
37
44
  getFeaturesOptions: Record<string, unknown>;
38
45
 
39
46
  wfsFormat: WFSFormat;
@@ -47,6 +54,7 @@ class WFSLayer extends VectorLayer {
47
54
  featureNS: '',
48
55
  featurePrefix: '',
49
56
  getFeatureOptions: {},
57
+ version: undefined,
50
58
  };
51
59
  }
52
60
 
@@ -70,10 +78,11 @@ class WFSLayer extends VectorLayer {
70
78
  this.featureNS = options.featureNS;
71
79
  this.featurePrefix = options.featurePrefix;
72
80
  this.getFeaturesOptions = options.getFeatureOptions || {};
73
-
81
+ this.version = options.version;
74
82
  this.wfsFormat = new WFSFormat({
75
83
  featureNS: this.featureNS,
76
84
  featureType: this.featureType,
85
+ version: this.version,
77
86
  });
78
87
 
79
88
  this._dataFetchedPromise = null;
@@ -87,6 +96,11 @@ class WFSLayer extends VectorLayer {
87
96
  }
88
97
 
89
98
  async reload(): Promise<void> {
99
+ this.wfsFormat = new WFSFormat({
100
+ featureNS: this.featureNS,
101
+ featureType: this.featureType,
102
+ version: this.version,
103
+ });
90
104
  if (this._dataFetchedPromise) {
91
105
  this.removeAllFeatures();
92
106
  this._dataFetchedPromise = null;
@@ -111,14 +125,15 @@ class WFSLayer extends VectorLayer {
111
125
  ...this.getFeaturesOptions,
112
126
  });
113
127
  const postData = new XMLSerializer().serializeToString(requestDocument);
114
- this._dataFetchedPromise = requestJson(this.url, {
128
+ this._dataFetchedPromise = requestUrl(this.url, {
115
129
  method: 'POST',
116
130
  headers: {
117
131
  'Content-Type': 'application/text+xml',
118
132
  },
119
- body: JSON.stringify(postData),
133
+ body: postData,
120
134
  })
121
- .then((data) => this._parseWFSData(data as Element))
135
+ .then((response) => response.text())
136
+ .then((data) => this._parseWFSData(data))
122
137
  .catch((err) => {
123
138
  this.getLogger().info(
124
139
  `Could not send request for loading layer content (${String(err)})`,
@@ -132,7 +147,7 @@ class WFSLayer extends VectorLayer {
132
147
  return Promise.reject(new Error('missing url in WFSLayer layer'));
133
148
  }
134
149
 
135
- private _parseWFSData(obj: Element): void {
150
+ private _parseWFSData(obj: string): void {
136
151
  const features = this.wfsFormat.readFeatures(obj);
137
152
  this.addFeatures(features);
138
153
  }
@@ -40,7 +40,7 @@ import {
40
40
  import type { Coordinate } from 'ol/coordinate.js';
41
41
 
42
42
  import { checkMaybe } from '@vcsuite/check';
43
- import { parseBoolean, parseInteger } from '@vcsuite/parsers';
43
+ import { parseBoolean, parseInteger, parseNumber } from '@vcsuite/parsers';
44
44
  import VcsMap, { type VcsMapOptions } from './vcsMap.js';
45
45
  import Viewpoint from '../util/viewpoint.js';
46
46
  import Projection, { mercatorProjection } from '../util/projection.js';
@@ -80,6 +80,12 @@ export type CesiumMapOptions = VcsMapOptions & {
80
80
  * This is a global Setting for all VCMap Instances on the same page.
81
81
  */
82
82
  useOriginalCesiumShader?: boolean;
83
+
84
+ /**
85
+ * changes the default Cesium Sunlight Intensity (default is 3.0)
86
+ * Cesium Default is 2.0
87
+ */
88
+ lightIntensity?: number;
83
89
  };
84
90
 
85
91
  export type CesiumMapEvent = {
@@ -344,6 +350,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
344
350
 
345
351
  private _useOriginalCesiumShader: boolean;
346
352
 
353
+ private _lightIntensity: number;
354
+
347
355
  constructor(options: CesiumMapOptions) {
348
356
  super(options);
349
357
 
@@ -403,6 +411,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
403
411
  this._listeners = [];
404
412
 
405
413
  this._lastEventFrameNumber = null;
414
+
415
+ this._lightIntensity = parseNumber(options.lightIntensity, 3.0);
406
416
  }
407
417
 
408
418
  get splitPosition(): number {
@@ -653,6 +663,7 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
653
663
  this._cesiumWidget.scene.highDynamicRange = false;
654
664
  // this._cesiumWidget.scene.logarithmicDepthBuffer = false; // TODO observe this
655
665
  this._cesiumWidget.scene.splitPosition = this.splitPosition;
666
+ this._cesiumWidget.scene.light.intensity = this._lightIntensity;
656
667
 
657
668
  this._cesiumWidget.scene.globe.enableLighting = this.enableLightning;
658
669
 
@@ -1,4 +1,4 @@
1
- import { parseBoolean, parseInteger, parseNumber } from '@vcsuite/parsers';
1
+ import { parseInteger, parseNumber } from '@vcsuite/parsers';
2
2
  import RBush from 'rbush';
3
3
  import knn from 'rbush-knn';
4
4
  import { getTransform } from 'ol/proj.js';
@@ -72,7 +72,7 @@ export type ObliqueCollectionOptions = VcsObjectOptions & {
72
72
  minZoom?: number;
73
73
  scaleFactor?: number;
74
74
  hideLevels?: number;
75
- activeOnStartup?: boolean;
75
+ datasourceId?: string;
76
76
  };
77
77
 
78
78
  export type ObliqueImageRbushItem = {
@@ -132,7 +132,7 @@ class ObliqueCollection extends VcsObject {
132
132
  scaleFactor: 4,
133
133
  dataSets: undefined,
134
134
  hideLevels: 0,
135
- activeOnStartup: false,
135
+ datasourceId: undefined,
136
136
  };
137
137
  }
138
138
 
@@ -172,9 +172,10 @@ class ObliqueCollection extends VcsObject {
172
172
  private _loadingPromise: Promise<void> | undefined = undefined;
173
173
 
174
174
  /**
175
- * Whether to activate this collection after loading its defining context.
175
+ * Optional Id to synchronize with the vcPublisher Datasources. This can also be used to track a connection
176
+ * to other sources of data.
176
177
  */
177
- activeOnStartup: boolean;
178
+ datasourceId?: string;
178
179
 
179
180
  /**
180
181
  * @param options
@@ -196,10 +197,7 @@ class ObliqueCollection extends VcsObject {
196
197
  });
197
198
  }
198
199
 
199
- this.activeOnStartup = parseBoolean(
200
- options.activeOnStartup,
201
- defaultOptions.activeOnStartup,
202
- );
200
+ this.datasourceId = options.datasourceId || defaultOptions.datasourceId;
203
201
  }
204
202
 
205
203
  get dataSets(): ObliqueDataSet[] {
@@ -622,6 +620,9 @@ class ObliqueCollection extends VcsObject {
622
620
  if (this.viewOptions.hideLevels !== defaultOptions.hideLevels) {
623
621
  config.hideLevels = this.viewOptions.hideLevels;
624
622
  }
623
+ if (this.datasourceId !== defaultOptions.datasourceId) {
624
+ config.datasourceId = this.datasourceId;
625
+ }
625
626
 
626
627
  if (this.dataSets.length > 0) {
627
628
  config.dataSets = this.dataSets.map((d) => d.toJSON());