bruce-cesium 6.8.5 → 6.8.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.
@@ -1,6 +1,6 @@
1
1
  import * as Cesium from 'cesium';
2
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, HeightReference, ColorBlendMode, HeadingPitchRoll, Math as Math$1, Transforms, ShadowMode, Cartesian3, ClassificationType, Model, JulianDate, Quaternion, Matrix4, PolygonHierarchy, ConstantPositionProperty, PolylineGraphics, ArcType, CornerType, HorizontalOrigin, VerticalOrigin, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, IonResource, Cesium3DTileset, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
- import { Cartes, Entity as Entity$1, ENVIRONMENT, Calculator, ClientFile, EntityLod, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Bounds, Geometry, Carto, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, Api, DelayQueue, EntityHistoricData, DataLab, BruceApi, EntityRelation, AccountConcept, RecordChangeFeed, ProgramKey, EntitySource, Camera, ProjectViewTile, ProjectViewLegacyTile, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType } from 'bruce-models';
2
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, HeightReference, ColorBlendMode, HeadingPitchRoll, Math as Math$1, Transforms, ShadowMode, Cartesian3, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, ArcType, CornerType, JulianDate, Quaternion, Matrix4, PolygonHierarchy, PolylineGraphics, Cartesian2, SceneTransforms, Rectangle, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, Cesium3DTileColorBlendMode, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, Cesium3DTileset, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
+ import { Cartes, Entity as Entity$1, ENVIRONMENT, Calculator, ClientFile, EntityLod, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Api, Carto, Geometry, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, Bounds, BruceEvent, EntityCoords, DataLab, DelayQueue, EntityHistoricData, BruceApi, EntityRelation, ProgramKey, EntitySource, ProjectViewLegacyTile, ProjectViewTile, AccountConcept, RecordChangeFeed, Camera, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType } from 'bruce-models';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -14290,7 +14290,7 @@ var TilesetCadRenderManager;
14290
14290
  // We calculate it here instead of relying on the render engine as we need to extract the model-tree from it.
14291
14291
  let loadUrl = null;
