bruce-cesium 7.6.6 → 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 (45) hide show
  1. package/dist/bruce-cesium.es5.js +346 -56
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +339 -53
  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/menu-item-manager.js +53 -2
  16. package/dist/lib/rendering/menu-item-manager.js.map +1 -1
  17. package/dist/lib/rendering/menu-item-style-overlay.js +161 -0
  18. package/dist/lib/rendering/menu-item-style-overlay.js.map +1 -0
  19. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js +31 -8
  20. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js.map +1 -1
  21. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +9 -4
  22. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
  23. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +10 -3
  24. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
  25. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +26 -7
  26. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  27. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +8 -2
  28. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
  29. package/dist/lib/rendering/render-managers/render-manager.js +4 -3
  30. package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
  31. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +4 -1
  32. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
  33. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +5 -1
  34. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
  35. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +5 -1
  36. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
  37. package/dist/lib/rendering/tileset-styler.js +15 -7
  38. package/dist/lib/rendering/tileset-styler.js.map +1 -1
  39. package/dist/types/bruce-cesium.d.ts +2 -1
  40. package/dist/types/rendering/menu-item-manager.d.ts +11 -1
  41. package/dist/types/rendering/menu-item-style-overlay.d.ts +30 -0
  42. package/dist/types/rendering/render-managers/entities/entities-datalab-render-manager.d.ts +1 -0
  43. package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +1 -0
  44. package/dist/types/rendering/tileset-styler.d.ts +3 -0
  45. 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() {
@@ -24685,6 +24883,8 @@
24685
24883
  this.isRunningCheck = false;
24686
24884
  this.viewMonitorRemoval = null;
24687
24885
  this.renderQueue = [];
24886
+ // Queued Entities a caller handed in, drawn even when the skip gate sees nothing changed.
24887
+ this.renderQueueForced = new Set();
24688
24888
  this.renderQueueInterval = null;
24689
24889
  this.zoomControl = [];
24690
24890
  this.queryLoadId = 0;
@@ -24713,6 +24913,7 @@
24713
24913
  clearInterval(this.renderQueueInterval);
24714
24914
  this.renderQueueInterval = null;
24715
24915
  this.renderQueue = [];
24916
+ this.renderQueueForced.clear();
24716
24917
  this.renderedEntities = {};
24717
24918
  this.ensureSettings();
24718
24919
  this.visualsManager.RemoveRegos({
@@ -24875,6 +25076,7 @@
24875
25076
  clearInterval(this.renderQueueInterval);
24876
25077
  this.renderQueueInterval = null;
24877
25078
  this.renderQueue = [];
25079
+ this.renderQueueForced.clear();
24878
25080
  this.entityCheckQueueIds = [];
24879
25081
  this.visualsManager.RemoveRegos({
24880
25082
  menuItemId: this.item.id
@@ -24917,7 +25119,8 @@
24917
25119
  await this.renderDataLabEntities(entities, true);
24918
25120
  }
24919
25121
  else {
24920
- this.distributeForRender(entities);
25122
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
25123
+ this.distributeForRender(entities, true);
24921
25124
  }
24922
25125
  }
24923
25126
  else {
@@ -25040,15 +25243,28 @@
25040
25243
  }
25041
25244
  }
25042
25245
  }
25043
- distributeForRender(entities) {
25246
+ distributeForRender(entities, force = false) {
25044
25247
  if (this.disposed || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
25045
25248
  return;
25046
25249
  }
25250
+ if (force) {
25251
+ entities.forEach(x => this.renderQueueForced.add(x));
25252
+ }
25047
25253
  this.renderQueue = this.renderQueue.concat(entities);
25048
25254
  if (!this.renderQueueInterval && this.renderQueue.length) {
25049
25255
  this.renderQueueInterval = setInterval(() => {
25050
- const batch = this.deduplicateEntities(this.renderQueue.splice(0, BATCH_SIZE$3));
25051
- 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
+ }
25052
25268
  if (this.renderQueue.length <= 0) {
25053
25269
  clearInterval(this.renderQueueInterval);
25054
25270
  this.renderQueueInterval = null;
@@ -25080,7 +25296,7 @@
25080
25296
  return next;
25081
25297
  }
25082
25298
  async doRenderDataLabEntities(entities, force = false) {
25083
- var _a, _b, _c;
25299
+ var _a, _b, _c, _d, _e;
25084
25300
  if (this.disposed || this.viewer.isDestroyed() || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
25085
25301
  return;
25086
25302
  }
@@ -25129,7 +25345,9 @@
25129
25345
  tagIds: entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [],
25130
25346
  name: cEntity.name,
25131
25347
  cdn: this.item.cdnEnabled,
25132
- 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
25133
25351
  },
25134
25352
  requestRender: false
25135
25353
  });
@@ -25138,10 +25356,12 @@
25138
25356
  rego.name = cEntity.name;
25139
25357
  rego.visual = cEntity;
25140
25358
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
25359
+ rego.styleId = cEntity.styleId;
25360
+ rego.styleEffective = cEntity.styleEffective;
25141
25361
  rego.tagIds = entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [];
25142
- 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;
25143
25363
  rego.cdn = this.item.cdnEnabled;
25144
- 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;
25145
25365
  rego.canEdit = canEdit;
25146
25366
  if (rego.stale) {
25147
25367
  this.visualsManager.RefreshMark({
@@ -25217,6 +25437,7 @@
25217
25437
  renderSignature: Manager.GetRenderSignature(this.item)
25218
25438
  };
25219
25439
  this.renderQueue = [];
25440
+ this.renderQueueForced.clear();
25220
25441
  this.queryLoadId += 1;
25221
25442
  this.disposed = true;
25222
25443
  return payload;
@@ -26651,6 +26872,7 @@
26651
26872
  api: api,
26652
26873
  cTileset: this.cTileset,
26653
26874
  fallbackStyleId: this.item.styleId,
26875
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
26654
26876
  styleMapping: [],
26655
26877
  expandSources: false,
26656
26878
  menuItemId: this.item.id,
@@ -26873,7 +27095,8 @@
26873
27095
  if (Manager.NeedsStyler(item)) {
26874
27096
  this.styler.UpdateStyleMapping({
26875
27097
  styleMapping: [],
26876
- fallbackStyleId: item.styleId
27098
+ fallbackStyleId: item.styleId,
27099
+ styleOverlay: exports.MenuItemStyleOverlay.Get(item)
26877
27100
  });
26878
27101
  }
26879
27102
  }
@@ -27024,6 +27247,7 @@
27024
27247
  api: this.getters.GetBruceApi(),
27025
27248
  cTileset: this.cTileset,
27026
27249
  fallbackStyleId: this.item.styleId,
27250
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
27027
27251
  styleMapping: [],
27028
27252
  expandSources: false,
27029
27253
  menuItemId: this.item.id,
@@ -27944,6 +28168,7 @@
27944
28168
  api: api,
27945
28169
  cTileset: this.cTileset,
27946
28170
  fallbackStyleId: this.item.styleId,
28171
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item),
27947
28172
  styleMapping: this.item.StyleMapping,
27948
28173
  expandSources: false,
27949
28174
  menuItemId: this.item.id,
@@ -28139,7 +28364,8 @@
28139
28364
  if (this.item.ApplyStyles || this.item.Type == BModels.MenuItem.EType.IonTileset) {
28140
28365
  this.styler.UpdateStyleMapping({
28141
28366
  styleMapping: (_a = this.item.StyleMapping) !== null && _a !== void 0 ? _a : [],
28142
- fallbackStyleId: this.item.styleId
28367
+ fallbackStyleId: this.item.styleId,
28368
+ styleOverlay: exports.MenuItemStyleOverlay.Get(this.item)
28143
28369
  });
28144
28370
  }
28145
28371
  }
@@ -31993,6 +32219,9 @@
31993
32219
  get Viewer() {
31994
32220
  return this.viewer;
31995
32221
  }
32222
+ get StyleOverlay() {
32223
+ return this.styleOverlay;
32224
+ }
31996
32225
  get VisualsRegister() {
31997
32226
  return this.visualsRegister;
31998
32227
  }
@@ -32053,6 +32282,9 @@
32053
32282
  this.pendingHandoffPool = [];
32054
32283
  // The settings bookmark alternations overwrite on a view's items, as that view authored them.
32055
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;
32056
32288
  this.onUpdate = null;
32057
32289
  // Segments discovered so far per menu item ID.
32058
32290
  this.seriesSegments = new Map();
@@ -32134,12 +32366,17 @@
32134
32366
  }
32135
32367
  // An item with a style set renders its first style unless the caller already picked one of them.
32136
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) };
32137
32371
  let rItem = this.items.find(x => x.id == params.item.id);
