bruce-cesium 2.6.7 → 2.6.9

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.
@@ -6968,10 +6968,11 @@
6968
6968
  enumerable: false,
6969
6969
  configurable: true
6970
6970
  });
6971
- Styler.prototype.QueueEntities = function (entities) {
6971
+ Styler.prototype.QueueEntities = function (entities, highPriority) {
6972
+ if (highPriority === void 0) { highPriority = false; }
6972
6973
  for (var i = 0; i < entities.length; i++) {
6973
6974
  var entity = entities[i];
6974
- this.queueTilesetFeatureStyle(entity);
6975
+ this.queueTilesetFeatureStyle(entity, highPriority);
6975
6976
  }
6976
6977
  if (this.recordLoadQueue.length > 0) {
6977
6978
  this.processQueue();
@@ -7250,7 +7251,7 @@
7250
7251
  var entityId = batch[i];
7251
7252
  var entity = _this.getEntityRego(entityId);
7252
7253
  if (entity) {
7253
- _this.queueTilesetFeatureStyle(entity);
7254
+ _this.queueTilesetFeatureStyle(entity, false);
7254
7255
  }
7255
7256
  }
7256
7257
  _this.viewer.scene.requestRender();
@@ -7264,7 +7265,7 @@
7264
7265
  });
7265
7266
  });
7266
7267
  };
7267
- Styler.prototype.queueTilesetFeatureStyle = function (entity) {
7268
+ Styler.prototype.queueTilesetFeatureStyle = function (entity, highPriority) {
7268
7269
  if (this.styleMappingLoaded || this.styleMappingsLoaded[entity.entityTypeId] == true) {
7269
7270
  var needsData = this.getTilesetFeatureNeedsFullData(entity.entityId, entity.entityTypeId);
7270
7271
  if (needsData) {
@@ -7277,7 +7278,12 @@
7277
7278
  }
7278
7279
  }
7279
7280
  else {
7280
- this.recordCheckQueue.push(entity.entityId);
7281
+ if (highPriority) {
7282
+ this.recordCheckQueue.unshift(entity.entityId);
7283
+ }
7284
+ else {
7285
+ this.recordCheckQueue.push(entity.entityId);
7286
+ }
7281
7287
  }
7282
7288
  };
7283
7289
  Styler.prototype.styleTilesetFeature = function (entity) {
@@ -7723,7 +7729,7 @@
7723
7729
  if (entityIds != null) {
7724
7730
  regos = regos.filter(function (r) { return entityIds.indexOf(r.entityId) >= 0; });
7725
7731
  }
7726
- this.styler.QueueEntities(regos);
7732
+ this.styler.QueueEntities(regos, true);
7727
7733
  return [2 /*return*/];
7728
7734
  });
7729
7735
  });
@@ -8187,19 +8193,53 @@
8187
8193
  return [2 /*return*/];
8188
8194
  }
8189
8195
  (function () { return __awaiter(_this, void 0, void 0, function () {
8190
- var api, tileset, cTileset, _a;
8196
+ var canAccess, e_1, accountId, api, tileset, cTileset, _a;
8191
8197
  var _this = this;
8192
- var _b, _c;
8193
- return __generator(this, function (_d) {
8194
- switch (_d.label) {
8198
+ var _b, _c, _d;
8199
+ return __generator(this, function (_e) {
8200
+ switch (_e.label) {
8195
8201
  case 0:
8196
- api = this.getters.GetBruceApi();
8202
+ if (!tilesetId) return [3 /*break*/, 5];
8203
+ canAccess = false;
8204
+ _e.label = 1;
8205
+ case 1:
8206
+ _e.trys.push([1, 3, , 4]);
8207
+ return [4 /*yield*/, bruceModels.Tileset.Publish.IsAccessAllowed({
8208
+ sourceAccountId: (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID,
8209
+ tilesetId: tilesetId,
8210
+ forAccountId: this.getters.GetAccountId(),
8211
+ api: this.getters.GetGlobalApi()
8212
+ })];
8213
+ case 2:
8214
+ canAccess = _e.sent();
8215
+ return [3 /*break*/, 4];
8216
+ case 3:
8217
+ e_1 = _e.sent();
8218
+ console.error(e_1);
8219
+ return [3 /*break*/, 4];
8220
+ case 4:
8221
+ if (!canAccess) {
8222
+ console.warn("Cannot access tileset: ".concat(tilesetId, ", from account: ").concat((_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.ClientAccountID, "."));
8223
+ return [2 /*return*/];
8224
+ }
8225
+ return [3 /*break*/, 6];
8226
+ case 5:
8227
+ console.warn("No tileset id found. Skipping access check.");
8228
+ _e.label = 6;
8229
+ case 6:
8230
+ accountId = (_d = this.item.tileset) === null || _d === void 0 ? void 0 : _d.ClientAccountID;
8231
+ if (!accountId) {
8232
+ accountId = this.getters.GetAccountId();
8233
+ }
8234
+ api = this.getters.GetBruceApi({
8235
+ accountId: accountId
8236
+ });
8197
8237
  return [4 /*yield*/, bruceModels.Tileset.Get({
8198
8238
  api: api,
8199
8239
  tilesetId: tilesetId
8200
8240
  })];
8201
- case 1:
8202
- tileset = (_d.sent()).tileset;
8241
+ case 7:
8242
+ tileset = (_e.sent()).tileset;
8203
8243
  if (!tileset || this.disposed) {
8204
8244
  return [2 /*return*/];
8205
8245
  }
@@ -8209,11 +8249,11 @@
8209
8249
  apiGetter: this.getters.GetBruceGetter(),
8210
8250
  tileset: tileset,
8211
8251
  viewer: this.viewer,
8212
- accountId: (_c = (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID) !== null && _c !== void 0 ? _c : this.getters.GetAccountId(),
8252
+ accountId: accountId,
8213
8253
  viaCdn: this.item.cdnEnabled
8214
8254
  })];
8215
- case 2:
8216
- cTileset = _a.cTileset = _d.sent();
8255
+ case 8:
8256
+ cTileset = _a.cTileset = _e.sent();
8217
8257
  if (this.disposed) {
8218
8258
  this.doDispose();
8219
8259
  return [2 /*return*/];
@@ -15122,7 +15162,7 @@
15122
15162
  ViewerUtils.CreateWidgets = CreateWidgets;
15123
15163
  })(exports.ViewerUtils || (exports.ViewerUtils = {}));
15124
15164
 
15125
- var VERSION$1 = "2.6.7";
15165
+ var VERSION$1 = "2.6.9";
15126
15166
 
15127
15167
  exports.VERSION = VERSION$1;
15128
15168
  exports.CesiumViewMonitor = CesiumViewMonitor;