@vcmap/core 5.0.0-rc.26 → 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 +282 -137
- package/index.js +6 -5
- package/package.json +3 -3
- package/src/category/category.js +16 -16
- package/src/category/categoryCollection.js +13 -14
- 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/arcStyle.js +74 -30
- 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 +33 -20
- package/src/vcsApp.js +107 -85
- package/src/vcsModule.js +129 -0
- package/src/{vcsAppContextHelpers.js → vcsModuleHelpers.js} +5 -5
- package/src/category/appBackedCategory.js +0 -89
- package/src/context.js +0 -89
package/index.d.ts
CHANGED
|
@@ -2,18 +2,6 @@ import olFeature from 'ol/Feature';
|
|
|
2
2
|
import Geometry from 'ol/geom/Geometry';
|
|
3
3
|
import Style from 'ol/style/Style';
|
|
4
4
|
|
|
5
|
-
export interface AppBackedCategoryOptions extends CategoryOptions {
|
|
6
|
-
collectionName: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class AppBackedCategory extends Category<VcsObject> {
|
|
10
|
-
constructor(options: AppBackedCategoryOptions);
|
|
11
|
-
protected _deserializeItem(config: VcsObjectOptions): Promise<VcsObject>;
|
|
12
|
-
setApp(app: VcsApp): void;
|
|
13
|
-
serializeForContext(contextId: string): null;
|
|
14
|
-
toJSON(): AppBackedCategoryOptions;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
5
|
/**
|
|
18
6
|
*/
|
|
19
7
|
export interface CategoryOptions extends VcsObjectOptions {
|
|
@@ -30,7 +18,7 @@ export interface CategoryOptions extends VcsObjectOptions {
|
|
|
30
18
|
/**
|
|
31
19
|
* A category contains user based items and is a special container. The container should not be created directly, but via
|
|
32
20
|
* the requestCategory API on the categories collection. Do not use toJSON to retrieve the state of a category, since
|
|
33
|
-
* categories outlive
|
|
21
|
+
* categories outlive modules and may be changed with mergeOptions to no longer reflect your initial state. Requestors
|
|
34
22
|
* should keep track of the requested options themselves.
|
|
35
23
|
*/
|
|
36
24
|
export class Category<T extends Object|VcsObject> extends VcsObject {
|
|
@@ -76,7 +64,7 @@ export class Category<T extends Object|VcsObject> extends VcsObject {
|
|
|
76
64
|
*/
|
|
77
65
|
protected _deserializeItem(config: any): Promise<T>;
|
|
78
66
|
protected _serializeItem(item: T): any;
|
|
79
|
-
|
|
67
|
+
serializeModule(moduleId: string): any | null;
|
|
80
68
|
/**
|
|
81
69
|
* unique Name
|
|
82
70
|
*/
|
|
@@ -99,7 +87,7 @@ export class CategoryCollection extends IndexedCollection<Category<Object|VcsObj
|
|
|
99
87
|
* Parses the category items. Items will only be parsed, if a category with said name exists. Otherwise,
|
|
100
88
|
* they will be cached, until such a category is requested.
|
|
101
89
|
*/
|
|
102
|
-
parseCategoryItems(name: string, items: object[],
|
|
90
|
+
parseCategoryItems(name: string, items: object[], moduleId: string): Promise<void>;
|
|
103
91
|
/**
|
|
104
92
|
* Add categories with this API.
|
|
105
93
|
*/
|
|
@@ -151,39 +139,6 @@ export const categoryClassRegistry: ClassRegistry<Category<any>>;
|
|
|
151
139
|
*/
|
|
152
140
|
export function getObjectFromClassRegistry<T extends Object|VcsObject>(classRegistry: OverrideClassRegistry<T> | ClassRegistry<T>, options: any, ...args: any[]): T | null;
|
|
153
141
|
|
|
154
|
-
export interface VcsAppConfig {
|
|
155
|
-
id?: string | undefined;
|
|
156
|
-
layers?: LayerOptions[];
|
|
157
|
-
maps?: VcsMapOptions[];
|
|
158
|
-
styles?: StyleItemOptions[];
|
|
159
|
-
viewpoints?: ViewpointOptions[];
|
|
160
|
-
startingViewpointName?: string;
|
|
161
|
-
startingMapName?: string;
|
|
162
|
-
projection?: ProjectionOptions;
|
|
163
|
-
categories?: { name: string; items: object[]; }[];
|
|
164
|
-
obliqueCollections?: ObliqueCollectionOptions[];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* The id of the volatile context. Objects with this id shall never be serialized.
|
|
169
|
-
*/
|
|
170
|
-
export const volatileContextId: string;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* This marks an object as "volatile". This ensures, that an object added to the {@see VcsApp}
|
|
174
|
-
* will never be serialized into a context, regardless of the current dynamic context. Typical use case is a scratch layer
|
|
175
|
-
* which represents temporary features.
|
|
176
|
-
* @param object - the object to mark as volatile
|
|
177
|
-
*/
|
|
178
|
-
export function markVolatile(object: VcsObject | any): void;
|
|
179
|
-
|
|
180
|
-
export class Context {
|
|
181
|
-
constructor(config: VcsAppConfig);
|
|
182
|
-
readonly id: string;
|
|
183
|
-
readonly checkSum: string;
|
|
184
|
-
readonly config: VcsAppConfig;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
142
|
/**
|
|
188
143
|
*/
|
|
189
144
|
export interface AbstractFeatureProviderOptions extends VcsObjectOptions {
|
|
@@ -560,9 +515,9 @@ export class EventHandler {
|
|
|
560
515
|
* Add a dynamic interaction to the interaction chain. This is the default methodology for
|
|
561
516
|
* user map interactions, such as drawing or measuring. If another exclusive interaction is added,
|
|
562
517
|
* this interaction is removed and a provided callback is called. Use the id parameter to add multiple interactions
|
|
563
|
-
* 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})
|
|
564
519
|
* @param removed - the callback for when the interaction is forcefully removed.
|
|
565
|
-
* @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.
|
|
566
521
|
* @param [id] - an id to allow for multiple interactions to belong to the same exclusive registerer
|
|
567
522
|
* @returns function to remove the interaction with. returns number of removed interactions (0|1)
|
|
568
523
|
*/
|
|
@@ -2208,7 +2163,7 @@ export interface HiddenObject {
|
|
|
2208
2163
|
* GlobalHider globally hides features existing within a layer of a {@link LayerCollection}.
|
|
2209
2164
|
* Features can be defined as hidden by {@link VcsAppConfig} or {@link LayerOptions}.
|
|
2210
2165
|
* Hiding will be performed, when a {@link Context} is loaded, a {@link Layer} is activated or GlobalHider API is called.
|
|
2211
|
-
* 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.
|
|
2212
2167
|
* A feature will be shown again, when a {@link Context} is removed, a {@link Layer} is deactivated or GlobalHider API is called.
|
|
2213
2168
|
*/
|
|
2214
2169
|
export class GlobalHider {
|
|
@@ -2256,6 +2211,10 @@ export interface VcsMeta extends VectorPropertiesOptions {
|
|
|
2256
2211
|
screenSpaceError?: number | undefined;
|
|
2257
2212
|
flightOptions?: any | undefined;
|
|
2258
2213
|
baseUrl?: string | undefined;
|
|
2214
|
+
/**
|
|
2215
|
+
* the layers properties bag
|
|
2216
|
+
*/
|
|
2217
|
+
layerProperties?: any | undefined;
|
|
2259
2218
|
}
|
|
2260
2219
|
|
|
2261
2220
|
/**
|
|
@@ -6302,15 +6261,15 @@ export class OverrideClassRegistry<T extends Object|VcsObject> {
|
|
|
6302
6261
|
removed: VcsEvent<string>;
|
|
6303
6262
|
getClassNames(): string[];
|
|
6304
6263
|
/**
|
|
6305
|
-
* 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.
|
|
6306
6265
|
*/
|
|
6307
|
-
registerClass(
|
|
6266
|
+
registerClass(moduleId: string, className: string, ctor: (...params: any[]) => any): void;
|
|
6308
6267
|
/**
|
|
6309
6268
|
* Unregister a previously registered class. You can only unregister classes added to this registry, not the underlying core registry.
|
|
6310
6269
|
* If when registering this class you have replaced class, it will be re-instated and replaced called.
|
|
6311
6270
|
* If there is no previously registered class, it will be removed and removed will be called.
|
|
6312
6271
|
*/
|
|
6313
|
-
unregisterClass(
|
|
6272
|
+
unregisterClass(moduleId: string, className: string): void;
|
|
6314
6273
|
/**
|
|
6315
6274
|
* Gets the constructor for a registered class or undefined, if no such class was registerd
|
|
6316
6275
|
*/
|
|
@@ -6327,10 +6286,10 @@ export class OverrideClassRegistry<T extends Object|VcsObject> {
|
|
|
6327
6286
|
*/
|
|
6328
6287
|
createFromTypeOptions(options: any, ...args: any[]): T;
|
|
6329
6288
|
/**
|
|
6330
|
-
* 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
|
|
6331
6290
|
* and call the appropriate events, outlined in unregisterClass.
|
|
6332
6291
|
*/
|
|
6333
|
-
|
|
6292
|
+
removeModule(moduleId: string): void;
|
|
6334
6293
|
/**
|
|
6335
6294
|
* Destroys the override class registry
|
|
6336
6295
|
*/
|
|
@@ -6348,6 +6307,10 @@ export interface ArcStyleOptions extends ArrowStyleOptions {
|
|
|
6348
6307
|
* number of segments to interpolate the arc by
|
|
6349
6308
|
*/
|
|
6350
6309
|
numberOfSegments?: number;
|
|
6310
|
+
/**
|
|
6311
|
+
* offset in m(mercator) from the arc end and arc start to the start/end points Is only rendered if offset * 2 < distance between start and endpoint
|
|
6312
|
+
*/
|
|
6313
|
+
offset?: number;
|
|
6351
6314
|
}
|
|
6352
6315
|
|
|
6353
6316
|
/**
|
|
@@ -6377,6 +6340,7 @@ export const featureArcStruct: unique symbol;
|
|
|
6377
6340
|
export class ArcStyle extends ArrowStyle {
|
|
6378
6341
|
constructor(options?: ArcStyleOptions);
|
|
6379
6342
|
numberOfSegments: any;
|
|
6343
|
+
offset: any;
|
|
6380
6344
|
arcFactor: any;
|
|
6381
6345
|
primitiveOptions: VectorPropertiesPrimitiveOptions;
|
|
6382
6346
|
end: ArrowEnd;
|
|
@@ -7086,33 +7050,58 @@ export function startCreateFeatureSession(app: VcsApp, layer: VectorLayer, geome
|
|
|
7086
7050
|
/**
|
|
7087
7051
|
*/
|
|
7088
7052
|
export interface EditFeaturesSession extends EditorSession {
|
|
7089
|
-
featureSelection: SelectMultiFeatureInteraction;
|
|
7090
7053
|
/**
|
|
7091
7054
|
* read only access to the current mode
|
|
7092
7055
|
*/
|
|
7093
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;
|
|
7094
7069
|
setMode: (...params: any[]) => any;
|
|
7095
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[];
|
|
7096
7079
|
}
|
|
7097
7080
|
|
|
7098
7081
|
/**
|
|
7099
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.
|
|
7100
7084
|
*/
|
|
7101
|
-
export function startEditFeaturesSession(app: VcsApp, layer: VectorLayer,
|
|
7085
|
+
export function startEditFeaturesSession(app: VcsApp, layer: VectorLayer, interactionId?: string, initialMode?: TransformationMode): EditFeaturesSession;
|
|
7102
7086
|
|
|
7103
7087
|
/**
|
|
7104
7088
|
*/
|
|
7105
7089
|
export interface EditGeometrySession extends EditorSession {
|
|
7106
7090
|
/**
|
|
7107
|
-
* 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.
|
|
7108
7096
|
*/
|
|
7109
|
-
|
|
7097
|
+
feature: import("ol").Feature | null;
|
|
7110
7098
|
}
|
|
7111
7099
|
|
|
7112
7100
|
/**
|
|
7113
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.
|
|
7114
7103
|
*/
|
|
7115
|
-
export function startEditGeometrySession(app: VcsApp, layer: VectorLayer): EditGeometrySession;
|
|
7104
|
+
export function startEditGeometrySession(app: VcsApp, layer: VectorLayer, interactionId?: string): EditGeometrySession;
|
|
7116
7105
|
|
|
7117
7106
|
export function createVertex(coordinate: import("ol/coordinate").Coordinate): Vertex;
|
|
7118
7107
|
|
|
@@ -7173,7 +7162,8 @@ export interface EditorSession {
|
|
|
7173
7162
|
export enum SessionType {
|
|
7174
7163
|
CREATE,
|
|
7175
7164
|
EDIT_GEOMETRY,
|
|
7176
|
-
EDIT_FEATURES
|
|
7165
|
+
EDIT_FEATURES,
|
|
7166
|
+
SELECT
|
|
7177
7167
|
}
|
|
7178
7168
|
|
|
7179
7169
|
/**
|
|
@@ -7206,6 +7196,11 @@ export const vertexIndex: unique symbol;
|
|
|
7206
7196
|
*/
|
|
7207
7197
|
export const handlerSymbol: unique symbol;
|
|
7208
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
|
+
|
|
7209
7204
|
|
|
7210
7205
|
|
|
7211
7206
|
/**
|
|
@@ -7349,14 +7344,8 @@ export class CreatePolygonInteraction extends AbstractInteraction implements Cre
|
|
|
7349
7344
|
|
|
7350
7345
|
/**
|
|
7351
7346
|
* A class to handle mouse over effects on features for editor sessions.
|
|
7352
|
-
* @param layerName - the layer name of the currently editing layer
|
|
7353
7347
|
*/
|
|
7354
7348
|
export class EditFeaturesMouseOverInteraction extends AbstractInteraction {
|
|
7355
|
-
constructor(layerName: string, selectMultiFeatureInteraction: SelectMultiFeatureInteraction);
|
|
7356
|
-
/**
|
|
7357
|
-
* The layer name to react to
|
|
7358
|
-
*/
|
|
7359
|
-
layerName: string;
|
|
7360
7349
|
cursorStyle: CSSStyleDeclaration;
|
|
7361
7350
|
/**
|
|
7362
7351
|
* Reset the cursorStyle to auto
|
|
@@ -7380,21 +7369,12 @@ export class EditFeaturesMouseOverInteraction extends AbstractInteraction {
|
|
|
7380
7369
|
pointerKey: number;
|
|
7381
7370
|
}
|
|
7382
7371
|
|
|
7383
|
-
/**
|
|
7384
|
-
* only exported for tests
|
|
7385
|
-
*/
|
|
7386
7372
|
export const cursorMap: any;
|
|
7387
7373
|
|
|
7388
7374
|
/**
|
|
7389
7375
|
* A class to handle mouse over effects on features for editor sessions.
|
|
7390
|
-
* @param layerName - the layer name of the currently editing layer
|
|
7391
7376
|
*/
|
|
7392
7377
|
export class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
7393
|
-
constructor(layerName: string);
|
|
7394
|
-
/**
|
|
7395
|
-
* The layer name to react to
|
|
7396
|
-
*/
|
|
7397
|
-
layerName: string;
|
|
7398
7378
|
cursorStyle: CSSStyleDeclaration;
|
|
7399
7379
|
/**
|
|
7400
7380
|
* Reset the cursorStyle to auto
|
|
@@ -7422,9 +7402,10 @@ export class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
|
7422
7402
|
* This interaction ensure a potential handler is dragged in 3D when it is obscured by a transparent feature.
|
|
7423
7403
|
* It uses drillPick on MOVE if: the map is 3D, there is a feature at said position, there is a feature selected in
|
|
7424
7404
|
* the feature selection & the feature at the position is _not_ a handler
|
|
7405
|
+
* @param selectedFeatures - Reference to the selected features.
|
|
7425
7406
|
*/
|
|
7426
7407
|
export class EnsureHandlerSelectionInteraction {
|
|
7427
|
-
constructor(
|
|
7408
|
+
constructor(selectedFeatures: import("ol").Feature[]);
|
|
7428
7409
|
pipe(event: InteractionEvent): Promise<InteractionEvent>;
|
|
7429
7410
|
}
|
|
7430
7411
|
|
|
@@ -7488,6 +7469,51 @@ export class RemoveVertexInteraction extends AbstractInteraction {
|
|
|
7488
7469
|
pointerKey: number;
|
|
7489
7470
|
}
|
|
7490
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
|
+
|
|
7491
7517
|
/**
|
|
7492
7518
|
* Interaction to create a selection set from the given layer.
|
|
7493
7519
|
* Will use CTRL modifier key to add more features to the set.
|
|
@@ -7495,15 +7521,18 @@ export class RemoveVertexInteraction extends AbstractInteraction {
|
|
|
7495
7521
|
* Creates a new set when clicking a feature
|
|
7496
7522
|
* FeatureStore features will be converted to their dynamic state on selection.
|
|
7497
7523
|
*/
|
|
7498
|
-
export class SelectMultiFeatureInteraction extends AbstractInteraction {
|
|
7524
|
+
export class SelectMultiFeatureInteraction extends AbstractInteraction implements SelectFeatureInteraction {
|
|
7499
7525
|
constructor(layer: VectorLayer);
|
|
7500
7526
|
/**
|
|
7501
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
|
|
7502
7528
|
*/
|
|
7503
7529
|
readonly featuresChanged: VcsEvent<import("ol").Feature[]>;
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
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>;
|
|
7507
7536
|
/**
|
|
7508
7537
|
* Clears the interaction, removing all features and calling the featureChange event with an empty array
|
|
7509
7538
|
*/
|
|
@@ -7526,22 +7555,28 @@ export class SelectMultiFeatureInteraction extends AbstractInteraction {
|
|
|
7526
7555
|
pointerKey: number;
|
|
7527
7556
|
}
|
|
7528
7557
|
|
|
7558
|
+
|
|
7559
|
+
|
|
7529
7560
|
/**
|
|
7530
7561
|
* Class to select features for editing.
|
|
7531
7562
|
* Static FeatureStore features will be converted into their dynamic form
|
|
7532
7563
|
*/
|
|
7533
|
-
export class SelectSingleFeatureInteraction extends AbstractInteraction {
|
|
7564
|
+
export class SelectSingleFeatureInteraction extends AbstractInteraction implements SelectFeatureInteraction {
|
|
7534
7565
|
constructor(layer: VectorLayer);
|
|
7535
7566
|
/**
|
|
7536
7567
|
* Event called when the feature changes. Called with null if the selection is cleared.
|
|
7537
7568
|
*/
|
|
7538
7569
|
featureChanged: VcsEvent<import("ol").Feature | null>;
|
|
7539
|
-
|
|
7570
|
+
selected: any;
|
|
7540
7571
|
/**
|
|
7541
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
|
|
7542
7573
|
* belong to the layer for which this interaction was created)
|
|
7543
7574
|
*/
|
|
7544
|
-
|
|
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;
|
|
7545
7580
|
/**
|
|
7546
7581
|
* Clears the current selection, if there is one.
|
|
7547
7582
|
*/
|
|
@@ -7588,6 +7623,52 @@ export class TranslateVertexInteraction extends AbstractInteraction {
|
|
|
7588
7623
|
pointerKey: number;
|
|
7589
7624
|
}
|
|
7590
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
|
+
|
|
7591
7672
|
/**
|
|
7592
7673
|
* A class to handle events on a {@see TransformationHandler}. Should be used with {@see TransformationHandler} created for mode TransformationMode.EXTRUDE.
|
|
7593
7674
|
* If the Z handler is dragged, the extruded event will be raised with a delta in Z direction. This
|
|
@@ -7737,6 +7818,10 @@ export interface TransformationHandler {
|
|
|
7737
7818
|
* readonly value indicating whether the handlers are showing (proxy for: features are selected)
|
|
7738
7819
|
*/
|
|
7739
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;
|
|
7740
7825
|
/**
|
|
7741
7826
|
* destroy the handler and any resources created by it
|
|
7742
7827
|
*/
|
|
@@ -8028,6 +8113,11 @@ export class IndexedCollection<T extends any> extends Collection<T> {
|
|
|
8028
8113
|
add(item: T, index?: number): number | null;
|
|
8029
8114
|
remove(item: T): void;
|
|
8030
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;
|
|
8031
8121
|
/**
|
|
8032
8122
|
* Lowers an item within the array
|
|
8033
8123
|
* @param [steps = 1] - an integer number to lower by
|
|
@@ -8077,9 +8167,9 @@ export class LayerCollection extends IndexedCollection<Layer> {
|
|
|
8077
8167
|
*/
|
|
8078
8168
|
readonly zIndexSymbol: symbol;
|
|
8079
8169
|
/**
|
|
8080
|
-
*
|
|
8170
|
+
* The current global hider of these layers
|
|
8081
8171
|
*/
|
|
8082
|
-
globalHider:
|
|
8172
|
+
globalHider: GlobalHider;
|
|
8083
8173
|
locale: any;
|
|
8084
8174
|
/**
|
|
8085
8175
|
* Adds a layer to the collection. Can optionally be passed an index at which to insert the layer.
|
|
@@ -8235,13 +8325,13 @@ export function getCartesianPitch(p1: import("ol/coordinate").Coordinate, p2: im
|
|
|
8235
8325
|
export const isOverrideCollection: unique symbol;
|
|
8236
8326
|
|
|
8237
8327
|
/**
|
|
8238
|
-
* @param
|
|
8328
|
+
* @param getDynamicModuleId - function to get the current dynamic module id
|
|
8239
8329
|
* @param [serializeItem] - optional function to serialize an item, defaults to returning item.toJSON or item: i => (i.toJSON || i)
|
|
8240
8330
|
* @param [deserializeItem] - optional deserialization function. defaults to returning the passed object: i => i
|
|
8241
8331
|
* @param [ctor] - optional constructor to validate deserialized items against. if passed, deserializeItem must be an instance of ctor.
|
|
8242
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.
|
|
8243
8333
|
*/
|
|
8244
|
-
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>;
|
|
8245
8335
|
|
|
8246
8336
|
/**
|
|
8247
8337
|
*/
|
|
@@ -8487,7 +8577,7 @@ export class Viewpoint extends VcsObject {
|
|
|
8487
8577
|
readonly className: string;
|
|
8488
8578
|
}
|
|
8489
8579
|
|
|
8490
|
-
export const
|
|
8580
|
+
export const defaultDynamicModuleId: string;
|
|
8491
8581
|
|
|
8492
8582
|
export class VcsApp {
|
|
8493
8583
|
readonly id: string;
|
|
@@ -8504,11 +8594,11 @@ export class VcsApp {
|
|
|
8504
8594
|
readonly styles: OverrideCollection<StyleItem>;
|
|
8505
8595
|
readonly categories: CategoryCollection;
|
|
8506
8596
|
readonly destroyed: VcsEvent<void>;
|
|
8507
|
-
readonly
|
|
8508
|
-
readonly
|
|
8509
|
-
readonly
|
|
8510
|
-
readonly
|
|
8511
|
-
readonly
|
|
8597
|
+
readonly modules: VcsModule[];
|
|
8598
|
+
readonly moduleAdded: any;
|
|
8599
|
+
readonly moduleRemoved: any;
|
|
8600
|
+
readonly dynamicModuleId: string;
|
|
8601
|
+
readonly dynamicModuleIdChanged: VcsEvent<string>;
|
|
8512
8602
|
readonly mapClassRegistry: OverrideClassRegistry<VcsMap>;
|
|
8513
8603
|
readonly layerClassRegistry: OverrideClassRegistry<Layer>;
|
|
8514
8604
|
readonly styleClassRegistry: OverrideClassRegistry<StyleItem>;
|
|
@@ -8516,20 +8606,21 @@ export class VcsApp {
|
|
|
8516
8606
|
readonly categoryItemClassRegistry: OverrideClassRegistry<any>;
|
|
8517
8607
|
readonly tileProviderClassRegistry: OverrideClassRegistry<TileProvider>;
|
|
8518
8608
|
readonly featureProviderClassRegistry: OverrideClassRegistry<AbstractFeatureProvider>;
|
|
8519
|
-
|
|
8520
|
-
protected
|
|
8521
|
-
protected
|
|
8522
|
-
|
|
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;
|
|
8523
8614
|
/**
|
|
8524
|
-
* sets the given
|
|
8615
|
+
* sets the given module as the dynamic
|
|
8525
8616
|
*/
|
|
8526
|
-
|
|
8617
|
+
setDynamicModule(module: VcsModule): void;
|
|
8527
8618
|
/**
|
|
8528
|
-
* resets the dynamic
|
|
8619
|
+
* resets the dynamic VcsModule to the "defaultDynamicModule"
|
|
8529
8620
|
*/
|
|
8530
|
-
|
|
8531
|
-
protected
|
|
8532
|
-
|
|
8621
|
+
resetDynamicModule(): void;
|
|
8622
|
+
protected _removeModule(moduleId: string): Promise<void>;
|
|
8623
|
+
removeModule(moduleId: string): Promise<void>;
|
|
8533
8624
|
/**
|
|
8534
8625
|
* Destroys the app and all its collections, their content and ui managers.
|
|
8535
8626
|
*/
|
|
@@ -8538,26 +8629,6 @@ export class VcsApp {
|
|
|
8538
8629
|
|
|
8539
8630
|
export function getVcsAppById(id: string): VcsApp;
|
|
8540
8631
|
|
|
8541
|
-
export const contextIdSymbol: unique symbol;
|
|
8542
|
-
|
|
8543
|
-
export interface ContextLayerOptions extends LayerOptions {
|
|
8544
|
-
style?: string | StyleItemOptions;
|
|
8545
|
-
tileProvider?: TileProviderOptions;
|
|
8546
|
-
featureProvider?: AbstractFeatureProviderOptions;
|
|
8547
|
-
}
|
|
8548
|
-
|
|
8549
|
-
export function deserializeMap(vcsApp: VcsApp, mapConfig: VcsMapOptions): VcsMap | null;
|
|
8550
|
-
|
|
8551
|
-
export function deserializeViewpoint(viewpointObject: ViewpointOptions): null | Viewpoint;
|
|
8552
|
-
|
|
8553
|
-
export function deserializeLayer(vcsApp: VcsApp, layerConfig: ContextLayerOptions): Layer | null;
|
|
8554
|
-
|
|
8555
|
-
export function serializeLayer(vcsApp: VcsApp, layer: Layer): ContextLayerOptions;
|
|
8556
|
-
|
|
8557
|
-
export function getLayerIndex(current: Layer, previous: Layer, currentIndex: number): number | null;
|
|
8558
|
-
|
|
8559
|
-
export function destroyCollection(collection: Collection<any>): void;
|
|
8560
|
-
|
|
8561
8632
|
export class VcsEvent<T extends any> {
|
|
8562
8633
|
/**
|
|
8563
8634
|
* The number of listeners
|
|
@@ -8585,6 +8656,70 @@ export class VcsEvent<T extends any> {
|
|
|
8585
8656
|
destroy(): void;
|
|
8586
8657
|
}
|
|
8587
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
|
+
|
|
8588
8723
|
/**
|
|
8589
8724
|
*/
|
|
8590
8725
|
export interface VcsObjectOptions {
|
|
@@ -8630,36 +8765,40 @@ export interface OverrideCollectionInterface<T extends any> {
|
|
|
8630
8765
|
replaced: VcsEvent<ReplacedEvent<T>>;
|
|
8631
8766
|
shadowMap: Map<string, object[]>;
|
|
8632
8767
|
override: (item: T) => T;
|
|
8633
|
-
parseItems: (items: object[],
|
|
8634
|
-
|
|
8635
|
-
|
|
8768
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8769
|
+
getSerializedByKey: (key: string) => object;
|
|
8770
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8771
|
+
serializeModule: (moduleId: string) => object[];
|
|
8636
8772
|
}
|
|
8637
8773
|
|
|
8638
8774
|
export class OverrideCollection<T extends any> extends Collection<T> implements OverrideCollectionInterface<T> {
|
|
8639
8775
|
replaced: VcsEvent<ReplacedEvent<T>>;
|
|
8640
8776
|
shadowMap: Map<string, object[]>;
|
|
8641
8777
|
override: (item: T) => T;
|
|
8642
|
-
parseItems: (items: object[],
|
|
8643
|
-
|
|
8644
|
-
|
|
8778
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8779
|
+
getSerializedByKey: (key: string) => object;
|
|
8780
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8781
|
+
serializeModule: (moduleId: string) => object[];
|
|
8645
8782
|
}
|
|
8646
8783
|
|
|
8647
8784
|
export class OverrideLayerCollection extends LayerCollection implements OverrideCollectionInterface<Layer> {
|
|
8648
8785
|
replaced: VcsEvent<ReplacedEvent<Layer>>;
|
|
8649
8786
|
shadowMap: Map<string, object[]>;
|
|
8650
8787
|
override: (item: Layer) => Layer;
|
|
8651
|
-
parseItems: (items: object[],
|
|
8652
|
-
|
|
8653
|
-
|
|
8788
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8789
|
+
getSerializedByKey: (key: string) => object;
|
|
8790
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8791
|
+
serializeModule: (moduleId: string) => object[];
|
|
8654
8792
|
}
|
|
8655
8793
|
|
|
8656
8794
|
export class OverrideMapCollection extends MapCollection implements OverrideCollectionInterface<VcsMap> {
|
|
8657
8795
|
replaced: VcsEvent<ReplacedEvent<VcsMap>>;
|
|
8658
8796
|
shadowMap: Map<string, object[]>;
|
|
8659
8797
|
override: (item: VcsMap) => VcsMap;
|
|
8660
|
-
parseItems: (items: object[],
|
|
8661
|
-
|
|
8662
|
-
|
|
8798
|
+
parseItems: (items: object[], moduleId: string) => Promise<void>;
|
|
8799
|
+
getSerializedByKey: (key: string) => object;
|
|
8800
|
+
removeModule: (moduleId: string) => Promise<void>;
|
|
8801
|
+
serializeModule: (moduleId: string) => object[];
|
|
8663
8802
|
}
|
|
8664
8803
|
|
|
8665
8804
|
|
|
@@ -8683,6 +8822,12 @@ export interface CreateInteraction<T extends import("ol/geom").Geometry> {
|
|
|
8683
8822
|
|
|
8684
8823
|
export type Vertex = import("ol").Feature<import("ol/geom").Point>;
|
|
8685
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
|
+
|
|
8686
8831
|
declare module "@vcmap-cesium/engine" {
|
|
8687
8832
|
interface Entity {
|
|
8688
8833
|
getId():number|string;
|