14292
14292
  (async () => {
14293
- var _a, _b, _c, _d;
14293
+ var _a, _b, _c, _d, _e;
14294
14294
  if (!this.initQueue) {
14295
14295
  await delay(INIT_BATCH_DELAY_MS);
14296
14296
  if (this.disposed) {
@@ -14375,7 +14375,8 @@ var TilesetCadRenderManager;
14375
14375
  // TODO: this is a problem as we need to know what nodes are collapsed...
14376
14376
  // In >v1 the model-tree sits in its own file.
14377
14377
  if (((_c = tileset.settings) === null || _c === void 0 ? void 0 : _c["tilesetVersion"]) > 1) {
14378
- const modelTreeUrl = Tileset.GetFileUrl({
14378
+ // Newer APIs precalculate this URL.
14379
+ const modelTreeUrl = (_d = tileset.urlModelTree) !== null && _d !== void 0 ? _d : Tileset.GetFileUrl({
14379
14380
  api: api,
14380
14381
  file: "model_tree.json",
14381
14382
  tilesetId: tileset.id,
@@ -14420,7 +14421,7 @@ var TilesetCadRenderManager;
14420
14421
  const rootId = settings.rootEntityId;
14421
14422
  this.rootId = rootId;
14422
14423
  // If historic, we'll see if the root Entity has a historic position to use.
14423
- if (((_d = this.item.BruceEntity) === null || _d === void 0 ? void 0 : _d.historic) && rootId) {
14424
+ if (((_e = this.item.BruceEntity) === null || _e === void 0 ? void 0 : _e.historic) && rootId) {
14424
14425
  try {
14425
14426
  const { entity: root } = await Entity$1.Get({
14426
14427
  entityId: rootId,
@@ -22160,7 +22161,7 @@ var MenuItemManager;
22160
22161
  * @returns
22161
22162
  */
22162
22163
  RenderItem(params) {
22163
- var _a, _b, _c, _d, _e, _f, _g, _h;
22164
+ var _a, _b, _c, _d, _e, _f, _g;
22164
22165
  if (this.viewer.isDestroyed()) {
22165
22166
  return null;
22166
22167
  }
@@ -22188,17 +22189,13 @@ var MenuItemManager;
22188
22189
  let create = true;
22189
22190
  // Item already exists so we'll check if we should re-create it.
22190
22191
  if (rItem) {
22191
- // This means we're updating a tag menu item.
22192
- // Tag menu items have alternative states based on bookmark settings.
22193
- // Eg: different tags that were enabled.
22192
+ // This means we're updating an entities menu item re-using the same id.
22193
+ // Eg: a bookmark swap that keeps the same item but changes tags, style, or zoom settings.
22194
22194
  if (rItem.type == MenuItem.EType.Entities && params.item.Type == MenuItem.EType.Entities) {
22195
- const eItem = rItem.item;
22196
- if ((_a = eItem === null || eItem === void 0 ? void 0 : eItem.BruceEntity) === null || _a === void 0 ? void 0 : _a.ExpandLayers) {
22197
- rItem.renderManager.Init({
22198
- item: params.item,
22199
- });
22200
- rItem.item = params.item;
22201
- }
22195
+ rItem.renderManager.Init({
22196
+ item: params.item,
22197
+ });
22198
+ rItem.item = params.item;
22202
22199
  create = false;
22203
22200
  }
22204
22201
  // This means we're updating a entities tileset menu item.
@@ -22272,7 +22269,7 @@ var MenuItemManager;
22272
22269
  const oRenderManager = rItem.renderManager;
22273
22270
  const oItem = params.item;
22274
22271
  if (oRenderManager && oItem) {
22275
- if (+oRenderManager.SourceId == +((_b = oItem.BruceEntity) === null || _b === void 0 ? void 0 : _b.SourceId) && oRenderManager.EntityTypeId == ((_c = oItem.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"])) {
22272
+ if (+oRenderManager.SourceId == +((_a = oItem.BruceEntity) === null || _a === void 0 ? void 0 : _a.SourceId) && oRenderManager.EntityTypeId == ((_b = oItem.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"])) {
22276
22273
  oRenderManager.Init({
22277
22274
  item: oItem
22278
22275
  });
@@ -22287,7 +22284,7 @@ var MenuItemManager;
22287
22284
  const eIdsItem = params.item;
22288
22285
  if (eIdsRenderManager && eIdsItem) {
22289
22286
  const eEntityIds = eIdsRenderManager.EntityIds;
22290
- const mEntityIds = (_d = eIdsItem.BruceEntity) === null || _d === void 0 ? void 0 : _d.EntityIds;
22287
+ const mEntityIds = (_c = eIdsItem.BruceEntity) === null || _c === void 0 ? void 0 : _c.EntityIds;
22291
22288
  const eEntityIdsStr = eEntityIds ? eEntityIds.join(",") : "";
22292
22289
  const mEntityIdsStr = mEntityIds ? mEntityIds.join(",") : "";
22293
22290
  if (eEntityIdsStr == mEntityIdsStr) {
@@ -22304,7 +22301,7 @@ var MenuItemManager;
22304
22301
  }
22305
22302
  if (create) {
22306
22303
  try {
22307
- (_e = rItem.renderManager) === null || _e === void 0 ? void 0 : _e.Dispose();
22304
+ (_d = rItem.renderManager) === null || _d === void 0 ? void 0 : _d.Dispose();
22308
22305
  }
22309
22306
  catch (e) {
22310
22307
  console.error(e);
@@ -22315,7 +22312,7 @@ var MenuItemManager;
22315
22312
  if (create) {
22316
22313
  if (!rItem) {
22317
22314
  rItem = {
22318
- id: (_f = params.item.id) !== null && _f !== void 0 ? _f : ObjectUtils.UId(),
22315
+ id: (_e = params.item.id) !== null && _e !== void 0 ? _e : ObjectUtils.UId(),
22319
22316
  childIds: [],
22320
22317
  item: params.item,
22321
22318
  renderManager: null,
@@ -22523,8 +22520,8 @@ var MenuItemManager;
22523
22520
  rItem.childIds.push(childId);
22524
22521
  }
22525
22522
  }
22526
- if (rItem.renderManager && !((_g = rItem.renderManager) === null || _g === void 0 ? void 0 : _g.Disposed)) {
22527
- (_h = this.onUpdate) === null || _h === void 0 ? void 0 : _h.Trigger({ isEnabling: true, itemId: rItem.id });
22523
+ if (rItem.renderManager && !((_f = rItem.renderManager) === null || _f === void 0 ? void 0 : _f.Disposed)) {
22524
+ (_g = this.onUpdate) === null || _g === void 0 ? void 0 : _g.Trigger({ isEnabling: true, itemId: rItem.id });
22528
22525
  }
22529
22526
  return rItem.id;
22530
22527
  }
@@ -35074,7 +35071,7 @@ var EntityRenderEngineModel3d;
35074
35071
  * @returns
35075
35072
  */
35076
35073
  async function RenderGroup(params) {
35077
- var _a, _b, _c, _d, _e, _f;
35074
+ var _a, _b, _c, _d, _e, _f, _g;
35078
35075
  const api = params.apiGetter.getApi();
35079
35076
  await api.Loading;
35080
35077
  const cEntities = new Map();
@@ -35184,7 +35181,7 @@ var EntityRenderEngineModel3d;
35184
35181
  style: mStyle,
35185
35182
  tags: tags,
35186
35183
  viewer: params.viewer,
35187
- lodUrl: ClientFile.GetUrl({
35184
+ lodUrl: (_g = lod.url) !== null && _g !== void 0 ? _g : ClientFile.GetUrl({
35188
35185
  api,
35189
35186
  fileId: lod.clientFileId,
35190
35187
  viaCdn: true
@@ -37570,7 +37567,7 @@ var StyleUtils;
37570
37567
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
37571
37568
  })(StyleUtils || (StyleUtils = {}));
37572
37569
 
37573
- const VERSION = "6.8.5";
37570
+ const VERSION = "6.8.7";
37574
37571
  /**
37575
37572
  * Updates the environment instance used by bruce-cesium to one specified.
37576
37573
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.