bruce-cesium 5.2.0 → 5.2.1

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.
@@ -16833,7 +16833,7 @@
16833
16833
  this.renderPriority = 0;
16834
16834
  }
16835
16835
  (async () => {
16836
- var _a, _b;
16836
+ var _a, _b, _c;
16837
16837
  let api = this.getters.GetBruceApi();
16838
16838
  let coords = null;
16839
16839
  let tileset = null;
@@ -16890,13 +16890,33 @@
16890
16890
  if (!tileset || this.disposed) {
16891
16891
  return;
16892
16892
  }
16893
+ // Get the model tree if it's in a separate file.
16894
+ // There is a setting that is more explicit but it's lying on the file name so can't trust it yet.
16895
+ if (((_a = tileset.settings) === null || _a === void 0 ? void 0 : _a["tilesetVersion"]) > 1) {
16896
+ try {
16897
+ const modelTreeUrl = BModels.Tileset.GetFileUrl({
16898
+ api: api,
16899
+ file: "model_tree.json",
16900
+ tilesetId: tileset.id,
16901
+ cacheToken: tileset.generateVersion,
16902
+ viaCdn: Boolean(this.item.cdnEnabled == null ? true : this.item.cdnEnabled)
16903
+ });
16904
+ this.modelTree = await api.get(modelTreeUrl);
16905
+ }
16906
+ catch (e) {
16907
+ console.error(e);
16908
+ }
16909
+ }
16910
+ if (this.disposed) {
16911
+ return;
16912
+ }
16893
16913
  // Render outside the shared process because we can't control file requests from Cesium.
16894
16914
  const cTileset = this.cTileset = await exports.TilesetRenderEngine.Render({
16895
16915
  apiGetter: this.getters.GetBruceGetter(),
16896
16916
  tileset: tileset,
16897
16917
  viewer: this.viewer,
16898
16918
  coords: coords,
16899
- accountId: (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId(),
16919
+ accountId: (_c = (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID) !== null && _c !== void 0 ? _c : this.getters.GetAccountId(),
16900
16920
  viaCdn: Boolean(this.item.cdnEnabled == null ? true : this.item.cdnEnabled),
16901
16921
  noMemoryLimit: this.item["noMaximumMemory"]
16902
16922
  });
@@ -17017,7 +17037,7 @@
17017
17037
  }
17018
17038
  };
17019
17039
  const setByEntityId = () => {
17020
- const bruceIdProp = propertyNames.find(x => String(x).toLowerCase() == "bruceid");
17040
+ const bruceIdProp = propertyNames.find(x => (String(x).toLowerCase() == "bruceid"));
17021
17041
  if (bruceIdProp) {
17022
17042
  rego.entityId = feature.getProperty(bruceIdProp);
17023
17043
  }
@@ -17075,6 +17095,13 @@
17075
17095
  getMetaByGeomId(geomId, tileset) {
17076
17096
  var _a;
17077
17097
  let modelTree = (_a = tileset === null || tileset === void 0 ? void 0 : tileset.extensions) === null || _a === void 0 ? void 0 : _a.modelTree;
17098
+ // Wasn't inside tileset.json and instead in a separate file.
17099
+ if (!modelTree) {
17100
+ modelTree = this.modelTree;
17101
+ }
17102
+ if (!modelTree) {
17103
+ return null;
17104
+ }
17078
17105
  return this.digMetaByGeomId(geomId, modelTree, [], 0);
17079
17106
  }
17080
17107
  digMetaByGeomId(geomId, branch, path, depth) {
@@ -29785,7 +29812,7 @@
29785
29812
  }
29786
29813
  }
29787
29814
 
29788
- const VERSION = "5.2.0";
29815
+ const VERSION = "5.2.1";
29789
29816
 
29790
29817
  exports.VERSION = VERSION;
29791
29818
  exports.isHistoricMetadataChanged = isHistoricMetadataChanged;