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

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 (51) hide show
  1. package/index.d.ts +287 -95
  2. package/index.js +11 -3
  3. package/package.json +5 -10
  4. package/src/vcs/vcm/category/appBackedCategory.js +41 -0
  5. package/src/vcs/vcm/category/category.js +374 -0
  6. package/src/vcs/vcm/category/categoryCollection.js +145 -0
  7. package/src/vcs/vcm/context.js +73 -0
  8. package/src/vcs/vcm/interaction/coordinateAtPixel.js +1 -1
  9. package/src/vcs/vcm/layer/cesiumTileset.js +1 -1
  10. package/src/vcs/vcm/layer/featureStore.js +3 -3
  11. package/src/vcs/vcm/layer/featureStoreChanges.js +89 -73
  12. package/src/vcs/vcm/layer/geojson.js +3 -5
  13. package/src/vcs/vcm/layer/geojsonHelpers.js +3 -3
  14. package/src/vcs/vcm/layer/oblique/obliqueHelpers.js +2 -2
  15. package/src/vcs/vcm/layer/singleImage.js +2 -1
  16. package/src/vcs/vcm/layer/terrainHelpers.js +4 -8
  17. package/src/vcs/vcm/layer/tileProvider/mvtTileProvider.js +3 -3
  18. package/src/vcs/vcm/layer/tileProvider/staticGeojsonTileProvider.js +3 -3
  19. package/src/vcs/vcm/layer/tileProvider/urlTemplateTileProvider.js +3 -3
  20. package/src/vcs/vcm/layer/vector.js +1 -1
  21. package/src/vcs/vcm/layer/vectorHelpers.js +4 -4
  22. package/src/vcs/vcm/layer/wfs.js +5 -5
  23. package/src/vcs/vcm/maps/cameraLimiter.js +5 -5
  24. package/src/vcs/vcm/maps/map.js +26 -11
  25. package/src/vcs/vcm/maps/oblique.js +8 -8
  26. package/src/vcs/vcm/object.js +1 -1
  27. package/src/vcs/vcm/oblique/ObliqueCollection.js +83 -31
  28. package/src/vcs/vcm/oblique/ObliqueDataSet.js +67 -24
  29. package/src/vcs/vcm/oblique/ObliqueImage.js +1 -1
  30. package/src/vcs/vcm/oblique/ObliqueImageMeta.js +2 -2
  31. package/src/vcs/vcm/oblique/ObliqueProvider.js +10 -7
  32. package/src/vcs/vcm/oblique/helpers.js +12 -40
  33. package/src/vcs/vcm/oblique/parseImageJson.js +17 -9
  34. package/src/vcs/vcm/util/clipping/clippingPlaneHelper.js +4 -4
  35. package/src/vcs/vcm/util/extent.js +16 -9
  36. package/src/vcs/vcm/util/featureProvider/featureProviderHelpers.js +3 -4
  37. package/src/vcs/vcm/util/featureProvider/wmsFeatureProvider.js +11 -6
  38. package/src/vcs/vcm/util/featureconverter/extent3D.js +181 -0
  39. package/src/vcs/vcm/util/fetch.js +32 -0
  40. package/src/vcs/vcm/util/indexedCollection.js +23 -0
  41. package/src/vcs/vcm/util/layerCollection.js +10 -5
  42. package/src/vcs/vcm/util/overrideCollection.js +224 -0
  43. package/src/vcs/vcm/util/projection.js +37 -3
  44. package/src/vcs/vcm/util/style/declarativeStyleItem.js +2 -0
  45. package/src/vcs/vcm/util/style/styleFactory.js +1 -1
  46. package/src/vcs/vcm/util/style/styleItem.js +2 -0
  47. package/src/vcs/vcm/util/style/vectorStyleItem.js +2 -0
  48. package/src/vcs/vcm/util/viewpoint.js +3 -0
  49. package/src/vcs/vcm/vcsApp.js +360 -0
  50. package/src/vcs/vcm/vcsAppContextHelpers.js +108 -0
  51. package/src/vcs/vcm/util/featureconverter/extent3d.js +0 -154
package/index.d.ts CHANGED
@@ -14,6 +14,103 @@ export class VcsCameraPrimitive {
14
14
  show: boolean;
15
15
  }
16
16
 
