bruce-cesium 4.6.2 → 4.6.3
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/bruce-cesium.es5.js +285 -85
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +283 -83
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +162 -10
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +7 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +75 -47
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +22 -16
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/widgets/widget-left-panel.js +18 -8
- package/dist/lib/widgets/widget-left-panel.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/getters/entity-filter-getter.d.ts +12 -0
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +1 -0
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -11827,6 +11827,20 @@
|
|
|
11827
11827
|
function colorToCColor$1(color) {
|
|
11828
11828
|
return new Cesium.Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
11829
11829
|
}
|
|
11830
|
+
function getShowDebugBounds() {
|
|
11831
|
+
if (!window) {
|
|
11832
|
+
return false;
|
|
11833
|
+
}
|
|
11834
|
+
var showBounds = window === null || window === void 0 ? void 0 : window.ENTITIES_RENDER_MANAGER_SHOW_BOUNDS;
|
|
11835
|
+
if (showBounds) {
|
|
11836
|
+
return true;
|
|
11837
|
+
}
|
|
11838
|
+
if (window.location.search) {
|
|
11839
|
+
var params = new URLSearchParams(window.location.search);
|
|
11840
|
+
showBounds = params.get("debugScanBounds");
|
|
11841
|
+
}
|
|
11842
|
+
return showBounds == "true" || showBounds == "1" || showBounds == "yes";
|
|
11843
|
+
}
|
|
11830
11844
|
(function (EntitiesRenderManager) {
|
|
11831
11845
|
var Manager = /** @class */ (function () {
|
|
11832
11846
|
function Manager(params) {
|
|
@@ -11957,9 +11971,10 @@
|
|
|
11957
11971
|
// Unfortunately this searches as an "AND" rather than "OR" which does not meet our needs here.
|
|
11958
11972
|
// So for multiple tags we'll manually sort on UI end...
|
|
11959
11973
|
tagIds: (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [],
|
|
11960
|
-
debugShowBounds:
|
|
11974
|
+
debugShowBounds: getShowDebugBounds(),
|
|
11961
11975
|
cdn: this.item.cdnEnabled,
|
|
11962
11976
|
historicAttrKey: this.item.BruceEntity.historicAttrKey,
|
|
11977
|
+
historicInterpolation: this.item.historicInterpolation,
|
|
11963
11978
|
schemaId: (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.schemaId
|
|
11964
11979
|
});
|
|
11965
11980
|
var minMax = exports.RenderManager.GetZoomMinMax({
|
|
@@ -12187,7 +12202,7 @@
|
|
|
12187
12202
|
switch (_b.label) {
|
|
12188
12203
|
case 0:
|
|
12189
12204
|
_b.trys.push([0, 8, , 9]);
|
|
12190
|
-
if (this.disposed || this.viewer.isDestroyed()) {
|
|
12205
|
+
if (this.disposed || this.viewer.isDestroyed() || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
12191
12206
|
return [2 /*return*/];
|
|
12192
12207
|
}
|
|
12193
12208
|
typeId_1 = (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a["EntityType.ID"];
|
|
@@ -12583,28 +12598,16 @@
|
|
|
12583
12598
|
* @returns
|
|
12584
12599
|
*/
|
|
12585
12600
|
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
12586
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
12601
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
12587
12602
|
if (force === void 0) { force = false; }
|
|
12588
12603
|
return __awaiter(this, void 0, void 0, function () {
|
|
12589
|
-
var entitiesHistoric,
|
|
12590
|
-
return __generator(this, function (
|
|
12591
|
-
switch (
|
|
12604
|
+
var entitiesHistoric, startTmp, stopTmp, startStr, stopStr, historicData, toRemoveIds_1, i, removeId, toRemoveIds_2, i, removeId, _o, updated, cEntities, i, entity, id, cEntity, rego, visual, wasClustered, tagIds, rego_1;
|
|
12605
|
+
return __generator(this, function (_p) {
|
|
12606
|
+
switch (_p.label) {
|
|
12592
12607
|
case 0:
|
|
12593
12608
|
entitiesHistoric = {};
|
|
12594
|
-
if (!((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey)) return [3 /*break*/,
|
|
12595
|
-
toRemove = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricAttrKey); });
|
|
12596
|
-
for (i = 0; i < toRemove.length; i++) {
|
|
12597
|
-
entity = toRemove[i];
|
|
12598
|
-
this.visualsManager.RemoveRegos({
|
|
12599
|
-
entityId: entity.Bruce.ID,
|
|
12600
|
-
menuItemId: this.item.id,
|
|
12601
|
-
requestRender: false
|
|
12602
|
-
});
|
|
12603
|
-
(_b = this.clustering) === null || _b === void 0 ? void 0 : _b.RemoveEntity(entity.Bruce.ID, false);
|
|
12604
|
-
}
|
|
12605
|
-
entities = entities.filter(function (x) { var _a; return !!((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricAttrKey); });
|
|
12609
|
+
if (!(((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey) && entities.length)) return [3 /*break*/, 3];
|
|
12606
12610
|
if (!this.item.historicInterpolation) return [3 /*break*/, 2];
|
|
12607
|
-
if (!entities.length) return [3 /*break*/, 2];
|
|
12608
12611
|
startTmp = Cesium.JulianDate.toDate(this.viewer.clock.startTime);
|
|
12609
12612
|
stopTmp = Cesium.JulianDate.toDate(this.viewer.clock.stopTime);
|
|
12610
12613
|
startStr = new Date(startTmp.getTime() - 1000).toISOString();
|
|
@@ -12617,29 +12620,54 @@
|
|
|
12617
12620
|
api: this.apiGetter.getApi()
|
|
12618
12621
|
})];
|
|
12619
12622
|
case 1:
|
|
12620
|
-
historicData =
|
|
12623
|
+
historicData = _p.sent();
|
|
12624
|
+
entitiesHistoric = historicData.recordsByIds;
|
|
12625
|
+
toRemoveIds_1 = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricAttrKey) && !entitiesHistoric[x.Bruce.ID]; }).map(function (x) { return x.Bruce.ID; });
|
|
12626
|
+
for (i = 0; i < toRemoveIds_1.length; i++) {
|
|
12627
|
+
removeId = toRemoveIds_1[i];
|
|
12628
|
+
this.visualsManager.RemoveRegos({
|
|
12629
|
+
entityId: removeId,
|
|
12630
|
+
menuItemId: this.item.id,
|
|
12631
|
+
requestRender: false
|
|
12632
|
+
});
|
|
12633
|
+
(_b = this.clustering) === null || _b === void 0 ? void 0 : _b.RemoveEntity(removeId, false);
|
|
12634
|
+
}
|
|
12635
|
+
entities = entities.filter(function (x) { return !toRemoveIds_1.includes(x.Bruce.ID); });
|
|
12636
|
+
return [3 /*break*/, 3];
|
|
12637
|
+
case 2:
|
|
12638
|
+
toRemoveIds_2 = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricAttrKey); }).map(function (x) { return x.Bruce.ID; });
|
|
12639
|
+
for (i = 0; i < toRemoveIds_2.length; i++) {
|
|
12640
|
+
removeId = toRemoveIds_2[i];
|
|
12641
|
+
this.visualsManager.RemoveRegos({
|
|
12642
|
+
entityId: removeId,
|
|
12643
|
+
menuItemId: this.item.id,
|
|
12644
|
+
requestRender: false
|
|
12645
|
+
});
|
|
12646
|
+
(_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(removeId, false);
|
|
12647
|
+
}
|
|
12648
|
+
entities = entities.filter(function (x) { return !toRemoveIds_2.includes(x.Bruce.ID); });
|
|
12649
|
+
_p.label = 3;
|
|
12650
|
+
case 3:
|
|
12621
12651
|
if (this.disposed) {
|
|
12622
12652
|
this.doDispose();
|
|
12623
12653
|
return [2 /*return*/];
|
|
12624
12654
|
}
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
case 3:
|
|
12642
|
-
_m = _o.sent(), updated = _m.updated, cEntities = _m.entities;
|
|
12655
|
+
return [4 /*yield*/, exports.EntityRenderEngine.Render({
|
|
12656
|
+
viewer: this.viewer,
|
|
12657
|
+
apiGetter: this.apiGetter,
|
|
12658
|
+
entities: entities,
|
|
12659
|
+
menuItemId: this.item.id,
|
|
12660
|
+
visualRegister: this.visualsManager,
|
|
12661
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
12662
|
+
entitiesHistoric: entitiesHistoric,
|
|
12663
|
+
entityHistoricDrawTrack: this.item.historicDrawTrack,
|
|
12664
|
+
force: force,
|
|
12665
|
+
optimizeGeometry: this.item.optimizeGeometry,
|
|
12666
|
+
optimizeMinPoints: this.item.optimizeMinPoints,
|
|
12667
|
+
optimizeTolerance: this.item.optimizeTolerance,
|
|
12668
|
+
})];
|
|
12669
|
+
case 4:
|
|
12670
|
+
_o = _p.sent(), updated = _o.updated, cEntities = _o.entities;
|
|
12643
12671
|
if (this.disposed) {
|
|
12644
12672
|
this.doDispose();
|
|
12645
12673
|
return [2 /*return*/];
|
|
@@ -12657,10 +12685,10 @@
|
|
|
12657
12685
|
visual = rego === null || rego === void 0 ? void 0 : rego.visual;
|
|
12658
12686
|
if (!visual || visual != cEntity) {
|
|
12659
12687
|
wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
12660
|
-
tagIds = (
|
|
12688
|
+
tagIds = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d["Layer.ID"];
|
|
12661
12689
|
rego_1 = {
|
|
12662
12690
|
entityId: id,
|
|
12663
|
-
schemaId: (
|
|
12691
|
+
schemaId: (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.SchemaID,
|
|
12664
12692
|
menuItemId: this.item.id,
|
|
12665
12693
|
menuItemType: this.item.Type,
|
|
12666
12694
|
visual: cEntity,
|
|
@@ -12671,8 +12699,8 @@
|
|
|
12671
12699
|
overrideShow: wasClustered ? false : null,
|
|
12672
12700
|
name: cEntity.name,
|
|
12673
12701
|
cdn: this.item.cdnEnabled,
|
|
12674
|
-
historicDateTime: (
|
|
12675
|
-
historicAttrKey: (
|
|
12702
|
+
historicDateTime: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.HistoricDateTime,
|
|
12703
|
+
historicAttrKey: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.HistoricAttrKey
|
|
12676
12704
|
};
|
|
12677
12705
|
this.visualsManager.AddRego({
|
|
12678
12706
|
rego: rego_1,
|
|
@@ -12683,11 +12711,11 @@
|
|
|
12683
12711
|
rego.name = cEntity.name;
|
|
12684
12712
|
rego.visual = cEntity;
|
|
12685
12713
|
rego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
12686
|
-
rego.tagIds = ((
|
|
12687
|
-
rego.historicDateTime = (
|
|
12688
|
-
rego.historicAttrKey = (
|
|
12714
|
+
rego.tagIds = ((_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
|
|
12715
|
+
rego.historicDateTime = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.HistoricDateTime;
|
|
12716
|
+
rego.historicAttrKey = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.HistoricAttrKey;
|
|
12689
12717
|
rego.cdn = this.item.cdnEnabled;
|
|
12690
|
-
rego.schemaId = (
|
|
12718
|
+
rego.schemaId = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.SchemaID;
|
|
12691
12719
|
// Marked as stale meaning some change was performed that requires a refresh.
|
|
12692
12720
|
// This usually means a new sibling was added that we need to update.
|
|
12693
12721
|
if (rego.stale) {
|
|
@@ -12717,7 +12745,7 @@
|
|
|
12717
12745
|
menuItemId: this.item.id,
|
|
12718
12746
|
requestRender: false
|
|
12719
12747
|
});
|
|
12720
|
-
(
|
|
12748
|
+
(_m = this.clustering) === null || _m === void 0 ? void 0 : _m.RemoveEntity(id, false);
|
|
12721
12749
|
}
|
|
12722
12750
|
}
|
|
12723
12751
|
this.viewer.scene.requestRender();
|
|
@@ -16124,20 +16152,28 @@
|
|
|
16124
16152
|
this.onStateUpdate = null;
|
|
16125
16153
|
this.onScanUpdate = null;
|
|
16126
16154
|
this.viewPortChangeRemoval = null;
|
|
16155
|
+
this.viewPortDelayQueue = null;
|
|
16127
16156
|
this.viewerDateTimeChangeRemoval = null;
|
|
16128
16157
|
this.cells = null;
|
|
16129
16158
|
this.registeredItems = {};
|
|
16130
16159
|
this.getterLoopId = 0;
|
|
16160
|
+
this.getterLoopAbortControllers = {};
|
|
16131
16161
|
this.tagIds = null;
|
|
16132
16162
|
this.minHeight = 0;
|
|
16133
16163
|
this.maxHeight = 100000;
|
|
16134
16164
|
this.viewRect = null;
|
|
16135
16165
|
this.viewCenter = null;
|
|
16136
|
-
|
|
16166
|
+
this.historicRefreshAbortController = null;
|
|
16167
|
+
// Entity IDs found for the latest integrity.
|
|
16168
|
+
// We use this for refreshing historic data without having to repeat geographic queries.
|
|
16169
|
+
this.gatheredIntegrity = null;
|
|
16170
|
+
this.gatheredEntityIds = [];
|
|
16171
|
+
var api = params.api, viewer = params.viewer, viewPort = params.viewPort, typeId = params.typeId, schemaId = params.schemaId, batchSize = params.batchSize, attrFilter = params.attrFilter, historicAttrKey = params.historicAttrKey, historicInterpolation = params.historicInterpolation, viaCdn = params.viaCdn;
|
|
16137
16172
|
this.api = api;
|
|
16138
16173
|
this.typeId = typeId;
|
|
16139
16174
|
this.schemaId = schemaId;
|
|
16140
16175
|
this.historicAttrKey = historicAttrKey;
|
|
16176
|
+
this.historicInterpolation = Boolean(historicInterpolation);
|
|
16141
16177
|
this.viaCdn = Boolean(viaCdn);
|
|
16142
16178
|
this.batchSize = isNaN(batchSize) ? 300 : batchSize;
|
|
16143
16179
|
this.viewPort = viewPort;
|
|
@@ -16190,15 +16226,22 @@
|
|
|
16190
16226
|
Getter.prototype.viewAreaSub = function () {
|
|
16191
16227
|
var _this = this;
|
|
16192
16228
|
this.viewAreaDispose();
|
|
16193
|
-
|
|
16229
|
+
// We'll avoid restarting the scanner too often.
|
|
16230
|
+
this.viewPortDelayQueue = new BModels.DelayQueue(function () {
|
|
16194
16231
|
_this.updateBounds();
|
|
16195
16232
|
_this.startGetterLoop();
|
|
16233
|
+
}, 2000);
|
|
16234
|
+
this.viewPortChangeRemoval = this.viewPort.Updated().Subscribe(function () {
|
|
16235
|
+
var _a;
|
|
16236
|
+
(_a = _this.viewPortDelayQueue) === null || _a === void 0 ? void 0 : _a.Call();
|
|
16196
16237
|
});
|
|
16197
16238
|
};
|
|
16198
16239
|
Getter.prototype.viewAreaDispose = function () {
|
|
16199
|
-
var _a;
|
|
16240
|
+
var _a, _b;
|
|
16200
16241
|
(_a = this.viewPortChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
16201
16242
|
this.viewPortChangeRemoval = null;
|
|
16243
|
+
(_b = this.viewPortDelayQueue) === null || _b === void 0 ? void 0 : _b.Dispose();
|
|
16244
|
+
this.viewPortDelayQueue = null;
|
|
16202
16245
|
};
|
|
16203
16246
|
/**
|
|
16204
16247
|
* Monitors the Cesium viewer and updates the historic data filter values.
|
|
@@ -16212,6 +16255,11 @@
|
|
|
16212
16255
|
// This is multiplied by the speed of animation to figure
|
|
16213
16256
|
// out how many animation "ticks" before we allow an update.
|
|
16214
16257
|
var INTERVAL_WHILE_ANIMATING = 2.5 * 1000;
|
|
16258
|
+
var INTERVAL_WHILE_NOT_ANIMATING = 1000;
|
|
16259
|
+
if (this.historicInterpolation) {
|
|
16260
|
+
INTERVAL_WHILE_ANIMATING = 6 * 1000;
|
|
16261
|
+
INTERVAL_WHILE_NOT_ANIMATING = 3.5 * 1000;
|
|
16262
|
+
}
|
|
16215
16263
|
var lastUpdateTime = null;
|
|
16216
16264
|
var delayQueue = new BModels.DelayQueue(function () {
|
|
16217
16265
|
try {
|
|
@@ -16221,17 +16269,16 @@
|
|
|
16221
16269
|
return;
|
|
16222
16270
|
}
|
|
16223
16271
|
}
|
|
16224
|
-
lastUpdateTime = new Date().getTime();
|
|
16225
16272
|
var current = _this.historicAttrDateTime;
|
|
16226
16273
|
_this.updateHistoricDateTime();
|
|
16227
16274
|
if (current != _this.historicAttrDateTime) {
|
|
16228
|
-
_this.
|
|
16275
|
+
_this.emitHistoricData();
|
|
16229
16276
|
}
|
|
16230
16277
|
}
|
|
16231
16278
|
catch (e) {
|
|
16232
16279
|
console.error(e);
|
|
16233
16280
|
}
|
|
16234
|
-
},
|
|
16281
|
+
}, INTERVAL_WHILE_NOT_ANIMATING);
|
|
16235
16282
|
var postUpdateRemoval = this.viewer.scene.postUpdate.addEventListener(function () {
|
|
16236
16283
|
if (delayQueue) {
|
|
16237
16284
|
delayQueue.Call();
|
|
@@ -16350,8 +16397,20 @@
|
|
|
16350
16397
|
this.getterLoopId += 1;
|
|
16351
16398
|
var loopId = this.getterLoopId;
|
|
16352
16399
|
var loopIntegrity = this.getIntegrityId();
|
|
16353
|
-
|
|
16354
|
-
|
|
16400
|
+
// Abort any existing loops that don't match the current loop.
|
|
16401
|
+
// We tried using integrity, however we want to interrupt when user moves camera quickly.
|
|
16402
|
+
// So it's better to use the loop ID.
|
|
16403
|
+
var abortId = String(loopId);
|
|
16404
|
+
{
|
|
16405
|
+
var newAbortControllers = {};
|
|
16406
|
+
for (var key in this.getterLoopAbortControllers) {
|
|
16407
|
+
this.getterLoopAbortControllers[key].abort();
|
|
16408
|
+
}
|
|
16409
|
+
this.getterLoopAbortControllers = newAbortControllers;
|
|
16410
|
+
}
|
|
16411
|
+
var abortController = this.getterLoopAbortControllers[abortId] = new AbortController();
|
|
16412
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16413
|
+
var MIN_HEIGHT, MAX_HEIGHT, PAGE_SIZE, retryAttempts, retryDelay, prevFirstId, prevLastId, prevTicks, alt, cells, curCellIndex, postedScanning, postedLoading, total, curCell, entities, integrity, i, entity, first, last, e_1;
|
|
16355
16414
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
16356
16415
|
return __generator(this, function (_j) {
|
|
16357
16416
|
switch (_j.label) {
|
|
@@ -16445,7 +16504,10 @@
|
|
|
16445
16504
|
viaCdn: this.viaCdn,
|
|
16446
16505
|
migrated: true,
|
|
16447
16506
|
req: {
|
|
16448
|
-
noCache
|
|
16507
|
+
// If we are passing in an abort, we MUST pass in noCache.
|
|
16508
|
+
// Otherwise we will cache an aborted request.
|
|
16509
|
+
noCache: true,
|
|
16510
|
+
abortSignal: abortController.signal
|
|
16449
16511
|
}
|
|
16450
16512
|
})];
|
|
16451
16513
|
case 9:
|
|
@@ -16454,6 +16516,20 @@
|
|
|
16454
16516
|
if (loopIntegrity == integrity && entities) {
|
|
16455
16517
|
(_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger(entities);
|
|
16456
16518
|
}
|
|
16519
|
+
if (this.gatheredIntegrity != integrity) {
|
|
16520
|
+
this.gatheredIntegrity = integrity;
|
|
16521
|
+
this.gatheredEntityIds = [];
|
|
16522
|
+
}
|
|
16523
|
+
// Add to the integrity list for any new IDs found.
|
|
16524
|
+
// This lets us keep track of all IDs we've found within the same integrity for historic data.
|
|
16525
|
+
if (this.historicAttrKey) {
|
|
16526
|
+
for (i = 0; i < entities.length; i++) {
|
|
16527
|
+
entity = entities[i];
|
|
16528
|
+
if (!this.gatheredEntityIds.includes(entity.Bruce.ID)) {
|
|
16529
|
+
this.gatheredEntityIds.push(entity.Bruce.ID);
|
|
16530
|
+
}
|
|
16531
|
+
}
|
|
16532
|
+
}
|
|
16457
16533
|
if (this.getterLoopId != loopId) {
|
|
16458
16534
|
return [3 /*break*/, 13];
|
|
16459
16535
|
}
|
|
@@ -16496,7 +16572,14 @@
|
|
|
16496
16572
|
return [3 /*break*/, 11];
|
|
16497
16573
|
case 10:
|
|
16498
16574
|
e_1 = _j.sent();
|
|
16575
|
+
// Ignore abort errors.
|
|
16576
|
+
if (e_1 && typeof e_1 === "object" && e_1.name == "AbortError") {
|
|
16577
|
+
return [3 /*break*/, 13];
|
|
16578
|
+
}
|
|
16499
16579
|
console.error(e_1);
|
|
16580
|
+
if (this.getterLoopId != loopId) {
|
|
16581
|
+
return [3 /*break*/, 13];
|
|
16582
|
+
}
|
|
16500
16583
|
// Request failed so let's add a delay and try again soon.
|
|
16501
16584
|
retryDelay += RETRY_DELAY_INCREMENT;
|
|
16502
16585
|
retryAttempts -= 1;
|
|
@@ -16515,7 +16598,104 @@
|
|
|
16515
16598
|
return [2 /*return*/];
|
|
16516
16599
|
}
|
|
16517
16600
|
});
|
|
16518
|
-
}); });
|
|
16601
|
+
}); })();
|
|
16602
|
+
};
|
|
16603
|
+
/**
|
|
16604
|
+
* Gets the historic state of found Entities for the current date times and emits them.
|
|
16605
|
+
* Since geometry searches are tied to the base Entity, we don't have to re-scan the viewport.
|
|
16606
|
+
*/
|
|
16607
|
+
Getter.prototype.emitHistoricData = function () {
|
|
16608
|
+
var _this = this;
|
|
16609
|
+
var integrity = this.getIntegrityId();
|
|
16610
|
+
// Gathered ID does't match current one.
|
|
16611
|
+
if (this.gatheredIntegrity != integrity) {
|
|
16612
|
+
return;
|
|
16613
|
+
}
|
|
16614
|
+
var historicAttrDateTime = this.historicAttrDateTime;
|
|
16615
|
+
var SCAN_BATCH_SIZE = 1000;
|
|
16616
|
+
if (this.historicRefreshAbortController) {
|
|
16617
|
+
this.historicRefreshAbortController.abort();
|
|
16618
|
+
this.historicRefreshAbortController = null;
|
|
16619
|
+
}
|
|
16620
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16621
|
+
var pageIndex, i, batch, controller, entities, e_2;
|
|
16622
|
+
var _a;
|
|
16623
|
+
return __generator(this, function (_b) {
|
|
16624
|
+
switch (_b.label) {
|
|
16625
|
+
case 0:
|
|
16626
|
+
pageIndex = 0;
|
|
16627
|
+
_b.label = 1;
|
|
16628
|
+
case 1:
|
|
16629
|
+
_b.trys.push([1, 6, , 7]);
|
|
16630
|
+
i = 0;
|
|
16631
|
+
_b.label = 2;
|
|
16632
|
+
case 2:
|
|
16633
|
+
if (!(i < this.gatheredEntityIds.length)) return [3 /*break*/, 5];
|
|
16634
|
+
batch = this.gatheredEntityIds.slice(i, i + SCAN_BATCH_SIZE);
|
|
16635
|
+
if (!batch.length) {
|
|
16636
|
+
return [3 /*break*/, 5];
|
|
16637
|
+
}
|
|
16638
|
+
controller = this.historicRefreshAbortController = new AbortController();
|
|
16639
|
+
return [4 /*yield*/, BModels.Entity.GetList({
|
|
16640
|
+
api: this.api,
|
|
16641
|
+
historicKey: this.historicAttrKey,
|
|
16642
|
+
historicPoint: historicAttrDateTime,
|
|
16643
|
+
schemaId: this.schemaId,
|
|
16644
|
+
filter: {
|
|
16645
|
+
pageSize: SCAN_BATCH_SIZE,
|
|
16646
|
+
pageIndex: pageIndex,
|
|
16647
|
+
entityTypeId: this.typeId,
|
|
16648
|
+
layerIds: this.tagIds,
|
|
16649
|
+
layerIdsOperator: "in",
|
|
16650
|
+
sortOrder: BModels.Api.ESortOrder.Asc,
|
|
16651
|
+
entityTypeConditions: {
|
|
16652
|
+
"ID": {
|
|
16653
|
+
"IN": batch
|
|
16654
|
+
}
|
|
16655
|
+
},
|
|
16656
|
+
},
|
|
16657
|
+
viaCdn: this.viaCdn,
|
|
16658
|
+
migrated: true,
|
|
16659
|
+
req: {
|
|
16660
|
+
// If we are passing in an abort, we MUST pass in noCache.
|
|
16661
|
+
// Otherwise we will cache an aborted request.
|
|
16662
|
+
noCache: true,
|
|
16663
|
+
abortSignal: controller.signal
|
|
16664
|
+
}
|
|
16665
|
+
})];
|
|
16666
|
+
case 3:
|
|
16667
|
+
entities = (_b.sent()).entities;
|
|
16668
|
+
// Date changed.
|
|
16669
|
+
if (this.historicAttrDateTime != historicAttrDateTime) {
|
|
16670
|
+
return [3 /*break*/, 5];
|
|
16671
|
+
}
|
|
16672
|
+
// Integrity changed.
|
|
16673
|
+
if (this.gatheredIntegrity != integrity) {
|
|
16674
|
+
return [3 /*break*/, 5];
|
|
16675
|
+
}
|
|
16676
|
+
// No Menu Items.
|
|
16677
|
+
if (!this.GetMenuItems().length) {
|
|
16678
|
+
return [3 /*break*/, 5];
|
|
16679
|
+
}
|
|
16680
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(entities);
|
|
16681
|
+
pageIndex += 1;
|
|
16682
|
+
_b.label = 4;
|
|
16683
|
+
case 4:
|
|
16684
|
+
i += SCAN_BATCH_SIZE;
|
|
16685
|
+
return [3 /*break*/, 2];
|
|
16686
|
+
case 5: return [3 /*break*/, 7];
|
|
16687
|
+
case 6:
|
|
16688
|
+
e_2 = _b.sent();
|
|
16689
|
+
// Ignore abort errors.
|
|
16690
|
+
if (e_2 && typeof e_2 === "object" && e_2.name == "AbortError") {
|
|
16691
|
+
return [2 /*return*/];
|
|
16692
|
+
}
|
|
16693
|
+
console.error(e_2);
|
|
16694
|
+
return [3 /*break*/, 7];
|
|
16695
|
+
case 7: return [2 /*return*/];
|
|
16696
|
+
}
|
|
16697
|
+
});
|
|
16698
|
+
}); })();
|
|
16519
16699
|
};
|
|
16520
16700
|
return Getter;
|
|
16521
16701
|
}());
|
|
@@ -16531,6 +16711,9 @@
|
|
|
16531
16711
|
cacheKey += params.schemaId ? params.schemaId : "";
|
|
16532
16712
|
cacheKey += JSON.stringify(params.tagIds ? params.tagIds : []);
|
|
16533
16713
|
cacheKey += params.historicAttrKey ? params.historicAttrKey : "";
|
|
16714
|
+
if (params.historicAttrKey) {
|
|
16715
|
+
cacheKey += params.historicInterpolation ? "true" : "false";
|
|
16716
|
+
}
|
|
16534
16717
|
// This could potentially crash, but if it crashes here then it would crash during API request anyways.
|
|
16535
16718
|
cacheKey += JSON.stringify(params.attrFilter ? params.attrFilter : {});
|
|
16536
16719
|
return cacheKey;
|
|
@@ -16554,6 +16737,7 @@
|
|
|
16554
16737
|
batchSize: params.batchSize,
|
|
16555
16738
|
attrFilter: params.attrFilter,
|
|
16556
16739
|
historicAttrKey: params.historicAttrKey,
|
|
16740
|
+
historicInterpolation: params.historicInterpolation,
|
|
16557
16741
|
viaCdn: params.cdn
|
|
16558
16742
|
});
|
|
16559
16743
|
this.data[cacheKey] = getter;
|
|
@@ -16564,6 +16748,7 @@
|
|
|
16564
16748
|
if (params.viewer && params.debugShowBounds) {
|
|
16565
16749
|
// Cell id -> entity.
|
|
16566
16750
|
var cellCache_1 = {};
|
|
16751
|
+
var cellPrefix_1 = BModels.ObjectUtils.UId(10) + "_";
|
|
16567
16752
|
getter.OnScanUpdate.Subscribe(function (cells) {
|
|
16568
16753
|
if (window.ON_SCAN_UPDATE_PAUSED == true) {
|
|
16569
16754
|
return;
|
|
@@ -16574,7 +16759,7 @@
|
|
|
16574
16759
|
cells.forEach(function (cell) {
|
|
16575
16760
|
var _a;
|
|
16576
16761
|
var bounds = cell.GetBounds();
|
|
16577
|
-
var id = bounds.east + "_" + bounds.north + "_" + bounds.south + "_" + bounds.west;
|
|
16762
|
+
var id = cellPrefix_1 + bounds.east + "_" + bounds.north + "_" + bounds.south + "_" + bounds.west;
|
|
16578
16763
|
curCellIds.push(id);
|
|
16579
16764
|
fetchedCells[id] = cell.IsFetched();
|
|
16580
16765
|
fetchingCellId = cell.Fetching ? id : fetchingCellId;
|
|
@@ -24033,11 +24218,11 @@
|
|
|
24033
24218
|
}
|
|
24034
24219
|
(function (ViewRenderEngine) {
|
|
24035
24220
|
function Render(params) {
|
|
24036
|
-
var _a;
|
|
24221
|
+
var _a, _b;
|
|
24037
24222
|
return __awaiter(this, void 0, void 0, function () {
|
|
24038
|
-
var iteration, api, view,
|
|
24039
|
-
return __generator(this, function (
|
|
24040
|
-
switch (
|
|
24223
|
+
var iteration, api, view, _c, bookmark, bookmarkId, _d, version, bWidget, lpWidget;
|
|
24224
|
+
return __generator(this, function (_e) {
|
|
24225
|
+
switch (_e.label) {
|
|
24041
24226
|
case 0:
|
|
24042
24227
|
if (!params.manager && params.viewer) {
|
|
24043
24228
|
params.manager = exports.ViewerUtils.GetManager({
|
|
@@ -24060,17 +24245,17 @@
|
|
|
24060
24245
|
}
|
|
24061
24246
|
api = params.getters.GetBruceApi();
|
|
24062
24247
|
if (!params.view) return [3 /*break*/, 1];
|
|
24063
|
-
|
|
24248
|
+
_c = params.view;
|
|
24064
24249
|
return [3 /*break*/, 3];
|
|
24065
24250
|
case 1: return [4 /*yield*/, BModels.ProjectView.Get({
|
|
24066
24251
|
api: api,
|
|
24067
24252
|
viewId: params.viewId
|
|
24068
24253
|
})];
|
|
24069
24254
|
case 2:
|
|
24070
|
-
|
|
24071
|
-
|
|
24255
|
+
_c = (_e.sent()).view;
|
|
24256
|
+
_e.label = 3;
|
|
24072
24257
|
case 3:
|
|
24073
|
-
view =
|
|
24258
|
+
view = _c;
|
|
24074
24259
|
bookmark = params.bookmark;
|
|
24075
24260
|
if (!!bookmark) return [3 /*break*/, 7];
|
|
24076
24261
|
bookmarkId = params.bookmarkId;
|
|
@@ -24084,14 +24269,14 @@
|
|
|
24084
24269
|
bookmarkId: bookmarkId
|
|
24085
24270
|
})];
|
|
24086
24271
|
case 4:
|
|
24087
|
-
|
|
24272
|
+
_d = (_e.sent()).bookmark;
|
|
24088
24273
|
return [3 /*break*/, 6];
|
|
24089
24274
|
case 5:
|
|
24090
|
-
|
|
24091
|
-
|
|
24275
|
+
_d = null;
|
|
24276
|
+
_e.label = 6;
|
|
24092
24277
|
case 6:
|
|
24093
|
-
bookmark =
|
|
24094
|
-
|
|
24278
|
+
bookmark = _d;
|
|
24279
|
+
_e.label = 7;
|
|
24095
24280
|
case 7:
|
|
24096
24281
|
if (!assertIteration$1(params.viewer, iteration)) {
|
|
24097
24282
|
return [2 /*return*/];
|
|
@@ -24100,12 +24285,12 @@
|
|
|
24100
24285
|
if (!(version == 1)) return [3 /*break*/, 9];
|
|
24101
24286
|
return [4 /*yield*/, renderLegacyNavigator(iteration, params, bookmark, view)];
|
|
24102
24287
|
case 8:
|
|
24103
|
-
|
|
24288
|
+
_e.sent();
|
|
24104
24289
|
return [3 /*break*/, 11];
|
|
24105
24290
|
case 9: return [4 /*yield*/, renderNavigator(iteration, params, bookmark, view, params.getters)];
|
|
24106
24291
|
case 10:
|
|
24107
|
-
|
|
24108
|
-
|
|
24292
|
+
_e.sent();
|
|
24293
|
+
_e.label = 11;
|
|
24109
24294
|
case 11:
|
|
24110
24295
|
if (!assertIteration$1(params.viewer, iteration)) {
|
|
24111
24296
|
return [2 /*return*/];
|
|
@@ -24115,6 +24300,11 @@
|
|
|
24115
24300
|
bWidget.ViewId = params.viewId ? params.viewId : view === null || view === void 0 ? void 0 : view.ID;
|
|
24116
24301
|
bWidget.LastEnabledBookmarkId = params.bookmarkId ? params.bookmarkId : bookmark === null || bookmark === void 0 ? void 0 : bookmark.ID;
|
|
24117
24302
|
}
|
|
24303
|
+
lpWidget = (_b = params.viewer) === null || _b === void 0 ? void 0 : _b[VIEWER_LEFT_PANEL_WIDGET_KEY];
|
|
24304
|
+
if (lpWidget) {
|
|
24305
|
+
lpWidget.ViewId = params.viewId ? params.viewId : view === null || view === void 0 ? void 0 : view.ID;
|
|
24306
|
+
lpWidget.LastEnabledBookmarkId = params.bookmarkId ? params.bookmarkId : bookmark === null || bookmark === void 0 ? void 0 : bookmark.ID;
|
|
24307
|
+
}
|
|
24118
24308
|
return [2 /*return*/];
|
|
24119
24309
|
}
|
|
24120
24310
|
});
|
|
@@ -24157,6 +24347,8 @@
|
|
|
24157
24347
|
var isChanged = this._viewId != value;
|
|
24158
24348
|
if (isChanged) {
|
|
24159
24349
|
this._viewId = value;
|
|
24350
|
+
this._updatePanelStyles();
|
|
24351
|
+
this._loading = this.loadBookmarks();
|
|
24160
24352
|
}
|
|
24161
24353
|
},
|
|
24162
24354
|
enumerable: false,
|
|
@@ -24208,13 +24400,15 @@
|
|
|
24208
24400
|
};
|
|
24209
24401
|
WidgetLeftPanel.prototype.loadBookmarks = function () {
|
|
24210
24402
|
return __awaiter(this, void 0, void 0, function () {
|
|
24211
|
-
var
|
|
24403
|
+
var viewId, api, data, e_1;
|
|
24212
24404
|
return __generator(this, function (_a) {
|
|
24213
24405
|
switch (_a.label) {
|
|
24214
24406
|
case 0:
|
|
24215
|
-
_a.trys.push([0, 2, , 3]);
|
|
24216
|
-
api = this._apiGetters.GetBruceApi();
|
|
24217
24407
|
viewId = this._viewId;
|
|
24408
|
+
_a.label = 1;
|
|
24409
|
+
case 1:
|
|
24410
|
+
_a.trys.push([1, 3, , 4]);
|
|
24411
|
+
api = this._apiGetters.GetBruceApi();
|
|
24218
24412
|
if (!viewId) {
|
|
24219
24413
|
this.bookmarks = [];
|
|
24220
24414
|
return [2 /*return*/];
|
|
@@ -24223,16 +24417,22 @@
|
|
|
24223
24417
|
viewId: viewId,
|
|
24224
24418
|
api: api
|
|
24225
24419
|
})];
|
|
24226
|
-
case
|
|
24420
|
+
case 2:
|
|
24227
24421
|
data = _a.sent();
|
|
24422
|
+
if (this._viewId !== viewId) {
|
|
24423
|
+
return [2 /*return*/];
|
|
24424
|
+
}
|
|
24228
24425
|
this.bookmarks = data.bookmarks;
|
|
24229
|
-
return [3 /*break*/,
|
|
24230
|
-
case
|
|
24426
|
+
return [3 /*break*/, 4];
|
|
24427
|
+
case 3:
|
|
24231
24428
|
e_1 = _a.sent();
|
|
24232
24429
|
console.error(e_1);
|
|
24430
|
+
if (this._viewId !== viewId) {
|
|
24431
|
+
return [2 /*return*/];
|
|
24432
|
+
}
|
|
24233
24433
|
this.bookmarks = [];
|
|
24234
|
-
return [3 /*break*/,
|
|
24235
|
-
case
|
|
24434
|
+
return [3 /*break*/, 4];
|
|
24435
|
+
case 4: return [2 /*return*/];
|
|
24236
24436
|
}
|
|
24237
24437
|
});
|
|
24238
24438
|
});
|
|
@@ -27775,7 +27975,7 @@
|
|
|
27775
27975
|
return WidgetViewBar;
|
|
27776
27976
|
}(exports.Widget.AWidget));
|
|
27777
27977
|
|
|
27778
|
-
var VERSION = "4.6.
|
|
27978
|
+
var VERSION = "4.6.3";
|
|
27779
27979
|
|
|
27780
27980
|
exports.VERSION = VERSION;
|
|
27781
27981
|
exports.CesiumParabola = CesiumParabola;
|