@vcmap/core 5.1.6 → 5.2.1
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/dist/src/interaction/abstractInteraction.d.ts +5 -0
- package/dist/src/interaction/abstractInteraction.js.map +1 -1
- package/dist/src/interaction/eventHandler.d.ts +5 -1
- package/dist/src/interaction/eventHandler.js +29 -12
- package/dist/src/interaction/eventHandler.js.map +1 -1
- package/dist/src/map/baseOLMap.d.ts +2 -1
- package/dist/src/map/baseOLMap.js +1 -1
- package/dist/src/map/baseOLMap.js.map +1 -1
- package/dist/src/map/cesiumMap.d.ts +2 -1
- package/dist/src/map/cesiumMap.js +7 -4
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/obliqueMap.js +3 -3
- package/dist/src/map/obliqueMap.js.map +1 -1
- package/dist/src/map/openlayersMap.js +1 -1
- package/dist/src/map/openlayersMap.js.map +1 -1
- package/dist/src/map/vcsMap.d.ts +17 -6
- package/dist/src/map/vcsMap.js +46 -8
- package/dist/src/map/vcsMap.js.map +1 -1
- package/dist/src/util/clipping/clippingObject.js +10 -1
- package/dist/src/util/clipping/clippingObject.js.map +1 -1
- package/dist/src/util/clipping/clippingObjectManager.js +6 -0
- package/dist/src/util/clipping/clippingObjectManager.js.map +1 -1
- package/dist/src/util/clipping/clippingPlaneHelper.d.ts +3 -2
- package/dist/src/util/clipping/clippingPlaneHelper.js +14 -7
- package/dist/src/util/clipping/clippingPlaneHelper.js.map +1 -1
- package/dist/src/util/editor/editFeaturesSession.js +56 -4
- package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.d.ts +6 -1
- package/dist/src/util/editor/editGeometrySession.js +51 -44
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +4 -2
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/rightClickInteraction.d.ts +9 -0
- package/dist/src/util/editor/interactions/rightClickInteraction.js +31 -0
- package/dist/src/util/editor/interactions/rightClickInteraction.js.map +1 -0
- package/dist/src/util/flight/flightInstance.d.ts +1 -1
- package/dist/src/util/flight/flightPlayer.js +16 -13
- package/dist/src/util/flight/flightPlayer.js.map +1 -1
- package/dist/src/util/mapCollection.d.ts +14 -0
- package/dist/src/util/mapCollection.js +33 -0
- package/dist/src/util/mapCollection.js.map +1 -1
- package/dist/src/vcsApp.d.ts +7 -1
- package/dist/src/vcsApp.js +71 -20
- package/dist/src/vcsApp.js.map +1 -1
- package/package.json +3 -2
- package/src/interaction/abstractInteraction.ts +5 -0
- package/src/interaction/eventHandler.ts +30 -13
- package/src/map/baseOLMap.ts +3 -2
- package/src/map/cesiumMap.ts +11 -4
- package/src/map/obliqueMap.ts +3 -3
- package/src/map/openlayersMap.ts +1 -1
- package/src/map/vcsMap.ts +63 -10
- package/src/util/clipping/clippingObject.ts +10 -1
- package/src/util/clipping/clippingObjectManager.ts +6 -0
- package/src/util/clipping/clippingPlaneHelper.ts +14 -6
- package/src/util/editor/editFeaturesSession.ts +72 -10
- package/src/util/editor/editGeometrySession.ts +61 -39
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +7 -2
- package/src/util/editor/interactions/rightClickInteraction.ts +42 -0
- package/src/util/flight/flightPlayer.ts +21 -15
- package/src/util/mapCollection.ts +47 -0
- package/src/vcsApp.ts +82 -23
package/src/vcsApp.ts
CHANGED
|
@@ -122,7 +122,15 @@ class VcsApp {
|
|
|
122
122
|
|
|
123
123
|
private _destroyed: VcsEvent<void>;
|
|
124
124
|
|
|
125
|
-
private
|
|
125
|
+
private _moduleMutationChain: {
|
|
126
|
+
running: boolean;
|
|
127
|
+
items: Array<{
|
|
128
|
+
moduleId: string;
|
|
129
|
+
mutation: () => Promise<void>;
|
|
130
|
+
resolve: () => void;
|
|
131
|
+
reject: (reason?: any) => void;
|
|
132
|
+
}>;
|
|
133
|
+
};
|
|
126
134
|
|
|
127
135
|
private _categoryItemClassRegistry: OverrideClassRegistry<Ctor<any>>;
|
|
128
136
|
|
|
@@ -216,7 +224,7 @@ class VcsApp {
|
|
|
216
224
|
);
|
|
217
225
|
this._categories = new CategoryCollection(this);
|
|
218
226
|
this._destroyed = new VcsEvent();
|
|
219
|
-
this.
|
|
227
|
+
this._moduleMutationChain = { running: false, items: [] };
|
|
220
228
|
this._categoryItemClassRegistry = new OverrideClassRegistry(
|
|
221
229
|
new ClassRegistry(),
|
|
222
230
|
);
|
|
@@ -402,12 +410,13 @@ class VcsApp {
|
|
|
402
410
|
config.startingObliqueCollectionName,
|
|
403
411
|
);
|
|
404
412
|
if (startingObliqueCollection) {
|
|
405
|
-
|
|
406
|
-
.
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
413
|
+
await Promise.all(
|
|
414
|
+
[...this._maps]
|
|
415
|
+
.filter((m) => m instanceof ObliqueMap)
|
|
416
|
+
.map((m) => {
|
|
417
|
+
return (m as ObliqueMap).setCollection(startingObliqueCollection);
|
|
418
|
+
}),
|
|
419
|
+
);
|
|
411
420
|
}
|
|
412
421
|
}
|
|
413
422
|
|
|
@@ -427,20 +436,61 @@ class VcsApp {
|
|
|
427
436
|
}
|
|
428
437
|
}
|
|
429
438
|
|
|
430
|
-
|
|
439
|
+
/**
|
|
440
|
+
* When adding multiple modules, adding of previous modules are awaited.
|
|
441
|
+
* If an invalid module is added an error is thrown and already added items of invalid module are removed.
|
|
442
|
+
* @param module
|
|
443
|
+
*/
|
|
444
|
+
async addModule(module: VcsModule): Promise<void> {
|
|
431
445
|
check(module, VcsModule);
|
|
432
446
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
447
|
+
const mutation = async (): Promise<void> => {
|
|
448
|
+
try {
|
|
449
|
+
if (this._modules.hasKey(module._id)) {
|
|
450
|
+
getLogger().info(`module with id ${module._id} already loaded`);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
438
453
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
454
|
+
await this._parseModule(module);
|
|
455
|
+
await this._setModuleState(module);
|
|
456
|
+
this._modules.add(module);
|
|
457
|
+
} catch (err) {
|
|
458
|
+
await this._removeModule(module._id);
|
|
459
|
+
throw err;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
return new Promise((resolve, reject) => {
|
|
463
|
+
this._moduleMutationChain.items.push({
|
|
464
|
+
moduleId: module._id,
|
|
465
|
+
mutation,
|
|
466
|
+
resolve,
|
|
467
|
+
reject,
|
|
468
|
+
});
|
|
469
|
+
this._startModuleMutationChain();
|
|
442
470
|
});
|
|
443
|
-
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
_startModuleMutationChain(): void {
|
|
474
|
+
if (!this._moduleMutationChain.running) {
|
|
475
|
+
const item = this._moduleMutationChain.items.shift();
|
|
476
|
+
if (item) {
|
|
477
|
+
try {
|
|
478
|
+
this._moduleMutationChain.running = true;
|
|
479
|
+
item
|
|
480
|
+
.mutation()
|
|
481
|
+
.then(() => item.resolve())
|
|
482
|
+
.catch((err) => item.reject(err))
|
|
483
|
+
.finally(() => {
|
|
484
|
+
this._moduleMutationChain.running = false;
|
|
485
|
+
this._startModuleMutationChain();
|
|
486
|
+
});
|
|
487
|
+
} catch (err) {
|
|
488
|
+
item.reject(err);
|
|
489
|
+
this._moduleMutationChain.running = false;
|
|
490
|
+
this._startModuleMutationChain();
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
444
494
|
}
|
|
445
495
|
|
|
446
496
|
serializeModule(moduleId: string): VcsModuleConfig {
|
|
@@ -503,8 +553,8 @@ class VcsApp {
|
|
|
503
553
|
]);
|
|
504
554
|
}
|
|
505
555
|
|
|
506
|
-
removeModule(moduleId: string): Promise<void> {
|
|
507
|
-
|
|
556
|
+
async removeModule(moduleId: string): Promise<void> {
|
|
557
|
+
const mutation = async (): Promise<void> => {
|
|
508
558
|
const module = this._modules.getByKey(moduleId);
|
|
509
559
|
if (!module) {
|
|
510
560
|
getLogger().info(`module with id ${moduleId} has already been removed`);
|
|
@@ -512,16 +562,25 @@ class VcsApp {
|
|
|
512
562
|
}
|
|
513
563
|
await this._removeModule(moduleId);
|
|
514
564
|
this._modules.remove(module);
|
|
565
|
+
};
|
|
566
|
+
return new Promise((resolve, reject) => {
|
|
567
|
+
this._moduleMutationChain.items.push({
|
|
568
|
+
moduleId,
|
|
569
|
+
mutation,
|
|
570
|
+
resolve,
|
|
571
|
+
reject,
|
|
572
|
+
});
|
|
573
|
+
this._startModuleMutationChain();
|
|
515
574
|
});
|
|
516
|
-
|
|
517
|
-
return this._moduleMutationPromise;
|
|
518
575
|
}
|
|
519
576
|
|
|
520
577
|
/**
|
|
521
578
|
* Destroys the app and all its collections, their content and ui managers.
|
|
522
579
|
*/
|
|
523
580
|
destroy(): void {
|
|
524
|
-
|
|
581
|
+
this._moduleMutationChain.running = false;
|
|
582
|
+
this._moduleMutationChain.items.splice(0);
|
|
583
|
+
Object.defineProperty(this, '_moduleMutationChain', {
|
|
525
584
|
get() {
|
|
526
585
|
throw new Error('VcsApp was destroyed');
|
|
527
586
|
},
|