@vcmap/core 5.0.0-rc.27 → 5.0.0-rc.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +273 -125
- package/index.js +6 -4
- package/package.json +1 -1
- package/src/category/category.js +16 -16
- package/src/category/categoryCollection.js +13 -13
- package/src/interaction/eventHandler.js +4 -4
- package/src/layer/featureVisibility.js +3 -4
- package/src/layer/globalHider.js +1 -1
- package/src/layer/layer.js +2 -1
- package/src/layer/vectorLayer.js +7 -0
- package/src/oblique/helpers.js +7 -9
- package/src/ol/feature.js +28 -0
- package/src/overrideClassRegistry.js +17 -17
- package/src/style/declarativeStyleItem.js +2 -3
- package/src/util/editor/editFeaturesSession.js +150 -166
- package/src/util/editor/editGeometrySession.js +69 -47
- package/src/util/editor/editorHelpers.js +3 -1
- package/src/util/editor/editorSessionHelpers.js +11 -3
- package/src/util/editor/editorSymbols.js +5 -0
- package/src/util/editor/interactions/editFeaturesMouseOverInteraction.js +15 -49
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +16 -33
- package/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +5 -5
- package/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +143 -0
- package/src/util/editor/interactions/selectMultiFeatureInteraction.js +17 -11
- package/src/util/editor/interactions/selectSingleFeatureInteraction.js +27 -8
- package/src/util/editor/interactions/translateVertexInteraction.js +2 -3
- package/src/util/editor/selectFeaturesSession.js +287 -0
- package/src/util/editor/transformation/transformationHandler.js +4 -9
- package/src/util/editor/transformation/transformationTypes.js +1 -0
- package/src/util/featureconverter/convert.js +1 -1
- package/src/util/indexedCollection.js +19 -3
- package/src/util/layerCollection.js +4 -2
- package/src/util/overrideCollection.js +20 -20
- package/src/vcsApp.js +107 -85
- package/src/vcsModule.js +129 -0
- package/src/{vcsAppContextHelpers.js → vcsModuleHelpers.js} +5 -5
- package/src/context.js +0 -89
package/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface CategoryOptions extends VcsObjectOptions {
|
|
|
18
18
|
/**
|
|
19
19
|
* A category contains user based items and is a special container. The container should not be created directly, but via
|
|
20
20
|
* the requestCategory API on the categories collection. Do not use toJSON to retrieve the state of a category, since
|
|
21
|
-
* categories outlive
|
|
21
|
+
* categories outlive modules and may be changed with mergeOptions to no longer reflect your initial state. Requestors
|
|
22
22
|
* should keep track of the requested options themselves.
|
|
23
23
|
*/
|
|
24
24
|
export class Category<T extends Object|VcsObject> extends VcsObject {
|
|
@@ -64,7 +64,7 @@ export class Category<T extends Object|VcsObject> extends VcsObject {
|
|
|
64
64
|
*/
|
|
65
65
|
protected _deserializeItem(config: any): Promise<T>;
|
|
66
66
|
protected _serializeItem(item: T): any;
|
|
67
|
-
|
|
67
|
+
serializeModule(moduleId: string): any | null;
|
|
68
68
|
/**
|
|
69
69
|
* unique Name
|
|
70
70
|
*/
|
|
@@ -87,7 +87,7 @@ export class CategoryCollection extends IndexedCollection<Category<Object|VcsObj
|
|
|
87
87
|
* Parses the category items. Items will only be parsed, if a category with said name exists. Otherwise,
|
|
88
88
|
* they will be cached, until such a category is requested.
|
|
89
89
|
*/
|
|
90
|
-
parseCategoryItems(name: string, items: object[],
|
|
90
|
+
parseCategoryItems(name: string, items: object[], moduleId: string): Promise<void>;
|
|
91
91
|
/**
|
|
92
92
|
* Add categories with this API.
|
|
93
93
|
*/
|
|
@@ -139,39 +139,6 @@ export const categoryClassRegistry: ClassRegistry<Category<any>>;
|
|
|
139
139
|
*/
|
|
140
140
|
export function getObjectFromClassRegistry<T extends Object|VcsObject>(classRegistry: OverrideClassRegistry<T> | ClassRegistry<T>, options: any, ...args: any[]): T | null;
|
|
141
141
|
|
|
142
|
-
export interface VcsAppConfig {
|
|
143
|
-
id?: string | undefined;
|
|
144
|
-
layers?: LayerOptions[];
|
|
145
|
-
maps?: VcsMapOptions[];
|
|
146
|
-
styles?: StyleItemOptions[];
|
|
147
|
-
viewpoints?: ViewpointOptions[];
|
|
148
|
-
startingViewpointName?: string;
|
|
149
|
-
startingMapName?: string;
|
|
150
|
-
projection?: ProjectionOptions;
|
|
151
|
-
categories?: { name: string; items: object[]; }[];
|
|
152
|
-
obliqueCollections?: ObliqueCollectionOptions[];
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* The id of the volatile context. Objects with this id shall never be serialized.
|
|
157
|
-
*/
|
|
158
|
-
export const volatileContextId: string;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* This marks an object as "volatile". This ensures, that an object added to the {@see VcsApp}
|
|
162
|
-
* will never be serialized into a context, regardless of the current dynamic context. Typical use case is a scratch layer
|
|
163
|
-
* which represents temporary features.
|
|
164
|
-
* @param object - the object to mark as volatile
|
|
165
|
-
*/
|
|
166
|
-
export function markVolatile(object: VcsObject | any): void;
|
|
167
|
-
|
|
168
|
-
export class Context {
|
|
169
|
-
constructor(config: VcsAppConfig);
|
|
170
|
-
readonly id: string;
|
|
171
|
-
readonly checkSum: string;
|
|
172
|
-
readonly config: VcsAppConfig;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
142
|
/**
|
|
176
143
|
*/
|
|
177
144
|
export interface AbstractFeatureProviderOptions extends VcsObjectOptions {
|
|
@@ -548,9 +515,9 @@ export class EventHandler {
|
|
|
548
515
|
* Add a dynamic interaction to the interaction chain. This is the default methodology for
|
|
549
516
|
* user map interactions, such as drawing or measuring. If another exclusive interaction is added,
|
|
550
517
|
* this interaction is removed and a provided callback is called. Use the id parameter to add multiple interactions
|
|
551
|
-
* from the same source (if you don't wish to provide an {@link InteractionChain}
|
|
518
|
+
* from the same source (if you don't wish to provide an {@link InteractionChain})
|
|
552
519
|
* @param removed - the callback for when the interaction is forcefully removed.
|
|
553
|
-
* @param [index
|
|
520
|
+
* @param [index] - the position at which to push the interaction. If no index is provided, the interaction is pushed at the end and therefore is executed last.
|
|
554
521
|
* @param [id] - an id to allow for multiple interactions to belong to the same exclusive registerer
|
|
555
522
|
* @returns function to remove the interaction with. returns number of removed interactions (0|1)
|
|
556
523
|
*/
|
|
@@ -2196,7 +2163,7 @@ export interface HiddenObject {
|
|
|
2196
2163
|
* GlobalHider globally hides features existing within a layer of a {@link LayerCollection}.
|
|
2197
2164
|
* Features can be defined as hidden by {@link VcsAppConfig} or {@link LayerOptions}.
|
|
2198
2165
|
* Hiding will be performed, when a {@link Context} is loaded, a {@link Layer} is activated or GlobalHider API is called.
|
|
2199
|
-
* A feature can be hidden multiple times by different actors, e.g.
|
|
2166
|
+
* A feature can be hidden multiple times by different actors, e.g. modules, layers, which is handled by this class.
|
|
2200
2167
|
* A feature will be shown again, when a {@link Context} is removed, a {@link Layer} is deactivated or GlobalHider API is called.
|
|
2201
2168
|
*/
|
|
2202
2169
|
export class GlobalHider {
|
|
@@ -2244,6 +2211,10 @@ export interface VcsMeta extends VectorPropertiesOptions {
|
|
|
2244
2211
|
screenSpaceError?: number | undefined;
|
|
2245
2212
|
flightOptions?: any | undefined;
|
|
2246
2213
|
baseUrl?: string | undefined;
|
|
2214
|
+
/**
|
|
2215
|
+
* the layers properties bag
|
|
2216
|
+
*/
|
|
2217
|
+
layerProperties?: any | undefined;
|
|
2247
2218
|
}
|
|
2248
2219
|
|
|
2249
2220
|
/**
|
|
@@ -6290,15 +6261,15 @@ export class OverrideClassRegistry<T extends Object|VcsObject> {
|
|
|
6290
6261
|
removed: VcsEvent<string>;
|
|
6291
6262
|
getClassNames(): string[];
|
|
6292
6263
|
/**
|
|
6293
|
-
* Register a class for a given
|
|
6264
|
+
* Register a class for a given module by name. If the class already exists, it will be replaced and replaced called with the classeName.
|
|
6294
6265
|
*/
|
|
6295
|
-
registerClass(
|
|
6266
|
+
registerClass(moduleId: string, className: string, ctor: (...params: any[]) => any): void;
|
|
6296
6267
|
/**
|
|
6297
6268
|
* Unregister a previously registered class. You can only unregister classes added to this registry, not the underlying core registry.
|
|
6298
6269
|
* If when registering this class you have replaced class, it will be re-instated and replaced called.
|
|
6299
6270
|
* If there is no previously registered class, it will be removed and removed will be called.
|
|
6300
6271
|
*/
|
|
6301
|
-
unregisterClass(
|
|
6272
|
+
unregisterClass(moduleId: string, className: string): void;
|
|
6302
6273
|
/**
|
|
6303
6274
|
* Gets the constructor for a registered class or undefined, if no such class was registerd
|
|
6304
6275
|
*/
|
|
@@ -6315,10 +6286,10 @@ export class OverrideClassRegistry<T extends Object|VcsObject> {
|
|
|
6315
6286
|
*/
|
|
6316
6287
|
createFromTypeOptions(options: any, ...args: any[]): T;
|
|
6317
6288
|
/**
|
|
6318
|
-
* Removes all classes registered from within a certain
|
|
6289
|
+
* Removes all classes registered from within a certain module. Will re-instate classes overwritten by the module
|
|
6319
6290
|
* and call the appropriate events, outlined in unregisterClass.
|
|
6320
6291
|
*/
|
|
6321
|
-
|
|
6292
|
+
removeModule(moduleId: string): void;
|
|
6322
6293
|
/**
|
|
6323
6294
|
* Destroys the override class registry
|
|
6324
6295
|
*/
|
|
@@ -7079,33 +7050,58 @@ export function startCreateFeatureSession(app: VcsApp, layer: VectorLayer, geome
|
|
|
7079
7050
|
/**
|
|
7080
7051
|
*/
|
|
7081
7052
|
export interface EditFeaturesSession extends EditorSession {
|
|
7082
|
-
featureSelection: SelectMultiFeatureInteraction;
|
|
7083
7053
|
/**
|
|
7084
7054
|
* read only access to the current mode
|
|
7085
7055
|
*/
|
|
7086
7056
|
mode: TransformationMode;
|
|
7057
|
+
/**
|
|
7058
|
+
* Function for rotating features. Takes angle in radians as parameter.
|
|
7059
|
+
*/
|
|
7060
|
+
rotate: (...params: any[]) => any;
|
|
7061
|
+
/**
|
|
7062
|
+
* Function for translating features. Takes Δx, Δy, Δz as parameters.
|
|
7063
|
+
*/
|
|
7064
|
+
translate: (...params: any[]) => any;
|
|
7065
|
+
/**
|
|
7066
|
+
* Function for scaling features. Takes sx, sy as parameters.
|
|
7067
|
+
*/
|
|
7068
|
+
scale: (...params: any[]) => any;
|
|
7087
7069
|
setMode: (...params: any[]) => any;
|
|
7088
7070
|
modeChanged: VcsEvent<TransformationMode>;
|
|
7071
|
+
/**
|
|
7072
|
+
* Sets the features for the edit session.
|
|
7073
|
+
*/
|
|
7074
|
+
setFeatures: (...params: any[]) => any;
|
|
7075
|
+
/**
|
|
7076
|
+
* Gets the features of the edit session.
|
|
7077
|
+
*/
|
|
7078
|
+
features: import("ol").Feature[];
|
|
7089
7079
|
}
|
|
7090
7080
|
|
|
7091
7081
|
/**
|
|
7092
7082
|
* Creates an editor session to select, translate, rotate & scale the feature on a given layer
|
|
7083
|
+
* @param [interactionId] - id for registering mutliple exclusive interaction. Needed to run a selection session at the same time as a edit features session.
|
|
7093
7084
|
*/
|
|
7094
|
-
export function startEditFeaturesSession(app: VcsApp, layer: VectorLayer,
|
|
7085
|
+
export function startEditFeaturesSession(app: VcsApp, layer: VectorLayer, interactionId?: string, initialMode?: TransformationMode): EditFeaturesSession;
|
|
7095
7086
|
|
|
7096
7087
|
/**
|
|
7097
7088
|
*/
|
|
7098
7089
|
export interface EditGeometrySession extends EditorSession {
|
|
7099
7090
|
/**
|
|
7100
|
-
* the feature
|
|
7091
|
+
* Sets the feature for the edit session.
|
|
7092
|
+
*/
|
|
7093
|
+
setFeature: (...params: any[]) => any;
|
|
7094
|
+
/**
|
|
7095
|
+
* Gets the current feature of the edit session.
|
|
7101
7096
|
*/
|
|
7102
|
-
|
|
7097
|
+
feature: import("ol").Feature | null;
|
|
7103
7098
|
}
|
|
7104
7099
|
|
|
7105
7100
|
/**
|
|
7106
7101
|
* Creates the edit geometry session.
|
|
7102
|
+
* @param [interactionId] - id for registering mutliple exclusive interaction. Needed to run a selection session at the same time as a edit features session.
|
|
7107
7103
|
*/
|
|
7108
|
-
export function startEditGeometrySession(app: VcsApp, layer: VectorLayer): EditGeometrySession;
|
|
7104
|
+
export function startEditGeometrySession(app: VcsApp, layer: VectorLayer, interactionId?: string): EditGeometrySession;
|
|
7109
7105
|
|
|
7110
7106
|
export function createVertex(coordinate: import("ol/coordinate").Coordinate): Vertex;
|
|
7111
7107
|
|
|
@@ -7166,7 +7162,8 @@ export interface EditorSession {
|
|
|
7166
7162
|
export enum SessionType {
|
|
7167
7163
|
CREATE,
|
|
7168
7164
|
EDIT_GEOMETRY,
|
|
7169
|
-
EDIT_FEATURES
|
|
7165
|
+
EDIT_FEATURES,
|
|
7166
|
+
SELECT
|
|
7170
7167
|
}
|
|
7171
7168
|
|
|
7172
7169
|
/**
|
|
@@ -7199,6 +7196,11 @@ export const vertexIndex: unique symbol;
|
|
|
7199
7196
|
*/
|
|
7200
7197
|
export const handlerSymbol: unique symbol;
|
|
7201
7198
|
|
|
7199
|
+
/**
|
|
7200
|
+
* Symbol to identify which was the last editor mouse over handler that edited the cursor style.
|
|
7201
|
+
*/
|
|
7202
|
+
export const mouseOverSymbol: unique symbol;
|
|
7203
|
+
|
|
7202
7204
|
|
|
7203
7205
|
|
|
7204
7206
|
/**
|
|
@@ -7342,14 +7344,8 @@ export class CreatePolygonInteraction extends AbstractInteraction implements Cre
|
|
|
7342
7344
|
|
|
7343
7345
|
/**
|
|
7344
7346
|
* A class to handle mouse over effects on features for editor sessions.
|
|
7345
|
-
* @param layerName - the layer name of the currently editing layer
|
|
7346
7347
|
*/
|
|
7347
7348
|
export class EditFeaturesMouseOverInteraction extends AbstractInteraction {
|
|
7348
|
-
constructor(layerName: string, selectMultiFeatureInteraction: SelectMultiFeatureInteraction);
|
|
7349
|
-
/**
|
|
7350
|
-
* The layer name to react to
|
|
7351
|
-
*/
|
|
7352
|
-
layerName: string;
|
|
7353
7349
|
cursorStyle: CSSStyleDeclaration;
|
|
7354
7350
|
/**
|
|
7355
7351
|
* Reset the cursorStyle to auto
|
|
@@ -7373,21 +7369,12 @@ export class EditFeaturesMouseOverInteraction extends AbstractInteraction {
|
|
|
7373
7369
|
pointerKey: number;
|
|
7374
7370
|
}
|
|
7375
7371
|
|
|
7376
|
-
/**
|
|
7377
|
-
* only exported for tests
|
|
7378
|
-
*/
|
|
7379
7372
|
export const cursorMap: any;
|
|
7380
7373
|
|
|
7381
7374
|
/**
|
|
7382
7375
|
* A class to handle mouse over effects on features for editor sessions.
|
|
7383
|
-
* @param layerName - the layer name of the currently editing layer
|
|
7384
7376
|
*/
|
|
7385
7377
|
export class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
7386
|
-
constructor(layerName: string);
|
|
7387
|
-
/**
|
|
7388
|
-
* The layer name to react to
|
|
7389
|
-
*/
|
|
7390
|
-
layerName: string;
|
|
7391
7378
|
cursorStyle: CSSStyleDeclaration;
|
|
7392
7379
|
/**
|
|
7393
7380
|
* Reset the cursorStyle to auto
|
|
@@ -7415,9 +7402,10 @@ export class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
|
7415
7402
|
* This interaction ensure a potential handler is dragged in 3D when it is obscured by a transparent feature.
|
|
7416
7403
|
* It uses drillPick on MOVE if: the map is 3D, there is a feature at said position, there is a feature selected in
|
|
7417
7404
|
* the feature selection & the feature at the position is _not_ a handler
|
|
7405
|
+
* @param selectedFeatures - Reference to the selected features.
|
|
7418
7406
|
*/
|
|
7419
7407
|
export class EnsureHandlerSelectionInteraction {
|
|
7420
|
-
constructor(
|
|
7408
|
+
constructor(selectedFeatures: import("ol").Feature[]);
|
|
7421
7409
|
pipe(event: InteractionEvent): Promise<InteractionEvent>;
|
|
7422
7410
|
}
|
|
7423
7411
|
|
|
@@ -7481,6 +7469,51 @@ export class RemoveVertexInteraction extends AbstractInteraction {
|
|
|
7481
7469
|
pointerKey: number;
|
|
7482
7470
|
}
|
|
7483
7471
|
|
|
7472
|
+
/**
|
|
7473
|
+
* Enumeration of editor selection modes.
|
|
7474
|
+
*/
|
|
7475
|
+
export enum SelectionMode {
|
|
7476
|
+
SINGLE,
|
|
7477
|
+
MULTI
|
|
7478
|
+
}
|
|
7479
|
+
|
|
7480
|
+
/**
|
|
7481
|
+
* A class to handle mouse over effects on features for select sessions.
|
|
7482
|
+
* @param layerName - Name of the layer for which the mouse over effect should accur.
|
|
7483
|
+
* @param selectFeatureInteraction - The select feature interaction that handles the feature selection. Supports both, single and multi selection.
|
|
7484
|
+
*/
|
|
7485
|
+
export class SelectFeatureMouseOverInteraction extends AbstractInteraction {
|
|
7486
|
+
constructor(layerName: string, selectFeatureInteraction: SelectSingleFeatureInteraction | SelectMultiFeatureInteraction);
|
|
7487
|
+
|
|
7488
|
+
selectionMode: SelectionMode;
|
|
7489
|
+
/**
|
|
7490
|
+
* The layer name to react to
|
|
7491
|
+
*/
|
|
7492
|
+
layerName: string;
|
|
7493
|
+
/**
|
|
7494
|
+
* Reset the cursorStyle to auto
|
|
7495
|
+
*/
|
|
7496
|
+
reset(): void;
|
|
7497
|
+
/**
|
|
7498
|
+
* A unique identifier for this interaction
|
|
7499
|
+
*/
|
|
7500
|
+
id: string;
|
|
7501
|
+
/**
|
|
7502
|
+
* The current active bitmask for {@link EventType}
|
|
7503
|
+
*/
|
|
7504
|
+
active: number;
|
|
7505
|
+
/**
|
|
7506
|
+
* The current active {@link ModificationKeyType}
|
|
7507
|
+
*/
|
|
7508
|
+
modificationKey: number;
|
|
7509
|
+
/**
|
|
7510
|
+
* The currently active {@link PointerKeyType}
|
|
7511
|
+
*/
|
|
7512
|
+
pointerKey: number;
|
|
7513
|
+
}
|
|
7514
|
+
|
|
7515
|
+
|
|
7516
|
+
|
|
7484
7517
|
/**
|
|
7485
7518
|
* Interaction to create a selection set from the given layer.
|
|
7486
7519
|
* Will use CTRL modifier key to add more features to the set.
|
|
@@ -7488,15 +7521,18 @@ export class RemoveVertexInteraction extends AbstractInteraction {
|
|
|
7488
7521
|
* Creates a new set when clicking a feature
|
|
7489
7522
|
* FeatureStore features will be converted to their dynamic state on selection.
|
|
7490
7523
|
*/
|
|
7491
|
-
export class SelectMultiFeatureInteraction extends AbstractInteraction {
|
|
7524
|
+
export class SelectMultiFeatureInteraction extends AbstractInteraction implements SelectFeatureInteraction {
|
|
7492
7525
|
constructor(layer: VectorLayer);
|
|
7493
7526
|
/**
|
|
7494
7527
|
* Event raised when the feature selection changes. Will be called with an array of features or an empty array, when no feature is selected
|
|
7495
7528
|
*/
|
|
7496
7529
|
readonly featuresChanged: VcsEvent<import("ol").Feature[]>;
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7530
|
+
selected: any;
|
|
7531
|
+
/**
|
|
7532
|
+
* Checks if a feature with a spicific id is selected.
|
|
7533
|
+
*/
|
|
7534
|
+
hasFeatureId(id: string | number): boolean;
|
|
7535
|
+
setSelected(features: (import("ol").Feature | import("@vcmap-cesium/engine").Cesium3DTileFeature | import("@vcmap-cesium/engine").Cesium3DTilePointFeature | import("@vcmap-cesium/engine").Entity)[] | import("ol").Feature | import("@vcmap-cesium/engine").Cesium3DTileFeature | import("@vcmap-cesium/engine").Cesium3DTilePointFeature | import("@vcmap-cesium/engine").Entity): Promise<void>;
|
|
7500
7536
|
/**
|
|
7501
7537
|
* Clears the interaction, removing all features and calling the featureChange event with an empty array
|
|
7502
7538
|
*/
|
|
@@ -7519,22 +7555,28 @@ export class SelectMultiFeatureInteraction extends AbstractInteraction {
|
|
|
7519
7555
|
pointerKey: number;
|
|
7520
7556
|
}
|
|
7521
7557
|
|
|
7558
|
+
|
|
7559
|
+
|
|
7522
7560
|
/**
|
|
7523
7561
|
* Class to select features for editing.
|
|
7524
7562
|
* Static FeatureStore features will be converted into their dynamic form
|
|
7525
7563
|
*/
|
|
7526
|
-
export class SelectSingleFeatureInteraction extends AbstractInteraction {
|
|
7564
|
+
export class SelectSingleFeatureInteraction extends AbstractInteraction implements SelectFeatureInteraction {
|
|
7527
7565
|
constructor(layer: VectorLayer);
|
|
7528
7566
|
/**
|
|
7529
7567
|
* Event called when the feature changes. Called with null if the selection is cleared.
|
|
7530
7568
|
*/
|
|
7531
7569
|
featureChanged: VcsEvent<import("ol").Feature | null>;
|
|
7532
|
-
|
|
7570
|
+
selected: any;
|
|
7533
7571
|
/**
|
|
7534
7572
|
* Selects the given feature. if passed in a tiled feature store feature, it will be converted. Do not pass in uneditable features (feature which do not
|
|
7535
7573
|
* belong to the layer for which this interaction was created)
|
|
7536
7574
|
*/
|
|
7537
|
-
|
|
7575
|
+
setSelected(feature: (import("ol").Feature | import("@vcmap-cesium/engine").Cesium3DTileFeature | import("@vcmap-cesium/engine").Cesium3DTilePointFeature | import("@vcmap-cesium/engine").Entity)[] | import("ol").Feature | import("@vcmap-cesium/engine").Cesium3DTileFeature | import("@vcmap-cesium/engine").Cesium3DTilePointFeature | import("@vcmap-cesium/engine").Entity): Promise<void>;
|
|
7576
|
+
/**
|
|
7577
|
+
* Checks if a feature with a spicific id is selected.
|
|
7578
|
+
*/
|
|
7579
|
+
hasFeatureId(id: string | number): boolean;
|
|
7538
7580
|
/**
|
|
7539
7581
|
* Clears the current selection, if there is one.
|
|
7540
7582
|
*/
|
|
@@ -7581,6 +7623,52 @@ export class TranslateVertexInteraction extends AbstractInteraction {
|
|
|
7581
7623
|
pointerKey: number;
|
|
7582
7624
|
}
|
|
7583
7625
|
|
|
7626
|
+
/**
|
|
7627
|
+
*/
|
|
7628
|
+
export interface SelectionHighlightManager {
|
|
7629
|
+
/**
|
|
7630
|
+
* Currently highlighted features.
|
|
7631
|
+
*/
|
|
7632
|
+
highlightedFeatures: import("ol").Feature[];
|
|
7633
|
+
/**
|
|
7634
|
+
* Sets the new features to be highlighted. All currently highlighted features that are not part of the new features are unhighlighted. Features that are not on the highlight layer are ignored.
|
|
7635
|
+
*/
|
|
7636
|
+
update: (...params: any[]) => any;
|
|
7637
|
+
/**
|
|
7638
|
+
* Stops all listeners, unhighlights all features.
|
|
7639
|
+
*/
|
|
7640
|
+
destroy: (...params: any[]) => any;
|
|
7641
|
+
}
|
|
7642
|
+
|
|
7643
|
+
export function getDefaultHighlightStyle(): import("ol/style").Style;
|
|
7644
|
+
|
|
7645
|
+
/**
|
|
7646
|
+
*/
|
|
7647
|
+
export interface SelectFeaturesSession extends EditorSession {
|
|
7648
|
+
currentFeatures: import("ol").Feature[];
|
|
7649
|
+
firstFeature: import("ol").Feature;
|
|
7650
|
+
featuresChanged: VcsEvent<import("ol").Feature[]>;
|
|
7651
|
+
mode: SelectionMode;
|
|
7652
|
+
/**
|
|
7653
|
+
* Sets the selection mode. Raises modeChanged event, throws error when invalid selection mode input.
|
|
7654
|
+
*/
|
|
7655
|
+
setMode: (...params: any[]) => any;
|
|
7656
|
+
modeChanged: VcsEvent<SelectionMode>;
|
|
7657
|
+
/**
|
|
7658
|
+
* Promise that resolves when features are set.
|
|
7659
|
+
*/
|
|
7660
|
+
setCurrentFeatures: (...params: any[]) => any;
|
|
7661
|
+
/**
|
|
7662
|
+
* Deselects all features.
|
|
7663
|
+
*/
|
|
7664
|
+
clearSelection: (...params: any[]) => any;
|
|
7665
|
+
}
|
|
7666
|
+
|
|
7667
|
+
/**
|
|
7668
|
+
* @param [interactionId] - id for registering mutliple exclusive interaction.
|
|
7669
|
+
*/
|
|
7670
|
+
export function startSelectFeaturesSession(app: VcsApp, layer: VectorLayer, interactionId?: string, initialMode?: SelectionMode, highlightStyle?: import("ol/style").Style): SelectFeaturesSession;
|
|
7671
|
+
|
|
7584
7672
|
/**
|
|
7585
7673
|
* A class to handle events on a {@see TransformationHandler}. Should be used with {@see TransformationHandler} created for mode TransformationMode.EXTRUDE.
|
|
7586
7674
|
* If the Z handler is dragged, the extruded event will be raised with a delta in Z direction. This
|
|
@@ -7730,6 +7818,10 @@ export interface TransformationHandler {
|
|
|
7730
7818
|
* readonly value indicating whether the handlers are showing (proxy for: features are selected)
|
|
7731
7819
|
*/
|
|
7732
7820
|
showing: boolean;
|
|
7821
|
+
/**
|
|
7822
|
+
* Sets transformation handle features. The handler is located in the center of the features.
|
|
7823
|
+
*/
|
|
7824
|
+
setFeatures: (...params: any[]) => any;
|
|
7733
7825
|
/**
|
|
7734
7826
|
* destroy the handler and any resources created by it
|
|
7735
7827
|
*/
|
|
@@ -8021,6 +8113,11 @@ export class IndexedCollection<T extends any> extends Collection<T> {
|
|
|
8021
8113
|
add(item: T, index?: number): number | null;
|
|
8022
8114
|
remove(item: T): void;
|
|
8023
8115
|
protected _move(item: T, itemIndex: number, targetIndex: number): number;
|
|
8116
|
+
/**
|
|
8117
|
+
* Moves an item to a provided index
|
|
8118
|
+
* @returns the new index of the item
|
|
8119
|
+
*/
|
|
8120
|
+
moveTo(item: T, targetIndex: number): number | null;
|
|
8024
8121
|
/**
|
|
8025
8122
|
* Lowers an item within the array
|
|
8026
8123
|
* @param [steps = 1] - an integer number to lower by
|
|
@@ -8070,9 +8167,9 @@ export class LayerCollection extends IndexedCollection<Layer> {
|
|
|
8070
8167
|
*/
|
|
8071
8168
|
readonly zIndexSymbol: symbol;
|
|
8072
8169
|
/**
|
|
8073
|
-
*
|
|
8170
|
+
* The current global hider of these layers
|
|
8074
8171
|
*/
|
|
8075
|
-
globalHider:
|
|
8172
|
+
globalHider: GlobalHider;
|
|
8076
8173
|
locale: any;
|
|
8077
8174
|
/**
|
|
8078
8175
|
* Adds a layer to the collection. Can optionally be passed an index at which to insert the layer.
|
|
@@ -8228,13 +8325,13 @@ export function getCartesianPitch(p1: import("ol/coordinate").Coordinate, p2: im
|
|
|
8228
8325
|
export const isOverrideCollection: unique symbol;
|
|
8229
8326
|
|
|
8230
8327
|
/**
|
|
8231
|
-
* @param
|
|
8328
|
+
* @param getDynamicModuleId - function to get the current dynamic module id
|
|
8232
8329
|
* @param [serializeItem] - optional function to serialize an item, defaults to returning item.toJSON or item: i => (i.toJSON || i)
|
|
8233
8330
|
* @param [deserializeItem] - optional deserialization function. defaults to returning the passed object: i => i
|
|
8234
8331
|
* @param [ctor] - optional constructor to validate deserialized items against. if passed, deserializeItem must be an instance of ctor.
|
|
8235
8332
|
* @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.
|
|
8236
8333
|
*/
|
|
8237
|
-
export function makeOverrideCollection<T extends any>(collection: Collection<T>,
|
|
8334
|
+
export function makeOverrideCollection<T extends any>(collection: Collection<T>, getDynamicModuleId: (...params: any[]) => any, serializeItem?: (...params: any[]) => any, deserializeItem?: (...params: any[]) => any, ctor?: any, determineShadowIndex?: ((...params: any[]) => any) | null): OverrideCollection<T>;
|
|
8238
8335
|
|
|
8239
8336
|
/**
|
|
8240
8337
|
*/
|
|
@@ -8480,7 +8577,7 @@ export class Viewpoint extends VcsObject {
|
|
|
8480
8577
|
readonly className: string;
|
|
8481
8578
|
}
|
|
8482
8579
|
|
|
8483
|
-
export const
|
|
8580
|
+
export const defaultDynamicModuleId: string;
|
|
8484
8581
|
|
|
8485
8582
|
export class VcsApp {
|
|
8486
8583
|
readonly id: string;
|
|
@@ -8497,11 +8594,11 @@ export class VcsApp {
|
|
|
8497
8594
|
readonly styles: OverrideCollection<StyleItem>;
|
|
8498
8595
|
readonly categories: CategoryCollection;
|
|
8499
8596
|
readonly destroyed: VcsEvent<void>;
|
|
8500
|
-
readonly
|
|
8501
|
-
readonly
|
|
8502
|
-
readonly
|
|
8503
|
-
readonly
|
|
8504
|
-
readonly
|
|
8597
|
+
readonly modules: VcsModule[];
|
|
8598
|
+
readonly moduleAdded: any;
|
|
8599
|
+
readonly moduleRemoved: any;
|
|
8600
|
+
readonly dynamicModuleId: string;
|
|
8601
|
+
readonly dynamicModuleIdChanged: VcsEvent<string>;
|
|
8505
8602
|
readonly mapClassRegistry: OverrideClassRegistry<VcsMap>;
|
|
8506
8603
|
readonly layerClassRegistry: OverrideClassRegistry<Layer>;
|
|
8507
8604
|
readonly styleClassRegistry: OverrideClassRegistry<StyleItem>;
|
|
@@ -8509,20 +8606,21 @@ export class VcsApp {
|
|
|
8509
8606
|
readonly categoryItemClassRegistry: OverrideClassRegistry<any>;
|
|
8510
8607
|
readonly tileProviderClassRegistry: OverrideClassRegistry<TileProvider>;
|
|
8511
8608
|
readonly featureProviderClassRegistry: OverrideClassRegistry<AbstractFeatureProvider>;
|
|
8512
|
-
|
|
8513
|
-
protected
|
|
8514
|
-
protected
|
|
8515
|
-
|
|
8609
|
+
getModuleById(id: string): VcsModule;
|
|
8610
|
+
protected _parseModule(module: VcsModule): Promise<void>;
|
|
8611
|
+
protected _setModuleState(module: VcsModule): Promise<void>;
|
|
8612
|
+
addModule(module: VcsModule): Promise<void>;
|
|
8613
|
+
serializeModule(moduleId: string): VcsModuleConfig;
|
|
8516
8614
|
/**
|
|
8517
|
-
* sets the given
|
|
8615
|
+
* sets the given module as the dynamic
|
|
8518
8616
|
*/
|
|
8519
|
-
|
|
8617
|
+
setDynamicModule(module: VcsModule): void;
|
|
8520
8618
|
/**
|
|
8521
|
-
* resets the dynamic
|
|
8619
|
+
* resets the dynamic VcsModule to the "defaultDynamicModule"
|
|
8522
8620
|
*/
|
|
8523
|
-
|
|
8524
|
-
protected
|
|
8525
|
-
|
|
8621
|
+
resetDynamicModule(): void;
|
|
8622
|
+
protected _removeModule(moduleId: string): Promise<void>;
|
|
8623
|
+
removeModule(moduleId: string): Promise<void>;
|
|
8526
8624
|
/**
|
|
8527
8625
|
* Destroys the app and all its collections, their content and ui managers.
|
|
8528
8626
|
*/
|
|
@@ -8531,26 +8629,6 @@ export class VcsApp {
|
|
|
8531
8629
|
|
|
8532
8630
|
export function getVcsAppById(id: string): VcsApp;
|
|
8533
8631
|
|
|
8534
|
-
export const contextIdSymbol: unique symbol;
|
|
8535
|
-
|
|
8536
|
-
export interface ContextLayerOptions extends LayerOptions {
|
|
8537
|
-
style?: string | StyleItemOptions;
|
|
8538
|
-
tileProvider?: TileProviderOptions;
|
|
8539
|
-
featureProvider?: AbstractFeatureProviderOptions;
|
|
8540
|
-
}
|
|
8541
|
-
|
|
8542
|
-
export function deserializeMap(vcsApp: VcsApp, mapConfig: VcsMapOptions): VcsMap | null;
|
|
8543
|
-
|
|
8544
|
-
export function deserializeViewpoint(viewpointObject: ViewpointOptions): null | Viewpoint;
|
|
8545
|
-
|
|
8546
|
-
export function deserializeLayer(vcsApp: VcsApp, layerConfig: ContextLayerOptions): Layer | null;
|
|
8547
|
-
|
|
8548
|
-
export function serializeLayer(vcsApp: VcsApp, layer: Layer): ContextLayerOptions;
|
|
8549
|
-
|
|
8550
|
-
export function getLayerIndex(current: Layer, previous: Layer, currentIndex: number): number | null;
|
|
8551
|
-
|
|
8552
|
-
export function destroyCollection(collection: Collection<any>): void;
|
|
8553
|
-
|
|
8554
8632
|
export class VcsEvent<T extends any> {
|
|
8555
8633
|
/**
|
|
8556
8634
|
* The number of listeners
|
|
@@ -8578,6 +8656,70 @@ export class VcsEvent<T extends any> {
|
|
|
8578
8656
|
destroy(): void;
|
|
8579
8657
|
}
|
|
8580
8658
|
|
|
8659
|
+
export interface VcsModuleConfig {
|
|
8660
|
+
|
|
8661
|
+
name?: string | undefined;
|
|
8662
|
+
description?: string | undefined;
|
|
8663
|
+
layers?: LayerOptions[];
|
|
8664
|
+
maps?: VcsMapOptions[];
|
|
8665
|
+
styles?: StyleItemOptions[];
|
|
8666
|
+
viewpoints?: ViewpointOptions[];
|
|
8667
|
+
startingViewpointName?: string;
|
|
8668
|
+
startingMapName?: string;
|
|
8669
|
+
projection?: ProjectionOptions;
|
|
8670
|
+
categories?: { name: string; items: object[]; }[];
|
|
8671
|
+
obliqueCollections?: ObliqueCollectionOptions[];
|
|
8672
|
+
}
|
|
8673
|
+
|
|
8674
|
+
/**
|
|
8675
|
+
* The id of the volatile module. Objects with this id shall never be serialized.
|
|
8676
|
+
*/
|
|
8677
|
+
export const volatileModuleId: string;
|
|
8678
|
+
|
|
8679
|
+
/**
|
|
8680
|
+
* This marks an object as "volatile". This ensures, that an object added to the {@see VcsApp}
|
|
8681
|
+
* will never be serialized into a module, regardless of the current dynamic module. Typical use case is a scratch layer
|
|
8682
|
+
* which represents temporary features.
|
|
8683
|
+
* @param object - the object to mark as volatile
|
|
8684
|
+
*/
|
|
8685
|
+
export function markVolatile(object: VcsObject | any): void;
|
|
8686
|
+
|
|
8687
|
+
export class VcsModule {
|
|
8688
|
+
constructor(config: VcsModuleConfig);
|
|
8689
|
+
name: string;
|
|
8690
|
+
description: string;
|
|
8691
|
+
startingViewpointName: string;
|
|
8692
|
+
startingMapName: string;
|
|
8693
|
+
projection: Projection | undefined;
|
|
8694
|
+
readonly _id: string;
|
|
8695
|
+
readonly config: VcsModuleConfig;
|
|
8696
|
+
/**
|
|
8697
|
+
* Sets the config object by serializing all runtime objects of the current app.
|
|
8698
|
+
*/
|
|
8699
|
+
setConfigFromApp(app: VcsApp): void;
|
|
8700
|
+
toJSON(): VcsModuleConfig;
|
|
8701
|
+
}
|
|
8702
|
+
|
|
8703
|
+
export const moduleIdSymbol: unique symbol;
|
|
8704
|
+
|
|
8705
|
+
export interface ModuleLayerOptions extends LayerOptions {
|
|
8706
|
+
style?: string | StyleItemOptions;
|
|
8707
|
+
tileProvider?: TileProviderOptions;
|
|
8708
|
+
featureProvider?: AbstractFeatureProviderOptions;
|
|
8709
|
+
}
|
|
8710
|
+
|
|
8711
|
+
export function deserializeMap(vcsApp: VcsApp, mapConfig: VcsMapOptions): VcsMap | null;
|
|
8712
|
+
|
|
8713
|
+
export function deserializeViewpoint(viewpointObject: ViewpointOptions): null | Viewpoint;
|
|
8714
|
+
|
|
8715
|
+
export function deserializeLayer(vcsApp: VcsApp, layerConfig: ModuleLayerOptions): Layer | null;
|
|
8716
|
+
|
|
8717
|
+
export function serializeLayer(vcsApp: VcsApp, layer: Layer): ModuleLayerOptions;
|
|
8718
|
+
|
|
8719
|
+
export function getLayerIndex(current: Layer, previous: Layer, currentIndex: number): number | null;
|
|
8720
|
+
|
|
8721
|
+
export function destroyCollection(collection: Collection<any>): void;
|
|
8722
|
+
|
|
8581
8723
|
/**
|
|
8582
8724
|
*/
|
|
8583
8725
|
export interface VcsObjectOptions {
|
|
@@ -8623,40 +8765,40 @@ export interface OverrideCollectionInterface<T extends any> {
|
|
|
8623
8765
|
replaced: VcsEvent<ReplacedEvent<T>>;
|
|
8624
8766
|
shadowMap: Map<string, object[]>;
|
|
8625
8767
|
override: (item: T) => T;
|
|
8626
|
-
parseItems: (items: object[],
|
|
8768
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8627
8769
|
getSerializedByKey: (key: string) => object;
|
|
8628
|
-
|
|
8629
|
-
|
|
8770
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8771
|
+
serializeModule: (moduleId: string) => object[];
|
|
8630
8772
|
}
|
|
8631
8773
|
|
|
8632
8774
|
export class OverrideCollection<T extends any> extends Collection<T> implements OverrideCollectionInterface<T> {
|
|
8633
8775
|
replaced: VcsEvent<ReplacedEvent<T>>;
|
|
8634
8776
|
shadowMap: Map<string, object[]>;
|
|
8635
8777
|
override: (item: T) => T;
|
|
8636
|
-
parseItems: (items: object[],
|
|
8778
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8637
8779
|
getSerializedByKey: (key: string) => object;
|
|
8638
|
-
|
|
8639
|
-
|
|
8780
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8781
|
+
serializeModule: (moduleId: string) => object[];
|
|
8640
8782
|
}
|
|
8641
8783
|
|
|
8642
8784
|
export class OverrideLayerCollection extends LayerCollection implements OverrideCollectionInterface<Layer> {
|
|
8643
8785
|
replaced: VcsEvent<ReplacedEvent<Layer>>;
|
|
8644
8786
|
shadowMap: Map<string, object[]>;
|
|
8645
8787
|
override: (item: Layer) => Layer;
|
|
8646
|
-
parseItems: (items: object[],
|
|
8788
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8647
8789
|
getSerializedByKey: (key: string) => object;
|
|
8648
|
-
|
|
8649
|
-
|
|
8790
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8791
|
+
serializeModule: (moduleId: string) => object[];
|
|
8650
8792
|
}
|
|
8651
8793
|
|
|
8652
8794
|
export class OverrideMapCollection extends MapCollection implements OverrideCollectionInterface<VcsMap> {
|
|
8653
8795
|
replaced: VcsEvent<ReplacedEvent<VcsMap>>;
|
|
8654
8796
|
shadowMap: Map<string, object[]>;
|
|
8655
8797
|
override: (item: VcsMap) => VcsMap;
|
|
8656
|
-
parseItems: (items: object[],
|
|
8798
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8657
8799
|
getSerializedByKey: (key: string) => object;
|
|
8658
|
-
|
|
8659
|
-
|
|
8800
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8801
|
+
serializeModule: (moduleId: string) => object[];
|
|
8660
8802
|
}
|
|
8661
8803
|
|
|
8662
8804
|
|
|
@@ -8680,6 +8822,12 @@ export interface CreateInteraction<T extends import("ol/geom").Geometry> {
|
|
|
8680
8822
|
|
|
8681
8823
|
export type Vertex = import("ol").Feature<import("ol/geom").Point>;
|
|
8682
8824
|
|
|
8825
|
+
export interface SelectFeatureInteraction extends AbstractInteraction {
|
|
8826
|
+
readonly selected: Array<import("ol").Feature>;
|
|
8827
|
+
setSelected(features: Array<import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|import("@vcmap-cesium/engine").Entity> | import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|import("@vcmap-cesium/engine").Entity ):void;
|
|
8828
|
+
hasFeatureId(id: string): boolean;
|
|
8829
|
+
}
|
|
8830
|
+
|
|
8683
8831
|
declare module "@vcmap-cesium/engine" {
|
|
8684
8832
|
interface Entity {
|
|
8685
8833
|
getId():number|string;
|