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
@@ -1,6 +1,6 @@
1
1
  import * as Cesium from 'cesium';
2
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, HeightReference, Matrix4, ColorBlendMode, ShadowMode, ClassificationType, Model, ShaderSource, Ellipsoid, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, PixelDatatype, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, ArcType, CornerType, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, DistanceDisplayCondition, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, SceneMode, IntersectionTests, Ray, SceneTransforms, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, FeatureDetection, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileColorBlendMode, Cesium3DTileset, Intersect, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, CustomDataSource, ScreenSpaceEventHandler, ScreenSpaceEventType, GeometryInstance, Fullscreen, CzmlDataSource } from 'cesium';
3
- import { Cartes, LRUCache, ProjectViewTile, ENVIRONMENT, Calculator, ClientFile, Entity as Entity$1, EntityLod, EntityTag, EntityType, ObjectUtils, Style, UrlUtils, Carto, Geometry as Geometry$1, Api, Bounds, ClientFileValueMap, Color as Color$1, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, DataLab, DelayQueue, AccountConcept, RecordChangeFeed, BruceApi, EntityRelation, ProgramKey, ProjectViewLegacyTile, EntitySource, Camera, Account, AccountLimits, Session, ProjectViewBookmarkGroup, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType, EntityHistoricData } from 'bruce-models';
2
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ShaderSource, Cartesian3, Math as Math$1, Ellipsoid, Transforms, Matrix4, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, PixelDatatype, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, JulianDate, Quaternion, HeadingPitchRoll, HeightReference, ConstantPositionProperty, DistanceDisplayCondition, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ArcType, CornerType, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, SceneMode, IntersectionTests, Ray, SceneTransforms, FeatureDetection, Matrix3, NearFarScalar, KmlDataSource, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, Cesium3DTileColorBlendMode, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, CustomDataSource, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, ScreenSpaceEventHandler, ScreenSpaceEventType, Fullscreen, CzmlDataSource } from 'cesium';
3
+ import { Cartes, LRUCache, ProjectViewTile, ENVIRONMENT, Calculator, ClientFile, Entity as Entity$1, EntityLod, EntityTag, EntityType, ObjectUtils, Style, UrlUtils, Api, Carto, Geometry as Geometry$1, Bounds, ClientFileValueMap, Color as Color$1, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, DataLab, DelayQueue, AccountConcept, BruceApi, EntityRelation, RecordChangeFeed, Camera, ProgramKey, ProjectViewLegacyTile, EntitySource, Account, AccountLimits, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, ProjectViewBookmarkGroup, EntityRelationType, EntityHistoricData } from 'bruce-models';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -16432,6 +16432,163 @@ class HistoricGatherer {
16432
16432
  // whatever the writer's clock and this one disagree by.
16433
16433
  HistoricGatherer.LIVE_TAIL_MS = 15000;
16434
16434
 
16435
+ /**
16436
+ * Lays one style over every menu item that can take it, changing only what that style sets.
16437
+ */
16438
+ var MenuItemStyleOverlay;
16439
+ (function (MenuItemStyleOverlay) {
16440
+ // Tileset items whose render manager runs a Styler, given the item settings that make it run one.
16441
+ const TILESET_TYPES = [
16442
+ MenuItem.EType.CadTileset,
16443
+ MenuItem.EType.ArbTileset,
16444
+ MenuItem.EType.IonTileset,
16445
+ MenuItem.EType.EntityTileset
16446
+ ];
16447
+ // Items whose style resolves per Entity from their zoom control rows.
16448
+ const ZOOM_CONTROL_TYPES = [
16449
+ MenuItem.EType.Entities,
16450
+ MenuItem.EType.Entity,
16451
+ MenuItem.EType.EntitiesIds,
16452
+ MenuItem.EType.EntitiesLoaded,
16453
+ MenuItem.EType.DataLab
16454
+ ];
16455
+ /**
16456
+ * Returns the base style with each field the overlay sets laid over it.
16457
+ */
16458
+ function Merge(base, overlay) {
16459
+ var _a, _b;
16460
+ if (!overlay) {
16461
+ return base;
16462
+ }
16463
+ const merged = { ...(base !== null && base !== void 0 ? base : {}) };
16464
+ for (const key of Object.keys(overlay)) {
16465
+ const value = overlay[key];
16466
+ if (!isSet(value)) {
16467
+ continue;
16468
+ }
16469
+ if (isPlainObject(value)) {
16470
+ merged[key] = { ...((_a = merged[key]) !== null && _a !== void 0 ? _a : {}), ...pickSet(value) };
16471
+ }
16472
+ else {
16473
+ merged[key] = value;
16474
+ }
16475
+ }
16476
+ // Tilesets only paint a customised model style, and an overlay that sets a colour wants painting.
16477
+ if (isSet((_b = overlay.modelStyle) === null || _b === void 0 ? void 0 : _b.fillColor) && overlay.modelStyle.customize == null) {
16478
+ merged.modelStyle = { ...merged.modelStyle, customize: true };
16479
+ }
16480
+ return merged;
16481
+ }
16482
+ MenuItemStyleOverlay.Merge = Merge;
16483
+ /**
16484
+ * Returns the overlay a zoom control row carries laid over the style it resolved.
16485
+ */
16486
+ function ApplyRow(style, row) {
16487
+ return Merge(style, row === null || row === void 0 ? void 0 : row.StyleOverlay);
16488
+ }
16489
+ MenuItemStyleOverlay.ApplyRow = ApplyRow;
16490
+ /**
16491
+ * Returns true when the item renders through a path that honours an overlay.
16492
+ */
16493
+ function Supports(item) {
16494
+ if (ZOOM_CONTROL_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16495
+ return true;
16496
+ }
16497
+ if (!TILESET_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16498
+ return false;
16499
+ }
16500
+ // These two only run a Styler when asked to.
16501
+ if (item.Type === MenuItem.EType.ArbTileset || item.Type === MenuItem.EType.EntityTileset) {
16502
+ return Boolean(item.ApplyStyles);
16503
+ }
16504
+ return true;
16505
+ }
16506
+ MenuItemStyleOverlay.Supports = Supports;
16507
+ /**
16508
+ * Returns the overlay laid on the item, or null when it carries none.
16509
+ */
16510
+ function Get(item) {
16511
+ var _a, _b, _c;
16512
+ if (TILESET_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16513
+ return (_a = item.styleOverlay) !== null && _a !== void 0 ? _a : null;
16514
+ }
16515
+ if (ZOOM_CONTROL_TYPES.includes(item === null || item === void 0 ? void 0 : item.Type)) {
16516
+ const rows = item.CameraZoomSettings;
16517
+ 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;
16518
+ }
16519
+ return null;
16520
+ }
16521
+ MenuItemStyleOverlay.Get = Get;
16522
+ /**
16523
+ * Returns a copy carrying the overlay, or the item itself when it cannot take one and carries none.
16524
+ */
16525
+ function With(item, overlay) {
16526
+ var _a;
16527
+ const target = Supports(item) ? overlay : null;
16528
+ if (!target && !Get(item)) {
16529
+ return item;
16530
+ }
16531
+ if (TILESET_TYPES.includes(item.Type)) {
16532
+ const next = { ...item };
16533
+ if (target) {
16534
+ next.styleOverlay = target;
16535
+ }
16536
+ else {
16537
+ delete next.styleOverlay;
16538
+ }
16539
+ return next;
16540
+ }
16541
+ const zItem = item;
16542
+ return {
16543
+ ...zItem,
16544
+ CameraZoomSettings: ((_a = zItem.CameraZoomSettings) !== null && _a !== void 0 ? _a : []).map(row => {
16545
+ const next = { ...row };
16546
+ if (target) {
16547
+ next.StyleOverlay = target;
16548
+ }
16549
+ else {
16550
+ delete next.StyleOverlay;
16551
+ }
16552
+ return next;
16553
+ })
16554
+ };
16555
+ }
16556
+ MenuItemStyleOverlay.With = With;
16557
+ /**
16558
+ * Returns true when the two items differ by nothing but their overlay.
16559
+ */
16560
+ function IsChangeOnly(from, to) {
16561
+ if (!from || !to || from.Type !== to.Type) {
16562
+ return false;
16563
+ }
16564
+ const toOverlay = Get(to);
16565
+ if (JSON.stringify(Get(from)) === JSON.stringify(toOverlay)) {
16566
+ return false;
16567
+ }
16568
+ // A false mismatch only costs the in-place swap, so key order is not normalized.
16569
+ return JSON.stringify(With(from, toOverlay)) === JSON.stringify(to);
16570
+ }
16571
+ MenuItemStyleOverlay.IsChangeOnly = IsChangeOnly;
16572
+ /*
16573
+ * Returns false for what leaves the base value in place: unset, null, or an empty Calculator field list.
16574
+ */
16575
+ function isSet(value) {
16576
+ return value !== undefined && value !== null && !(Array.isArray(value) && !value.length);
16577
+ }
16578
+ function isPlainObject(value) {
16579
+ return typeof value === "object" && !Array.isArray(value);
16580
+ }
16581
+ function pickSet(value) {
16582
+ const picked = {};
16583
+ for (const key of Object.keys(value)) {
16584
+ if (isSet(value[key])) {
16585
+ picked[key] = value[key];
16586
+ }
16587
+ }
16588
+ return picked;
16589
+ }
16590
+ })(MenuItemStyleOverlay || (MenuItemStyleOverlay = {}));
16591
+
16435
16592
  const BATCH_SIZE = 500;
16436
16593
  const CHECK_BATCH_SIZE = 250;
16437
16594
  function getValue$2(viewer, obj) {
@@ -16492,6 +16649,8 @@ var EntitiesRenderManager;
16492
16649
  this.isRunningCheck = false;
16493
16650
  this.viewMonitorRemoval = null;
16494
16651
  this.renderQueue = [];
16652
+ // Queued Entities a caller handed in, drawn even when the skip gate sees nothing changed.
16653
+ this.renderQueueForced = new Set();
16495
16654
  this.renderQueueInterval = null;
16496
16655
  this.sources = [];
16497
16656
  // Highly experimental flag to try improve rendering large sets of polygons and polylines.
@@ -16586,6 +16745,7 @@ var EntitiesRenderManager;
16586
16745
  clearInterval(this.renderQueueInterval);
16587
16746
  this.renderQueueInterval = null;
16588
16747
  this.renderQueue = [];
16748
+ this.renderQueueForced.clear();
16589
16749
  // Remove just the ones that shouldn't be rendered.
16590
16750
  // Eg: for a tag menu item we can see what tags are selected and only render those.
16591
16751
  if (shouldRender) {
@@ -16896,6 +17056,7 @@ var EntitiesRenderManager;
16896
17056
  (_b = this.viewMonitorRemoval) === null || _b === void 0 ? void 0 : _b.call(this);
16897
17057
  clearInterval(this.renderQueueInterval);
16898
17058
  this.renderQueue = [];
17059
+ this.renderQueueForced.clear();
16899
17060
  (_c = this.clustering) === null || _c === void 0 ? void 0 : _c.Dispose();
16900
17061
  this.clustering = null;
16901
17062
  for (let i = 0; i < this.sources.length; i++) {
@@ -16984,7 +17145,8 @@ var EntitiesRenderManager;
16984
17145
  }
16985
17146
  else {
16986
17147
  if (entities === null || entities === void 0 ? void 0 : entities.length) {
16987
- this.distributeForRender(entities);
17148
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
17149
+ this.distributeForRender(entities, true);
16988
17150
  }
16989
17151
  else {
16990
17152
  await this.doEntityCheck(entityIds);
@@ -17135,12 +17297,22 @@ var EntitiesRenderManager;
17135
17297
  }
17136
17298
  this.isRunningCheck = false;
17137
17299
  }
17138
- distributeForRender(entities) {
17300
+ distributeForRender(entities, force = false) {
17301
+ if (force) {
17302
+ entities.forEach(x => this.renderQueueForced.add(x));
17303
+ }
17139
17304
  this.renderQueue = this.renderQueue.concat(entities);
17140
17305
  if (!this.renderQueueInterval && this.renderQueue.length) {
17141
17306
  this.renderQueueInterval = setInterval(() => {
17142
17307
  const batch = this.renderQueue.splice(0, BATCH_SIZE);
17143
- this.renderEntities(batch);
17308
+ const forced = new Set(batch.filter(x => this.renderQueueForced.delete(x)));
17309
+ const rest = batch.filter(x => !forced.has(x));
17310
+ if (forced.size) {
17311
+ this.renderEntities(Array.from(forced), true);
17312
+ }
17313
+ if (rest.length) {
17314
+ this.renderEntities(rest);
17315
+ }
17144
17316
  if (this.renderQueue.length <= 0) {
17145
17317
  clearInterval(this.renderQueueInterval);
17146
17318
  this.renderQueueInterval = null;
@@ -17276,6 +17448,7 @@ var EntitiesRenderManager;
17276
17448
  console.error(e);
17277
17449
  }
17278
17450
  }
17451
+ style = MenuItemStyleOverlay.ApplyRow(style, zoomItem);
17279
17452
  const pStyle = (_g = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _g !== void 0 ? _g : {};
17280
17453
  const lStyle = (_h = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _h !== void 0 ? _h : {};
17281
17454
  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;
@@ -17567,7 +17740,7 @@ var EntitiesRenderManager;
17567
17740
  return recordsByIds;
17568
17741
  }
17569
17742
  async doRenderAsIndividuals(entities, force = false) {
17570
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
17743
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
17571
17744
  // When live we just want to show the latest pos.
17572
17745
  // When not live, the user might scroll the timeline and want to see it a fluid animation between points in time.
17573
17746
  const isLive = ViewUtils.GetTimeDetails({
@@ -17671,8 +17844,9 @@ var EntitiesRenderManager;
17671
17844
  rego.schema = (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Schema;
17672
17845
  rego.canEdit = canEdit;
17673
17846
  rego.internalId = (_k = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.InternalID) !== null && _k !== void 0 ? _k : rego.internalId;
17674
- rego.styleId = (_l = cEntity.styleId) !== null && _l !== void 0 ? _l : rego.styleId;
17675
- rego.styleEffective = (_m = cEntity.styleEffective) !== null && _m !== void 0 ? _m : rego.styleEffective;
17847
+ // Assigned outright, so a restyle that traces nothing clears the old key.
17848
+ rego.styleId = cEntity.styleId;
17849
+ rego.styleEffective = cEntity.styleEffective;
17676
17850
  // Marked as stale meaning some change was performed that requires a refresh.
17677
17851
  // This usually means a new sibling was added that we need to update.
17678
17852
  if (rego.stale) {
@@ -17702,7 +17876,7 @@ var EntitiesRenderManager;
17702
17876
  menuItemId: this.item.id,
17703
17877
  requestRender: false
17704
17878
  });
17705
- (_o = this.clustering) === null || _o === void 0 ? void 0 : _o.RemoveEntity(id, false);
17879
+ (_l = this.clustering) === null || _l === void 0 ? void 0 : _l.RemoveEntity(id, false);
17706
17880
  }
17707
17881
  }
17708
17882
  this.viewer.scene.requestRender();
@@ -17781,6 +17955,7 @@ var EntitiesRenderManager;
17781
17955
  clearInterval(this.renderQueueInterval);
17782
17956
  this.renderQueueInterval = null;
17783
17957
  this.renderQueue = [];
17958
+ this.renderQueueForced.clear();
17784
17959
  this.disposed = true;
17785
17960
  return payload;
17786
17961
  }
@@ -18143,7 +18318,8 @@ var EntitiesLoadedRenderManager;
18143
18318
  menuItemIds: [this.item.id]
18144
18319
  });
18145
18320
  if (entities === null || entities === void 0 ? void 0 : entities.length) {
18146
- this.onGetterUpdate(entities, force);
18321
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
18322
+ this.onGetterUpdate(entities, true);
18147
18323
  }
18148
18324
  else {
18149
18325
  this.doEntityCheck(entityIds, force);
@@ -18377,6 +18553,7 @@ var EntitiesLoadedRenderManager;
18377
18553
  if (!style) {
18378
18554
  style = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.Style;
18379
18555
  }
18556
+ style = MenuItemStyleOverlay.ApplyRow(style, zoomItem);
18380
18557
  const pStyle = (_h = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _h !== void 0 ? _h : {};
18381
18558
  const lStyle = (_j = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _j !== void 0 ? _j : {};
18382
18559
  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;
@@ -18621,7 +18798,7 @@ var EntitiesLoadedRenderManager;
18621
18798
  return next;
18622
18799
  }
18623
18800
  async doRenderAsIndividuals(entities, force = false) {
18624
- var _a;
18801
+ var _a, _b, _c;
18625
18802
  const { updated, entities: cEntities } = await EntityRenderEngine.Render({
18626
18803
  viewer: this.viewer,
18627
18804
  apiGetter: this.apiGetter,
@@ -18675,7 +18852,9 @@ var EntitiesLoadedRenderManager;
18675
18852
  priority: this.renderPriority,
18676
18853
  entityTypeId: entity.Bruce["EntityType.ID"],
18677
18854
  accountId: this.apiGetter.accountId,
18678
- name: cEntity.name
18855
+ name: cEntity.name,
18856
+ styleId: (_b = cEntity.styleId) !== null && _b !== void 0 ? _b : undefined,
18857
+ styleEffective: (_c = cEntity.styleEffective) !== null && _c !== void 0 ? _c : undefined
18679
18858
  },
18680
18859
  requestRender: false
18681
18860
  });
@@ -18683,6 +18862,8 @@ var EntitiesLoadedRenderManager;
18683
18862
  else if (updated.get(id) && rego) {
18684
18863
  rego.visual = cEntity;
18685
18864
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
18865
+ rego.styleId = cEntity.styleId;
18866
+ rego.styleEffective = cEntity.styleEffective;
18686
18867
  rego.name = cEntity.name;
18687
18868
  // We manually trigger an update event since the graphic was updated but not recreated.
18688
18869
  this.visualsManager.OnUpdate.Trigger({
@@ -18862,7 +19043,8 @@ var EntitiesIdsRenderManager;
18862
19043
  menuItemIds: [this.item.id]
18863
19044
  });
18864
19045
  if (entities === null || entities === void 0 ? void 0 : entities.length) {
18865
- this.renderEntities(entities, force);
19046
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
19047
+ this.renderEntities(entities, true);
18866
19048
  }
18867
19049
  else {
18868
19050
  this.onGetterUpdate(entityIds, force);
@@ -19074,7 +19256,7 @@ var EntitiesIdsRenderManager;
19074
19256
  * @returns
19075
19257
  */
19076
19258
  async renderAsIndividuals(entities, force = false) {
19077
- var _a;
19259
+ var _a, _b, _c;
19078
19260
  if (this.disposed || this.viewer.isDestroyed() || !entities.length) {
19079
19261
  return;
19080
19262
  }
@@ -19133,7 +19315,9 @@ var EntitiesIdsRenderManager;
19133
19315
  entityTypeId: entity.Bruce["EntityType.ID"],
19134
19316
  accountId: this.apiGetter.accountId,
19135
19317
  overrideShow: clustered ? false : null,
19136
- name: cEntity.name
19318
+ name: cEntity.name,
19319
+ styleId: (_a = cEntity.styleId) !== null && _a !== void 0 ? _a : undefined,
19320
+ styleEffective: (_b = cEntity.styleEffective) !== null && _b !== void 0 ? _b : undefined
19137
19321
  },
19138
19322
  requestRender: false
19139
19323
  });
@@ -19141,6 +19325,8 @@ var EntitiesIdsRenderManager;
19141
19325
  else if (updated.get(id) && rego) {
19142
19326
  rego.visual = cEntity;
19143
19327
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
19328
+ rego.styleId = cEntity.styleId;
19329
+ rego.styleEffective = cEntity.styleEffective;
19144
19330
  rego.name = cEntity.name;
19145
19331
  // We manually trigger an update event since the graphic was updated but not recreated.
19146
19332
  this.visualsManager.OnUpdate.Trigger({
@@ -19156,7 +19342,7 @@ var EntitiesIdsRenderManager;
19156
19342
  menuItemId: this.item.id,
19157
19343
  requestRender: false
19158
19344
  });
19159
- (_a = this.clustering) === null || _a === void 0 ? void 0 : _a.RemoveEntity(id, false);
19345
+ (_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(id, false);
19160
19346
  }
19161
19347
  }
19162
19348
  if (!this.disposed) {
@@ -19306,7 +19492,8 @@ var EntityRenderManager;
19306
19492
  menuItemIds: [this.item.id]
19307
19493
  });
19308
19494
  if (incoming) {
19309
- await this.renderEntity(incoming, force);
19495
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
19496
+ await this.renderEntity(incoming, true);
19310
19497
  }
19311
19498
  else {
19312
19499
  await this.onGetterUpdate(itemEntityId, force);
@@ -19380,6 +19567,7 @@ var EntityRenderManager;
19380
19567
  return next;
19381
19568
  }
19382
19569
  async doRenderEntity(entity, force = false) {
19570
+ var _a, _b;
19383
19571
  try {
19384
19572
  if (this.disposed || this.viewer.isDestroyed()) {
19385
19573
  return;
@@ -19412,7 +19600,9 @@ var EntityRenderManager;
19412
19600
  priority: this.renderPriority,
19413
19601
  entityTypeId: entity.Bruce["EntityType.ID"],
19414
19602
  accountId: this.apiGetter.accountId,
19415
- name: cEntity.name
19603
+ name: cEntity.name,
19604
+ styleId: (_a = cEntity.styleId) !== null && _a !== void 0 ? _a : undefined,
19605
+ styleEffective: (_b = cEntity.styleEffective) !== null && _b !== void 0 ? _b : undefined
19416
19606
  },
19417
19607
  requestRender: false
19418
19608
  });
@@ -19420,6 +19610,8 @@ var EntityRenderManager;
19420
19610
  else if (updated.get(id) && rego) {
19421
19611
  rego.visual = cEntity;
19422
19612
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
19613
+ rego.styleId = cEntity.styleId;
19614
+ rego.styleEffective = cEntity.styleEffective;
19423
19615
  rego.name = cEntity.name;
19424
19616
  // We manually trigger an update event since the graphic was updated but not recreated.
19425
19617
  this.visualsManager.OnUpdate.Trigger({
@@ -20490,6 +20682,8 @@ class TilesetStyler {
20490
20682
  // Once the style is loaded, we can queue the set for styling.
20491
20683
  this.stylePendingEntityIds = new Map();
20492
20684
  this.fallbackStyle = null;
20685
+ // Laid over whichever style each feature resolves, so it only changes the fields it sets.
20686
+ this.styleOverlay = null;
20493
20687
  this.styleFallbackLoaded = false;
20494
20688
  this.loadingCounter = 0;
20495
20689
  // Entity IDs -> boolean to indicate if we should override the feature colour.
@@ -20542,8 +20736,9 @@ class TilesetStyler {
20542
20736
  return this._styleProgress;
20543
20737
  }
20544
20738
  Init(params) {
20545
- var _a, _b;
20739
+ var _a, _b, _c;
20546
20740
  let { viewer, api, cTileset, fallbackStyleId, styleMapping, expandSources, menuItemId, register, scenario, historic, applyStyles, monitor } = params;
20741
+ this.styleOverlay = (_a = params.styleOverlay) !== null && _a !== void 0 ? _a : null;
20547
20742
  this.monitor = monitor;
20548
20743
  this.viewer = viewer;
20549
20744
  this.api = api;
@@ -20571,7 +20766,7 @@ class TilesetStyler {
20571
20766
  // We have some evil hard-coded style mappings that need to be fixed.
20572
20767
  // These exist within legacy project views.
20573
20768
  // Update: This now also lets people have a style mapping without a real style record.
20574
- if ((_a = this.styleMapping) === null || _a === void 0 ? void 0 : _a.length) {
20769
+ if ((_b = this.styleMapping) === null || _b === void 0 ? void 0 : _b.length) {
20575
20770
  for (let i = 0; i < this.styleMapping.length; i++) {
20576
20771
  const mapItem = this.styleMapping[i];
20577
20772
  const mapStyle = mapItem.style ? mapItem.style : mapItem.Style;
@@ -20611,7 +20806,7 @@ class TilesetStyler {
20611
20806
  });
20612
20807
  this.loaded = true;
20613
20808
  this.loadStyles();
20614
- const feed = (_b = this.api) === null || _b === void 0 ? void 0 : _b.RecordChangeFeed;
20809
+ const feed = (_c = this.api) === null || _c === void 0 ? void 0 : _c.RecordChangeFeed;
20615
20810
  if (feed) {
20616
20811
  this.feedSub = feed.Subscribe({
20617
20812
  concepts: [AccountConcept.EConcept.ENTITY],
@@ -20676,6 +20871,10 @@ class TilesetStyler {
20676
20871
  else {
20677
20872
  this.fallbackStyle = null;
20678
20873
  }
20874
+ // Left as it is when a caller omits it, so a mapping change keeps the scene-wide style.
20875
+ if (params.styleOverlay !== undefined) {
20876
+ this.styleOverlay = params.styleOverlay;
20877
+ }
20679
20878
  if (params.scenario != null) {
20680
20879
  if (!this.shouldUpdateRegoStates && !!this.scenario) {
20681
20880
  this.shouldUpdateRegoStates = true;
@@ -21178,12 +21377,11 @@ class TilesetStyler {
21178
21377
  override: override
21179
21378
  });
21180
21379
  this.overrideFeatureColor.set(rego.entityId, true);
21181
- if (resolvedStyleId != null) {
21182
- rego.styleId = resolvedStyleId;
21183
- }
21380
+ // Assigned outright, so a restyle that traces nothing clears the old key.
21381
+ rego.styleId = resolvedStyleId !== null && resolvedStyleId !== void 0 ? resolvedStyleId : undefined;
21184
21382
  rego.styleEffective = (_b = StyleEffective.Combine([
21185
21383
  { key: "color", effective: fillColorTrace.effective }
21186
- ])) !== null && _b !== void 0 ? _b : rego.styleEffective;
21384
+ ])) !== null && _b !== void 0 ? _b : undefined;
21187
21385
  }
21188
21386
  if (((_c = data === null || data === void 0 ? void 0 : data.Bruce) === null || _c === void 0 ? void 0 : _c.InternalID) != null) {
21189
21387
  rego.internalId = data.Bruce.InternalID;
@@ -21229,6 +21427,7 @@ class TilesetStyler {
21229
21427
  style = (_b = this.fallbackStyle) === null || _b === void 0 ? void 0 : _b.Settings;
21230
21428
  styleId = this.fallbackStyleId != null ? Number(this.fallbackStyleId) : null;
21231
21429
  }
21430
+ style = MenuItemStyleOverlay.Merge(style, this.styleOverlay);
21232
21431
  if (!style || !((_c = style === null || style === void 0 ? void 0 : style.modelStyle) === null || _c === void 0 ? void 0 : _c.customize)) {
21233
21432
  return { settings: null, styleId: null };
21234
21433
  }
@@ -22420,6 +22619,7 @@ var TilesetCadRenderManager;
22420
22619
  api: this.getters.GetBruceApi(),
22421
22620
  cTileset: this.cTileset,
22422
22621
  fallbackStyleId: this.item.styleId,
22622
+ styleOverlay: MenuItemStyleOverlay.Get(this.item),
22423
22623
  styleMapping: this.item.StyleMapping,
22424
22624
  expandSources: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.ExpandSources,
22425
22625
  menuItemId: this.item.id,
@@ -22634,6 +22834,7 @@ var TilesetCadRenderManager;
22634
22834
  api: this.getters.GetBruceApi(),
22635
22835
  cTileset: this.cTileset,
22636
22836
  fallbackStyleId: this.item.styleId,
22837
+ styleOverlay: MenuItemStyleOverlay.Get(this.item),
22637
22838
  styleMapping: this.item.StyleMapping,
22638
22839
  expandSources: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.ExpandSources,
22639
22840
  menuItemId: this.item.id,
@@ -23255,7 +23456,8 @@ var TilesetCadRenderManager;
23255
23456
  // Before the tileset loads this only stores the pick, and the styler's Init reads the new item.
23256
23457
  this.styler.UpdateStyleMapping({
23257
23458
  styleMapping: (_a = item.StyleMapping) !== null && _a !== void 0 ? _a : [],
23258
- fallbackStyleId: item.styleId
23459
+ fallbackStyleId: item.styleId,
23460
+ styleOverlay: MenuItemStyleOverlay.Get(item)
23259
23461
  });
23260
23462
  }
23261
23463
  Dispose() {
@@ -24192,6 +24394,13 @@ var EntityFilterGetter;
24192
24394
  this.historicAttrDateTime = newDateTime.toISOString();
24193
24395
  }
24194
24396
  }
24397
+ /*
24398
+ * Returns the viewer clock's current time as ISO, or null without a viewer.
24399
+ */
24400
+ sceneDateTime() {
24401
+ var _a;
24402
+ return ((_a = this.viewer) === null || _a === void 0 ? void 0 : _a.clock) ? JulianDate.toDate(this.viewer.clock.currentTime).toISOString() : null;
24403
+ }
24195
24404
  viewerDateTimeDispose() {
24196
24405
  var _a;
24197
24406
  (_a = this.viewerDateTimeChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
@@ -24475,7 +24684,8 @@ var EntityFilterGetter;
24475
24684
  api: this.api,
24476
24685
  scenario: this.scenario,
24477
24686
  historicKey: this.historicAttrKey,
24478
- historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : null,
24687
+ // Non-historic items still read as at the scene's time, matching the info view.
24688
+ historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : this.sceneDateTime(),
24479
24689
  expandSources: true,
24480
24690
  expandLocation: true,
24481
24691
  schemaId: this.schemaId,
@@ -24731,6 +24941,8 @@ var DataLabRenderManager;
24731
24941
  this.isRunningCheck = false;
24732
24942
  this.viewMonitorRemoval = null;
24733
24943
  this.renderQueue = [];
24944
+ // Queued Entities a caller handed in, drawn even when the skip gate sees nothing changed.
24945
+ this.renderQueueForced = new Set();
24734
24946
  this.renderQueueInterval = null;
24735
24947
  this.zoomControl = [];
24736
24948
  this.queryLoadId = 0;
@@ -24759,6 +24971,7 @@ var DataLabRenderManager;
24759
24971
  clearInterval(this.renderQueueInterval);
24760
24972
  this.renderQueueInterval = null;
24761
24973
  this.renderQueue = [];
24974
+ this.renderQueueForced.clear();
24762
24975
  this.renderedEntities = {};
24763
24976
  this.ensureSettings();
24764
24977
  this.visualsManager.RemoveRegos({
@@ -24921,6 +25134,7 @@ var DataLabRenderManager;
24921
25134
  clearInterval(this.renderQueueInterval);
24922
25135
  this.renderQueueInterval = null;
24923
25136
  this.renderQueue = [];
25137
+ this.renderQueueForced.clear();
24924
25138
  this.entityCheckQueueIds = [];
24925
25139
  this.visualsManager.RemoveRegos({
24926
25140
  menuItemId: this.item.id
@@ -24963,7 +25177,8 @@ var DataLabRenderManager;
24963
25177
  await this.renderDataLabEntities(entities, true);
24964
25178
  }
24965
25179
  else {
24966
- this.distributeForRender(entities);
25180
+ // The skip gate cannot see an edited copy, so handed-in Entities are drawn forced.
25181
+ this.distributeForRender(entities, true);
24967
25182
  }
24968
25183
  }
24969
25184
  else {
@@ -25086,15 +25301,28 @@ var DataLabRenderManager;
25086
25301
  }
25087
25302
  }
25088
25303
  }
25089
- distributeForRender(entities) {
25304
+ distributeForRender(entities, force = false) {
25090
25305
  if (this.disposed || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
25091
25306
  return;
25092
25307
  }
25308
+ if (force) {
25309
+ entities.forEach(x => this.renderQueueForced.add(x));
25310
+ }
25093
25311
  this.renderQueue = this.renderQueue.concat(entities);
25094
25312
  if (!this.renderQueueInterval && this.renderQueue.length) {
25095
25313
  this.renderQueueInterval = setInterval(() => {
25096
- const batch = this.deduplicateEntities(this.renderQueue.splice(0, BATCH_SIZE$3));
25097
- this.renderDataLabEntities(batch);
25314
+ const taken = this.renderQueue.splice(0, BATCH_SIZE$3);
25315
+ // Read before de-duplicating, so a copy it drops does not stay in the set.
25316
+ const takenForced = new Set(taken.filter(x => this.renderQueueForced.delete(x)));
25317
+ const batch = this.deduplicateEntities(taken);
25318
+ const forced = batch.filter(x => takenForced.has(x));
25319
+ const rest = batch.filter(x => !takenForced.has(x));
25320
+ if (forced.length) {
25321
+ this.renderDataLabEntities(forced, true);
25322
+ }
25323
+ if (rest.length) {
25324
+ this.renderDataLabEntities(rest);
25325
+ }
25098
25326
  if (this.renderQueue.length <= 0) {
25099
25327
  clearInterval(this.renderQueueInterval);
25100
25328
  this.renderQueueInterval = null;
@@ -25126,7 +25354,7 @@ var DataLabRenderManager;
25126
25354
  return next;
25127
25355
  }
25128
25356
  async doRenderDataLabEntities(entities, force = false) {
25129
- var _a, _b, _c;
25357
+ var _a, _b, _c, _d, _e;
25130
25358
  if (this.disposed || this.viewer.isDestroyed() || !(entities === null || entities === void 0 ? void 0 : entities.length)) {
25131
25359
  return;
25132
25360
  }
@@ -25175,7 +25403,9 @@ var DataLabRenderManager;
25175
25403
  tagIds: entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [],
25176
25404
  name: cEntity.name,
25177
25405
  cdn: this.item.cdnEnabled,
25178
- outline: entity.Bruce.Outline
25406
+ outline: entity.Bruce.Outline,
25407
+ styleId: (_b = cEntity.styleId) !== null && _b !== void 0 ? _b : undefined,
25408
+ styleEffective: (_c = cEntity.styleEffective) !== null && _c !== void 0 ? _c : undefined
25179
25409
  },
25180
25410
  requestRender: false
25181
25411
  });
@@ -25184,10 +25414,12 @@ var DataLabRenderManager;
25184
25414
  rego.name = cEntity.name;
25185
25415
  rego.visual = cEntity;
25186
25416
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
25417
+ rego.styleId = cEntity.styleId;
25418
+ rego.styleEffective = cEntity.styleEffective;
25187
25419
  rego.tagIds = entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [];
25188
- rego.outline = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Outline;
25420
+ rego.outline = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.Outline;
25189
25421
  rego.cdn = this.item.cdnEnabled;
25190
- rego.schema = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.Schema;
25422
+ rego.schema = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.Schema;
25191
25423
  rego.canEdit = canEdit;
25192
25424
  if (rego.stale) {
25193
25425
  this.visualsManager.RefreshMark({
@@ -25263,6 +25495,7 @@ var DataLabRenderManager;
25263
25495
  renderSignature: Manager.GetRenderSignature(this.item)
25264
25496
  };
25265
25497
  this.renderQueue = [];
25498
+ this.renderQueueForced.clear();
25266
25499
  this.queryLoadId += 1;
25267
25500
  this.disposed = true;
25268
25501
  return payload;
@@ -26701,6 +26934,7 @@ var TilesetEntitiesRenderManager;
26701
26934
  api: api,
26702
26935
  cTileset: this.cTileset,
26703
26936
  fallbackStyleId: this.item.styleId,
26937
+ styleOverlay: MenuItemStyleOverlay.Get(this.item),
26704
26938
  styleMapping: [],
26705
26939
  expandSources: false,
26706
26940
  menuItemId: this.item.id,
@@ -26923,7 +27157,8 @@ var TilesetEntitiesRenderManager;
26923
27157
  if (Manager.NeedsStyler(item)) {
26924
27158
  this.styler.UpdateStyleMapping({
26925
27159
  styleMapping: [],
26926
- fallbackStyleId: item.styleId
27160
+ fallbackStyleId: item.styleId,
27161
+ styleOverlay: MenuItemStyleOverlay.Get(item)
26927
27162
  });
26928
27163
  }
26929
27164
  }
@@ -27074,6 +27309,7 @@ var TilesetEntitiesRenderManager;
27074
27309
  api: this.getters.GetBruceApi(),
27075
27310
  cTileset: this.cTileset,
27076
27311
  fallbackStyleId: this.item.styleId,
27312
+ styleOverlay: MenuItemStyleOverlay.Get(this.item),
27077
27313
  styleMapping: [],
27078
27314
  expandSources: false,
27079
27315
  menuItemId: this.item.id,
@@ -28001,6 +28237,7 @@ var TilesetArbRenderManager;
28001
28237
  api: api,
28002
28238
  cTileset: this.cTileset,
28003
28239
  fallbackStyleId: this.item.styleId,
28240
+ styleOverlay: MenuItemStyleOverlay.Get(this.item),
28004
28241
  styleMapping: this.item.StyleMapping,
28005
28242
  expandSources: false,
28006
28243
  menuItemId: this.item.id,
@@ -28196,7 +28433,8 @@ var TilesetArbRenderManager;
28196
28433
  if (this.item.ApplyStyles || this.item.Type == MenuItem.EType.IonTileset) {
28197
28434
  this.styler.UpdateStyleMapping({
28198
28435
  styleMapping: (_a = this.item.StyleMapping) !== null && _a !== void 0 ? _a : [],
28199
- fallbackStyleId: this.item.styleId
28436
+ fallbackStyleId: this.item.styleId,
28437
+ styleOverlay: MenuItemStyleOverlay.Get(this.item)
28200
28438
  });
28201
28439
  }
28202
28440
  }
@@ -32068,6 +32306,9 @@ var MenuItemManager;
32068
32306
  get Viewer() {
32069
32307
  return this.viewer;
32070
32308
  }
32309
+ get StyleOverlay() {
32310
+ return this.styleOverlay;
32311
+ }
32071
32312
  get VisualsRegister() {
32072
32313
  return this.visualsRegister;
32073
32314
  }
@@ -32128,6 +32369,9 @@ var MenuItemManager;
32128
32369
  this.pendingHandoffPool = [];
32129
32370
  // The settings bookmark alternations overwrite on a view's items, as that view authored them.
32130
32371
  this.authoredAlternations = new WeakMap();
32372
+ // Laid over each item's own style where it can take one, including items rendered after it was set.
32373
+ this.styleOverlay = null;
32374
+ this.styleOverlayCounter = 0;
32131
32375
  this.onUpdate = null;
32132
32376
  // Segments discovered so far per menu item ID.
32133
32377
  this.seriesSegments = new Map();
@@ -32209,12 +32453,17 @@ var MenuItemManager;
32209
32453
  }
32210
32454
  // An item with a style set renders its first style unless the caller already picked one of them.
32211
32455
  params = { ...params, item: MenuItemStyles.Resolve(params.item) };
32456
+ // The overlay rides on the rendered copy, so the view's item never carries it.
32457
+ params = { ...params, item: MenuItemStyleOverlay.With(params.item, this.styleOverlay) };
32212
32458
  let rItem = this.items.find(x => x.id == params.item.id);
32213
32459
  let create = true;
32214
32460
  // Item already exists so we'll check if we should re-create it.
32215
32461
  if (rItem) {
32216
- // Only the picked style changed, so what is drawn gets restyled rather than rebuilt.
32217
- if (MenuItemStyles.IsStyleChangeOnly(rItem.item, params.item) && this.isStyleSwapCapable(rItem.renderManager)) {
32462
+ // Only the style pick or overlay changed, so the drawn graphics are restyled, not rebuilt.
32463
+ const aligned = MenuItemStyleOverlay.With(rItem.item, MenuItemStyleOverlay.Get(params.item));
32464
+ const pickOnly = MenuItemStyles.IsStyleChangeOnly(aligned, params.item);
32465
+ const restyleOnly = pickOnly || MenuItemStyleOverlay.IsChangeOnly(rItem.item, params.item);
32466
+ if (restyleOnly && this.isStyleSwapCapable(rItem.renderManager)) {
32218
32467
  rItem.renderManager.SwapStyle(params.item);
32219
32468
  rItem.item = params.item;
32220
32469
  create = false;
@@ -32661,6 +32910,45 @@ var MenuItemManager;
32661
32910
  (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger({ isEnabling: true, itemId: rItem.id });
32662
32911
  return true;
32663
32912
  }
32913
+ /**
32914
+ * Lays a style, inline or by record, over every item that can take one; null clears it.
32915
+ */
32916
+ async SetStyleOverlay(params) {
32917
+ var _a, _b, _c;
32918
+ const counter = ++this.styleOverlayCounter;
32919
+ let overlay = (_a = params === null || params === void 0 ? void 0 : params.style) !== null && _a !== void 0 ? _a : null;
32920
+ if (!overlay && (params === null || params === void 0 ? void 0 : params.styleId) != null && params.styleId !== "" && params.styleId != -1) {
32921
+ // A record that fails to load leaves every item on its own style.
32922
+ try {
32923
+ const { style } = await Style.Get({
32924
+ api: this.getters.GetBruceApi(),
32925
+ styleId: params.styleId
32926
+ });
32927
+ overlay = (_b = style === null || style === void 0 ? void 0 : style.Settings) !== null && _b !== void 0 ? _b : null;
32928
+ }
32929
+ catch (e) {
32930
+ console.error(e);
32931
+ }
32932
+ }
32933
+ // A later call won while the record loaded.
32934
+ if (counter !== this.styleOverlayCounter) {
32935
+ return;
32936
+ }
32937
+ this.styleOverlay = overlay;
32938
+ for (const rItem of this.items) {
32939
+ const next = MenuItemStyleOverlay.With(rItem.item, overlay);
32940
+ // Setting the same overlay again would otherwise restyle every feature for nothing.
32941
+ const unchanged = JSON.stringify(MenuItemStyleOverlay.Get(next)) === JSON.stringify(MenuItemStyleOverlay.Get(rItem.item));
32942
+ if (unchanged ||
32943
+ !this.isStyleSwapCapable(rItem.renderManager) ||
32944
+ rItem.renderManager.Disposed) {
32945
+ continue;
32946
+ }
32947
+ rItem.renderManager.SwapStyle(next);
32948
+ rItem.item = next;
32949
+ (_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger({ isEnabling: true, itemId: rItem.id });
32950
+ }
32951
+ }
32664
32952
  /*
32665
32953
  * Picks the child the caller asked for, else the one already enabled, else the first.
32666
32954
  */
@@ -46590,15 +46878,16 @@ var RenderManager;
46590
46878
  */
46591
46879
  function GetZoomControlSignature(zoomControl) {
46592
46880
  return JSON.stringify([].concat(zoomControl !== null && zoomControl !== void 0 ? zoomControl : []).map((zoomItem) => {
46593
- var _a, _b, _c, _d, _e, _f, _g;
46881
+ var _a, _b, _c, _d, _e, _f, _g, _h;
46594
46882
  return ({
46595
46883
  MinZoom: (_a = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.MinZoom) !== null && _a !== void 0 ? _a : null,
46596
46884
  MaxZoom: (_b = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.MaxZoom) !== null && _b !== void 0 ? _b : null,
46597
46885
  DisplayType: (_c = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.DisplayType) !== null && _c !== void 0 ? _c : null,
46598
46886
  StyleID: (_d = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) !== null && _d !== void 0 ? _d : null,
46599
46887
  Style: (_e = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.Style) !== null && _e !== void 0 ? _e : null,
46600
- LODCategoryID: (_f = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODCategoryID) !== null && _f !== void 0 ? _f : null,
46601
- LODLevel: (_g = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODLevel) !== null && _g !== void 0 ? _g : null
46888
+ StyleOverlay: (_f = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleOverlay) !== null && _f !== void 0 ? _f : null,
46889
+ LODCategoryID: (_g = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODCategoryID) !== null && _g !== void 0 ? _g : null,
46890
+ LODLevel: (_h = zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.LODLevel) !== null && _h !== void 0 ? _h : null
46602
46891
  });
46603
46892
  }));
46604
46893
  }
@@ -47868,7 +48157,8 @@ var EntityRenderEnginePoint;
47868
48157
  for (let i = 0; i < params.entities.length; i++) {
47869
48158
  const entity = params.entities[i];
47870
48159
  const zoomItem = params.zoomItems[entity.Bruce.ID];
47871
- 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;
48160
+ 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;
48161
+ const style = MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
47872
48162
  // Pass through tags that may be needed for styling.
47873
48163
  const tagIds = entity.Bruce["Layer.ID"];
47874
48164
  const tags = [];
@@ -48701,6 +48991,10 @@ var EntityRenderEngineModel3d;
48701
48991
  trackEntity._parentEntity = cEntity;
48702
48992
  }
48703
48993
  cEntity._siblingGraphics = siblings;
48994
+ cEntity.styleEffective = StyleEffective.Combine([
48995
+ { key: "color", effective: fillColorTrace.effective },
48996
+ { key: "scale", effective: scaleTrace.effective }
48997
+ ]);
48704
48998
  return cEntity;
48705
48999
  }
48706
49000
  EntityRenderEngineModel3d.Render = Render;
@@ -48711,7 +49005,7 @@ var EntityRenderEngineModel3d;
48711
49005
  * @returns
48712
49006
  */
48713
49007
  async function RenderGroup(params) {
48714
- var _a, _b, _c, _d, _e, _f, _g;
49008
+ var _a, _b, _c, _d, _e, _f, _g, _h;
48715
49009
  const api = params.apiGetter.getApi();
48716
49010
  await api.Loading;
48717
49011
  const cEntities = new Map();
@@ -48748,7 +49042,8 @@ var EntityRenderEngineModel3d;
48748
49042
  for (let i = 0; i < params.entities.length; i++) {
48749
49043
  const entity = params.entities[i];
48750
49044
  const zoomItem = params.zoomItems[entity.Bruce.ID];
48751
- 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;
49045
+ 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;
49046
+ const style = MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
48752
49047
  // Pass through tags that may be needed for styling.
48753
49048
  const tagIds = entity.Bruce["Layer.ID"];
48754
49049
  const tags = [];
@@ -48787,8 +49082,8 @@ var EntityRenderEngineModel3d;
48787
49082
  for (let i = 0; i < params.entities.length; i++) {
48788
49083
  const entity = params.entities[i];
48789
49084
  const zoomItem = params.zoomItems[entity.Bruce.ID];
48790
- const styleRecord = (!params.offline && zoomItem.StyleID != -1) ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
48791
- const style = (!params.offline && zoomItem.StyleID != -1) ? styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.Settings : zoomItem.Style;
49085
+ 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;
49086
+ const style = MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
48792
49087
  const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
48793
49088
  if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
48794
49089
  continue;
@@ -48807,21 +49102,21 @@ var EntityRenderEngineModel3d;
48807
49102
  let rego = null;
48808
49103
  // Only used for historic tracks right now.
48809
49104
  // So won't bother getting it if we don't have historic data.
48810
- if ((_c = params.entitiesHistoric) === null || _c === void 0 ? void 0 : _c[entity.Bruce.ID]) {
49105
+ if ((_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]) {
48811
49106
  rego = params.visualRegister.GetRego({
48812
49107
  entityId: entity.Bruce.ID,
48813
49108
  menuItemId: params.menuItemId
48814
49109
  });
48815
49110
  }
48816
- const mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
49111
+ const mStyle = (_e = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _e !== void 0 ? _e : {};
48817
49112
  const cEntity = Render({
48818
- rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
49113
+ rendered: (_f = params.rendered) === null || _f === void 0 ? void 0 : _f.get(entity.Bruce.ID),
48819
49114
  entity: entity,
48820
- entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
49115
+ entityHistoric: (_g = params.entitiesHistoric) === null || _g === void 0 ? void 0 : _g[entity.Bruce.ID],
48821
49116
  style: mStyle,
48822
49117
  tags: tags,
48823
49118
  viewer: params.viewer,
48824
- lodUrl: (_g = lod.url) !== null && _g !== void 0 ? _g : ClientFile.GetUrl({
49119
+ lodUrl: (_h = lod.url) !== null && _h !== void 0 ? _h : ClientFile.GetUrl({
48825
49120
  api,
48826
49121
  fileId: lod.clientFileId,
48827
49122
  viaCdn: true
@@ -48837,7 +49132,8 @@ var EntityRenderEngineModel3d;
48837
49132
  const name = await getName$1(api, entity, params.offline);
48838
49133
  cEntity.name = name;
48839
49134
  cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
48840
- cEntity.styleId = zoomItem.StyleID == -1 ? -1 : styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.ID;
49135
+ // The skip gate compares this with the zoom item, so it must not name the type default.
49136
+ cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
48841
49137
  cEntities.set(entity.Bruce.ID, cEntity);
48842
49138
  }
48843
49139
  }
@@ -49276,7 +49572,8 @@ var EntityRenderEnginePolyline;
49276
49572
  for (let i = 0; i < params.entities.length; i++) {
49277
49573
  const entity = params.entities[i];
49278
49574
  const zoomItem = params.zoomItems[entity.Bruce.ID];
49279
- 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;
49575
+ 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;
49576
+ const style = MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
49280
49577
  // Pass through tags that may be needed for styling.
49281
49578
  const tagIds = entity.Bruce["Layer.ID"];
49282
49579
  const tags = [];
@@ -53954,7 +54251,8 @@ var EntityRenderEnginePolygon;
53954
54251
  for (let i = 0; i < params.entities.length; i++) {
53955
54252
  const entity = params.entities[i];
53956
54253
  const zoomItem = params.zoomItems[entity.Bruce.ID];
53957
- 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;
54254
+ 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;
54255
+ const style = MenuItemStyleOverlay.ApplyRow(ownStyle, zoomItem);
53958
54256
  // Pass through tags that may be needed for styling.
53959
54257
  const tagIds = entity.Bruce["Layer.ID"];
53960
54258
  const tags = [];
@@ -56225,7 +56523,7 @@ var StyleUtils;
56225
56523
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
56226
56524
  })(StyleUtils || (StyleUtils = {}));
56227
56525
 
56228
- const VERSION = "7.6.5";
56526
+ const VERSION = "7.6.7";
56229
56527
  /**
56230
56528
  * Updates the environment instance used by bruce-cesium to one specified.
56231
56529
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
@@ -56242,5 +56540,5 @@ const getENVIRONMENT = () => {
56242
56540
  return ENVIRONMENT;
56243
56541
  };
56244
56542
 
56245
- export { VERSION, setENVIRONMENT, getENVIRONMENT, ClusterItems, PointClustering, PointClusterSize, CesiumAnimatedInOut, DisplacedSurfacePrimitive, CesiumAnimatedProperty, isStyleChanged, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, extractMetadataFromFileUrl, EntityRenderEnginePolygon, EntityRenderEnginePolyline, TextureFrameSeriesAnimator, TextureValueLabels, MenuItemCreator, MenuItemManager, MenuItemStyles, CesiumParabola, EntityLabel, EntityLabelGroup, LiveCursor, SharedGetters, EntitySimulation, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualRegisterCuller, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, DEFAULT_BRIGHTNESS_SHIFT, DEFAULT_LIGHT_INTENSITY, LIGHTING_SETTINGS_VERSION, LIGHT_INTENSITY_COMPENSATION, MAX_COMPENSATED_LIGHT_INTENSITY, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, WidgetLeftPanelTabDashboard, EMenuItemState, WidgetLeftPanelTabMenuItems, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, ECursor, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, CreateTabIconSvg, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
56543
+ export { VERSION, setENVIRONMENT, getENVIRONMENT, ClusterItems, PointClustering, PointClusterSize, CesiumAnimatedInOut, DisplacedSurfacePrimitive, CesiumAnimatedProperty, isStyleChanged, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, extractMetadataFromFileUrl, EntityRenderEnginePolygon, EntityRenderEnginePolyline, TextureFrameSeriesAnimator, TextureValueLabels, MenuItemCreator, MenuItemManager, MenuItemStyles, MenuItemStyleOverlay, CesiumParabola, EntityLabel, EntityLabelGroup, LiveCursor, SharedGetters, EntitySimulation, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualRegisterCuller, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, DEFAULT_BRIGHTNESS_SHIFT, DEFAULT_LIGHT_INTENSITY, LIGHTING_SETTINGS_VERSION, LIGHT_INTENSITY_COMPENSATION, MAX_COMPENSATED_LIGHT_INTENSITY, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, WidgetLeftPanelTabDashboard, EMenuItemState, WidgetLeftPanelTabMenuItems, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, ECursor, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, CreateTabIconSvg, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
56246
56544
  //# sourceMappingURL=bruce-cesium.es5.js.map