bruce-cesium 7.6.5 → 7.6.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.
Files changed (48) hide show
  1. package/dist/bruce-cesium.es5.js +355 -57
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +348 -54
  4. package/dist/bruce-cesium.umd.js.map +1 -1
  5. package/dist/lib/bruce-cesium.js +2 -1
  6. package/dist/lib/bruce-cesium.js.map +1 -1
  7. package/dist/lib/rendering/entity-render-engine-model3d.js +17 -10
  8. package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
  9. package/dist/lib/rendering/entity-render-engine-point.js +3 -1
  10. package/dist/lib/rendering/entity-render-engine-point.js.map +1 -1
  11. package/dist/lib/rendering/entity-render-engine-polygon.js +3 -1
  12. package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
  13. package/dist/lib/rendering/entity-render-engine-polyline.js +3 -1
  14. package/dist/lib/rendering/entity-render-engine-polyline.js.map +1 -1
  15. package/dist/lib/rendering/getters/entity-filter-getter.js +9 -1
  16. package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
  17. package/dist/lib/rendering/menu-item-manager.js +53 -2
  18. package/dist/lib/rendering/menu-item-manager.js.map +1 -1
  19. package/dist/lib/rendering/menu-item-style-overlay.js +161 -0
  20. package/dist/lib/rendering/menu-item-style-overlay.js.map +1 -0
  21. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js +31 -8
  22. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js.map +1 -1
  23. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +9 -4
  24. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
  25. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +10 -3
  26. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
  27. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +26 -7
  28. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  29. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +8 -2
  30. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
  31. package/dist/lib/rendering/render-managers/render-manager.js +4 -3
  32. package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
  33. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +4 -1
  34. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
  35. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +5 -1
  36. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
  37. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +5 -1
  38. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
  39. package/dist/lib/rendering/tileset-styler.js +15 -7
  40. package/dist/lib/rendering/tileset-styler.js.map +1 -1
  41. package/dist/types/bruce-cesium.d.ts +2 -1
  42. package/dist/types/rendering/getters/entity-filter-getter.d.ts +1 -0
  43. package/dist/types/rendering/menu-item-manager.d.ts +11 -1
  44. package/dist/types/rendering/menu-item-style-overlay.d.ts +30 -0
  45. package/dist/types/rendering/render-managers/entities/entities-datalab-render-manager.d.ts +1 -0
  46. package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +1 -0
  47. package/dist/types/rendering/tileset-styler.d.ts +3 -0
  48. package/package.json +2 -2
@@ -16406,6 +16406,159 @@
16406
16406
  // whatever the writer's clock and this one disagree by.
16407
16407
  HistoricGatherer.LIVE_TAIL_MS = 15000;
16408
16408
 
16409
+ (function (MenuItemStyleOverlay) {
16410
+ // Tileset items whose render manager runs a Styler, given the item settings that make it run one.
16411
+ const TILESET_TYPES = [
16412
+ BModels.MenuItem.EType.CadTileset,
16413
+ BModels.MenuItem.EType.ArbTileset,
16414
+ BModels.MenuItem.EType.IonTileset,
16415
+ BModels.MenuItem.EType.EntityTileset
16416
+ ];
16417
+ // Items whose style resolves per Entity from their zoom control rows.
16418
+ const ZOOM_CONTROL_TYPES = [
16419
+ BModels.MenuItem.EType.Entities,
16420
+ BModels.MenuItem.EType.Entity,
16421
+ BModels.MenuItem.EType.EntitiesIds,
16422
+ BModels.MenuItem.EType.EntitiesLoaded,
16423
+ BModels.MenuItem.EType.DataLab
16424
+ ];
16425
+ /**
16426
+ * Returns the base style with each field the overlay sets laid over it.
16427
+ */
16428
+ function Merge(base, overlay) {
16429
+ var _a, _b;
16430
+ if (!overlay) {
16431
+ return base;
16432
+ }
16433
+ const merged = { ...(base !== null && base !== void 0 ? base : {}) };
16434
+ for (const key of Object.keys(overlay)) {
16435
+ const value = overlay[key];
16436
+ if (!isSet(value)) {
16437
+ continue;
16438
+ }
16439
+ if (isPlainObject(value)) {
16440
+ merged[key] = { ...((_a = merged[key]) !== null && _a !== void 0 ? _a : {}), ...pickSet(value) };
16441
+ }
16442
+ else {
16443
+ merged[key] = value;
16444
+ }
16445
+ }
16446
+ // Tilesets only paint a customised model style, and an overlay that sets a colour wants painting.
16447
+ if (isSet((_b = overlay.modelStyle) === null || _b === void 0 ? void 0 : _b.fillColor) && overlay.modelStyle.customize == null) {
16448
+ merged.modelStyle = { ...merged.modelStyle, customize: true };
16449
+ }
16450
+ return merged;
16451
+ }
16452
+ MenuItemStyleOverlay.Merge = Merge;
16453
+ /**
16454
+ * Returns the overlay a zoom control row carries laid over the style it resolved.
16455
+ */
16456
+ function ApplyRow(style, row) {
16457
+ return Merge(style, row === null || row === void 0 ? void 0 : row.StyleOverlay);
16458
+ }
16459
+ MenuItemStyleOverlay.ApplyRow = ApplyRow;
16460
+ /**
16461
+ * Returns true when the item renders through a path that honours an overlay.
16462
+ */
16463
+ function Supports(item) {
16464
+ if (ZOOM_CONTROL_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16465
+ return true;
16466
+ }
16467
+ if (!TILESET_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16468
+ return false;
16469
+ }
16470
+ // These two only run a Styler when asked to.
16471
+ if (item.Type === BModels.MenuItem.EType.ArbTileset || item.Type === BModels.MenuItem.EType.EntityTileset) {
16472
+ return Boolean(item.ApplyStyles);
16473
+ }
16474
+ return true;
16475
+ }
16476
+ MenuItemStyleOverlay.Supports = Supports;
16477
+ /**
16478
+ * Returns the overlay laid on the item, or null when it carries none.
16479
+ */
16480
+ function Get(item) {
16481
+ var _a, _b, _c;
16482
+ if (TILESET_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16483
+ return (_a = item.styleOverlay) !== null && _a !== void 0 ? _a : null;
16484
+ }
16485
+ if (ZOOM_CONTROL_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16486
+ const rows = item.CameraZoomSettings;
16487
+ return (_c = (_b = rows === null || rows === void 0 ? void 0 : rows.find(x => x === null || x === void 0 ? void 0 : x.StyleOverlay)) === null || _b === void 0 ? void 0 : _b.StyleOverlay) !== null && _c !== void 0 ? _c : null;
16488
+ }
16489
+ return null;
16490
+ }
16491
+ MenuItemStyleOverlay.Get = Get;
16492
+ /**
16493
+ * Returns a copy carrying the overlay, or the item itself when it cannot take one and carries none.
16494
+ */
16495
+ function With(item, overlay) {
16496
+ var _a;
16497
+ const target = Supports(item) ? overlay : null;
16498
+ if (!target && !Get(item)) {
16499
+ return item;
16500
+ }
16501
+ if (TILESET_TYPES.includes(item.Type)) {
16502
+ const next = { ...item };
16503
+ if (target) {
16504
+ next.styleOverlay = target;
16505
+ }
16506
+ else {
16507
+ delete next.styleOverlay;
16508
+ }
16509
+ return next;
16510
+ }
16511
+ const zItem = item;
16512
+ return {
16513
+ ...zItem,
16514
+ CameraZoomSettings: ((_a = zItem.CameraZoomSettings) !== null && _a !== void 0 ? _a : []).map(row => {
16515
+ const next = { ...row };
16516
+ if (target) {
16517
+ next.StyleOverlay = target;
16518
+ }
16519
+ else {
16520
+ delete next.StyleOverlay;
16521
+ }
16522
+ return next;
16523
+ })
16524
+ };
16525
+ }
16526
+ MenuItemStyleOverlay.With = With;
16527
+ /**
16528
+ * Returns true when the two items differ by nothing but their overlay.
16529
+ */
16530
+ function IsChangeOnly(from, to) {
16531
+ if (!from || !to || from.Type !== to.Type) {
16532
+ return false;
16533
+ }
16534
+ const toOverlay = Get(to);
16535
+ if (JSON.stringify(Get(from)) === JSON.stringify(toOverlay)) {
16536
+ return false;
16537
+ }
16538
+ // A false mismatch only costs the in-place swap, so key order is not normalized.
16539
+ return JSON.stringify(With(from, toOverlay)) === JSON.stringify(to);
16540
+ }
16541
+ MenuItemStyleOverlay.IsChangeOnly = IsChangeOnly;
16542
+ /*
16543
+ * Returns false for what leaves the base value in place: unset, null, or an empty Calculator field list.
16544
+ */
16545
+ function isSet(value) {
16546
+ return value !== undefined && value !== null && !(Array.isArray(value) && !value.length);
16547
+ }
16548
+ function isPlainObject(value) {
16549
+ return typeof value === "object" && !Array.isArray(value);
16550
+ }
16551
+ function pickSet(value) {
16552
+ const picked = {};
16553
+ for (const key of Object.keys(value)) {
16554
+ if (isSet(value[key])) {
16555
+ picked[key] = value[key];
16556
+ }
16557
+ }
16558
+ return picked;
16559
+ }
16560
+ })(exports.MenuItemStyleOverlay || (exports.MenuItemStyleOverlay = {}));
16561
+
16409
16562
  const BATCH_SIZE = 500;
