bruce-cesium 3.7.6 → 3.7.7

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.
@@ -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
- cEntities = {};
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[id] = existingRego.visual;
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[id] = existingRego.visual;
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[id];
4898
+ cEntity = mEntities.get(id);
4897
4899
  if (cEntity) {
4898
- cEntities[id] = cEntity;
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
- Object.keys(cPoly).forEach(function (key) {
4928
- if (cPoly[key]) {
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 = Object.values(cPoly);
4934
+ rendered = Array.from(cPoly.values());
4933
4935
  return [4 /*yield*/, Polyline.RenderGroup(pParams)];
4934
4936
  case 2:
4935
4937
  cLines = _o.sent();
4936
- Object.keys(cLines).forEach(function (key) {
4937
- if (cLines[key]) {
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(Object.values(cLines));
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(Object.values(cPoints));
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[entity.Bruce.ID] = rootEntity_1;
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[entity.Bruce.ID];
4994
+ cEntity = pEntities.get(entity.Bruce.ID);
4993
4995
  if (cEntity) {
4994
- cEntities[entity.Bruce.ID] = cEntity;
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[entity.Bruce.ID];
5011
+ cEntity = pEntities.get(entity.Bruce.ID);
5010
5012
  if (cEntity) {
5011
- cEntities[entity.Bruce.ID] = cEntity;
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[entity.Bruce.ID];
5028
+ cEntity = pEntities.get(entity.Bruce.ID);
5027
5029
  if (cEntity) {
5028
- cEntities[entity.Bruce.ID] = cEntity;
5030
+ cEntities.set(entity.Bruce.ID, cEntity);
5029
5031
  }
5030
5032
  }
5031
5033
  _m.label = 12;
5032
- case 12: return [2 /*return*/, cEntities];
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[entity.Bruce.ID]
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[entity.Bruce.ID] = cEntity;
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[entity.Bruce.ID]
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[entity.Bruce.ID] = cEntity;
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[entity.Bruce.ID]
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[entity.Bruce.ID] = cEntity;
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[entity.Bruce.ID],
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[entity.Bruce.ID] = cEntity;
6447
+ cEntities.set(entity.Bruce.ID, cEntity);
6443
6448
  _k.label = 7;
6444
6449
  case 7: return [2 /*return*/];
6445
6450
  }
@@ -10305,10 +10310,10 @@
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;
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, rego;
10316
+ var toRemove, i, entity, _g, updated, cEntities, i, entity, id, cEntity, rego, visual, wasClustered, tagIds, rego_1;
10312
10317
  return __generator(this, function (_h) {
10313
10318
  switch (_h.label) {
10314
10319
  case 0:
@@ -10335,7 +10340,7 @@
10335
10340
  force: force
10336
10341
  })];
10337
10342
  case 1:
10338
- cEntities = _h.sent();
10343
+ _g = _h.sent(), updated = _g.updated, cEntities = _g.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[id];
10351
+ cEntity = cEntities.get(id);
10347
10352
  this.renderedEntities[id] = !!cEntity;
10348
10353
  if (cEntity) {
10349
- visual = (_c = this.visualsManager.GetRego({
10354
+ rego = this.visualsManager.GetRego({
10350
10355
  entityId: id,
10351
10356
  menuItemId: this.item.id
10352
- })) === null || _c === void 0 ? void 0 : _c.visual;
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 = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d["Layer.ID"];
10356
- rego = {
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,22 @@
10364
10370
  overrideShow: wasClustered ? false : null,
10365
10371
  name: cEntity.name,
10366
10372
  cdn: this.item.cdnEnabled,
10367
- historicDateTime: (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicDateTime,
10368
- historicAttrKey: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.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: rego,
10377
+ rego: rego_1,
10372
10378
  requestRender: false
10373
10379
  });
10374
10380
  }
10381
+ else if (updated.get(id)) {
10382
+ // We manually trigger an update event since the graphic was updated but not recreated.
10383
+ this.visualsManager.OnUpdate.Trigger({
10384
+ type: exports.VisualsRegister.EVisualUpdateType.Update,
10385
+ entityId: id,
10386
+ rego: rego
10387
+ });
10388
+ }
10375
10389
  }
10376
10390
  else {
10377
10391
  this.visualsManager.RemoveRegos({
@@ -10379,7 +10393,7 @@
10379
10393
  menuItemId: this.item.id,
10380
10394
  requestRender: false
10381
10395
  });
10382
- (_g = this.clustering) === null || _g === void 0 ? void 0 : _g.RemoveEntity(id, false);
10396
+ (_f = this.clustering) === null || _f === void 0 ? void 0 : _f.RemoveEntity(id, false);
10383
10397
  }
10384
10398
  }
10385
10399
  this.viewer.scene.requestRender();
@@ -11132,10 +11146,9 @@
11132
11146
  * @returns
11133
11147
  */
11134
11148
  Manager.prototype.renderAsIndividuals = function (entities, force) {
11135
- var _a;
11136
11149
  if (force === void 0) { force = false; }
11137
11150
  return __awaiter(this, void 0, void 0, function () {
11138
- var cEntities, isEntityInItem, i, entity, id, cEntity, visual;
11151
+ var _a, updated, cEntities, isEntityInItem, i, entity, id, cEntity, rego, visual;
11139
11152
  var _this = this;
11140
11153
  return __generator(this, function (_b) {
11141
11154
  switch (_b.label) {
@@ -11149,7 +11162,7 @@
11149
11162
  force: force
11150
11163
  })];
11151
11164
  case 1:
11152
- cEntities = _b.sent();
11165
+ _a = _b.sent(), updated = _a.updated, cEntities = _a.entities;
11153
11166
  if (this.disposed) {
11154
11167
  this.visualsManager.RemoveRegos({
11155
11168
  menuItemId: this.item.id
@@ -11163,13 +11176,14 @@
11163
11176
  for (i = 0; i < entities.length; i++) {
11164
11177
  entity = entities[i];
11165
11178
  id = entity.Bruce.ID;
11166
- cEntity = cEntities[id];
11179
+ cEntity = cEntities.get(id);
11167
11180
  this.renderedEntities[id] = !!cEntity;
11168
11181
  if (cEntity && isEntityInItem(id)) {
11169
- visual = (_a = this.visualsManager.GetRego({
11182
+ rego = this.visualsManager.GetRego({
11170
11183
  entityId: id,
11171
11184
  menuItemId: this.item.id
11172
- })) === null || _a === void 0 ? void 0 : _a.visual;
11185
+ });
11186
+ visual = rego === null || rego === void 0 ? void 0 : rego.visual;
11173
11187
  if (!visual || visual != cEntity) {
11174
11188
  this.visualsManager.AddRego({
11175
11189
  rego: {
@@ -11184,6 +11198,14 @@
11184
11198
  requestRender: false
11185
11199
  });
11186
11200
  }
11201
+ else if (updated.get(id)) {
11202
+ // We manually trigger an update event since the graphic was updated but not recreated.
11203
+ this.visualsManager.OnUpdate.Trigger({
11204
+ type: exports.VisualsRegister.EVisualUpdateType.Update,
11205
+ entityId: id,
11206
+ rego: rego
11207
+ });
11208
+ }
11187
11209
  }
11188
11210
  else {
11189
11211
  this.visualsManager.RemoveRegos({
@@ -11736,10 +11758,10 @@
11736
11758
  * @returns
11737
11759
  */
11738
11760
  Manager.prototype.renderAsIndividuals = function (entities, force) {
11739
- var _a, _b;
11761
+ var _a;
11740
11762
  if (force === void 0) { force = false; }
11741
11763
  return __awaiter(this, void 0, void 0, function () {
11742
- var cEntities, i, entity, id, cEntity, visual, clustered;
11764
+ var _b, updated, cEntities, i, entity, id, cEntity, rego, visual, clustered;
11743
11765
  return __generator(this, function (_c) {
11744
11766
  switch (_c.label) {
11745
11767
  case 0: return [4 /*yield*/, exports.EntityRenderEngine.Render({
@@ -11752,17 +11774,18 @@
11752
11774
  force: force
11753
11775
  })];
11754
11776
  case 1:
11755
- cEntities = _c.sent();
11777
+ _b = _c.sent(), updated = _b.updated, cEntities = _b.entities;
11756
11778
  for (i = 0; i < entities.length; i++) {
11757
11779
  entity = entities[i];
11758
11780
  id = entity.Bruce.ID;
11759
- cEntity = cEntities[id];
11781
+ cEntity = cEntities.get(id);
11760
11782
  this.renderedEntities[id] = !!cEntity;
11761
11783
  if (cEntity) {
11762
- visual = (_a = this.visualsManager.GetRego({
11784
+ rego = this.visualsManager.GetRego({
11763
11785
  entityId: id,
11764
11786
  menuItemId: this.item.id
11765
- })) === null || _a === void 0 ? void 0 : _a.visual;
11787
+ });
11788
+ visual = rego === null || rego === void 0 ? void 0 : rego.visual;
11766
11789
  if (!visual || visual != cEntity) {
11767
11790
  clustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
11768
11791
  this.visualsManager.AddRego({
@@ -11779,6 +11802,14 @@
11779
11802
  requestRender: false
11780
11803
  });
11781
11804
  }
11805
+ else if (updated.get(id)) {
11806
+ // We manually trigger an update event since the graphic was updated but not recreated.
11807
+ this.visualsManager.OnUpdate.Trigger({
11808
+ type: exports.VisualsRegister.EVisualUpdateType.Update,
11809
+ entityId: id,
11810
+ rego: rego
11811
+ });
11812
+ }
11782
11813
  }
11783
11814
  else {
11784
11815
  this.visualsManager.RemoveRegos({
@@ -11786,7 +11817,7 @@
11786
11817
  menuItemId: this.item.id,
11787
11818
  requestRender: false
11788
11819
  });
11789
- (_b = this.clustering) === null || _b === void 0 ? void 0 : _b.RemoveEntity(id, false);
11820
+ (_a = this.clustering) === null || _a === void 0 ? void 0 : _a.RemoveEntity(id, false);
11790
11821
  }
11791
11822
  }
11792
11823
  this.viewer.scene.requestRender();
@@ -11938,10 +11969,9 @@
11938
11969
  }
11939
11970
  };
11940
11971
  Manager.prototype.renderEntity = function (entity, force) {
11941
- var _a;
11942
11972
  if (force === void 0) { force = false; }
11943
11973
  return __awaiter(this, void 0, void 0, function () {
11944
- var id, cEntities, cEntity, visual, e_2;
11974
+ var id, _a, updated, cEntities, cEntity, rego, visual, e_2;
11945
11975
  return __generator(this, function (_b) {
11946
11976
  switch (_b.label) {
11947
11977
  case 0:
@@ -11960,13 +11990,14 @@
11960
11990
  force: force
11961
11991
  })];
11962
11992
  case 1:
11963
- cEntities = _b.sent();
11964
- cEntity = cEntities[id];
11993
+ _a = _b.sent(), updated = _a.updated, cEntities = _a.entities;
11994
+ cEntity = cEntities.get(id);
11965
11995
  if (cEntity) {
11966
- visual = (_a = this.visualsManager.GetRego({
11996
+ rego = this.visualsManager.GetRego({
11967
11997
  entityId: id,
11968
11998
  menuItemId: this.item.id
11969
- })) === null || _a === void 0 ? void 0 : _a.visual;
11999
+ });
12000
+ visual = rego === null || rego === void 0 ? void 0 : rego.visual;
11970
12001
  if (!visual || visual != cEntity) {
11971
12002
  this.visualsManager.AddRego({
11972
12003
  rego: {
@@ -11981,6 +12012,14 @@
11981
12012
  requestRender: false
11982
12013
  });
11983
12014
  }
12015
+ else if (updated.get(id)) {
12016
+ // We manually trigger an update event since the graphic was updated but not recreated.
12017
+ this.visualsManager.OnUpdate.Trigger({
12018
+ type: exports.VisualsRegister.EVisualUpdateType.Update,
12019
+ entityId: id,
12020
+ rego: rego
12021
+ });
12022
+ }
11984
12023
  }
11985
12024
  else {
11986
12025
  this.visualsManager.RemoveRegos({
@@ -13693,20 +13732,35 @@
13693
13732
  };
13694
13733
  };
13695
13734
  Getter.prototype.updateHistoricDateTime = function () {
13696
- var newDateTime = Cesium.JulianDate.toDate(this.viewer.clock.currentTime);
13697
- // Has previous value. Let's compare.
13698
- if (this.historicAttrDateTime) {
13699
- var oldDateTime = new Date(this.historicAttrDateTime);
13700
- // Change must be at least 0.1 seconds.
13701
- // TODO: This is just a random value I picked. We may need to make a setting or refine this.
13702
- if (Math.abs(newDateTime.getTime() - oldDateTime.getTime()) < 100) {
13703
- return;
13735
+ if (!this.historicAttrKey) {
13736
+ this.historicAttrDateTime = null;
13737
+ this.historicAttrDateTimeMin = null;
13738
+ this.historicAttrDateTimeMax = null;
13739
+ return;
13740
+ }
13741
+ var isChanged = function (before, after) {
13742
+ if (before && !after) {
13743
+ return true;
13704
13744
  }
13745
+ if (!before && after) {
13746
+ return true;
13747
+ }
13748
+ // Change must be at least 0.1 seconds.
13749
+ return Math.abs(before.getTime() - after.getTime()) > 100;
13750
+ };
13751
+ var oldDateTime = this.historicAttrDateTime ? new Date(this.historicAttrDateTime) : null;
13752
+ var newDateTime = Cesium.JulianDate.toDate(this.viewer.clock.currentTime);
13753
+ var oldDateMin = this.historicAttrDateTimeMin ? new Date(this.historicAttrDateTimeMin) : null;
13754
+ var newDateMin = this.viewer.clock.startTime ? Cesium.JulianDate.toDate(this.viewer.clock.startTime) : null;
13755
+ var oldDateMax = this.historicAttrDateTimeMax ? new Date(this.historicAttrDateTimeMax) : null;
13756
+ var newDateMax = this.viewer.clock.stopTime ? Cesium.JulianDate.toDate(this.viewer.clock.stopTime) : null;
13757
+ if (isChanged(oldDateTime, newDateTime) ||
13758
+ isChanged(oldDateMin, newDateMin) ||
13759
+ isChanged(oldDateMax, newDateMax)) {
13760
+ this.historicAttrDateTime = newDateTime.toISOString();
13761
+ this.historicAttrDateTimeMin = newDateMin === null || newDateMin === void 0 ? void 0 : newDateMin.toISOString();
13762
+ this.historicAttrDateTimeMax = newDateMax === null || newDateMax === void 0 ? void 0 : newDateMax.toISOString();
13705
13763
  }
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
13764
  };
13711
13765
  Getter.prototype.viewerDateTimeDispose = function () {
13712
13766
  var _a;
@@ -13871,6 +13925,7 @@
13871
13925
  return [4 /*yield*/, bruceModels.Entity.GetList({
13872
13926
  api: this.api,
13873
13927
  historicKey: this.historicAttrKey,
13928
+ historicPoint: this.historicAttrDateTime,
13874
13929
  historicFrom: this.historicAttrKey ? this.historicAttrDateTimeMin : null,
13875
13930
  historicTo: this.historicAttrKey ? this.historicAttrDateTimeMax : null,
13876
13931
  filter: {
@@ -23377,7 +23432,7 @@
23377
23432
  ViewRenderEngine.Render = Render;
23378
23433
  })(exports.ViewRenderEngine || (exports.ViewRenderEngine = {}));
23379
23434
 
23380
- var VERSION = "3.7.6";
23435
+ var VERSION = "3.7.7";
23381
23436
 
23382
23437
  exports.VERSION = VERSION;
23383
23438
  exports.CesiumParabola = CesiumParabola;