32138
32372
  let create = true;
32139
32373
  // Item already exists so we'll check if we should re-create it.
32140
32374
  if (rItem) {
32141
- // Only the picked style changed, so what is drawn gets restyled rather than rebuilt.
32142
- 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)) {
32143
32380
  rItem.renderManager.SwapStyle(params.item);
32144
32381
  rItem.item = params.item;
32145
32382
  create = false;
@@ -32586,6 +32823,45 @@
32586
32823
  (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger({ isEnabling: true, itemId: rItem.id });
32587
32824
  return true;
32588
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
+ }
32589
32865
  /*
32590
32866
  * Picks the child the caller asked for, else the one already enabled, else the first.
32591
32867
  */
@@ -46488,15 +46764,16 @@
46488
46764
  */
46489
46765
  function GetZoomControlSignature(zoomControl) {
46490
46766
  return JSON.stringify([].concat(zoomControl !== null && zoomControl !== void 0 ? zoomControl : []).map((zoomItem) => {
46491
- var _a, _b, _c, _d, _e, _f, _g;
46767
+ var _a, _b, _c, _d, _e, _f, _g, _h;
46492
46768
  return ({
46493
46769
  MinZoom: (_a = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.MinZoom) !== null && _a !== void 0 ? _a : null,
46494
46770
  MaxZoom: (_b = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.MaxZoom) !== null && _b !== void 0 ? _b : null,
46495
46771
  DisplayType: (_c = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.DisplayType) !== null && _c !== void 0 ? _c : null,
46496
46772
  StyleID: (_d = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) !== null && _d !== void 0 ? _d : null,
46497
46773
  Style: (_e = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.Style) !== null && _e !== void 0 ? _e : null,
46498
- LODCategoryID: (_f = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODCategoryID) !== null && _f !== void 0 ? _f : null,
46499
- 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
46500
46777
  });
46501
46778
  }));
46502
46779
  }
@@ -47762,7 +48039,8 @@
47762
48039
  for (let i = 0; i < params.entities.length; i++) {
47763
48040
  const entity = params.entities[i];
47764
48041
  const zoomItem = params.zoomItems[entity.Bruce.ID];
47765
- 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);
47766
48044
  // Pass through tags that may be needed for styling.
47767
48045
  const tagIds = entity.Bruce["Layer.ID"];
47768
48046
  const tags = [];
@@ -48591,6 +48869,10 @@
48591
48869
  trackEntity._parentEntity = cEntity;
48592
48870
  }
