bruce-cesium 6.7.0 → 6.7.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.
@@ -1,6 +1,6 @@
1
- import { Cartes, Entity as Entity$1, Geometry, ProjectViewTile, ENVIRONMENT, EntityRelationType, EntityType, Calculator, Style, DelayQueue, LRUCache, BruceEvent, ObjectUtils, AccountConcept, EntityHistoricData, EntityLod, RecordChangeFeed, ZoomControl, EntityTag, Tileset, EntityCoords, Api, DataLab, BruceApi, EntitySource, ProgramKey, ClientFile, MenuItem, EntityRelation, Bounds, Carto, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session } from 'bruce-models';
1
+ import { Cartes, Entity as Entity$1, Geometry, ProjectViewTile, ENVIRONMENT, EntityRelationType, EntityType, Calculator, Style, DelayQueue, LRUCache, BruceEvent, ObjectUtils, AccountConcept, EntityHistoricData, EntityLod, RecordChangeFeed, ZoomControl, EntityTag, Tileset, EntityCoords, Api, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, BruceApi, ProgramKey, Bounds, Carto, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, ColorMaterialProperty, Color, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, Entity, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Cesium3DTileset, IonResource, OrthographicFrustum, Ion, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, HeightReference, HorizontalOrigin, VerticalOrigin, ClassificationType, ConstantPositionProperty, PolygonHierarchy, ShadowMode, PolylineGraphics, ArcType, CornerType, ColorBlendMode, Model, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, HeadingPitchRange, Cesium3DTileStyle, Cesium3DTileColorBlendMode, Ion, Cesium3DTileset, IonResource, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -16113,18 +16113,15 @@ var TilesetOsmRenderManager;
16113
16113
  // Already exists, no need to re-initialize.
16114
16114
  return;
16115
16115
  }
16116
- const ionCheckApi = this.getters.GetBruceApi({});
16117
- await ionCheckApi.Loading;
16118
- const { programKeys: ionCheckKeys } = await ProgramKey.GetList({ api: ionCheckApi });
16119
- const ionKey = ionCheckKeys.find(k => k.ProgramId === ProgramKey.EProgramId.CesiumIon);
16120
- // Use if marked as available.
16121
16116
  let validToken;
16122
- if (ionCheckApi.IsVersionAtLeast(BruceApi.VERSION_WITH_PROXIES)) {
16123
- validToken = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Available) === true;
16117
+ if (Ion.defaultServer) {
16118
+ // Proxy server was set after verifying Ion availability upstream
16119
+ // (including template account fallback) — trust that check.
16120
+ validToken = true;
16124
16121
  }
16125
- // Legacy route, to be killed off.
16126
16122
  else {
16127
- validToken = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Key) ? await ViewerUtils.AssertIonToken(ionKey.Key) : false;
16123
+ // No proxy; validate the legacy access token directly.
16124
+ validToken = await ViewerUtils.AssertIonToken(Ion.defaultAccessToken);
16128
16125
  }
16129
16126
  if (!validToken) {
16130
16127
  console.warn("'tileset-osm-render-manager.ts' could not locate a valid Cesium Ion token.");
@@ -23092,17 +23089,13 @@ var TileRenderEngine;
23092
23089
  // If we need a cesium token, and we don't have one, then we can't render this.
23093
23090
  let shouldCreate = true;
23094
23091
  if (NEEDS_CESIUM_TOKEN.includes(defaultImg.id)) {
23095
- const ionCheckApi = apiGetter.getApi(apiGetter.accountId);
23096
- await ionCheckApi.Loading;
23097
- const { programKeys: ionCheckKeys } = await ProgramKey.GetList({ api: ionCheckApi });
23098
- const ionKey = ionCheckKeys.find(k => k.ProgramId === ProgramKey.EProgramId.CesiumIon);
23099
- // Use if marked as available.
23100
- if (ionCheckApi.IsVersionAtLeast(BruceApi.VERSION_WITH_PROXIES)) {
23101
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Available) === true;
23092
+ // Proxy server was set after verifying Ion availability upstream.
23093
+ if (Ion.defaultServer) {
23094
+ shouldCreate = true;
23102
23095
  }
23103
23096
  // Legacy route, to be killed off.
23104
23097
  else {
23105
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Key) ? await ViewerUtils.AssertIonToken(ionKey.Key) : false;
23098
+ shouldCreate = await ViewerUtils.AssertIonToken(Ion.defaultAccessToken);
23106
23099
  }
23107
23100
  }
23108
23101
  if (shouldCreate) {
@@ -23546,17 +23539,13 @@ var TileRenderEngine;
23546
23539
  // Cesium token is required for Cesium World Terrain.
23547
23540
  let shouldCreate = true;
23548
23541
  if (defaultTerr.id == ProjectViewTile.EDefaultTerrain.CesiumWorldTerrain) {
23549
- const ionCheckApi = params.apiGetter.getApi(params.apiGetter.accountId);
23550
- await ionCheckApi.Loading;
23551
- const { programKeys: ionCheckKeys } = await ProgramKey.GetList({ api: ionCheckApi });
23552
- const ionKey = ionCheckKeys.find(k => k.ProgramId === ProgramKey.EProgramId.CesiumIon);
23553
- // Use if marked as available.
23554
- if (ionCheckApi.IsVersionAtLeast(BruceApi.VERSION_WITH_PROXIES)) {
23555
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Available) === true;
23542
+ // Proxy server was set after verifying Ion availability upstream
23543
+ if (Ion.defaultServer) {
23544
+ shouldCreate = true;
23556
23545
  }
23557
23546
  // Legacy route, to be killed off.
23558
23547
  else {
23559
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Key) ? await ViewerUtils.AssertIonToken(ionKey.Key) : false;
23548
+ shouldCreate = await ViewerUtils.AssertIonToken(Ion.defaultAccessToken);
23560
23549
  }
23561
23550
  }
23562
23551
  if (shouldCreate) {
@@ -36340,7 +36329,7 @@ class WidgetViewBar extends Widget.AWidget {
36340
36329
  }
36341
36330
  }
36342
36331
 
36343
- const VERSION = "6.7.0";
36332
+ const VERSION = "6.7.1";
36344
36333
  /**
36345
36334
  * Updates the environment instance used by bruce-cesium to one specified.
36346
36335
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.