bruce-cesium 6.0.5 → 6.0.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.
@@ -2982,6 +2982,7 @@
2982
2982
  const CESIUM_TIMELINE_LIVE_KEY = "_nextspace_timeline_live";
2983
2983
  const CESIUM_TIMELINE_LIVE_PADDING_KEY = "_nextspace_timeline_live_padding";
2984
2984
  const CESIUM_TIMELINE_INTERVAL_KEY = "_nextspace_timeline_interval";
2985
+ const CESIUM_MODEL_SPACE_KEY = "_nextspace_model_space";
2985
2986
  const DEFAULT_LIVE_PADDING_SECONDS = 30 * 60;
2986
2987
  (function (ViewUtils) {
2987
2988
  function GatherLegacyMapTiles(params) {
@@ -3343,7 +3344,7 @@
3343
3344
  }
3344
3345
  // When globe is off, we'll also hide the stars/moon.
3345
3346
  // We also grab the globe color and apply it to the sky.
3346
- if (hidden) {
3347
+ if (hidden && GetModelSpace(viewer)) {
3347
3348
  scene.skyBox.show = false;
3348
3349
  scene.skyAtmosphere.show = false;
3349
3350
  scene.sun.show = false;
@@ -3360,6 +3361,25 @@
3360
3361
  scene.globe.baseColor = baseColor;
3361
3362
  }
3362
3363
  ViewUtils.SetGlobeDetails = SetGlobeDetails;
3364
+ function SetModelSpace(viewer, modelSpace) {
3365
+ if (!viewer) {
3366
+ return;
3367
+ }
3368
+ if (viewer[CESIUM_MODEL_SPACE_KEY] === modelSpace) {
3369
+ return;
3370
+ }
3371
+ viewer[CESIUM_MODEL_SPACE_KEY] = modelSpace;
3372
+ // Reload globe since we display it differently between the two modes.
3373
+ SetGlobeDetails({ viewer });
3374
+ }
3375
+ ViewUtils.SetModelSpace = SetModelSpace;
3376
+ function GetModelSpace(viewer) {
3377
+ if (!viewer) {
3378
+ return false;
3379
+ }
3380
+ return Boolean(viewer[CESIUM_MODEL_SPACE_KEY]);
3381
+ }
3382
+ ViewUtils.GetModelSpace = GetModelSpace;
3363
3383
  })(exports.ViewUtils || (exports.ViewUtils = {}));
3364
3384
 
3365
3385
  function traverseEntity(cEntity, arr, ignoreParent, onlyEditable, onlySelectable) {
@@ -3541,7 +3561,7 @@
3541
3561
  let validSamples = 0;
3542
3562
  // When in model-space, Assembly Entities are all relative to 0,0 lat/lon.
3543
3563
  // Which means we have to ignore the location and calculate based on relative position to 0,0.
3544
- const modelSpace = viewer["nextspace-model-space"] === true;
3564
+ const modelSpace = exports.ViewUtils.GetModelSpace(viewer);
3545
3565
  // Quick lookup on what historic Entities we have and what dates they map to.
3546
3566
  let latestDate = null;
3547
3567
  const entityIdDates = new Map();
@@ -4219,7 +4239,7 @@
4219
4239
  if (allowRendered == null) {
4220
4240
  allowRendered = true;
4221
4241
  }
4222
- const isModelSpace = viewer["nextspace-model-space"] === true;
4242
+ const isModelSpace = exports.ViewUtils.GetModelSpace(viewer);
4223
4243
  const isAssemblyEntity = ((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyRootLocation) != null;
4224
4244
  function evaluateRendered() {
4225
4245
  const rego = visualRegister ? visualRegister.GetRego({
@@ -26649,9 +26669,6 @@
26649
26669
  // 1- new accounts get our token set.
26650
26670
  // 2- we reference to the template account's token.
26651
26671
  const CESIUM_DEFAULT_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiODI1OWQyZC0wYzdlLTRlOTctODFlOC1kYjIwOGYzOWE0NGIiLCJpZCI6MTE3NDg0LCJpYXQiOjE2NzAzODczOTR9.sx0EZdD-Y33FQ7gB_R3CkTsk3KhNpODoQGrnpvSH4UQ";
26652
- // Model-space flag so we know if we're changing from and to model-space.
26653
- // This helps determine if we should instantly transition.
26654
- const MODEL_SPACE_FLAG = "nextspace-model-space";
26655
26672
  /**
26656
26673
  * Creates a new iteration state.
26657
26674
  * This will stop any existing renders from processing to their end.
@@ -26982,7 +26999,7 @@
26982
26999
  (contentType == BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) ||
26983
27000
  // Moving away from model-space.
26984
27001
  // @ts-expect-error
26985
- (contentType != BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE && viewer[MODEL_SPACE_FLAG] == true)) {
27002
+ (contentType != BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE && exports.ViewUtils.GetModelSpace(viewer))) {
26986
27003
  const cameraPos3d = viewer.camera.position;
26987
27004
  if (!cameraPos3d || (cameraPos3d.x == 0 && cameraPos3d.y == 0 && cameraPos3d.z == 0)) {
26988
27005
  transition = 0;
@@ -27004,7 +27021,7 @@
27004
27021
  });
27005
27022
  }
27006
27023
  }
27007
- viewer[MODEL_SPACE_FLAG] = contentType == BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE;
27024
+ exports.ViewUtils.SetModelSpace(viewer, contentType == BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE);
27008
27025
  let terrain = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain) != null ? bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain : (_o = defaults.settings) === null || _o === void 0 ? void 0 : _o.terrain;
27009
27026
  if (terrain) {
27010
27027
  // If there is no Cesium token set then we'll swap cesium terrain to flat terrain.
@@ -27601,7 +27618,7 @@
27601
27618
  (contentType == BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) ||
27602
27619
  // Moving away from model-space.
27603
27620
  // @ts-expect-error
27604
- (contentType != BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE && viewer[MODEL_SPACE_FLAG] == true)) {
27621
+ (contentType != BModels.ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE && exports.ViewUtils.GetModelSpace(viewer))) {
27605
27622
  const cameraPos3d = viewer.camera.position;
27606
27623
  if (!cameraPos3d || (cameraPos3d.x == 0 && cameraPos3d.y == 0 && cameraPos3d.z == 0)) {
27607
27624
  transition = 0;
@@ -33396,7 +33413,7 @@
33396
33413
  }
33397
33414
  }
33398
33415
 
33399
- const VERSION = "6.0.5";
33416
+ const VERSION = "6.0.7";
33400
33417
 
33401
33418
  exports.VERSION = VERSION;
33402
33419
  exports.isOutlineChanged = isOutlineChanged;
@@ -33406,6 +33423,7 @@
33406
33423
  exports.CESIUM_TIMELINE_LIVE_KEY = CESIUM_TIMELINE_LIVE_KEY;
33407
33424
  exports.CESIUM_TIMELINE_LIVE_PADDING_KEY = CESIUM_TIMELINE_LIVE_PADDING_KEY;
33408
33425
  exports.CESIUM_TIMELINE_INTERVAL_KEY = CESIUM_TIMELINE_INTERVAL_KEY;
33426
+ exports.CESIUM_MODEL_SPACE_KEY = CESIUM_MODEL_SPACE_KEY;
33409
33427
  exports.DEFAULT_LIVE_PADDING_SECONDS = DEFAULT_LIVE_PADDING_SECONDS;
33410
33428
  exports.Draw3dPolygon = Draw3dPolygon;
33411
33429
  exports.Draw3dPolyline = Draw3dPolyline;