bruce-cesium 3.7.6 → 3.7.8
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 +151 -80
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +150 -79
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine.js +38 -33
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +28 -12
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +20 -7
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +18 -6
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +31 -14
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +18 -6
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/entity-render-engine.d.ts +12 -9
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -4798,7 +4798,7 @@
|
|
|
4798
4798
|
function Render(params) {
|
|
4799
4799
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4800
4800
|
return __awaiter(this, void 0, void 0, function () {
|
|
4801
|
-
var groupRenderParams, i, entity, geometry, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
|
|
4801
|
+
var groupRenderParams, i, entity, geometry, updated, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
|
|
4802
4802
|
return __generator(this, function (_m) {
|
|
4803
4803
|
switch (_m.label) {
|
|
4804
4804
|
case 0:
|
|
@@ -4818,7 +4818,8 @@
|
|
|
4818
4818
|
entity.geometry = __assign(__assign(__assign({}, entity.geometry), geometry.MultiGeometry[0]), { MultiGeometry: [] });
|
|
4819
4819
|
}
|
|
4820
4820
|
}
|
|
4821
|
-
|
|
4821
|
+
updated = new Map();
|
|
4822
|
+
cEntities = new Map();
|
|
4822
4823
|
models = [];
|
|
4823
4824
|
multiGeometry = [];
|
|
4824
4825
|
polygons = [];
|
|
@@ -4854,18 +4855,19 @@
|
|
|
4854
4855
|
// If historic metadata is different then it's also stale.
|
|
4855
4856
|
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.historicDateTime))) {
|
|
4856
4857
|
// No sorting category needed. Already rendered the way we want.
|
|
4857
|
-
cEntities
|
|
4858
|
+
cEntities.set(id, existingRego.visual);
|
|
4858
4859
|
}
|
|
4859
4860
|
else {
|
|
4860
4861
|
// Add so we can re-use the graphic and update it.
|
|
4861
4862
|
if (existingRego && newRenderId == oldRenderId) {
|
|
4862
|
-
cEntities
|
|
4863
|
+
cEntities.set(id, existingRego.visual);
|
|
4863
4864
|
// Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
|
|
4864
4865
|
existingRego.stale = false;
|
|
4865
4866
|
// Update metadata for the same reason.
|
|
4866
4867
|
existingRego.historicDateTime = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicDateTime;
|
|
4867
4868
|
existingRego.historicAttrKey = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.historicAttrKey;
|
|
4868
4869
|
existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
4870
|
+
updated.set(id, true);
|
|
4869
4871
|
}
|
|
4870
4872
|
if (displayType == bruceModels.ZoomControl.EDisplayType.Model3D) {
|
|
4871
4873
|
models.push(entity);
|
|
@@ -4893,9 +4895,9 @@
|
|
|
4893
4895
|
for (i = 0; i < mParams.entities.length; i++) {
|
|
4894
4896
|
entity = mParams.entities[i];
|
|
4895
4897
|
id = entity.Bruce.ID;
|
|
4896
|
-
cEntity = mEntities
|
|
4898
|
+
cEntity = mEntities.get(id);
|
|
4897
4899
|
if (cEntity) {
|
|
4898
|
-
cEntities
|
|
4900
|
+
cEntities.set(id, cEntity);
|
|
4899
4901
|
}
|
|
4900
4902
|
else {
|
|
4901
4903
|
multiGeometry.push(entity);
|
|
@@ -4924,26 +4926,26 @@
|
|
|
4924
4926
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
4925
4927
|
case 1:
|
|
4926
4928
|
cPoly = _o.sent();
|
|
4927
|
-
|
|
4928
|
-
if (cPoly
|
|
4929
|
+
Array.from(cPoly.keys()).forEach(function (key) {
|
|
4930
|
+
if (cPoly.get(key)) {
|
|
4929
4931
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
4930
4932
|
}
|
|
4931
4933
|
});
|
|
4932
|
-
rendered =
|
|
4934
|
+
rendered = Array.from(cPoly.values());
|
|
4933
4935
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
4934
4936
|
case 2:
|
|
4935
4937
|
cLines = _o.sent();
|
|
4936
|
-
|
|
4937
|
-
if (cLines
|
|
4938
|
+
Array.from(cLines.keys()).forEach(function (key) {
|
|
4939
|
+
if (cLines.get(key)) {
|
|
4938
4940
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
4939
4941
|
}
|
|
4940
4942
|
});
|
|
4941
|
-
rendered = rendered.concat(
|
|
4943
|
+
rendered = rendered.concat(Array.from(cLines.values()));
|
|
4942
4944
|
if (!!rendered.length) return [3 /*break*/, 4];
|
|
4943
4945
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
4944
4946
|
case 3:
|
|
4945
4947
|
cPoints = _o.sent();
|
|
4946
|
-
rendered = rendered.concat(
|
|
4948
|
+
rendered = rendered.concat(Array.from(cPoints.values()));
|
|
4947
4949
|
_o.label = 4;
|
|
4948
4950
|
case 4:
|
|
4949
4951
|
rendered = rendered.filter(function (x) { return x != null; });
|
|
@@ -4954,7 +4956,7 @@
|
|
|
4954
4956
|
rootEntity_1._siblingGraphics = [];
|
|
4955
4957
|
rootEntity_1._renderGroup = getRenderGroupId(zoomItem, (_l = params.viewer) === null || _l === void 0 ? void 0 : _l.terrainProvider);
|
|
4956
4958
|
rootEntity_1._siblingGraphics = rootEntity_1._siblingGraphics.concat(rendered);
|
|
4957
|
-
cEntities
|
|
4959
|
+
cEntities.set(entity.Bruce.ID, rootEntity_1);
|
|
4958
4960
|
firstEntity = rendered[0];
|
|
4959
4961
|
if (firstEntity) {
|
|
4960
4962
|
rootEntity_1.position = getValue$1(params.viewer, firstEntity.position);
|
|
@@ -4989,9 +4991,9 @@
|
|
|
4989
4991
|
pEntities = _m.sent();
|
|
4990
4992
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
4991
4993
|
entity = pParams.entities[i];
|
|
4992
|
-
cEntity = pEntities
|
|
4994
|
+
cEntity = pEntities.get(entity.Bruce.ID);
|
|
4993
4995
|
if (cEntity) {
|
|
4994
|
-
cEntities
|
|
4996
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
4995
4997
|
}
|
|
4996
4998
|
else {
|
|
4997
4999
|
polylines.push(entity);
|
|
@@ -5006,9 +5008,9 @@
|
|
|
5006
5008
|
pEntities = _m.sent();
|
|
5007
5009
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5008
5010
|
entity = pParams.entities[i];
|
|
5009
|
-
cEntity = pEntities
|
|
5011
|
+
cEntity = pEntities.get(entity.Bruce.ID);
|
|
5010
5012
|
if (cEntity) {
|
|
5011
|
-
cEntities
|
|
5013
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
5012
5014
|
}
|
|
5013
5015
|
else {
|
|
5014
5016
|
points.push(entity);
|
|
@@ -5023,13 +5025,16 @@
|
|
|
5023
5025
|
pEntities = _m.sent();
|
|
5024
5026
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5025
5027
|
entity = pParams.entities[i];
|
|
5026
|
-
cEntity = pEntities
|
|
5028
|
+
cEntity = pEntities.get(entity.Bruce.ID);
|
|
5027
5029
|
if (cEntity) {
|
|
5028
|
-
cEntities
|
|
5030
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
5029
5031
|
}
|
|
5030
5032
|
}
|
|
5031
5033
|
_m.label = 12;
|
|
5032
|
-
case 12: return [2 /*return*/,
|
|
5034
|
+
case 12: return [2 /*return*/, {
|
|
5035
|
+
entities: cEntities,
|
|
5036
|
+
updated: updated
|
|
5037
|
+
}];
|
|
5033
5038
|
}
|
|
5034
5039
|
});
|
|
5035
5040
|
});
|
|
@@ -5451,7 +5456,7 @@
|
|
|
5451
5456
|
switch (_f.label) {
|
|
5452
5457
|
case 0:
|
|
5453
5458
|
api = params.apiGetter.getApi();
|
|
5454
|
-
cEntities =
|
|
5459
|
+
cEntities = new Map();
|
|
5455
5460
|
i = 0;
|
|
5456
5461
|
_f.label = 1;
|
|
5457
5462
|
case 1:
|
|
@@ -5489,7 +5494,7 @@
|
|
|
5489
5494
|
apiGetter: params.apiGetter,
|
|
5490
5495
|
maxDistance: zoomItem.MaxZoom,
|
|
5491
5496
|
minDistance: zoomItem.MinZoom,
|
|
5492
|
-
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c
|
|
5497
|
+
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID)
|
|
5493
5498
|
})];
|
|
5494
5499
|
case 7:
|
|
5495
5500
|
cEntity = _f.sent();
|
|
@@ -5501,7 +5506,7 @@
|
|
|
5501
5506
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_d = params.viewer) === null || _d === void 0 ? void 0 : _d.terrainProvider);
|
|
5502
5507
|
_f.label = 9;
|
|
5503
5508
|
case 9:
|
|
5504
|
-
cEntities
|
|
5509
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
5505
5510
|
_f.label = 10;
|
|
5506
5511
|
case 10:
|
|
5507
5512
|
i++;
|
|
@@ -5688,7 +5693,7 @@
|
|
|
5688
5693
|
switch (_f.label) {
|
|
5689
5694
|
case 0:
|
|
5690
5695
|
api = params.apiGetter.getApi();
|
|
5691
|
-
cEntities =
|
|
5696
|
+
cEntities = new Map();
|
|
5692
5697
|
i = 0;
|
|
5693
5698
|
_f.label = 1;
|
|
5694
5699
|
case 1:
|
|
@@ -5724,7 +5729,7 @@
|
|
|
5724
5729
|
viewer: params.viewer,
|
|
5725
5730
|
maxDistance: zoomItem.MaxZoom,
|
|
5726
5731
|
minDistance: zoomItem.MinZoom,
|
|
5727
|
-
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c
|
|
5732
|
+
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID)
|
|
5728
5733
|
});
|
|
5729
5734
|
if (!cEntity) return [3 /*break*/, 8];
|
|
5730
5735
|
return [4 /*yield*/, getName(api, entity)];
|
|
@@ -5732,7 +5737,7 @@
|
|
|
5732
5737
|
name_3 = _f.sent();
|
|
5733
5738
|
cEntity.name = name_3;
|
|
5734
5739
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_d = params.viewer) === null || _d === void 0 ? void 0 : _d.terrainProvider);
|
|
5735
|
-
cEntities
|
|
5740
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
5736
5741
|
_f.label = 8;
|
|
5737
5742
|
case 8:
|
|
5738
5743
|
i++;
|
|
@@ -6012,7 +6017,7 @@
|
|
|
6012
6017
|
switch (_f.label) {
|
|
6013
6018
|
case 0:
|
|
6014
6019
|
api = params.apiGetter.getApi();
|
|
6015
|
-
cEntities =
|
|
6020
|
+
cEntities = new Map();
|
|
6016
6021
|
i = 0;
|
|
6017
6022
|
_f.label = 1;
|
|
6018
6023
|
case 1:
|
|
@@ -6048,7 +6053,7 @@
|
|
|
6048
6053
|
viewer: params.viewer,
|
|
6049
6054
|
maxDistance: zoomItem.MaxZoom,
|
|
6050
6055
|
minDistance: zoomItem.MinZoom,
|
|
6051
|
-
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c
|
|
6056
|
+
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID)
|
|
6052
6057
|
});
|
|
6053
6058
|
if (!cEntity) return [3 /*break*/, 8];
|
|
6054
6059
|
return [4 /*yield*/, getName(api, entity)];
|
|
@@ -6056,7 +6061,7 @@
|
|
|
6056
6061
|
name_4 = _f.sent();
|
|
6057
6062
|
cEntity.name = name_4;
|
|
6058
6063
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_d = params.viewer) === null || _d === void 0 ? void 0 : _d.terrainProvider);
|
|
6059
|
-
cEntities
|
|
6064
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
6060
6065
|
_f.label = 8;
|
|
6061
6066
|
case 8:
|
|
6062
6067
|
i++;
|
|
@@ -6323,7 +6328,7 @@
|
|
|
6323
6328
|
return [4 /*yield*/, api.Loading];
|
|
6324
6329
|
case 1:
|
|
6325
6330
|
_h.sent();
|
|
6326
|
-
cEntities =
|
|
6331
|
+
cEntities = new Map();
|
|
6327
6332
|
reqBody = {
|
|
6328
6333
|
"strict": false,
|
|
6329
6334
|
"externalSources": false,
|
|
@@ -6419,7 +6424,7 @@
|
|
|
6419
6424
|
}
|
|
6420
6425
|
mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
|
|
6421
6426
|
cEntity = Render({
|
|
6422
|
-
rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e
|
|
6427
|
+
rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
|
|
6423
6428
|
entity: entity,
|
|
6424
6429
|
style: mStyle,
|
|
6425
6430
|
tags: tags,
|
|
@@ -6439,7 +6444,7 @@
|
|
|
6439
6444
|
name_5 = _k.sent();
|
|
6440
6445
|
cEntity.name = name_5;
|
|
6441
6446
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_f = params.viewer) === null || _f === void 0 ? void 0 : _f.terrainProvider);
|
|
6442
|
-
cEntities
|
|
6447
|
+
cEntities.set(entity.Bruce.ID, cEntity);
|
|
6443
6448
|
_k.label = 7;
|
|
6444
6449
|
case 7: return [2 /*return*/];
|
|
6445
6450
|
}
|
|
@@ -10305,12 +10310,12 @@
|
|
|
10305
10310
|
* @returns
|
|
10306
10311
|
*/
|
|
10307
10312
|
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
10308
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
10313
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
10309
10314
|
if (force === void 0) { force = false; }
|
|
10310
10315
|
return __awaiter(this, void 0, void 0, function () {
|
|
10311
|
-
var toRemove, i, entity, cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds,
|
|
10312
|
-
return __generator(this, function (
|
|
10313
|
-
switch (
|
|
10316
|
+
var toRemove, i, entity, _k, updated, cEntities, i, entity, id, cEntity, rego, visual, wasClustered, tagIds, rego_1;
|
|
10317
|
+
return __generator(this, function (_l) {
|
|
10318
|
+
switch (_l.label) {
|
|
10314
10319
|
case 0:
|
|
10315
10320
|
if ((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey) {
|
|
10316
10321
|
toRemove = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.historicAttrKey); });
|
|
@@ -10335,7 +10340,7 @@
|
|
|
10335
10340
|
force: force
|
|
10336
10341
|
})];
|
|
10337
10342
|
case 1:
|
|
10338
|
-
|
|
10343
|
+
_k = _l.sent(), updated = _k.updated, cEntities = _k.entities;
|
|
10339
10344
|
if (this.disposed) {
|
|
10340
10345
|
this.doDispose();
|
|
10341
10346
|
return [2 /*return*/];
|
|
@@ -10343,17 +10348,18 @@
|
|
|
10343
10348
|
for (i = 0; i < entities.length; i++) {
|
|
10344
10349
|
entity = entities[i];
|
|
10345
10350
|
id = entity.Bruce.ID;
|
|
10346
|
-
cEntity = cEntities
|
|
10351
|
+
cEntity = cEntities.get(id);
|
|
10347
10352
|
this.renderedEntities[id] = !!cEntity;
|
|
10348
10353
|
if (cEntity) {
|
|
10349
|
-
|
|
10354
|
+
rego = this.visualsManager.GetRego({
|
|
10350
10355
|
entityId: id,
|
|
10351
10356
|
menuItemId: this.item.id
|
|
10352
|
-
})
|
|
10357
|
+
});
|
|
10358
|
+
visual = rego === null || rego === void 0 ? void 0 : rego.visual;
|
|
10353
10359
|
if (!visual || visual != cEntity) {
|
|
10354
10360
|
wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
10355
|
-
tagIds = (
|
|
10356
|
-
|
|
10361
|
+
tagIds = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c["Layer.ID"];
|
|
10362
|
+
rego_1 = {
|
|
10357
10363
|
entityId: id,
|
|
10358
10364
|
menuItemId: this.item.id,
|
|
10359
10365
|
visual: cEntity,
|
|
@@ -10364,14 +10370,29 @@
|
|
|
10364
10370
|
overrideShow: wasClustered ? false : null,
|
|
10365
10371
|
name: cEntity.name,
|
|
10366
10372
|
cdn: this.item.cdnEnabled,
|
|
10367
|
-
historicDateTime: (
|
|
10368
|
-
historicAttrKey: (
|
|
10373
|
+
historicDateTime: (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.historicDateTime,
|
|
10374
|
+
historicAttrKey: (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicAttrKey
|
|
10369
10375
|
};
|
|
10370
10376
|
this.visualsManager.AddRego({
|
|
10371
|
-
rego:
|
|
10377
|
+
rego: rego_1,
|
|
10372
10378
|
requestRender: false
|
|
10373
10379
|
});
|
|
10374
10380
|
}
|
|
10381
|
+
else if (updated.get(id) && rego) {
|
|
10382
|
+
rego.name = cEntity.name;
|
|
10383
|
+
rego.visual = cEntity;
|
|
10384
|
+
rego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
10385
|
+
rego.tagIds = ((_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
|
|
10386
|
+
rego.historicDateTime = (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.historicDateTime;
|
|
10387
|
+
rego.historicAttrKey = (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.historicAttrKey;
|
|
10388
|
+
rego.cdn = this.item.cdnEnabled;
|
|
10389
|
+
// We manually trigger an update event since the graphic was updated but not recreated.
|
|
10390
|
+
this.visualsManager.OnUpdate.Trigger({
|
|
10391
|
+
type: exports.VisualsRegister.EVisualUpdateType.Update,
|
|
10392
|
+
entityId: id,
|
|
10393
|
+
rego: rego
|
|
10394
|
+
});
|
|
10395
|
+
}
|
|
10375
10396
|
}
|
|
10376
10397
|
else {
|
|
10377
10398
|
this.visualsManager.RemoveRegos({
|
|
@@ -10379,7 +10400,7 @@
|
|
|
10379
10400
|
menuItemId: this.item.id,
|
|
10380
10401
|
requestRender: false
|
|
10381
10402
|
});
|
|
10382
|
-
(
|
|
10403
|
+
(_j = this.clustering) === null || _j === void 0 ? void 0 : _j.RemoveEntity(id, false);
|
|
10383
10404
|
}
|
|
10384
10405
|
}
|
|
10385
10406
|
this.viewer.scene.requestRender();
|
|
@@ -11132,10 +11153,9 @@
|
|
|
11132
11153
|
* @returns
|
|
11133
11154
|
*/
|
|
11134
11155
|
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
11135
|
-
var _a;
|
|
11136
11156
|
if (force === void 0) { force = false; }
|
|
11137
11157
|
return __awaiter(this, void 0, void 0, function () {
|
|
11138
|
-
var cEntities, isEntityInItem, i, entity, id, cEntity, visual;
|
|
11158
|
+
var _a, updated, cEntities, isEntityInItem, i, entity, id, cEntity, rego, visual;
|
|
11139
11159
|
var _this = this;
|
|
11140
11160
|
return __generator(this, function (_b) {
|
|
11141
11161
|
switch (_b.label) {
|
|
@@ -11149,7 +11169,7 @@
|
|
|
11149
11169
|
force: force
|
|
11150
11170
|
})];
|
|
11151
11171
|
case 1:
|
|
11152
|
-
|
|
11172
|
+
_a = _b.sent(), updated = _a.updated, cEntities = _a.entities;
|
|
11153
11173
|
if (this.disposed) {
|
|
11154
11174
|
this.visualsManager.RemoveRegos({
|
|
11155
11175
|
menuItemId: this.item.id
|
|
@@ -11163,13 +11183,14 @@
|
|
|
11163
11183
|
for (i = 0; i < entities.length; i++) {
|
|
11164
11184
|
entity = entities[i];
|
|
11165
11185
|
id = entity.Bruce.ID;
|
|
11166
|
-
cEntity = cEntities
|
|
11186
|
+
cEntity = cEntities.get(id);
|
|
11167
11187
|
this.renderedEntities[id] = !!cEntity;
|
|
11168
11188
|
if (cEntity && isEntityInItem(id)) {
|
|
11169
|
-
|
|
11189
|
+
rego = this.visualsManager.GetRego({
|
|
11170
11190
|
entityId: id,
|
|
11171
11191
|
menuItemId: this.item.id
|
|
11172
|
-
})
|
|
11192
|
+
});
|
|
11193
|
+
visual = rego === null || rego === void 0 ? void 0 : rego.visual;
|
|
11173
11194
|
if (!visual || visual != cEntity) {
|
|
11174
11195
|
this.visualsManager.AddRego({
|
|
11175
11196
|
rego: {
|
|
@@ -11184,6 +11205,17 @@
|
|
|
11184
11205
|
requestRender: false
|
|
11185
11206
|
});
|
|
11186
11207
|
}
|
|
11208
|
+
else if (updated.get(id) && rego) {
|
|
11209
|
+
rego.visual = cEntity;
|
|
11210
|
+
rego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
11211
|
+
rego.name = cEntity.name;
|
|
11212
|
+
// We manually trigger an update event since the graphic was updated but not recreated.
|
|
11213
|
+
this.visualsManager.OnUpdate.Trigger({
|
|
11214
|
+
type: exports.VisualsRegister.EVisualUpdateType.Update,
|
|
11215
|
+
entityId: id,
|
|
11216
|
+
rego: rego
|
|
11217
|
+
});
|
|
11218
|
+
}
|
|
11187
11219
|
}
|
|
11188
11220
|
else {
|
|
11189
11221
|
this.visualsManager.RemoveRegos({
|
|
@@ -11736,10 +11768,10 @@
|
|
|
11736
11768
|
* @returns
|
|
11737
11769
|
*/
|
|
11738
11770
|
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
11739
|
-
var _a
|
|
11771
|
+
var _a;
|
|
11740
11772
|
if (force === void 0) { force = false; }
|
|
11741
11773
|
return __awaiter(this, void 0, void 0, function () {
|
|
11742
|
-
var cEntities, i, entity, id, cEntity, visual, clustered;
|
|
11774
|
+
var _b, updated, cEntities, i, entity, id, cEntity, rego, visual, clustered;
|
|
11743
11775
|
return __generator(this, function (_c) {
|
|
11744
11776
|
switch (_c.label) {
|
|
11745
11777
|
case 0: return [4 /*yield*/, exports.EntityRenderEngine.Render({
|
|
@@ -11752,17 +11784,18 @@
|
|
|
11752
11784
|
force: force
|
|
11753
11785
|
})];
|
|
11754
11786
|
case 1:
|
|
11755
|
-
|
|
11787
|
+
_b = _c.sent(), updated = _b.updated, cEntities = _b.entities;
|
|
11756
11788
|
for (i = 0; i < entities.length; i++) {
|
|
11757
11789
|
entity = entities[i];
|
|
11758
11790
|
id = entity.Bruce.ID;
|
|
11759
|
-
cEntity = cEntities
|
|
11791
|
+
cEntity = cEntities.get(id);
|
|
11760
11792
|
this.renderedEntities[id] = !!cEntity;
|
|
11761
11793
|
if (cEntity) {
|
|
11762
|
-
|
|
11794
|
+
rego = this.visualsManager.GetRego({
|
|
11763
11795
|
entityId: id,
|
|
11764
11796
|
menuItemId: this.item.id
|
|
11765
|
-
})
|
|
11797
|
+
});
|
|
11798
|
+
visual = rego === null || rego === void 0 ? void 0 : rego.visual;
|
|
11766
11799
|
if (!visual || visual != cEntity) {
|
|
11767
11800
|
clustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
11768
11801
|
this.visualsManager.AddRego({
|
|
@@ -11779,6 +11812,17 @@
|
|
|
11779
11812
|
requestRender: false
|
|
11780
11813
|
});
|
|
11781
11814
|
}
|
|
11815
|
+
else if (updated.get(id) && rego) {
|
|
11816
|
+
rego.visual = cEntity;
|
|
11817
|
+
rego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
11818
|
+
rego.name = cEntity.name;
|
|
11819
|
+
// We manually trigger an update event since the graphic was updated but not recreated.
|
|
11820
|
+
this.visualsManager.OnUpdate.Trigger({
|
|
11821
|
+
type: exports.VisualsRegister.EVisualUpdateType.Update,
|
|
11822
|
+
entityId: id,
|
|
11823
|
+
rego: rego
|
|
11824
|
+
});
|
|
11825
|
+
}
|
|
11782
11826
|
}
|
|
11783
11827
|
else {
|
|
11784
11828
|
this.visualsManager.RemoveRegos({
|
|
@@ -11786,7 +11830,7 @@
|
|
|
11786
11830
|
menuItemId: this.item.id,
|
|
11787
11831
|
requestRender: false
|
|
11788
11832
|
});
|
|
11789
|
-
(
|
|
11833
|
+
(_a = this.clustering) === null || _a === void 0 ? void 0 : _a.RemoveEntity(id, false);
|
|
11790
11834
|
}
|
|
11791
11835
|
}
|
|
11792
11836
|
this.viewer.scene.requestRender();
|
|
@@ -11938,10 +11982,9 @@
|
|
|
11938
11982
|
}
|
|
11939
11983
|
};
|
|
11940
11984
|
Manager.prototype.renderEntity = function (entity, force) {
|
|
11941
|
-
var _a;
|
|
11942
11985
|
if (force === void 0) { force = false; }
|
|
11943
11986
|
return __awaiter(this, void 0, void 0, function () {
|
|
11944
|
-
var id, cEntities, cEntity, visual, e_2;
|
|
11987
|
+
var id, _a, updated, cEntities, cEntity, rego, visual, e_2;
|
|
11945
11988
|
return __generator(this, function (_b) {
|
|
11946
11989
|
switch (_b.label) {
|
|
11947
11990
|
case 0:
|
|
@@ -11960,13 +12003,14 @@
|
|
|
11960
12003
|
force: force
|
|
11961
12004
|
})];
|
|
11962
12005
|
case 1:
|
|
11963
|
-
|
|
11964
|
-
cEntity = cEntities
|
|
12006
|
+
_a = _b.sent(), updated = _a.updated, cEntities = _a.entities;
|
|
12007
|
+
cEntity = cEntities.get(id);
|
|
11965
12008
|
if (cEntity) {
|
|
11966
|
-
|
|
12009
|
+
rego = this.visualsManager.GetRego({
|
|
11967
12010
|
entityId: id,
|
|
11968
12011
|
menuItemId: this.item.id
|
|
11969
|
-
})
|
|
12012
|
+
});
|
|
12013
|
+
visual = rego === null || rego === void 0 ? void 0 : rego.visual;
|
|
11970
12014
|
if (!visual || visual != cEntity) {
|
|
11971
12015
|
this.visualsManager.AddRego({
|
|
11972
12016
|
rego: {
|
|
@@ -11981,6 +12025,17 @@
|
|
|
11981
12025
|
requestRender: false
|
|
11982
12026
|
});
|
|
11983
12027
|
}
|
|
12028
|
+
else if (updated.get(id) && rego) {
|
|
12029
|
+
rego.visual = cEntity;
|
|
12030
|
+
rego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
12031
|
+
rego.name = cEntity.name;
|
|
12032
|
+
// We manually trigger an update event since the graphic was updated but not recreated.
|
|
12033
|
+
this.visualsManager.OnUpdate.Trigger({
|
|
12034
|
+
type: exports.VisualsRegister.EVisualUpdateType.Update,
|
|
12035
|
+
entityId: id,
|
|
12036
|
+
rego: rego
|
|
12037
|
+
});
|
|
12038
|
+
}
|
|
11984
12039
|
}
|
|
11985
12040
|
else {
|
|
11986
12041
|
this.visualsManager.RemoveRegos({
|
|
@@ -13693,20 +13748,35 @@
|
|
|
13693
13748
|
};
|
|
13694
13749
|
};
|
|
13695
13750
|
Getter.prototype.updateHistoricDateTime = function () {
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
|
|
13751
|
+
if (!this.historicAttrKey) {
|
|
13752
|
+
this.historicAttrDateTime = null;
|
|
13753
|
+
this.historicAttrDateTimeMin = null;
|
|
13754
|
+
this.historicAttrDateTimeMax = null;
|
|
13755
|
+
return;
|
|
13756
|
+
}
|
|
13757
|
+
var isChanged = function (before, after) {
|
|
13758
|
+
if (before && !after) {
|
|
13759
|
+
return true;
|
|
13704
13760
|
}
|
|
13761
|
+
if (!before && after) {
|
|
13762
|
+
return true;
|
|
13763
|
+
}
|
|
13764
|
+
// Change must be at least 0.1 seconds.
|
|
13765
|
+
return Math.abs(before.getTime() - after.getTime()) > 100;
|
|
13766
|
+
};
|
|
13767
|
+
var oldDateTime = this.historicAttrDateTime ? new Date(this.historicAttrDateTime) : null;
|
|
13768
|
+
var newDateTime = Cesium.JulianDate.toDate(this.viewer.clock.currentTime);
|
|
13769
|
+
var oldDateMin = this.historicAttrDateTimeMin ? new Date(this.historicAttrDateTimeMin) : null;
|
|
13770
|
+
var newDateMin = this.viewer.clock.startTime ? Cesium.JulianDate.toDate(this.viewer.clock.startTime) : null;
|
|
13771
|
+
var oldDateMax = this.historicAttrDateTimeMax ? new Date(this.historicAttrDateTimeMax) : null;
|
|
13772
|
+
var newDateMax = this.viewer.clock.stopTime ? Cesium.JulianDate.toDate(this.viewer.clock.stopTime) : null;
|
|
13773
|
+
if (isChanged(oldDateTime, newDateTime) ||
|
|
13774
|
+
isChanged(oldDateMin, newDateMin) ||
|
|
13775
|
+
isChanged(oldDateMax, newDateMax)) {
|
|
13776
|
+
this.historicAttrDateTime = newDateTime.toISOString();
|
|
13777
|
+
this.historicAttrDateTimeMin = newDateMin === null || newDateMin === void 0 ? void 0 : newDateMin.toISOString();
|
|
13778
|
+
this.historicAttrDateTimeMax = newDateMax === null || newDateMax === void 0 ? void 0 : newDateMax.toISOString();
|
|
13705
13779
|
}
|
|
13706
|
-
this.historicAttrDateTime = newDateTime.toISOString();
|
|
13707
|
-
// Set min/max to be the value increased/decreased by 1 minute.
|
|
13708
|
-
this.historicAttrDateTimeMin = new Date(newDateTime.getTime() - 60000).toISOString();
|
|
13709
|
-
this.historicAttrDateTimeMax = new Date(newDateTime.getTime() + 60000).toISOString();
|
|
13710
13780
|
};
|
|
13711
13781
|
Getter.prototype.viewerDateTimeDispose = function () {
|
|
13712
13782
|
var _a;
|
|
@@ -13871,6 +13941,7 @@
|
|
|
13871
13941
|
return [4 /*yield*/, bruceModels.Entity.GetList({
|
|
13872
13942
|
api: this.api,
|
|
13873
13943
|
historicKey: this.historicAttrKey,
|
|
13944
|
+
historicPoint: this.historicAttrDateTime,
|
|
13874
13945
|
historicFrom: this.historicAttrKey ? this.historicAttrDateTimeMin : null,
|
|
13875
13946
|
historicTo: this.historicAttrKey ? this.historicAttrDateTimeMax : null,
|
|
13876
13947
|
filter: {
|
|
@@ -23377,7 +23448,7 @@
|
|
|
23377
23448
|
ViewRenderEngine.Render = Render;
|
|
23378
23449
|
})(exports.ViewRenderEngine || (exports.ViewRenderEngine = {}));
|
|
23379
23450
|
|
|
23380
|
-
var VERSION = "3.7.
|
|
23451
|
+
var VERSION = "3.7.8";
|
|
23381
23452
|
|
|
23382
23453
|
exports.VERSION = VERSION;
|
|
23383
23454
|
exports.CesiumParabola = CesiumParabola;
|