bruce-cesium 5.2.1 → 5.2.3

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.
@@ -12145,7 +12145,7 @@
12145
12145
  const minMax = exports.RenderManager.GetZoomMinMax({
12146
12146
  zoomControl: this.zoomControl
12147
12147
  });
12148
- this.getter.IncludeMenuItem(this.item.id, (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [], minMax[0], minMax[1]);
12148
+ this.getter.IncludeMenuItem(this.item.id, this.item.BruceEntity["EntityType.ID"], (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [], minMax[0], minMax[1]);
12149
12149
  this.getterSub = this.getter.OnUpdate.Subscribe((entities) => {
12150
12150
  if (isTagItem) {
12151
12151
  this.distributeForRender(entities.filter((entity) => {
@@ -14580,7 +14580,8 @@
14580
14580
  const RETRY_DELAY_INCREMENT = 500;
14581
14581
  const REQUEST_PAGE_DELAY = 50;
14582
14582
  class regMenuItemGetter {
14583
- constructor(tagIds, minHeight, maxHeight) {
14583
+ constructor(typeId, tagIds, minHeight, maxHeight) {
14584
+ this.TypeId = typeId;
14584
14585
  this.TagIds = tagIds;
14585
14586
  this.MinHeight = minHeight;
14586
14587
  this.MaxHeight = maxHeight;
@@ -14624,6 +14625,9 @@
14624
14625
  }
14625
14626
  return this.onScanUpdate;
14626
14627
  }
14628
+ get isLooping() {
14629
+ return this.looping > 0;
14630
+ }
14627
14631
  constructor(params) {
14628
14632
  this.onUpdate = null;
14629
14633
  this.LastStateUpdates = {};
@@ -14636,6 +14640,7 @@
14636
14640
  this.registeredItems = {};
14637
14641
  this.getterLoopId = 0;
14638
14642
  this.getterLoopAbortControllers = {};
14643
+ this.looping = 0;
14639
14644
  this.tagIds = null;
14640
14645
  this.minHeight = 0;
14641
14646
  this.maxHeight = 100000;
@@ -14647,9 +14652,9 @@
14647
14652
  // We use this for refreshing historic data without having to repeat geographic queries.
14648
14653
  this.gatheredIntegrity = null;
14649
14654
  this.gatheredEntityIds = [];
14650
- const { api, viewer, viewPort, typeId, schemaId, batchSize, attrFilter, historicAttrKey, historicInterpolation, historic, viaCdn, scenario } = params;
14655
+ const { api, viewer, viewPort, typeIds, schemaId, batchSize, attrFilter, historicAttrKey, historicInterpolation, historic, viaCdn, scenario } = params;
14651
14656
  this.api = api;
14652
- this.typeId = typeId;
14657
+ this.typeIds = typeIds;
14653
14658
  this.schemaId = schemaId;
14654
14659
  this.historic = Boolean(historic);
14655
14660
  this.historicAttrKey = historicAttrKey;
@@ -14679,6 +14684,9 @@
14679
14684
  if (this.scenario) {
14680
14685
  integrity += this.scenario;
14681
14686
  }
14687
+ if (this.typeIds) {
14688
+ integrity += this.typeIds.join();
14689
+ }
14682
14690
  return integrity;
14683
14691
  }
14684
14692
  viewAreaSub() {
@@ -14776,14 +14784,14 @@
14776
14784
  GetMenuItems() {
14777
14785
  return Object.keys(this.registeredItems);
14778
14786
  }
14779
- IncludeMenuItem(menuItemId, layerIds, minHeight, maxHeight) {
14780
- this.registeredItems[menuItemId] = new regMenuItemGetter(layerIds, minHeight, maxHeight);
14787
+ IncludeMenuItem(menuItemId, typeId, layerIds, minHeight, maxHeight) {
14788
+ this.registeredItems[menuItemId] = new regMenuItemGetter(typeId, layerIds, minHeight, maxHeight);
14781
14789
  this.updateState();
14782
14790
  }
14783
14791
  ExcludeMenuItem(menuItemId) {
14784
14792
  this.registeredItems[menuItemId] = null;
14785
14793
  delete this.registeredItems[menuItemId];
14786
- this.updateState();
14794
+ this.updateState(true);
14787
14795
  }
14788
14796
  updateBounds() {
14789
14797
  const viewRect = this.viewPort.GetBounds();
@@ -14799,8 +14807,9 @@
14799
14807
  this.viewCenter = poi;
14800
14808
  }
14801
14809
  }
14802
- updateState() {
14810
+ updateState(onlyIfLooping = false) {
14803
14811
  const tagIds = [];
14812
+ const typeIds = [];
14804
14813
  const menuItemIds = this.GetMenuItems();
14805
14814
  let minHeight = null;
14806
14815
  let maxHeight = null;
@@ -14822,12 +14831,19 @@
14822
14831
  }
14823
14832
  }
14824
14833
  }
14834
+ const itemTypeId = menuItem.TypeId;
14835
+ if (itemTypeId) {
14836
+ if (!typeIds.includes(itemTypeId)) {
14837
+ typeIds.push(itemTypeId);
14838
+ }
14839
+ }
14825
14840
  }
14826
14841
  }
14827
- if (menuItemIds.length > 0) {
14842
+ if (menuItemIds.length > 0 && (!onlyIfLooping || this.isLooping)) {
14828
14843
  // Reset cells so none are marked as fetched.
14829
14844
  this.cells = new EntityGlobe.Grid();
14830
14845
  this.tagIds = tagIds;
14846
+ this.typeIds = typeIds;
14831
14847
  this.minHeight = minHeight;
14832
14848
  this.maxHeight = maxHeight;
14833
14849
  this.updateBounds();
@@ -14864,6 +14880,7 @@
14864
14880
  this.getterLoopAbortControllers = newAbortControllers;
14865
14881
  }
14866
14882
  const abortController = this.getterLoopAbortControllers[abortId] = new AbortController();
14883
+ this.looping += 1;
14867
14884
  (async () => {
14868
14885
  var _a, _b, _c, _d, _e, _f, _g, _h;
14869
14886
  // Larger initial delay for the first loops because terrain is likely loading in.
@@ -14924,7 +14941,7 @@
14924
14941
  nextPage: false,
14925
14942
  nextPageUrl: null
14926
14943
  };
14927
- await exports.SharedGetters.Queue.Run("Loading Entities from Menu Item that loads Entity Type: " + this.typeId, async () => {
14944
+ await exports.SharedGetters.Queue.Run("Loading Entities from Menu Item that loads Entity Type: " + this.typeIds, async () => {
14928
14945
  var _a;
14929
14946
  if (abortController.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
14930
14947
  return;
@@ -14952,7 +14969,7 @@
14952
14969
  filter: {
14953
14970
  pageSize: PAGE_SIZE,
14954
14971
  pageIndex: curCell.FetchPageIndex,
14955
- entityTypeId: this.typeId,
14972
+ entityTypeId: this.typeIds,
14956
14973
  layerIds: this.tagIds,
14957
14974
  // Any tag specified will be allowed.
14958
14975
  layerIdsOperator: "in",
@@ -15064,7 +15081,11 @@
15064
15081
  if (postedScanning) {
15065
15082
  this.postStatus({ msg: EStatus.Scanning, revoking: true });
15066
15083
  }
15067
- })();
15084
+ })().then(() => {
15085
+ this.looping -= 1;
15086
+ }).catch(() => {
15087
+ this.looping -= 1;
15088
+ });
15068
15089
  }
15069
15090
  /**
15070
15091
  * Gets the historic state of found Entities for the current date times and emits them.
@@ -15097,7 +15118,7 @@
15097
15118
  // Controller we can use to abort the request when a new loop starts.
15098
15119
  const controller = this.historicRefreshAbortController = new AbortController();
15099
15120
  let entities = [];
15100
- await exports.SharedGetters.Queue.Run("Refreshing historic data in Menu Item that loads Entity Type: " + this.typeId, async () => {
15121
+ await exports.SharedGetters.Queue.Run("Refreshing historic data in Menu Item that loads Entity Type: " + this.typeIds, async () => {
15101
15122
  var _a;
15102
15123
  if (controller.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
15103
15124
  return;
@@ -15111,7 +15132,7 @@
15111
15132
  filter: {
15112
15133
  pageSize: batch.length,
15113
15134
  pageIndex: 0,
15114
- entityTypeId: this.typeId,
15135
+ entityTypeId: this.typeIds,
15115
15136
  layerIds: this.tagIds,
15116
15137
  layerIdsOperator: "in",
15117
15138
  sortOrder: BModels.Api.ESortOrder.Asc,
@@ -15167,7 +15188,9 @@
15167
15188
  function createFilterGetterCacheKey(params) {
15168
15189
  let cacheKey = "";
15169
15190
  cacheKey += params.api.GetBaseUrl();
15170
- cacheKey += params.typeId;
15191
+ // Not including Type ID in the cache key now.
15192
+ // This allows us to re-use the same getter between Entity Types.
15193
+ // cacheKey += params.typeId;
15171
15194
  cacheKey += params.batchSize;
15172
15195
  cacheKey += String(params.cdn);
15173
15196
  cacheKey += params.schemaId ? params.schemaId : "";
@@ -15196,7 +15219,7 @@
15196
15219
  api: params.api,
15197
15220
  viewer: params.viewer,
15198
15221
  viewPort: params.monitor,
15199
- typeId: params.typeId,
15222
+ typeIds: !params.typeId ? null : typeof params.typeId == "string" ? [params.typeId] : params.typeId,
15200
15223
  schemaId: params.schemaId,
15201
15224
  batchSize: params.batchSize,
15202
15225
  attrFilter: params.attrFilter,
@@ -29812,7 +29835,7 @@
29812
29835
  }
29813
29836
  }
29814
29837
 
29815
- const VERSION = "5.2.1";
29838
+ const VERSION = "5.2.3";
29816
29839
 
29817
29840
  exports.VERSION = VERSION;
29818
29841
  exports.isHistoricMetadataChanged = isHistoricMetadataChanged;