16410
16563
  const CHECK_BATCH_SIZE = 250;
16411
16564
  function getValue$2(viewer, obj) {
@@ -16461,6 +16614,8 @@
16461
16614
  this.isRunningCheck = false;
16462
16615
  this.viewMonitorRemoval = null;
16463
16616
  this.renderQueue = [];
16617
+ // Queued Entities a caller handed in, drawn even when the skip gate sees nothing changed.
16618
+ this.renderQueueForced = new Set();
16464
16619
  this.renderQueueInterval = null;
16465
16620
  this.sources = [];
16466
16621
  // Highly experimental flag to try improve rendering large sets of polygons and polylines.
@@ -16555,6 +16710,7 @@
16555
16710
  clearInterval(this.renderQueueInterval);
16556
16711
  this.renderQueueInterval = null;
16557
16712
  this.renderQueue = [];
16713
+ this.renderQueueForced.clear();
16558
16714
  // Remove just the ones that shouldn't be rendered.
16559
16715
  // Eg: for a tag menu item we can see what tags are selected and only render those.
16560
16716
  if (shouldRender) {
@@ -16865,6 +17021,7 @@
16865
17021
  (_b = this.viewMonitorRemoval) === null || _b === void 0 ? void 0 : _b.call(this);
16866
17022
  clearInterval(this.renderQueueInterval);
16867
17023
  this.renderQueue = [];
17024
+ this.renderQueueForced.clear();
16868
17025
  (_c = this.clustering) === null || _c === void 0 ? void 0 : _c.Dispose();
16869
17026
  this.clustering = null;
16870
17027
  for (let i = 0; i < this.sources.length; i++) {
@@ -16953,7 +17110,8 @@
16953
17110
  }
16954
17111
  else {
16955
17112
  if (entities === null || entities === void 0 ? void 0 : entities.length) {
16956
- this.distributeForRender(entities);
17113
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
17114
+ this.distributeForRender(entities, true);
16957
17115
  }
16958
17116
  else {
16959
17117
  await this.doEntityCheck(entityIds);
@@ -17104,12 +17262,22 @@
17104
17262
  }
17105
17263
  this.isRunningCheck = false;
17106
17264
  }
17107
- distributeForRender(entities) {
17265
+ distributeForRender(entities, force = false) {
17266
+ if (force) {
17267
+ entities.forEach(x => this.renderQueueForced.add(x));
17268
+ }
17108
17269
  this.renderQueue = this.renderQueue.concat(entities);
17109
17270
  if (!this.renderQueueInterval && this.renderQueue.length) {
17110
17271
  this.renderQueueInterval = setInterval(() => {
17111
17272
  const batch = this.renderQueue.splice(0, BATCH_SIZE);
17112
- this.renderEntities(batch);
17273
+ const forced = new Set(batch.filter(x => this.renderQueueForced.delete(x)));
17274
+ const rest = batch.filter(x => !forced.has(x));
17275
+ if (forced.size) {
17276
+ this.renderEntities(Array.from(forced), true);
17277
+ }
17278
+ if (rest.length) {
17279
+ this.renderEntities(rest);
17280
+ }
17113
17281
  if (this.renderQueue.length <= 0) {
17114
17282
  clearInterval(this.renderQueueInterval);
17115
17283
  this.renderQueueInterval = null;
@@ -17245,6 +17413,7 @@
17245
17413
  console.error(e);
17246
17414
  }
17247
17415
  }
17416
+ style = exports.MenuItemStyleOverlay.ApplyRow(style, zoomItem);
17248
17417
  const pStyle = (_g = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _g !== void 0 ? _g : {};
17249
17418
  const lStyle = (_h = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _h !== void 0 ? _h : {};
17250
17419
  const polygonsClamped = ((_j = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _j === void 0 ? void 0 : _j.id) == null ? true : ((_k = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _k === void 0 ? void 0 : _k.id) == 0;
@@ -17536,7 +17705,7 @@
17536
17705
  return recordsByIds;
17537
17706
  }
17538
17707
  async doRenderAsIndividuals(entities, force = false) {
17539
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
17708
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
17540
17709
  // When live we just want to show the latest pos.
17541
17710
  // When not live, the user might scroll the timeline and want to see it a fluid animation between points in time.
17542
17711
  const isLive = exports.ViewUtils.GetTimeDetails({
@@ -17640,8 +17809,9 @@
17640
17809
  rego.schema = (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Schema;
17641
17810
  rego.canEdit = canEdit;
17642
17811
  rego.internalId = (_k = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.InternalID) !== null && _k !== void 0 ? _k : rego.internalId;
17643
- rego.styleId = (_l = cEntity.styleId) !== null && _l !== void 0 ? _l : rego.styleId;
17644
- rego.styleEffective = (_m = cEntity.styleEffective) !== null && _m !== void 0 ? _m : rego.styleEffective;
17812
+ // Assigned outright, so a restyle that traces nothing clears the old key.
17813
+ rego.styleId = cEntity.styleId;
17814
+ rego.styleEffective = cEntity.styleEffective;
17645
17815
  // Marked as stale meaning some change was performed that requires a refresh.
17646
17816
  // This usually means a new sibling was added that we need to update.
17647
17817
  if (rego.stale) {
@@ -17671,7 +17841,7 @@
17671
17841
  menuItemId: this.item.id,
17672
17842
  requestRender: false
17673
17843
  });
17674
- (_o = this.clustering) === null || _o === void 0 ? void 0 : _o.RemoveEntity(id, false);
17844
+ (_l = this.clustering) === null || _l === void 0 ? void 0 : _l.RemoveEntity(id, false);
17675
17845
  }
17676
17846
  }
17677
17847
  this.viewer.scene.requestRender();
@@ -17750,6 +17920,7 @@
17750
17920
  clearInterval(this.renderQueueInterval);
17751
17921
  this.renderQueueInterval = null;
17752
17922
  this.renderQueue = [];
17923
+ this.renderQueueForced.clear();
17753
17924
  this.disposed = true;
17754
17925
  return payload;
17755
17926
  }
@@ -18106,7 +18277,8 @@
18106
18277
  menuItemIds: [this.item.id]
18107
18278
  });
18108
18279
  if (entities === null || entities === void 0 ? void 0 : entities.length) {
18109
- this.onGetterUpdate(entities, force);
18280
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
18281
+ this.onGetterUpdate(entities, true);
18110
18282
  }
18111
18283
  else {
18112
18284
  this.doEntityCheck(entityIds, force);
@@ -18340,6 +18512,7 @@
18340
18512
  if (!style) {
18341
18513
  style = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.Style;
18342
18514
  }
18515
+ style = exports.MenuItemStyleOverlay.ApplyRow(style, zoomItem);
18343
18516
  const pStyle = (_h = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _h !== void 0 ? _h : {};
18344
18517
  const lStyle = (_j = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _j !== void 0 ? _j : {};
18345
18518
  const polygonsClamped = ((_k = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _k === void 0 ? void 0 : _k.id) == null ? true : ((_l = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _l === void 0 ? void 0 : _l.id) == 0;
@@ -18584,7 +18757,7 @@
18584
18757
  return next;
18585
18758
  }
18586
18759
  async doRenderAsIndividuals(entities, force = false) {
18587
- var _a;
18760
+ var _a, _b, _c;
18588
18761
  const { updated, entities: cEntities } = await exports.EntityRenderEngine.Render({
18589
18762
  viewer: this.viewer,
18590
18763
  apiGetter: this.apiGetter,
@@ -18638,7 +18811,9 @@
18638
18811
  priority: this.renderPriority,
18639
18812
  entityTypeId: entity.Bruce["EntityType.ID"],
18640
18813
  accountId: this.apiGetter.accountId,
18641
- name: cEntity.name
18814
+ name: cEntity.name,
18815
+ styleId: (_b = cEntity.styleId) !== null && _b !== void 0 ? _b : undefined,
18816
+ styleEffective: (_c = cEntity.styleEffective) !== null && _c !== void 0 ? _c : undefined
18642
18817
  },
18643
18818
  requestRender: false
18644
18819
  });
@@ -18646,6 +18821,8 @@
18646
18821
  else if (updated.get(id) && rego) {
18647
18822
  rego.visual = cEntity;
18648
18823
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
18824
+ rego.styleId = cEntity.styleId;
18825
+ rego.styleEffective = cEntity.styleEffective;
18649
18826
  rego.name = cEntity.name;
18650
18827
  // We manually trigger an update event since the graphic was updated but not recreated.
18651
18828
  this.visualsManager.OnUpdate.Trigger({
@@ -18820,7 +18997,8 @@
18820
18997
  menuItemIds: [this.item.id]
18821
18998
  });
18822
18999
  if (entities === null || entities === void 0 ? void 0 : entities.length) {
18823
- this.renderEntities(entities, force);
19000
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
19001
+ this.renderEntities(entities, true);
18824
19002
  }
18825
19003
  else {
18826
19004
  this.onGetterUpdate(entityIds, force);
@@ -19032,7 +19210,7 @@
19032
19210
  * @returns
19033
19211
  */
19034
19212
  async renderAsIndividuals(entities, force = false) {
19035
- var _a;
19213
+ var _a, _b, _c;
19036
19214
  if (this.disposed || this.viewer.isDestroyed() || !entities.length) {
19037
19215
  return;
19038
19216
  }
@@ -19091,7 +19269,9 @@
19091
19269
  entityTypeId: entity.Bruce["EntityType.ID"],
19092
19270
  accountId: this.apiGetter.accountId,
19093
19271
  overrideShow: clustered ? false : null,
19094
- name: cEntity.name
19272
+ name: cEntity.name,
19273
+ styleId: (_a = cEntity.styleId) !== null && _a !== void 0 ? _a : undefined,
19274
+ styleEffective: (_b = cEntity.styleEffective) !== null && _b !== void 0 ? _b : undefined
19095
19275
  },
19096
19276
  requestRender: false
19097
19277
  });
@@ -19099,6 +19279,8 @@
19099
19279
  else if (updated.get(id) && rego) {
19100
19280
  rego.visual = cEntity;
19101
19281
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
19282
+ rego.styleId = cEntity.styleId;
19283
+ rego.styleEffective = cEntity.styleEffective;
19102
19284
  rego.name = cEntity.name;
19103
19285
  // We manually trigger an update event since the graphic was updated but not recreated.
19104
19286
  this.visualsManager.OnUpdate.Trigger({
@@ -19114,7 +19296,7 @@
19114
19296
  menuItemId: this.item.id,
19115
19297
  requestRender: false
19116
19298
  });
19117
- (_a = this.clustering) === null || _a === void 0 ? void 0 : _a.RemoveEntity(id, false);
19299
+ (_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(id, false);
19118
19300
  }
19119
19301
  }
19120
19302
  if (!this.disposed) {
@@ -19260,7 +19442,8 @@
19260
19442
  menuItemIds: [this.item.id]
19261
19443
  });
19262
19444
  if (incoming) {
19263
- await this.renderEntity(incoming, force);
19445
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
19446
+ await this.renderEntity(incoming, true);
19264
19447
  }
19265
19448
  else {
19266
19449
  await this.onGetterUpdate(itemEntityId, force);
@@ -19334,6 +19517,7 @@
19334
19517
  return next;
19335
19518
  }
19336
19519
  async doRenderEntity(entity, force = false) {
19520
+ var _a, _b;
19337
19521
  try {
19338
19522
  if (this.disposed || this.viewer.isDestroyed()) {
19339
19523
  return;
@@ -19366,7 +19550,9 @@
19366
19550
  priority: this.renderPriority,
19367
19551
  entityTypeId: entity.Bruce["EntityType.ID"],
19368
19552
  accountId: this.apiGetter.accountId,
19369
- name: cEntity.name
19553
+ name: cEntity.name,
19554
+ styleId: (_a = cEntity.styleId) !== null && _a !== void 0 ? _a : undefined,
19555
+ styleEffective: (_b = cEntity.styleEffective) !== null && _b !== void 0 ? _b : undefined
19370
19556
  },
19371
19557
  requestRender: false
19372
19558
  });
@@ -19374,6 +19560,8 @@
19374
19560
  else if (updated.get(id) && rego) {
19375
19561
  rego.visual = cEntity;
19376
19562
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
19563
+ rego.styleId = cEntity.styleId;
19564
+ rego.styleEffective = cEntity.styleEffective;
19377
19565
  rego.name = cEntity.name;
19378
19566
  // We manually trigger an update event since the graphic was updated but not recreated.
19379
19567
  this.visualsManager.OnUpdate.Trigger({
@@ -20444,6 +20632,8 @@
20444
20632
  // Once the style is loaded, we can queue the set for styling.
20445
20633
  this.stylePendingEntityIds = new Map();
20446
20634
  this.fallbackStyle = null;
20635
+ // Laid over whichever style each feature resolves, so it only changes the fields it sets.
20636
+ this.styleOverlay = null;
20447
20637
  this.styleFallbackLoaded = false;
20448
20638
  this.loadingCounter = 0;
20449
20639
  // Entity IDs -> boolean to indicate if we should override the feature colour.
@@ -20496,8 +20686,9 @@
20496
20686
  return this._styleProgress;
20497
20687
  }
20498
20688
  Init(params) {
20499
- var _a, _b;
20689
+ var _a, _b, _c;
20500
20690
  let { viewer, api, cTileset, fallbackStyleId, styleMapping, expandSources, menuItemId, register, scenario, historic, applyStyles, monitor } = params;
20691
+ this.styleOverlay = (_a = params.styleOverlay) !== null && _a !== void 0 ? _a : null;
20501
20692
  this.monitor = monitor;
20502
20693
  this.viewer = viewer;
20503
20694
  this.api = api;
@@ -20525,7 +20716,7 @@
20525
20716
  // We have some evil hard-coded style mappings that need to be fixed.
20526
20717
  // These exist within legacy project views.
20527
20718
  // Update: This now also lets people have a style mapping without a real style record.
20528
- if ((_a = this.styleMapping) === null || _a === void 0 ? void 0 : _a.length) {
20719
+ if ((_b = this.styleMapping) === null || _b === void 0 ? void 0 : _b.length) {
20529
20720
  for (let i = 0; i < this.styleMapping.length; i++) {
20530
20721
  const mapItem = this.styleMapping[i];
20531
20722
  const mapStyle = mapItem.style ? mapItem.style : mapItem.Style;
@@ -20565,7 +20756,7 @@
20565
20756
  });
20566
20757
  this.loaded = true;
20567
20758
  this.loadStyles();
20568
- const feed = (_b = this.api) === null || _b === void 0 ? void 0 : _b.RecordChangeFeed;
20759
+ const feed = (_c = this.api) === null || _c === void 0 ? void 0 : _c.RecordChangeFeed;
20569
20760
  if (feed) {
20570
20761
  this.feedSub = feed.Subscribe({
20571
20762
  concepts: [BModels.AccountConcept.EConcept.ENTITY],
@@ -20630,6 +20821,10 @@
20630
20821
  else {
20631
20822
  this.fallbackStyle = null;
20632
20823
  }
20824
+ // Left as it is when a caller omits it, so a mapping change keeps the scene-wide style.
20825
+ if (params.styleOverlay !== undefined) {
20826
+ this.styleOverlay = params.styleOverlay;
20827
+ }
20633
20828
  if (params.scenario != null) {
20634
20829
  if (!this.shouldUpdateRegoStates && !!this.scenario) {
20635
20830
  this.shouldUpdateRegoStates = true;
@@ -21132,12 +21327,11 @@
21132
21327
  override: override
21133
21328
  });
21134
21329
  this.overrideFeatureColor.set(rego.entityId, true);
21135
- if (resolvedStyleId != null) {
21136
- rego.styleId = resolvedStyleId;
21137
- }
21330
+ // Assigned outright, so a restyle that traces nothing clears the old key.
21331
+ rego.styleId = resolvedStyleId !== null && resolvedStyleId !== void 0 ? resolvedStyleId : undefined;
21138
21332
  rego.styleEffective = (_b = exports.StyleEffective.Combine([
21139
21333
  { key: "color", effective: fillColorTrace.effective }
21140
- ])) !== null && _b !== void 0 ? _b : rego.styleEffective;
21334
+ ])) !== null && _b !== void 0 ? _b : undefined;
21141
21335
  }
21142
21336
  if (((_c = data === null || data === void 0 ? void 0 : data.Bruce) === null || _c === void 0 ? void 0 : _c.InternalID) != null) {
21143
21337
  rego.internalId = data.Bruce.InternalID;
@@ -21183,6 +21377,7 @@
21183
21377
  style = (_b = this.fallbackStyle) === null || _b === void 0 ? void 0 : _b.Settings;
21184
21378
  styleId = this.fallbackStyleId != null ? Number(this.fallbackStyleId) : null;
21185
21379
  }
21380
+ style = exports.MenuItemStyleOverlay.Merge(style, this.styleOverlay);
21186
21381
  if (!style || !((_c = style === null || style === void 0 ? void 0 : style.modelStyle) === null || _c === void 0 ? void 0 : _c.customize)) {
21187
21382
  return { settings: null, styleId: null };
21188
21383
  }
@@ -22368,6 +22563,7 @@
22368
22563
  api: this.getters.GetBruceApi(),
22369
22564
  cTileset: this.cTileset,
22370
22565
  fallbackStyleId: this.item.styleId,
22566
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
22371
22567
  styleMapping: this.item.StyleMapping,
22372
22568
  expandSources: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.ExpandSources,
22373
22569
  menuItemId: this.item.id,
@@ -22582,6 +22778,7 @@
22582
22778
  api: this.getters.GetBruceApi(),
22583
22779
  cTileset: this.cTileset,
22584
22780
  fallbackStyleId: this.item.styleId,
22781
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
22585
22782
  styleMapping: this.item.StyleMapping,
22586
22783
  expandSources: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.ExpandSources,
22587
22784
  menuItemId: this.item.id,
@@ -23203,7 +23400,8 @@
23203
23400
  // Before the tileset loads this only stores the pick, and the styler's Init reads the new item.
23204
23401
  this.styler.UpdateStyleMapping({
23205
23402
  styleMapping: (_a = item.StyleMapping) !== null && _a !== void 0 ? _a : [],
23206
- fallbackStyleId: item.styleId
23403
+ fallbackStyleId: item.styleId,
23404
+ styleOverlay: exports.MenuItemStyleOverlay.Get(item)
23207
23405
  });
23208
23406
  }
23209
23407
  Dispose() {
@@ -24139,6 +24337,13 @@
24139
24337
  this.historicAttrDateTime = newDateTime.toISOString();
24140
24338
  }
24141
24339
  }
24340
+ /*
24341
+ * Returns the viewer clock's current time as ISO, or null without a viewer.
24342
+ */
24343
+ sceneDateTime() {
24344
+ var _a;
24345
+ return ((_a = this.viewer) === null || _a === void 0 ? void 0 : _a.clock) ? Cesium.JulianDate.toDate(this.viewer.clock.currentTime).toISOString() : null;
24346
+ }
24142
24347
  viewerDateTimeDispose() {
24143
24348
  var _a;
24144
24349
  (_a = this.viewerDateTimeChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
@@ -24422,7 +24627,8 @@
24422
24627
  api: this.api,
24423
24628
  scenario: this.scenario,
24424
24629
  historicKey: this.historicAttrKey,
24425
- historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : null,
24630
+ // Non-historic items still read as at the scene's time, matching the info view.
24631
+ historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : this.sceneDateTime(),
24426
24632
  expandSources: true,
24427
24633
  expandLocation: true,
24428
24634
  schemaId: this.schemaId,
@@ -24677,6 +24883,8 @@
24677
24883
  this.isRunningCheck = false;
24678
24884
  this.viewMonitorRemoval = null;
24679
24885
  this.renderQueue = [];
24886
+ // Queued Entities a caller handed in, drawn even when the skip gate sees nothing changed.
24887
+ this.renderQueueForced = new Set();
24680
24888
  this.renderQueueInterval = null;
24681
24889
  this.zoomControl = [];
24682
24890
  this.queryLoadId = 0;
@@ -24705,6 +24913,7 @@
24705
24913
  clearInterval(this.renderQueueInterval);
24706
24914
  this.renderQueueInterval = null;
24707
24915
  this.renderQueue = [];
24916
+ this.renderQueueForced.clear();
24708
24917
  this.renderedEntities = {};
24709
24918
  this.ensureSettings();
24710
24919
  this.visualsManager.RemoveRegos({
@@ -24867,6 +25076,7 @@
24867
25076
  clearInterval(this.renderQueueInterval);
24868
25077
  this.renderQueueInterval = null;
24869
25078
  this.renderQueue = [];
25079
+ this.renderQueueForced.clear();
24870
25080
  this.entityCheckQueueIds = [];
24871
25081
  this.visualsManager.RemoveRegos({
24872
25082
  menuItemId: this.item.id
@@ -24909,7 +25119,8 @@
24909
25119
  await this.renderDataLabEntities(entities, true);
24910
25120
  }
24911
25121
  else {
24912
- this.distributeForRender(entities);
25122
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
25123
+ this.distributeForRender(entities, true);
24913
25124
  }
24914
25125
  }
24915
25126
  else {
@@ -25032,15 +25243,28 @@
25032
25243
  }
25033
25244
  }
25034
25245
  }
25035
- distributeForRender(entities) {
25246
+ distributeForRender(entities, force = false) {
25036
25247
  if (this.disposed || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
25037
25248
  return;
25038
25249
  }
25250
+ if (force) {
25251
+ entities.forEach(x => this.renderQueueForced.add(x));
25252
+ }
25039
25253
  this.renderQueue = this.renderQueue.concat(entities);
25040
25254
  if (!this.renderQueueInterval && this.renderQueue.length) {
25041
25255
  this.renderQueueInterval = setInterval(() => {
25042
- const batch = this.deduplicateEntities(this.renderQueue.splice(0, BATCH_SIZE$3));
25043
- this.renderDataLabEntities(batch);
25256
+ const taken = this.renderQueue.splice(0, BATCH_SIZE$3);
25257
+ // Read before de-duplicating, so a copy it drops does not stay in the set.
25258
+ const takenForced = new Set(taken.filter(x => this.renderQueueForced.delete(x)));
25259
+ const batch = this.deduplicateEntities(taken);
25260
+ const forced = batch.filter(x => takenForced.has(x));
25261
+ const rest = batch.filter(x => !takenForced.has(x));
25262
+ if (forced.length) {
25263
+ this.renderDataLabEntities(forced, true);
25264
+ }
25265
+ if (rest.length) {
25266
+ this.renderDataLabEntities(rest);
25267
+ }
25044
25268
  if (this.renderQueue.length <= 0) {
25045
25269
  clearInterval(this.renderQueueInterval);
25046
25270
  this.renderQueueInterval = null;
@@ -25072,7 +25296,7 @@
25072
25296
  return next;
25073
25297
  }
25074
25298
  async doRenderDataLabEntities(entities, force = false) {
25075
- var _a, _b, _c;
25299
+ var _a, _b, _c, _d, _e;
25076
25300
  if (this.disposed || this.viewer.isDestroyed() || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
25077
25301
  return;
25078
25302
  }
@@ -25121,7 +25345,9 @@
25121
25345
  tagIds: entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [],
25122
25346
  name: cEntity.name,
25123
25347
  cdn: this.item.cdnEnabled,
25124
- outline: entity.Bruce.Outline
25348
+ outline: entity.Bruce.Outline,
25349
+ styleId: (_b = cEntity.styleId) !== null && _b !== void 0 ? _b : undefined,
25350
+ styleEffective: (_c = cEntity.styleEffective) !== null && _c !== void 0 ? _c : undefined
25125
25351
  },
25126
25352
  requestRender: false
25127
25353
  });
@@ -25130,10 +25356,12 @@
25130
25356
  rego.name = cEntity.name;
25131
25357
  rego.visual = cEntity;
25132
25358
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
25359
+ rego.styleId = cEntity.styleId;
25360
+ rego.styleEffective = cEntity.styleEffective;
25133
25361
  rego.tagIds = entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [];
25134
- rego.outline = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Outline;
25362
+ rego.outline = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.Outline;
25135
25363
  rego.cdn = this.item.cdnEnabled;
25136
- rego.schema = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.Schema;
25364
+ rego.schema = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.Schema;
25137
25365
  rego.canEdit = canEdit;
25138
25366
  if (rego.stale) {
25139
25367
  this.visualsManager.RefreshMark({
@@ -25209,6 +25437,7 @@
25209
25437
  renderSignature: Manager.GetRenderSignature(this.item)
25210
25438
  };
25211
25439
  this.renderQueue = [];
25440
+ this.renderQueueForced.clear();
25212
25441
  this.queryLoadId += 1;
25213
25442
  this.disposed = true;
25214
25443
  return payload;
@@ -26643,6 +26872,7 @@
26643
26872
  api: api,
26644
26873
  cTileset: this.cTileset,
26645
26874
  fallbackStyleId: this.item.styleId,
26875
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
26646
26876
  styleMapping: [],
26647
26877
  expandSources: false,
26648
26878
  menuItemId: this.item.id,
@@ -26865,7 +27095,8 @@
26865
27095
  if (Manager.NeedsStyler(item)) {
26866
27096
  this.styler.UpdateStyleMapping({
26867
27097
  styleMapping: [],
26868
- fallbackStyleId: item.styleId
27098
+ fallbackStyleId: item.styleId,
27099
+ styleOverlay: exports.MenuItemStyleOverlay.Get(item)
26869
27100
  });
26870
27101
  }
26871
27102
  }
@@ -27016,6 +27247,7 @@
27016
27247
  api: this.getters.GetBruceApi(),
27017
27248
  cTileset: this.cTileset,
27018
27249
  fallbackStyleId: this.item.styleId,
27250
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
27019
27251
  styleMapping: [],
27020
27252
  expandSources: false,
27021
27253
  menuItemId: this.item.id,
@@ -27936,6 +28168,7 @@
27936
28168
  api: api,
27937
28169
  cTileset: this.cTileset,
27938
28170
  fallbackStyleId: this.item.styleId,
28171
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
27939
28172
  styleMapping: this.item.StyleMapping,
27940
28173
  expandSources: false,
27941
28174
  menuItemId: this.item.id,
@@ -28131,7 +28364,8 @@
28131
28364
  if (this.item.ApplyStyles || this.item.Type == BModels.MenuItem.EType.IonTileset) {
28132
28365
  this.styler.UpdateStyleMapping({
28133
28366
  styleMapping: (_a = this.item.StyleMapping) !== null && _a !== void 0 ? _a : [],
28134
- fallbackStyleId: this.item.styleId
28367
+ fallbackStyleId: this.item.styleId,
28368
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item)
28135
28369
  });
28136
28370
  }
28137
28371
  }
@@ -31985,6 +32219,9 @@
31985
32219
  get Viewer() {
31986
32220
  return this.viewer;
31987
32221
  }
32222
+ get StyleOverlay() {
32223
+ return this.styleOverlay;
32224
+ }
31988
32225
  get VisualsRegister() {
31989
32226
  return this.visualsRegister;
31990
32227
  }
@@ -32045,6 +32282,9 @@
32045
32282
  this.pendingHandoffPool = [];
32046
32283
  // The settings bookmark alternations overwrite on a view's items, as that view authored them.
32047
32284
  this.authoredAlternations = new WeakMap();
32285
+ // Laid over each item's own style where it can take one, including items rendered after it was set.
32286
+ this.styleOverlay = null;
32287
+ this.styleOverlayCounter = 0;
32048
32288
  this.onUpdate = null;
32049
32289
  // Segments discovered so far per menu item ID.
32050
32290
  this.seriesSegments = new Map();
@@ -32126,12 +32366,17 @@
32126
32366
  }
32127
32367
  // An item with a style set renders its first style unless the caller already picked one of them.
32128
32368
  params = { ...params, item: exports.MenuItemStyles.Resolve(params.item) };
32369
+ // The overlay rides on the rendered copy, so the view's item never carries it.
32370
+ params = { ...params, item: exports.MenuItemStyleOverlay.With(params.item, this.styleOverlay) };
32129
32371
  let rItem = this.items.find(x => x.id == params.item.id);
32130
32372
  let create = true;
32131
32373
  // Item already exists so we'll check if we should re-create it.
32132
32374
  if (rItem) {
32133
- // Only the picked style changed, so what is drawn gets restyled rather than rebuilt.
32134
- if (exports.MenuItemStyles.IsStyleChangeOnly(rItem.item, params.item) && this.isStyleSwapCapable(rItem.renderManager)) {
32375
+ // Only the style pick or overlay changed, so the drawn graphics are restyled, not rebuilt.
32376
+ const aligned = exports.MenuItemStyleOverlay.With(rItem.item, exports.MenuItemStyleOverlay.Get(params.item));
32377
+ const pickOnly = exports.MenuItemStyles.IsStyleChangeOnly(aligned, params.item);
32378
+ const restyleOnly = pickOnly || exports.MenuItemStyleOverlay.IsChangeOnly(rItem.item, params.item);
32379
+ if (restyleOnly && this.isStyleSwapCapable(rItem.renderManager)) {
32135
32380
  rItem.renderManager.SwapStyle(params.item);
32136
32381
  rItem.item = params.item;
32137
32382
  create = false;
@@ -32578,6 +32823,45 @@
32578
32823
  (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger({ isEnabling: true, itemId: rItem.id });
32579
32824
  return true;
32580
32825
  }
32826
+ /**
32827
+ * Lays a style, inline or by record, over every item that can take one; null clears it.
32828
+ */
32829
+ async SetStyleOverlay(params) {
32830
+ var _a, _b, _c;
32831
+ const counter = ++this.styleOverlayCounter;
32832
+ let overlay = (_a = params === null || params === void 0 ? void 0 : params.style) !== null && _a !== void 0 ? _a : null;
32833
+ if (!overlay && (params === null || params === void 0 ? void 0 : params.styleId) != null && params.styleId !== "" && params.styleId != -1) {
32834
+ // A record that fails to load leaves every item on its own style.
32835
+ try {
32836
+ const { style } = await BModels.Style.Get({
32837
+ api: this.getters.GetBruceApi(),
32838
+ styleId: params.styleId
32839
+ });
32840
+ overlay = (_b = style === null || style === void 0 ? void 0 : style.Settings) !== null && _b !== void 0 ? _b : null;
32841
+ }
32842
+ catch (e) {
32843
+ console.error(e);
32844
+ }
32845
+ }
32846
+ // A later call won while the record loaded.
32847
+ if (counter !== this.styleOverlayCounter) {
32848
+ return;
32849
+ }
32850
+ this.styleOverlay = overlay;
32851
+ for (const rItem of this.items) {
32852
+ const next = exports.MenuItemStyleOverlay.With(rItem.item, overlay);
32853
+ // Setting the same overlay again would otherwise restyle every feature for nothing.
32854
+ const unchanged = JSON.stringify(exports.MenuItemStyleOverlay.Get(next)) === JSON.stringify(exports.MenuItemStyleOverlay.Get(rItem.item));
32855
+ if (unchanged ||
32856
+ !this.isStyleSwapCapable(rItem.renderManager) ||
32857
+ rItem.renderManager.Disposed) {
32858
+ continue;
32859
+ }
32860
+ rItem.renderManager.SwapStyle(next);
32861
+ rItem.item = next;
32862
+ (_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger({ isEnabling: true, itemId: rItem.id });
32863
+ }
32864
+ }
32581
32865
  /*
32582
32866
  * Picks the child the caller asked for, else the one already enabled, else the first.
32583
32867
  */
@@ -46480,15 +46764,16 @@
46480
46764
  */
46481
46765
  function GetZoomControlSignature(zoomControl) {
46482
46766
  return JSON.stringify([].concat(zoomControl !== null && zoomControl !== void 0 ? zoomControl : []).map((zoomItem) => {
46483
- var _a, _b, _c, _d, _e, _f, _g;
46767
+ var _a, _b, _c, _d, _e, _f, _g, _h;
46484
46768
  return ({
46485
46769
  MinZoom: (_a = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.MinZoom) !== null && _a !== void 0 ? _a : null,
46486
46770
  MaxZoom: (_b = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.MaxZoom) !== null && _b !== void 0 ? _b : null,
46487
46771
  DisplayType: (_c = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.DisplayType) !== null && _c !== void 0 ? _c : null,
46488
46772
  StyleID: (_d = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) !== null && _d !== void 0 ? _d : null,
46489
46773
  Style: (_e = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.Style) !== null && _e !== void 0 ? _e : null,
46490
- LODCategoryID: (_f = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODCategoryID) !== null && _f !== void 0 ? _f : null,
46491
- LODLevel: (_g = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODLevel) !== null && _g !== void 0 ? _g : null
46774
+ StyleOverlay: (_f = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleOverlay) !== null && _f !== void 0 ? _f : null,
46775
+ LODCategoryID: (_g = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODCategoryID) !== null && _g !== void 0 ? _g : null,
46776
+ LODLevel: (_h = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODLevel) !== null && _h !== void 0 ? _h : null
46492
46777
  });
46493
46778
  }));
46494
46779
  }
@@ -47754,7 +48039,8 @@
47754
48039
  for (let i = 0; i < params.entities.length; i++) {
47755
48040
  const entity = params.entities[i];
47756
48041
  const zoomItem = params.zoomItems[entity.Bruce.ID];
47757
- const style = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$1(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
48042
+ const ownStyle = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$1(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
48043
+ const style = exports.MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
47758
48044
  // Pass through tags that may be needed for styling.
47759
48045
  const tagIds = entity.Bruce["Layer.ID"];
47760
48046
  const tags = [];
@@ -48583,6 +48869,10 @@
48583
48869
  trackEntity._parentEntity = cEntity;
48584
48870
  }
48585
48871
  cEntity._siblingGraphics = siblings;
48872
+ cEntity.styleEffective = exports.StyleEffective.Combine([
48873
+ { key: "color", effective: fillColorTrace.effective },
48874
+ { key: "scale", effective: scaleTrace.effective }
48875
+ ]);
48586
48876
  return cEntity;
48587
48877
  }
48588
48878
  EntityRenderEngineModel3d.Render = Render;
@@ -48593,7 +48883,7 @@
48593
48883
  * @returns
48594
48884
  */
48595
48885
  async function RenderGroup(params) {
48596
- var _a, _b, _c, _d, _e, _f, _g;
48886
+ var _a, _b, _c, _d, _e, _f, _g, _h;
48597
48887
  const api = params.apiGetter.getApi();
48598
48888
  await api.Loading;
48599
48889
  const cEntities = new Map();
@@ -48630,7 +48920,8 @@
48630
48920
  for (let i = 0; i < params.entities.length; i++) {
48631
48921
  const entity = params.entities[i];
48632
48922
  const zoomItem = params.zoomItems[entity.Bruce.ID];
48633
- const style = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$2(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
48923
+ const ownStyle = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$2(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
48924
+ const style = exports.MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
48634
48925
  // Pass through tags that may be needed for styling.
48635
48926
  const tagIds = entity.Bruce["Layer.ID"];
48636
48927
  const tags = [];
@@ -48669,8 +48960,8 @@
48669
48960
  for (let i = 0; i < params.entities.length; i++) {
48670
48961
  const entity = params.entities[i];
48671
48962
  const zoomItem = params.zoomItems[entity.Bruce.ID];
48672
- const styleRecord = (!params.offline && zoomItem.StyleID != -1) ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
48673
- const style = (!params.offline && zoomItem.StyleID != -1) ? styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.Settings : zoomItem.Style;
48963
+ const ownStyle = (!params.offline && zoomItem.StyleID != -1) ? (_c = (await getStyle$2(api, entity, zoomItem.StyleID))) === null || _c === void 0 ? void 0 : _c.Settings : zoomItem.Style;
48964
+ const style = exports.MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
48674
48965
  const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
48675
48966
  if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
48676
48967
  continue;
@@ -48689,21 +48980,21 @@
48689
48980
  let rego = null;
48690
48981
  // Only used for historic tracks right now.
48691
48982
  // So won't bother getting it if we don't have historic data.
48692
- if ((_c = params.entitiesHistoric) === null || _c === void 0 ? void 0 : _c[entity.Bruce.ID]) {
48983
+ if ((_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]) {
48693
48984
  rego = params.visualRegister.GetRego({
48694
48985
  entityId: entity.Bruce.ID,
48695
48986
  menuItemId: params.menuItemId
48696
48987
  });
48697
48988
  }
48698
- const mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
48989
+ const mStyle = (_e = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _e !== void 0 ? _e : {};
48699
48990
  const cEntity = Render({
48700
- rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
48991
+ rendered: (_f = params.rendered) === null || _f === void 0 ? void 0 : _f.get(entity.Bruce.ID),
48701
48992
  entity: entity,
48702
- entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
48993
+ entityHistoric: (_g = params.entitiesHistoric) === null || _g === void 0 ? void 0 : _g[entity.Bruce.ID],
48703
48994
  style: mStyle,
48704
48995
  tags: tags,
48705
48996
  viewer: params.viewer,
48706
- lodUrl: (_g = lod.url) !== null && _g !== void 0 ? _g : BModels.ClientFile.GetUrl({
48997
+ lodUrl: (_h = lod.url) !== null && _h !== void 0 ? _h : BModels.ClientFile.GetUrl({
48707
48998
  api,
48708
48999
  fileId: lod.clientFileId,
48709
49000
  viaCdn: true
@@ -48719,7 +49010,8 @@
48719
49010
  const name = await getName$1(api, entity, params.offline);
48720
49011
  cEntity.name = name;
48721
49012
  cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
48722
- cEntity.styleId = zoomItem.StyleID == -1 ? -1 : styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.ID;
49013
+ // The skip gate compares this with the zoom item, so it must not name the type default.
49014
+ cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
48723
49015
  cEntities.set(entity.Bruce.ID, cEntity);
48724
49016
  }
48725
49017
  }
@@ -49154,7 +49446,8 @@
49154
49446
  for (let i = 0; i < params.entities.length; i++) {
49155
49447
  const entity = params.entities[i];
49156
49448
  const zoomItem = params.zoomItems[entity.Bruce.ID];
49157
- const style = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$3(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
49449
+ const ownStyle = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$3(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
49450
+ const style = exports.MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
49158
49451
  // Pass through tags that may be needed for styling.
49159
49452
  const tagIds = entity.Bruce["Layer.ID"];
49160
49453
  const tags = [];
@@ -53821,7 +54114,8 @@ void main() {
53821
54114
  for (let i = 0; i < params.entities.length; i++) {
53822
54115
  const entity = params.entities[i];
53823
54116
  const zoomItem = params.zoomItems[entity.Bruce.ID];
53824
- const style = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$4(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
54117
+ const ownStyle = (!params.offline && zoomItem.StyleID != -1) ? (_a = (await getStyle$4(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
54118
+ const style = exports.MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
53825
54119
  // Pass through tags that may be needed for styling.
53826
54120
  const tagIds = entity.Bruce["Layer.ID"];
53827
54121
  const tags = [];
@@ -56077,7 +56371,7 @@ void main() {
56077
56371
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
56078
56372
  })(exports.StyleUtils || (exports.StyleUtils = {}));
56079
56373
 
56080
- const VERSION = "7.6.5";
56374
+ const VERSION = "7.6.7";
56081
56375
  /**
56082
56376
  * Updates the environment instance used by bruce-cesium to one specified.
56083
56377
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.