48593
48871
  cEntity._siblingGraphics = siblings;
48872
+ cEntity.styleEffective = exports.StyleEffective.Combine([
48873
+ { key: "color", effective: fillColorTrace.effective },
48874
+ { key: "scale", effective: scaleTrace.effective }
48875
+ ]);
48594
48876
  return cEntity;
48595
48877
  }
48596
48878
  EntityRenderEngineModel3d.Render = Render;
@@ -48601,7 +48883,7 @@
48601
48883
  * @returns
48602
48884
  */
48603
48885
  async function RenderGroup(params) {
48604
- var _a, _b, _c, _d, _e, _f, _g;
48886
+ var _a, _b, _c, _d, _e, _f, _g, _h;
48605
48887
  const api = params.apiGetter.getApi();
48606
48888
  await api.Loading;
48607
48889
  const cEntities = new Map();
@@ -48638,7 +48920,8 @@
48638
48920
  for (let i = 0; i < params.entities.length; i++) {
48639
48921
  const entity = params.entities[i];
48640
48922
  const zoomItem = params.zoomItems[entity.Bruce.ID];
48641
- 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);
48642
48925
  // Pass through tags that may be needed for styling.
48643
48926
  const tagIds = entity.Bruce["Layer.ID"];
48644
48927
  const tags = [];
@@ -48677,8 +48960,8 @@
48677
48960
  for (let i = 0; i < params.entities.length; i++) {
48678
48961
  const entity = params.entities[i];
48679
48962
  const zoomItem = params.zoomItems[entity.Bruce.ID];
48680
- const styleRecord = (!params.offline && zoomItem.StyleID != -1) ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
48681
- 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);
48682
48965
  const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
48683
48966
  if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
48684
48967
  continue;
@@ -48697,21 +48980,21 @@
48697
48980
  let rego = null;
48698
48981
  // Only used for historic tracks right now.
48699
48982
  // So won't bother getting it if we don't have historic data.
48700
- 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]) {
48701
48984
  rego = params.visualRegister.GetRego({
48702
48985
  entityId: entity.Bruce.ID,
48703
48986
  menuItemId: params.menuItemId
48704
48987
  });
48705
48988
  }