17
+ export interface AppBackedCategoryOptions extends CategoryOptions {
18
+ collectionName: string;
19
+ }
20
+
21
+ export class AppBackedCategory extends Category<VcsObject> {
22
+ constructor(options: AppBackedCategoryOptions);
23
+ serializeForContext(contextId: string): null;
24
+ }
25
+
26
+ /**
27
+ */
28
+ export interface CategoryOptions extends VcsObjectOptions {
29
+ title?: string | {
30
+ [key: string]: string;
31
+ };
32
+ typed?: boolean;
33
+ featureProperty?: string | undefined;
34
+ layerOptions?: VectorOptions;
35
+ /**
36
+ * items are not evaluated by the constructor but passed to parseItem during deserialization.
37
+ */
38
+ items?: object[];
39
+ keyProperty?: string;
40
+ }
41
+
42
+ /**
43
+ * A category contains user based items and is a special container. The container should not be created directly, but via
44
+ * the requestCategory API on the categories collection. Do not use toJSON to retrieve the state of a category, since
45
+ * categories outlive contexts and may be changed with mergeOptions to no longer reflect your initial state. Requestors
46
+ * should keep track of the requested options themselves.
47
+ */
48
+ export class Category<T extends Object|VcsObject> extends VcsObject {
49
+ constructor(options: CategoryOptions);
50
+ static getDefaultConfig(): CategoryOptions;
51
+ title: string | {
52
+ [key: string]: string;
53
+ };
54
+ protected _app: VcsApp;
55
+ protected _layer: Vector;
56
+ /**
57
+ * The collection of this category.
58
+ */
59
+ readonly collection: OverrideCollection<T>;
60
+ /**
61
+ * Returns the layer of this collection. Caution, do not use the layer API to add or remove items.
62
+ * When adding items to the collection, the features are added to the layer async (timeout of 0), since there is weird behavior
63
+ * when removing and adding a feature with the same id in the same sync call.
64
+ */
65
+ layer: Vector | null;
66
+ protected _itemAdded(item: T): void;
67
+ protected _itemRemoved(item: T): void;
68
+ protected _itemReplaced(item: T): void;
69
+ protected _itemMoved(item: T): void;
70
+ /**
71
+ * Throws if typed, featureProperty and keyProperty do not match. Merges other options.
72
+ * Only merges: style, highlightStyle, zIndex & vectorProperties from layerOptions.
73
+ */
74
+ mergeOptions(options: CategoryOptions): void;
75
+ /**
76
+ * When setting the category, it MUST use the same unqiueKey as the previous collection (default is "name").
77
+ * All items in the current collection _will be destroyed_ and the current collection will be destroyed. The category will take
78
+ * complete ownership of the collection and destroy it once the category is destroyed. The collection will
79
+ * be turned into an {@see OverrideCollection}.
80
+ */
81
+ setCollection(collection: Collection<T>): void;
82
+ setApp(app: VcsApp): void;
83
+ protected _serializeItem(item: T): object[];
84
+ serializeForContext(contextId: string): CategoryOptions | null;
85
+ /**
86
+ * unique Name
87
+ */
88
+ readonly name: string;
89
+ properties: any;
90
+ readonly className: string;
91
+ }
92
+
93
+ export class CategoryCollection extends IndexedCollection<Category<Object|VcsObject>> {
94
+ constructor(app: VcsApp);
95
+ /**
96
+ * Do not call add directly. Use request category for adding categories.
97
+ */
98
+ add(category: Category<object | VcsObject>): number | null;
99
+ /**
100
+ * Categories should be static. Removing them can lead to undefined behavior.
101
+ */
102
+ remove(category: Category<object | VcsObject>): void;
103
+ /**
104
+ * Parses the category items. Items will only be parsed, if a category with said name exists. Otherwise,
105
+ * they will be cached, until such a category is requested.
106
+ */
107
+ parseCategoryItems(name: string, items: object[], contextId: string): Promise<void>;
108
+ /**
109
+ * Add categories with this API.
110
+ */
111
+ requestCategory(options: CategoryOptions): Promise<Category<object | VcsObject>>;
112
+ }
113
+
17
114
  export class ClassRegistry {
18
115
  logger: import("@vcsuite/logger").Logger;
19
116
  /**
@@ -36,6 +133,26 @@ export class ClassRegistry {
36
133
 
37
134
  export const VcsClassRegistry: ClassRegistry;
38
135
 
136
+ export interface VcsAppConfig {
137
+ id?: string | undefined;
138
+ layers?: LayerOptions[];
139
+ maps?: VcsMapOptions[];
140
+ styles?: StyleItemOptions[];
141
+ viewpoints?: ViewPointOptions[];
142
+ startingViewPointName?: string;
143
+ startingMapName?: string;
144
+ projection?: ProjectionOptions;
145
+ categories?: { name: string; items: object[]; }[];
146
+ obliqueCollections?: ObliqueCollectionOptions[];
147
+ }
148
+
149
+ export class Context {
150
+ constructor(config: VcsAppConfig);
151
+ readonly id: string;
152
+ readonly checkSum: string;
153
+ readonly config: VcsAppConfig;
154
+ }
155
+
39
156
  export class VcsEvent<T extends any> {
40
157
  /**
41
158
  * The number of listeners
@@ -1567,6 +1684,13 @@ export interface FeatureStoreChangesValues {
1567
1684
  changed: boolean;
1568
1685
  }
1569
1686
 
1687
+ export interface CommitAction {
1688
+ action: string;
1689
+ feature: import("ol/format/GeoJSON").GeoJSONFeature;
1690
+ original: import("ol").Feature<import("ol/geom/Geometry").default>;
1691
+ success: (...params: any[]) => any;
1692
+ }
1693
+
1570
1694
  /**
1571
1695
  * do not construct directly, use the layers .changeTracker instead
1572
1696
  */
@@ -3124,7 +3248,7 @@ export function sampleCesiumTerrain(terrainProvider: import("@vcmap/cesium").Ces
3124
3248
  * changes input coordinate Array in place, new height can also be accessed by coordinates[x][2]
3125
3249
  * @param [optSourceProjection] - if input is not WGS84
3126
3250
  */
3127
- export function getHeightFromTerrainProvider(terrainProvider: import("@vcmap/cesium").CesiumTerrainProvider, coordinates: import("ol/coordinate").Coordinate[], optSourceProjection?: Projection | import("ol/proj/Projection").default, result?: import("ol/coordinate").Coordinate[]): Promise<import("ol/coordinate").Coordinate[]>;
3251
+ export function getHeightFromTerrainProvider(terrainProvider: import("@vcmap/cesium").CesiumTerrainProvider, coordinates: import("ol/coordinate").Coordinate[], optSourceProjection?: Projection, result?: import("ol/coordinate").Coordinate[]): Promise<import("ol/coordinate").Coordinate[]>;
3128
3252
 
3129
3253
  /**
3130
3254
  * checks, whether a terrain tile is available at given position or not
@@ -4731,7 +4855,7 @@ export interface CameraLimiterOptions {
4731
4855
  /**
4732
4856
  * Enumeration of camera limiter modes.
4733
4857
  */
4734
- export const enum Mode {
4858
+ export const enum CameraLimiterMode {
4735
4859
  HEIGHT,
4736
4860
  DISTANCE
4737
4861
  }
@@ -4745,7 +4869,7 @@ export class CameraLimiter {
4745
4869
  /**
4746
4870
  * The mode to use. When using DISTANCE mode, be sure to have a terrainProvider set.
4747
4871
  */
4748
- mode: Mode;
4872
+ mode: CameraLimiterMode;
4749
4873
  /**
4750
4874
  * The minimum height/distance to the terrain the camera must maintain
4751
4875
  */
@@ -5158,7 +5282,7 @@ export class Oblique extends BaseOLMap {
5158
5282
  switchThreshold: any;
5159
5283
  mapChangeEvent: any;
5160
5284
  readonly collection: ObliqueCollection;
5161
- readonly imageChanged: import("@vcmap/cesium").Event;
5285
+ readonly imageChanged: VcsEvent<ObliqueImage>;
5162
5286
  readonly currentImage: ObliqueImage | null;
5163
5287
  getExtentOfCurrentImage(): Extent;
5164
5288
  getCurrentImage(): ObliqueImage;
@@ -5365,9 +5489,14 @@ export interface ObliqueVersion {
5365
5489
  buildNumber: number;
5366
5490
  }
5367
5491
 
5368
- export interface ObliqueCollectionOptions {
5369
- name?: string | undefined;
5370
- dataSets: ObliqueDataSet[];
5492
+ export interface ObliqueDataSetOptions {
5493
+ url: string;
5494
+ projection?: ProjectionOptions;
5495
+ terrainProvider?: TerrainProviderOptions;
5496
+ }
5497
+
5498
+ export interface ObliqueCollectionOptions extends VcsObjectOptions {
5499
+ dataSets?: (ObliqueDataSet | ObliqueDataSetOptions)[];
5371
5500
  maxZoom?: number | undefined;
5372
5501
  minZoom?: number | undefined;
5373
5502
  scaleFactor?: number | undefined;
@@ -5376,16 +5505,13 @@ export interface ObliqueCollectionOptions {
5376
5505
 
5377
5506
  export class ObliqueCollection {
5378
5507
  constructor(options: ObliqueCollectionOptions);
5379
- /**
5380
- * The unique name of the collection
5381
- */
5382
- name: string;
5508
+ static getDefaultOptions(): ObliqueCollectionOptions;
5383
5509
  viewOptions: ObliqueViewOptions;
5384
5510
 
5385
5511
  /**
5386
5512
  * Event raised when images are loaded. Is passed an Array of ObliqueImages as its only argument.
5387
5513
  */
5388
- imagesLoaded: import("@vcmap/cesium").Event;
5514
+ imagesLoaded: VcsEvent<ObliqueImage[]>;
5389
5515
  readonly dataSets: ObliqueDataSet[];
5390
5516
  /**
5391
5517
  * Indicates, that this collection has been loaded
@@ -5476,6 +5602,20 @@ export class ObliqueCollection {
5476
5602
  * Destroys all data sets and all images and any image/tile features for this collection
5477
5603
  */
5478
5604
  destroy(): void;
5605
+ toJSON(): ObliqueCollectionOptions;
5606
+ }
5607
+
5608
+ /**
5609
+ */
5610
+ export interface ObliqueDataSetImagesLoaded {
5611
+ /**
5612
+ * the loaded images
5613
+ */
5614
+ images: ObliqueImage[];
5615
+ /**
5616
+ * an optional tile coordinate
5617
+ */
5618
+ tileCoordinate?: string;
5479
5619
  }
5480
5620
 
5481
5621
  /**
@@ -5490,16 +5630,14 @@ export const enum DataState {
5490
5630
  export function getStateFromStatesArray(states: DataState[]): DataState;
5491
5631
 
5492
5632
  export class ObliqueDataSet {
5493
- constructor(url: string, projection: import("ol/proj/Projection").default, terrainProvider?: import("@vcmap/cesium").CesiumTerrainProvider);
5633
+ constructor(url: string, projection: Projection | ProjectionOptions, terrainProviderOptions?: TerrainProviderOptions);
5494
5634
  url: string;
5495
5635
  baseUrl: string;
5496
- projection: import("ol/proj/Projection").default;
5497
- terrainProvider: import("@vcmap/cesium").CesiumTerrainProvider | undefined;
5636
+ projection: Projection;
5498
5637
  /**
5499
- * Event raised when images are loaded. Is passed an Array of ObliqueImages as the first argument and optionally
5500
- * a string representing the tile coordinate ("z/x/y"), if the images where loaded for a tile.
5638
+ * Event raised when images are loaded.
5501
5639
  */
5502
- imagesLoaded: import("@vcmap/cesium").Event;
5640
+ imagesLoaded: VcsEvent<ObliqueDataSetImagesLoaded>;
5503
5641
 
5504
5642
 
5505
5643
 
@@ -5513,6 +5651,7 @@ export class ObliqueDataSet {
5513
5651
  * reflect the state of loaded tiles.
5514
5652
  */
5515
5653
  readonly state: DataState;
5654
+ readonly terrainProvider: import("@vcmap/cesium").CesiumTerrainProvider | undefined;
5516
5655
  /**
5517
5656
  * Loads the data set.
5518
5657
  */
@@ -5546,6 +5685,7 @@ export class ObliqueDataSet {
5546
5685
  * Loads all the tiles for a given extent.
5547
5686
  */
5548
5687
  loadDataForExtent(extent: import("ol/extent").Extent): Promise<void>;
5688
+ toJSON(): ObliqueDataSetOptions;
5549
5689
  }
5550
5690
 
5551
5691
  export interface ObliqueImageOptions {
@@ -5558,7 +5698,7 @@ export interface ObliqueImageOptions {
5558
5698
  projectionCenter?: import("@vcmap/cesium").Cartesian3 | undefined;
5559
5699
  pToRealworld?: import("@vcmap/cesium").Matrix3 | undefined;
5560
5700
  pToImage?: import("@vcmap/cesium").Matrix4 | undefined;
5561
- projection?: import("ol/proj/Projection").default | undefined;
5701
+ projection?: Projection | undefined;
5562
5702
  terrainProvider?: import("@vcmap/cesium").CesiumTerrainProvider | undefined;
5563
5703
  }
5564
5704
 
@@ -5624,7 +5764,7 @@ export interface ObliqueImageMetaOptions {
5624
5764
  size: import("ol/size").Size;
5625
5765
  tileSize: import("ol/size").Size;
5626
5766
  tileResolution: number[];
5627
- projection: import("ol/proj/Projection").default;
5767
+ projection: Projection;
5628
5768
  url: string;
5629
5769
  terrainProvider: import("@vcmap/cesium").CesiumTerrainProvider;
5630
5770
  name: string;
@@ -5657,7 +5797,7 @@ export class ObliqueImageMeta {
5657
5797
  /**
5658
5798
  * The world projection of the images associated with this meta
5659
5799
  */
5660
- projection: import("ol/proj/Projection").default;
5800
+ projection: Projection;
5661
5801
  url: string;
5662
5802
  /**
5663
5803
  * An optional terrain provider
@@ -5692,7 +5832,7 @@ export class ObliqueProvider {
5692
5832
  /**
5693
5833
  * Event raised once a new image is set on the provider. Will be passed the new image as the only argument.
5694
5834
  */
5695
- imageChanged: import("@vcmap/cesium").Event;
5835
+ imageChanged: VcsEvent<ObliqueImage>;
5696
5836
  /**
5697
5837
  * Whether the post render handler should switch on image edge. Setting
5698
5838
  * this to false will suspend all post render handler switches.
@@ -5821,7 +5961,7 @@ export interface ImageTransformationOptions {
5821
5961
  /**
5822
5962
  * the projection of the input/output coordinates, assumes image source projection
5823
5963
  */
5824
- dataProjection?: import("ol/proj/Projection").default | undefined;
5964
+ dataProjection?: Projection | undefined;
5825
5965
  /**
5826
5966
  * the transformToWorld process iterativly calculates a new Height Value from the terrainProvider until the difference to the new height value is smaller
5827
5967
  */
@@ -5858,17 +5998,12 @@ export function transformFromImage(image: ObliqueImage, imageCoordinate: import(
5858
5998
 
5859
5999
  export function hasSameOrigin(url: string): boolean;
5860
6000
 
5861
- /**
5862
- * destroys a cesium Event Emitter, (removes all listeners)
5863
- */
5864
- export function destroyCesiumEvent(cesiumEvent: import("@vcmap/cesium").Event): void;
5865
-
5866
6001
  /**
5867
6002
  * @returns version
5868
6003
  */
5869
6004
  export function getVersionFromImageJson(json: any): ObliqueVersion;
5870
6005
 
5871
- export function parseImageMeta(json: ObliqueImageJson, url: string, projection?: import("ol/proj/Projection").default | null, terrainProvider?: import("@vcmap/cesium").CesiumTerrainProvider): ObliqueImageMeta[];
6006
+ export function parseImageMeta(json: ObliqueImageJson, url: string, projection?: Projection, terrainProvider?: import("@vcmap/cesium").CesiumTerrainProvider): ObliqueImageMeta[];
5872
6007
 
5873
6008
  export function parseImageData(json: ObliqueImageJson, imageMetas: ObliqueImageMeta[]): ObliqueImage[];
5874
6009
 
@@ -6168,11 +6303,16 @@ export class ExclusiveManager {
6168
6303
 
6169
6304
  /**
6170
6305
  */
6171
- export interface ExtentOptions extends ProjectionOptions {
6306
+ export interface ExtentOptions {
6307
+ type?: string;
6172
6308
  /**
6173
6309
  * if not specified, the extent of the projection is used
6174
6310
  */
6175
6311
  coordinates?: import("ol/extent").Extent | undefined;
6312
+ /**
6313
+ * if not specified the default projection is assumed
6314
+ */
6315
+ projection?: ProjectionOptions;
6176
6316
  }
6177
6317
 
6178
6318
  /**
@@ -6181,6 +6321,7 @@ export interface ExtentOptions extends ProjectionOptions {
6181
6321
  */
6182
6322
  export class Extent {
6183
6323
  constructor(options?: ExtentOptions);
6324
+ static className: string;
6184
6325
  projection: Projection;
6185
6326
  extent: import("ol/extent").Extent | null;
6186
6327
  getCoordinatesInProjection(destination: Projection, result?: import("ol/extent").Extent): import("ol/extent").Extent;
@@ -6388,7 +6529,7 @@ export class WMSFeatureProvider extends AbstractFeatureProvider {
6388
6529
  * The feature response projection, if not present in the response format.
6389
6530
  */
6390
6531
  projection: Projection;
6391
- featureResponseCallback(response: import("axios").AxiosResponse<any>, coordinate: import("ol/coordinate").Coordinate): import("ol").Feature<import("ol/geom/Geometry").default>[];
6532
+ featureResponseCallback(data: import("ol/format/GeoJSON").GeoJSONObject, coordinate: import("ol/coordinate").Coordinate): import("ol").Feature<import("ol/geom/Geometry").default>[];
6392
6533
  /**
6393
6534
  * The layer name of the associated layer
6394
6535
  */
@@ -6424,69 +6565,6 @@ export function validateCircle(circle: import("ol/geom/Circle").default): boolea
6424
6565
 
6425
6566
  export function getStylesArray(style: void | import("ol/style/Style").StyleLike, feature: import("ol").Feature<import("ol/geom/Geometry").default>, resolution?: number): import("ol/style/Style").default[];
6426
6567
 
6427
- /**
6428
- * Create an empty extent.
6429
- * @returns Empty extent.
6430
- */
6431
- export function createEmpty3D(): number[];
6432
-
6433
- /**
6434
- * Create a new extent or update the provided extent.
6435
- * @param minX - Minimum X.
6436
- * @param minY - Minimum Y.
6437
- * @param minZ - Minimum Z.
6438
- * @param maxX - Maximum X.
6439
- * @param maxY - Maximum Y.
6440
- * @param maxZ - Maximum Z.
6441
- * @param [optExtent] - Destination extent.
6442
- * @returns Extent.
6443
- */
6444
- export function createOrUpdate3D(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number, optExtent?: number[]): number[];
6445
-
6446
- /**
6447
- * @param extent - Extent.
6448
- * @param x - X.
6449
- * @param y - Y.
6450
- * @param z - Z.
6451
- */
6452
- export function extendXYZ(extent: number[], x: number, y: number, z: number): void;
6453
-
6454
- /**
6455
- * @param extent - Extent.
6456
- * @param x - X.
6457
- * @param y - Y.
6458
- */
6459
- export function extendXY(extent: number[], x: number, y: number): void;
6460
-
6461
- /**
6462
- * @param extent - Extent.
6463
- * @param z - Z.
6464
- */
6465
- export function extendZ(extent: number[], z: number): void;
6466
-
6467
- /**
6468
- * @param extent - Extent.
6469
- * @param flatCoordinates - Flat coordinates.
6470
- * @param stride - Stride.
6471
- * @returns Extent.
6472
- */
6473
- export function extendFlatCoordinates(extent: number[], flatCoordinates: number[], stride: number): number[];
6474
-
6475
- /**
6476
- * @param geometry - Geometry.
6477
- * @param [optExtent] - Extent.
6478
- * @returns Extent.
6479
- */
6480
- export function createOrUpdateFromGeometry(geometry: import("ol/geom/Geometry").default, optExtent?: number[]): number[];
6481
-
6482
- export function createOrUpdateFromHeightInfo(heightInfo: VectorHeightInfo, optExtent: number[]): void;
6483
-
6484
- /**
6485
- * @param extent - Extent.
6486
- * @returns Extent.
6487
- */
6488
- export function make2D(extent: number[]): import("ol/extent").Extent;
6489
-
6490
6568
  export function getMaterialAppearance(scene: import("@vcmap/cesium").Scene, fill: import("ol/style/Fill").default, feature: import("ol").Feature<import("ol/geom/Geometry").default>): import("@vcmap/cesium").MaterialAppearance;
6491
6569
 
6492
6570
  export function createClassificationPrimitive(options: any, geometries: import("@vcmap/cesium").Geometry[], color: import("@vcmap/cesium").Color, classificationType: import("@vcmap/cesium").ClassificationType): import("@vcmap/cesium").ClassificationPrimitive;
@@ -6549,6 +6627,12 @@ export function getCartesian3AndWGS84FromCoordinates(coordinates: import("ol/coo
6549
6627
  */
6550
6628
  export function validatePolygon(polygon: import("ol/geom/Polygon").default): boolean;
6551
6629
 
6630
+ export function requestUrl(url: string, init?: RequestInit): Promise<Response>;
6631
+
6632
+ export function requestJson(url: string, init?: RequestInit): Promise<any>;
6633
+
6634
+ export function requestArrayBuffer(url: string, init?: RequestInit): Promise<ArrayBuffer>;
6635
+
6552
6636
  export function getFlatCoordinatesFromSimpleGeometry(geometry: import("ol/geom/SimpleGeometry").default): import("ol/coordinate").Coordinate[];
6553
6637
 
6554
6638
  export function getFlatCoordinatesFromGeometry(geometry: import("ol/geom/Geometry").default, inputCoordinates?: any[]): import("ol/coordinate").Coordinate[];
@@ -6578,6 +6662,11 @@ export class IndexedCollection<T extends any> extends Collection<T> {
6578
6662
  * Event raised if an item is relocated within the collection. Is passed the moved item.
6579
6663
  */
6580
6664
  moved: VcsEvent<T>;
6665
+ /**
6666
+ * Get the symbol which is attached to an item prior to its removal. If an item is removed, the current index of the item
6667
+ * is set on the item with this symbol.
6668
+ */
6669
+ readonly previousIndexSymbol: symbol;
6581
6670
  /**
6582
6671
  * Returns an item at index.
6583
6672
  */
@@ -6589,6 +6678,7 @@ export class IndexedCollection<T extends any> extends Collection<T> {
6589
6678
  * @returns the index at which the item was inserted
6590
6679
  */
6591
6680
  add(item: T, index?: number): number | null;
6681
+ remove(item: T): void;
6592
6682
  protected _move(item: T, itemIndex: number, targetIndex: number): number;
6593
6683
  /**
6594
6684
  * Lowers an item within the array
@@ -6626,6 +6716,12 @@ export class LayerCollection extends IndexedCollection<Layer> {
6626
6716
  * The exclusive manager for this collection. Layers within this collection are automatically added and tracked.
6627
6717
  */
6628
6718
  exclusiveManager: ExclusiveManager;
6719
+ /**
6720
+ * A symbol to describe the local z index of a layer. The local z index must not equal the layers z index, but is
6721
+ * always consistent in comparison to the neighbouring layers. If a layer is moved other then by z index, the collection
6722
+ * ensures consistency by setting a new local z index if needed.
6723
+ */
6724
+ readonly zIndexSymbol: symbol;
6629
6725
  /**
6630
6726
  * Adds a layer to the collection. Can optionally be passed an index at which to insert the layer.
6631
6727
  * @returns returns the layer index or null, if the layers name is not unique
@@ -6742,9 +6838,24 @@ export function cartesian2DDistance(point0: import("ol/coordinate").Coordinate,
6742
6838
 
6743
6839
  export function cartesian3DDistance(p1: import("ol/coordinate").Coordinate, p2: import("ol/coordinate").Coordinate): number;
6744
6840
 
6841
+ /**
6842
+ * A symbol added to override collections.
6843
+ */
6844
+ export const isOverrideCollection: symbol;
6845
+
6846
+ /**
6847
+ * @param getDynamicContextId - function to get the current dynamic context id
6848
+ * @param [serializeItem] - optional function to serialize an item, defaults to returning item.toJSON or item: i => (i.toJSON || i)
6849
+ * @param [deserializeItem] - optional desirialization function. defaults to returning the passed object: i => i
6850
+ * @param [ctor] - optional constructor to validate deserialized items against. if passed, deserializeItem must be an instance of ctor.
6851
+ * @param [determineShadowIndex] - return the index where a shadow should be inserted. only has relevance, if the collection is indexed. previous and current index may be null.
6852
+ */
6853
+ export function makeOverrideCollection<T extends any>(collection: Collection<T>, getDynamicContextId: (...params: any[]) => any, serializeItem?: (...params: any[]) => any, deserializeItem?: (...params: any[]) => any, ctor?: any, determineShadowIndex?: ((...params: any[]) => any) | null): OverrideCollection<T>;
6854
+
6745
6855
  /**
6746
6856
  */
6747
6857
  export interface ProjectionOptions {
6858
+ type?: string;
6748
6859
  /**
6749
6860
  * EPSG of the projection, for example: "EPSG:4326" if not specified, uses the framework projection
6750
6861
  */
@@ -6757,6 +6868,10 @@ export interface ProjectionOptions {
6757
6868
  * aliases to define
6758
6869
  */
6759
6870
  alias?: string[] | undefined | null;
6871
+ /**
6872
+ * an alternate prefix to use for custom projection
6873
+ */
6874
+ prefix?: string | undefined;
6760
6875
  }
6761
6876
 
6762
6877
  /**
@@ -6770,6 +6885,7 @@ export function setDefaultProjectionOptions(options: ProjectionOptions): void;
6770
6885
  */
6771
6886
  export class Projection {
6772
6887
  constructor(options: ProjectionOptions);
6888
+ static className: any;
6773
6889
  /**
6774
6890
  * epsg code in the format "EPSG:25832"
6775
6891
  */
@@ -6951,7 +7067,7 @@ export function getShapeFromOptions(options: VectorStyleItemImage): import("ol/s
6951
7067
 
6952
7068
  export const shapeCategory: any;
6953
7069
 
6954
- export function getStyleOrDefaultStyle(styleOptions?: Reference | DeclarativeStyleItemOptions | VectorStyleItemOptions | StyleItem | string, defaultStyle?: VectorStyleItem | DeclarativeStyleItem): StyleItem;
7070
+ export function getStyleOrDefaultStyle(styleOptions?: Reference | DeclarativeStyleItemOptions | VectorStyleItemOptions | StyleItem | string, defaultStyle?: StyleItem): StyleItem;
6955
7071
 
6956
7072
  export interface FontObject {
6957
7073
  fontStyle: string;
@@ -7432,4 +7548,80 @@ export class ViewPoint extends VcsObject {
7432
7548
  readonly className: string;
7433
7549
  }
7434
7550
 
7551
+ export class VcsApp {
7552
+ readonly id: string;
7553
+ readonly maps: OverrideMapCollection;
7554
+ readonly layers: OverrideLayerCollection;
7555
+ readonly obliqueCollections: OverrideCollection<ObliqueCollection>;
7556
+ readonly viewPoints: OverrideCollection<ViewPoint>;
7557
+ readonly styles: OverrideCollection<StyleItem>;
7558
+ readonly categories: CategoryCollection;
7559
+ readonly destroyed: VcsEvent<void>;
7560
+ readonly contextAdded: any;
7561
+ readonly contextRemoved: any;
7562
+ getContextById(id: string): Context;
7563
+ protected _parseContext(context: Context): Promise<void>;
7564
+ protected _setContextState(context: Context): Promise<void>;
7565
+ addContext(context: Context): Promise<void>;
7566
+ protected _removeContext(contextId: string): Promise<void>;
7567
+ removeContext(contextId: string): Promise<void>;
7568
+ }
7569
+
7570
+ export function getVcsAppById(id: string): VcsApp;
7571
+
7572
+ export const contextIdSymbol: symbol;
7573
+
7574
+ /**
7575
+ * returns a constructor of a type.
7576
+ */
7577
+ export function getObjectFromOptions(options: any, ...args: any[]): Promise<object | null>;
7578
+
7579
+ export function deserializeMap(vcsApp: VcsApp, mapConfig: VcsMapOptions): Promise<VcsMap | null>;
7580
+
7581
+ export function deserializeViewPoint(viewPointObject: ViewPointOptions): Promise<null | ViewPoint>;
7582
+
7583
+ export function serializeLayer(vcsApp: VcsApp, layer: Layer): Promise<LayerOptions | null>;
7584
+
7585
+ export function getLayerIndex(current: Layer, previous: Layer, currentIndex: number): number | null;
7586
+
7587
+ export function destroyCollection(collection: Collection<any>): void;
7588
+
7589
+
7590
+
7591
+
7592
+ export interface OverrideCollectionInterface<T extends any> {
7593
+ replaced: VcsEvent<T>;
7594
+ shadowMap: Map<string, object[]>;
7595
+ override: (item: T) => T;
7596
+ parseItems: (items: object[], contextId: string) => Promise<void>;
7597
+ removeContext: (contextId: string) => Promise<void>;
7598
+ serializeContext: (contextId: string) => object[];
7599
+ }
7600
+
7601
+ export class OverrideCollection<T extends any> extends Collection<T> implements OverrideCollectionInterface<T> {
7602
+ replaced: VcsEvent<T>;
7603
+ shadowMap: Map<string, object[]>;
7604
+ override: (item: T) => T;
7605
+ parseItems: (items: object[], contextId: string) => Promise<void>;
7606
+ removeContext: (contextId: string) => Promise<void>;
7607
+ serializeContext: (contextId: string) => object[];
7608
+ }
7609
+
7610
+ export class OverrideLayerCollection extends LayerCollection implements OverrideCollectionInterface<Layer> {
7611
+ replaced: VcsEvent<Layer>;
7612
+ shadowMap: Map<string, object[]>;
7613
+ override: (item: Layer) => Layer;
7614
+ parseItems: (items: object[], contextId: string) => Promise<void>;
7615
+ removeContext: (contextId: string) => Promise<void>;
7616
+ serializeContext: (contextId: string) => object[];
7617
+ }
7618
+
7619
+ export class OverrideMapCollection extends MapCollection implements OverrideCollectionInterface<VcsMap> {
7620
+ replaced: VcsEvent<VcsMap>;
7621
+ shadowMap: Map<string, object[]>;
7622
+ override: (item: VcsMap) => VcsMap;
7623
+ parseItems: (items: object[], contextId: string) => Promise<void>;
7624
+ removeContext: (contextId: string) => Promise<void>;
7625
+ serializeContext: (contextId: string) => object[];
7626
+ }
7435
7627
 
package/index.js CHANGED
@@ -6,7 +6,11 @@ import './src/cesium/cesium3DTilePointFeature.js';
6
6
  import './src/cesium/cesium3DTileFeature.js';
7
7
  import './src/cesium/cesiumVcsCameraPrimitive.js';
8
8
 
9
+ export { default as AppBackedCategory } from './src/vcs/vcm/category/appBackedCategory.js';
10
+ export { default as Category } from './src/vcs/vcm/category/category.js';
11
+ export { default as CategoryCollection } from './src/vcs/vcm/category/categoryCollection.js';
9
12
  export { VcsClassRegistry, default as ClassRegistry } from './src/vcs/vcm/classRegistry.js';
13
+ export { default as Context } from './src/vcs/vcm/context.js';
10
14
  export { default as VcsEvent } from './src/vcs/vcm/event/vcsEvent.js';
11
15
  export { styleCollection, obliqueCollectionCollection } from './src/vcs/vcm/globalCollections.js';
12
16
  export { default as AbstractInteraction } from './src/vcs/vcm/interaction/abstractInteraction.js';
@@ -84,7 +88,7 @@ export { default as WMS } from './src/vcs/vcm/layer/wms.js';
84
88
  export { getWMSSource } from './src/vcs/vcm/layer/wmsHelpers.js';
85
89
  export { default as WMTS } from './src/vcs/vcm/layer/wmts.js';
86
90
  export { default as BaseOLMap } from './src/vcs/vcm/maps/baseOLMap.js';
87
- export { Mode, default as CameraLimiter } from './src/vcs/vcm/maps/cameraLimiter.js';
91
+ export { CameraLimiterMode, default as CameraLimiter } from './src/vcs/vcm/maps/cameraLimiter.js';
88
92
  export { default as CesiumMap } from './src/vcs/vcm/maps/cesium.js';
89
93
  export { default as VcsMap } from './src/vcs/vcm/maps/map.js';
90
94
  export { default as MapState } from './src/vcs/vcm/maps/mapState.js';
@@ -98,7 +102,7 @@ export { default as ObliqueImageMeta } from './src/vcs/vcm/oblique/ObliqueImageM
98
102
  export { default as ObliqueProvider } from './src/vcs/vcm/oblique/ObliqueProvider.js';
99
103
  export { default as ObliqueView } from './src/vcs/vcm/oblique/ObliqueView.js';
100
104
  export { ObliqueViewDirection, obliqueViewDirectionNames, getDirectionName } from './src/vcs/vcm/oblique/ObliqueViewDirection.js';
101
- export { sortRealWordEdgeCoordinates, checkLineIntersection, transformCWIFC, transformToImage, transformFromImage, hasSameOrigin, destroyCesiumEvent } from './src/vcs/vcm/oblique/helpers.js';
105
+ export { sortRealWordEdgeCoordinates, checkLineIntersection, transformCWIFC, transformToImage, transformFromImage, hasSameOrigin } from './src/vcs/vcm/oblique/helpers.js';
102
106
  export { getVersionFromImageJson, parseImageMeta, parseImageData, parseLegacyImageData } from './src/vcs/vcm/oblique/parseImageJson.js';
103
107
  export { default as ClippingObject } from './src/vcs/vcm/util/clipping/clippingObject.js';
104
108
  export { default as ClippingObjectManager } from './src/vcs/vcm/util/clipping/clippingObjectManager.js';
@@ -114,11 +118,12 @@ export { default as TileProviderFeatureProvider } from './src/vcs/vcm/util/featu
114
118
  export { getFormat, default as WMSFeatureProvider } from './src/vcs/vcm/util/featureProvider/wmsFeatureProvider.js';
115
119
  export { validateCircle, default as circleToCesium } from './src/vcs/vcm/util/featureconverter/circleToCesium.js';
116
120
  export { getStylesArray, default as convert } from './src/vcs/vcm/util/featureconverter/convert.js';
117
- export { createEmpty3D, createOrUpdate3D, extendXYZ, extendXY, extendZ, extendFlatCoordinates, createOrUpdateFromGeometry, createOrUpdateFromHeightInfo, make2D } from './src/vcs/vcm/util/featureconverter/extent3d.js';
121
+ export { default as Extent3D } from './src/vcs/vcm/util/featureconverter/extent3D.js';
118
122
  export { getMaterialAppearance, createClassificationPrimitive, createPrimitive, createOutlinePrimitive, createLinePrimitive, getMinHeightOrGroundLevel, getStoreyHeights, validateStoreys, getHeightAboveGround, getHeightInfo, getStoreyOptions, addPrimitivesToContext } from './src/vcs/vcm/util/featureconverter/featureconverterHelper.js';
119
123
  export { validateLineString, default as lineStringToCesium } from './src/vcs/vcm/util/featureconverter/lineStringToCesium.js';
120
124
  export { getBillboardOptions, getLabelOptions, getModelOptions, validatePoint, getCartesian3AndWGS84FromCoordinates, default as pointToCesium } from './src/vcs/vcm/util/featureconverter/pointToCesium.js';
121
125
  export { validatePolygon, default as polygonToCesium } from './src/vcs/vcm/util/featureconverter/polygonToCesium.js';
126
+ export { requestUrl, requestJson, requestArrayBuffer } from './src/vcs/vcm/util/fetch.js';
122
127
  export { getFlatCoordinatesFromSimpleGeometry, getFlatCoordinatesFromGeometry, circleFromCenterRadius, convertGeometryToPolygon, enforceEndingVertex, removeEndingVertex, removeEndingVertexFromGeometry, enforceRightHand } from './src/vcs/vcm/util/geometryHelpers.js';
123
128
  export { default as IndexedCollection } from './src/vcs/vcm/util/indexedCollection.js';
124
129
  export { isMobile } from './src/vcs/vcm/util/isMobile.js';
@@ -126,6 +131,7 @@ export { default as LayerCollection } from './src/vcs/vcm/util/layerCollection.j
126
131
  export { getLocaleChangedEvent, detectBrowserLocale, getCurrentLocale, setCurrentLocale } from './src/vcs/vcm/util/locale.js';
127
132
  export { default as MapCollection } from './src/vcs/vcm/util/mapCollection.js';
128
133
  export { coordinateAtDistance, initialBearingBetweenCoords, cartesian2DDistance, cartesian3DDistance } from './src/vcs/vcm/util/math.js';
134
+ export { isOverrideCollection, default as makeOverrideCollection } from './src/vcs/vcm/util/overrideCollection.js';
129
135
  export { wgs84ToMercatorTransformer, mercatorToWgs84Transformer, setDefaultProjectionOptions, getDefaultProjection, wgs84Projection, mercatorProjection, default as Projection } from './src/vcs/vcm/util/projection.js';
130
136
  export { default as SplitScreen } from './src/vcs/vcm/util/splitScreen.js';
131
137
  export { defaultDeclarativeStyle, default as DeclarativeStyleItem } from './src/vcs/vcm/util/style/declarativeStyleItem.js';
@@ -137,3 +143,5 @@ export { olcsGeometryType, vectorStyleSymbol, defaultVectorStyle, fromCesiumColo
137
143
  export { embedIconsInStyle, default as writeStyle } from './src/vcs/vcm/util/style/writeStyle.js';
138
144
  export { isSameOrigin } from './src/vcs/vcm/util/urlHelpers.js';
139
145
  export { propertyEqualsEpsilon, angleEqualsEpsilon, coordinateEqualsEpsilon, default as ViewPoint } from './src/vcs/vcm/util/viewpoint.js';
146
+ export { getVcsAppById, default as VcsApp } from './src/vcs/vcm/vcsApp.js';
147
+ export { contextIdSymbol, getObjectFromOptions, deserializeMap, deserializeViewPoint, serializeLayer, getLayerIndex, destroyCollection } from './src/vcs/vcm/vcsAppContextHelpers.js';