48706
- 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 : {};
48707
48990
  const cEntity = Render({
48708
- 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),
48709
48992
  entity: entity,
48710
- 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],
48711
48994
  style: mStyle,
48712
48995
  tags: tags,
48713
48996
  viewer: params.viewer,
48714
- 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({
48715
48998
  api,
48716
48999
  fileId: lod.clientFileId,
48717
49000
  viaCdn: true
@@ -48727,7 +49010,8 @@
48727
49010
  const name = await getName$1(api, entity, params.offline);
48728
49011
  cEntity.name = name;
48729
49012
  cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
48730
- 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);
48731
49015
  cEntities.set(entity.Bruce.ID, cEntity);
48732
49016
  }
48733
49017
  }
@@ -49162,7 +49446,8 @@
49162
49446
  for (let i = 0; i < params.entities.length; i++) {
49163
49447
  const entity = params.entities[i];
49164
49448
  const zoomItem = params.zoomItems[entity.Bruce.ID];
49165
- 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);
49166
49451
  // Pass through tags that may be needed for styling.
49167
49452
  const tagIds = entity.Bruce["Layer.ID"];
49168
49453
  const tags = [];
@@ -53829,7 +54114,8 @@ void main() {
53829
54114
  for (let i = 0; i < params.entities.length; i++) {
53830
54115
  const entity = params.entities[i];
53831
54116
  const zoomItem = params.zoomItems[entity.Bruce.ID];
53832
- 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);
53833
54119
  // Pass through tags that may be needed for styling.
53834
54120
  const tagIds = entity.Bruce["Layer.ID"];
53835
54121
  const tags = [];
@@ -56085,7 +56371,7 @@ void main() {
56085
56371
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
56086
56372
  })(exports.StyleUtils || (exports.StyleUtils = {}));
56087
56373
 
56088
- const VERSION = "7.6.6";
56374
+ const VERSION = "7.6.7";
56089
56375
  /**
56090
56376
  * Updates the environment instance used by bruce-cesium to one specified.
56091
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.