bruce-cesium 2.2.3 → 2.2.5

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 { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, DelayQueue, BatchedDataGetter, EntityRelationType, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartesian2, Cartographic, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, SceneMode, Entity, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, HeightReference, DistanceDisplayCondition, NearFarScalar, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, CesiumInspector, PolygonPipeline, ColorMaterialProperty, EasingFunction, GeometryInstance } from 'cesium';
3
+ import { Cartesian2, Cartographic, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, Model, CesiumInspector, PolygonPipeline, ColorMaterialProperty, EasingFunction, GeometryInstance } from 'cesium';
4
4
 
5
5
  var TIME_LAG = 300;
6
6
  var POSITION_CHECK_TIMER = 950;
@@ -547,6 +547,84 @@ var DrawingUtils;
547
547
  return pos3d;
548
548
  }
549
549
  DrawingUtils.EnsurePosHeight = EnsurePosHeight;
550
+ /**
551
+ * Returns an accurate 3d position from a given screen position.
552
+ * @param viewer
553
+ * @param cursor
554
+ * @returns
555
+ */
556
+ DrawingUtils.GetAccuratePosition = (function () {
557
+ var cachedPick = null;
558
+ var cacheTimestamp = null;
559
+ var cachedCameraState = null;
560
+ return function (viewer, cursor, pickOnly) {
561
+ if (pickOnly === void 0) { pickOnly = false; }
562
+ var scene = viewer.scene;
563
+ var camera = scene.camera;
564
+ // Check if we can use cached position.
565
+ if (cachedPick && cacheTimestamp) {
566
+ var timeElapsed = Date.now() - cacheTimestamp;
567
+ var isWithinCacheDuration = timeElapsed < 3000; // 3 seconds
568
+ var isNearPreviousPick = Cartesian2.distanceSquared(cursor, cachedPick.cursor) < 9; // 3 pixels
569
+ var directionDot = Cartesian3.dot(camera.directionWC, cachedCameraState.direction);
570
+ var directionLengths = Cartesian3.magnitude(camera.directionWC) * Cartesian3.magnitude(cachedCameraState.direction);
571
+ var angle = Math.acos(directionDot / directionLengths);
572
+ var hasCameraMoved = Math.abs(camera.positionWC.x - cachedCameraState.position.x) > 2 || // 2 meters
573
+ Math.abs(camera.positionWC.y - cachedCameraState.position.y) > 2 ||
574
+ angle > Math$1.toRadians(5); // 5 degrees
575
+ if (isWithinCacheDuration && isNearPreviousPick && !hasCameraMoved) {
576
+ return cachedPick.position;
577
+ }
578
+ }
579
+ // Actual picking logic
580
+ // https://community.cesium.com/t/scene-pick-returning-point-inside-the-globe/18940/9
581
+ var pos3d = null;
582
+ // Means we can accurately pick right now.
583
+ if (!pickOnly && scene.globe.depthTestAgainstTerrain) {
584
+ pos3d = scene.pickPosition(cursor);
585
+ }
586
+ // Means we cannot guarantee an accurate pick.
587
+ // We want to prioritize pick-position when we can, so we'll try use it and if the result is sus then we'll use some fallbacks.
588
+ else {
589
+ if (!pickOnly) {
590
+ pos3d = scene.pickPosition(cursor);
591
+ }
592
+ if (defined(pos3d)) {
593
+ var carto = Cartographic.fromCartesian(pos3d);
594
+ if (!defined(carto) || carto.height < 0) {
595
+ pos3d = null;
596
+ }
597
+ }
598
+ if (!defined(pos3d)) {
599
+ pos3d = null;
600
+ var ray = scene.camera.getPickRay(cursor);
601
+ if (scene.pickPositionSupported) {
602
+ var pickedObject = scene.pick(cursor, 1, 1);
603
+ if (defined(pickedObject) &&
604
+ (pickedObject instanceof Cesium3DTileFeature ||
605
+ pickedObject.primitive instanceof Cesium3DTileset ||
606
+ pickedObject.primitive instanceof Model)) {
607
+ pos3d = scene.pickPosition(cursor);
608
+ }
609
+ }
610
+ if (!pickOnly && !defined(pos3d)) {
611
+ pos3d = scene.globe.pick(ray, scene);
612
+ }
613
+ }
614
+ }
615
+ // Update cache.
616
+ cachedPick = {
617
+ position: pos3d,
618
+ cursor: cursor.clone()
619
+ };
620
+ cacheTimestamp = Date.now();
621
+ cachedCameraState = {
622
+ position: camera.positionWC.clone(),
623
+ direction: camera.directionWC.clone()
624
+ };
625
+ return pos3d;
626
+ };
627
+ })();
550
628
  })(DrawingUtils || (DrawingUtils = {}));
551
629
 
552
630
  /**
@@ -1302,7 +1380,7 @@ var RenderManager;
1302
1380
  if (!pos) {
1303
1381
  return null;
1304
1382
  }
1305
- var is2d = viewer.scene.mode === SceneMode.SCENE2D;
1383
+ var isFlatEarth = viewer.scene.mode === SceneMode.SCENE2D;
1306
1384
  var cameraPos = viewer.camera.positionCartographic;
1307
1385
  if (!cameraPos || !cameraPos.latitude) {
1308
1386
  return null;
@@ -1316,9 +1394,9 @@ var RenderManager;
1316
1394
  zoomControl: zoomControl,
1317
1395
  distance: distance
1318
1396
  });
1319
- // In 2d cesium gets camera position very wrong.
1397
+ // In flat earth mode cesium gets camera position very wrong.
1320
1398
  // TODO: Need to check if lat/lon is correct and use that for distance calc instead.
1321
- if (is2d && !zoomItem && zoomControl.length) {
1399
+ if (isFlatEarth && !zoomItem && zoomControl.length) {
1322
1400
  zoomItem = zoomControl[zoomControl.length - 1];
1323
1401
  }
1324
1402
  return zoomItem;
@@ -6639,6 +6717,7 @@ var TilesetCadRenderManager;
6639
6717
  }
6640
6718
  settings = tileset.settings;
6641
6719
  rootId = settings.rootEntityId;
6720
+ this.rootId = rootId;
6642
6721
  return [4 /*yield*/, EntityCoords.GetEntityCoords({
6643
6722
  api: api,
6644
6723
  rootEntityId: rootId
@@ -6721,7 +6800,8 @@ var TilesetCadRenderManager;
6721
6800
  priority: 0,
6722
6801
  visual: feature,
6723
6802
  accountId: (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.apiGetter.accountId,
6724
- tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID
6803
+ tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
6804
+ rootId: this.rootId
6725
6805
  };
6726
6806
  var featureAny = feature;
6727
6807
  var propertyNames = featureAny.getPropertyNames ? featureAny.getPropertyNames() : (_d = featureAny.getPropertyIds) === null || _d === void 0 ? void 0 : _d.call(featureAny);
@@ -10313,6 +10393,61 @@ var ViewUtils;
10313
10393
  return (_b = (_a = params.viewer[CESIUM_INSPECTOR_KEY]) === null || _a === void 0 ? void 0 : _a.viewModel) === null || _b === void 0 ? void 0 : _b.wireframe;
10314
10394
  }
10315
10395
  ViewUtils.GetTerrainWireframeStatus = GetTerrainWireframeStatus;
10396
+ /**
10397
+ * Changes between perspective and orthographic view.
10398
+ * When Cesium stops being bad at picking positions in 2d mode we'll use the flat earth mode instead.
10399
+ * @param params
10400
+ */
10401
+ function Set2dStatus(params) {
10402
+ var viewer = params.viewer, is2d = params.status, moveCamera = params.moveCamera;
10403
+ var curLens2d = viewer.camera.frustum instanceof OrthographicFrustum;
10404
+ if (curLens2d && !is2d) {
10405
+ viewer.camera.switchToPerspectiveFrustum();
10406
+ viewer.scene.screenSpaceCameraController.enableTilt = true;
10407
+ }
10408
+ else if (!curLens2d && is2d) {
10409
+ viewer.camera.switchToOrthographicFrustum();
10410
+ viewer.scene.screenSpaceCameraController.enableTilt = false;
10411
+ if (moveCamera != false) {
10412
+ try {
10413
+ // Face camera downwards to make it look 2d.
10414
+ // We want to try make it look at the center-point of the current view.
10415
+ // If center cannot be calculated then we'll simply raise the camera and face it downwards.
10416
+ var scene = viewer.scene;
10417
+ var windowPosition = new Cartesian2(scene.canvas.clientWidth / 2, scene.canvas.clientHeight / 2);
10418
+ var ray = viewer.camera.getPickRay(windowPosition);
10419
+ var intersection = scene.globe.pick(ray, scene);
10420
+ var center = void 0;
10421
+ if (defined(intersection)) {
10422
+ center = Cartographic.fromCartesian(intersection);
10423
+ }
10424
+ // Use current camera position if we can't calculate the center.
10425
+ else {
10426
+ center = Cartographic.fromCartesian(viewer.camera.position);
10427
+ center.height = 0;
10428
+ }
10429
+ center.height = viewer.camera.positionCartographic.height + 100;
10430
+ viewer.camera.setView({
10431
+ destination: Cartographic.toCartesian(center),
10432
+ orientation: {
10433
+ heading: 0.0,
10434
+ pitch: Math$1.toRadians(-90.0),
10435
+ roll: 0.0
10436
+ }
10437
+ });
10438
+ }
10439
+ catch (e) {
10440
+ console.error(e);
10441
+ }
10442
+ }
10443
+ }
10444
+ }
10445
+ ViewUtils.Set2dStatus = Set2dStatus;
10446
+ function Get2dStatus(params) {
10447
+ var viewer = params.viewer;
10448
+ return viewer.camera.frustum instanceof OrthographicFrustum;
10449
+ }
10450
+ ViewUtils.Get2dStatus = Get2dStatus;
10316
10451
  })(ViewUtils || (ViewUtils = {}));
10317
10452
 
10318
10453
  // TODO: Move these to the data model.
@@ -10466,11 +10601,11 @@ function renderLegacyNavigator(params, bookmark, view) {
10466
10601
  * @param view
10467
10602
  */
10468
10603
  function renderNavigator(params, bookmark, view) {
10469
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
10604
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
10470
10605
  return __awaiter(this, void 0, void 0, function () {
10471
- var viewer, scene, vSettings, bSettings, defaults, camera, newLens, modePicker, is2d, curLens, modePicker_1, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
10472
- return __generator(this, function (_7) {
10473
- switch (_7.label) {
10606
+ var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
10607
+ return __generator(this, function (_6) {
10608
+ switch (_6.label) {
10474
10609
  case 0:
10475
10610
  viewer = params.manager.Viewer;
10476
10611
  scene = viewer.scene;
@@ -10489,25 +10624,21 @@ function renderNavigator(params, bookmark, view) {
10489
10624
  // TODO: Need global default.
10490
10625
  newLens = Camera.EFrustum.Perspective;
10491
10626
  }
10492
- modePicker = viewer === null || viewer === void 0 ? void 0 : viewer.sceneModePicker;
10493
- is2d = ((_l = modePicker === null || modePicker === void 0 ? void 0 : modePicker.viewModel) === null || _l === void 0 ? void 0 : _l.sceneMode) === SceneMode.SCENE2D;
10494
- curLens = is2d ? Camera.EFrustum.Orthographic : Camera.EFrustum.Perspective;
10495
- if (newLens != curLens) {
10496
- modePicker_1 = viewer === null || viewer === void 0 ? void 0 : viewer.sceneModePicker;
10497
- if (modePicker_1) {
10498
- modePicker_1.viewModel.duration = 0;
10499
- if (newLens == Camera.EFrustum.Perspective) {
10500
- modePicker_1.viewModel._morphTo3D();
10501
- }
10502
- else {
10503
- modePicker_1.viewModel._morphTo2D();
10504
- }
10505
- }
10627
+ shouldBe2d = newLens == Camera.EFrustum.Orthographic;
10628
+ curIs2d = ViewUtils.Get2dStatus({
10629
+ viewer: viewer
10630
+ });
10631
+ if (shouldBe2d != curIs2d) {
10632
+ ViewUtils.Set2dStatus({
10633
+ status: shouldBe2d,
10634
+ viewer: viewer,
10635
+ moveCamera: false
10636
+ });
10506
10637
  }
10507
10638
  if (!params.skipCamera) {
10508
- transition = params.skipTransition ? 0 : curLens === newLens ? camera.transition : 0;
10639
+ transition = params.skipTransition ? 0 : shouldBe2d === curIs2d ? camera.transition : 0;
10509
10640
  if (transition == null) {
10510
- transition = (_m = defaults.camera) === null || _m === void 0 ? void 0 : _m.transition;
10641
+ transition = (_l = defaults.camera) === null || _l === void 0 ? void 0 : _l.transition;
10511
10642
  }
10512
10643
  if (transition == null) {
10513
10644
  // TODO: Need global default.
@@ -10526,7 +10657,7 @@ function renderNavigator(params, bookmark, view) {
10526
10657
  });
10527
10658
  }
10528
10659
  }
10529
- 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;
10660
+ terrain = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain) != null ? bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain : (_m = defaults.settings) === null || _m === void 0 ? void 0 : _m.terrain;
10530
10661
  if (!terrain) return [3 /*break*/, 2];
10531
10662
  return [4 /*yield*/, TileRenderEngine.Terrain.Navigator.Render({
10532
10663
  apiGetter: params.apiGetter,
@@ -10534,12 +10665,12 @@ function renderNavigator(params, bookmark, view) {
10534
10665
  viewer: params.manager.Viewer,
10535
10666
  })];
10536
10667
  case 1:
10537
- _7.sent();
10538
- _7.label = 2;
10668
+ _6.sent();
10669
+ _6.label = 2;
10539
10670
  case 2:
10540
- hillShades = (_p = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) === null || _p === void 0 ? void 0 : _p.hillShades;
10671
+ hillShades = (_o = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) === null || _o === void 0 ? void 0 : _o.hillShades;
10541
10672
  if (hillShades == null) {
10542
- hillShades = (_q = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _q === void 0 ? void 0 : _q.hillShades;
10673
+ hillShades = (_p = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _p === void 0 ? void 0 : _p.hillShades;
10543
10674
  }
10544
10675
  if (hillShades == null) {
10545
10676
  hillShades = true;
@@ -10547,7 +10678,7 @@ function renderNavigator(params, bookmark, view) {
10547
10678
  scene.globe.enableLighting = Boolean(hillShades);
10548
10679
  baseColor = bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeColor;
10549
10680
  if (baseColor == null) {
10550
- baseColor = (_r = defaults.settings) === null || _r === void 0 ? void 0 : _r.globeColor;
10681
+ baseColor = (_q = defaults.settings) === null || _q === void 0 ? void 0 : _q.globeColor;
10551
10682
  }
10552
10683
  if (baseColor == null) {
10553
10684
  // TODO: Need global default.
@@ -10556,7 +10687,7 @@ function renderNavigator(params, bookmark, view) {
10556
10687
  scene.globe.baseColor = Color.fromCssColorString(baseColor);
10557
10688
  globeHidden = bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeHidden;
10558
10689
  if (globeHidden == null) {
10559
- globeHidden = (_s = defaults.settings) === null || _s === void 0 ? void 0 : _s.globeHidden;
10690
+ globeHidden = (_r = defaults.settings) === null || _r === void 0 ? void 0 : _r.globeHidden;
10560
10691
  }
10561
10692
  if (globeHidden == null) {
10562
10693
  globeHidden = false;
@@ -10564,7 +10695,7 @@ function renderNavigator(params, bookmark, view) {
10564
10695
  scene.globe.show = !globeHidden;
10565
10696
  terrainWireframe = bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrainWireframe;
10566
10697
  if (terrainWireframe == null) {
10567
- terrainWireframe = (_t = defaults.settings) === null || _t === void 0 ? void 0 : _t.terrainWireframe;
10698
+ terrainWireframe = (_s = defaults.settings) === null || _s === void 0 ? void 0 : _s.terrainWireframe;
10568
10699
  }
10569
10700
  if (terrainWireframe == null) {
10570
10701
  terrainWireframe = false;
@@ -10575,7 +10706,7 @@ function renderNavigator(params, bookmark, view) {
10575
10706
  });
10576
10707
  globeAlpha = +(bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeAlpha);
10577
10708
  if (isNaN(globeAlpha)) {
10578
- globeAlpha = +((_u = defaults.settings) === null || _u === void 0 ? void 0 : _u.globeAlpha);
10709
+ globeAlpha = +((_t = defaults.settings) === null || _t === void 0 ? void 0 : _t.globeAlpha);
10579
10710
  }
10580
10711
  if (!scene.globe.translucency.enabled) {
10581
10712
  scene.globe.translucency.enabled = true;
@@ -10585,7 +10716,7 @@ function renderNavigator(params, bookmark, view) {
10585
10716
  scene.globe.translucency.frontFaceAlphaByDistance.nearValue = EnsureNumber(globeAlpha, 1);
10586
10717
  shadows = bSettings === null || bSettings === void 0 ? void 0 : bSettings.shadows;
10587
10718
  if (shadows == null) {
10588
- shadows = (_v = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _v === void 0 ? void 0 : _v.shadows;
10719
+ shadows = (_u = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _u === void 0 ? void 0 : _u.shadows;
10589
10720
  }
10590
10721
  if (shadows == null) {
10591
10722
  // Experimenting with default on.
@@ -10613,7 +10744,7 @@ function renderNavigator(params, bookmark, view) {
10613
10744
  }
10614
10745
  ambientOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.ambientOcclusion;
10615
10746
  if (ambientOcclusion == null) {
10616
- ambientOcclusion = (_w = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _w === void 0 ? void 0 : _w.ambientOcclusion;
10747
+ ambientOcclusion = (_v = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _v === void 0 ? void 0 : _v.ambientOcclusion;
10617
10748
  }
10618
10749
  if (ambientOcclusion == null) {
10619
10750
  ambientOcclusion = {
@@ -10636,7 +10767,7 @@ function renderNavigator(params, bookmark, view) {
10636
10767
  }
10637
10768
  lighting = bSettings === null || bSettings === void 0 ? void 0 : bSettings.lighting;
10638
10769
  if (lighting == null) {
10639
- lighting = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.lighting;
10770
+ lighting = (_w = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _w === void 0 ? void 0 : _w.lighting;
10640
10771
  }
10641
10772
  if (lighting == null) {
10642
10773
  lighting = {
@@ -10651,7 +10782,7 @@ function renderNavigator(params, bookmark, view) {
10651
10782
  }
10652
10783
  quality = bSettings === null || bSettings === void 0 ? void 0 : bSettings.quality;
10653
10784
  if (quality == null) {
10654
- quality = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.quality;
10785
+ quality = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.quality;
10655
10786
  }
10656
10787
  if (quality == null) {
10657
10788
  quality = {
@@ -10662,7 +10793,7 @@ function renderNavigator(params, bookmark, view) {
10662
10793
  fxaa.enabled = Boolean(quality.fxaa);
10663
10794
  dateTime = bSettings === null || bSettings === void 0 ? void 0 : bSettings.dateTime;
10664
10795
  if (dateTime == null) {
10665
- dateTime = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.dateTime;
10796
+ dateTime = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.dateTime;
10666
10797
  }
10667
10798
  if (dateTime != null) {
10668
10799
  clock = viewer.clock;
@@ -10670,7 +10801,7 @@ function renderNavigator(params, bookmark, view) {
10670
10801
  }
10671
10802
  selectedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedEntityIds;
10672
10803
  if (selectedIds == null) {
10673
- selectedIds = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.selectedEntityIds;
10804
+ selectedIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.selectedEntityIds;
10674
10805
  }
10675
10806
  if (selectedIds != null) {
10676
10807
  params.manager.VisualsRegister.ClearSelected();
@@ -10683,7 +10814,7 @@ function renderNavigator(params, bookmark, view) {
10683
10814
  params.manager.VisualsRegister.ClearHidden();
10684
10815
  hiddenIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hiddenEntityIds;
10685
10816
  if (hiddenIds == null) {
10686
- hiddenIds = (_1 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _1 === void 0 ? void 0 : _1.hiddenEntityIds;
10817
+ hiddenIds = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.hiddenEntityIds;
10687
10818
  }
10688
10819
  if (hiddenIds != null) {
10689
10820
  params.manager.VisualsRegister.SetHidden({
@@ -10694,7 +10825,7 @@ function renderNavigator(params, bookmark, view) {
10694
10825
  params.manager.VisualsRegister.ClearIsolated();
10695
10826
  isolatedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.isolatedEntityIds;
10696
10827
  if (isolatedIds == null) {
10697
- isolatedIds = (_2 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _2 === void 0 ? void 0 : _2.isolatedEntityIds;
10828
+ isolatedIds = (_1 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _1 === void 0 ? void 0 : _1.isolatedEntityIds;
10698
10829
  }
10699
10830
  if (isolatedIds != null) {
10700
10831
  params.manager.VisualsRegister.SetIsolated({
@@ -10705,7 +10836,7 @@ function renderNavigator(params, bookmark, view) {
10705
10836
  params.manager.VisualsRegister.ClearOpacity();
10706
10837
  entityOpacityMap = bSettings === null || bSettings === void 0 ? void 0 : bSettings.entityOpacityMap;
10707
10838
  if (entityOpacityMap == null) {
10708
- entityOpacityMap = (_3 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _3 === void 0 ? void 0 : _3.entityOpacityMap;
10839
+ entityOpacityMap = (_2 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _2 === void 0 ? void 0 : _2.entityOpacityMap;
10709
10840
  }
10710
10841
  if (entityOpacityMap != null) {
10711
10842
  for (entityId in entityOpacityMap) {
@@ -10718,7 +10849,7 @@ function renderNavigator(params, bookmark, view) {
10718
10849
  }
10719
10850
  }
10720
10851
  }
10721
- imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (_4 = defaults.settings) === null || _4 === void 0 ? void 0 : _4.imagery;
10852
+ imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (_3 = defaults.settings) === null || _3 === void 0 ? void 0 : _3.imagery;
10722
10853
  if (imagery == null) {
10723
10854
  // TODO: Need global default.
10724
10855
  imagery = [
@@ -10740,13 +10871,13 @@ function renderNavigator(params, bookmark, view) {
10740
10871
  viewer: params.manager.Viewer,
10741
10872
  })];
10742
10873
  case 3:
10743
- _7.sent();
10874
+ _6.sent();
10744
10875
  renderedRelationEntityIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
10745
10876
  if (!renderedRelationEntityIds) {
10746
10877
  renderedRelationEntityIds = [];
10747
10878
  }
10748
10879
  curEnabled = params.manager.GetEnabledItemIds();
10749
- newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
10880
+ newItemIds = (_4 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _4 !== void 0 ? _4 : [];
10750
10881
  for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
10751
10882
  id = curEnabled_1[_i];
10752
10883
  if (newItemIds.indexOf(id) === -1 ||
@@ -10764,8 +10895,8 @@ function renderNavigator(params, bookmark, view) {
10764
10895
  bookmark: bookmark
10765
10896
  })];
10766
10897
  case 4:
10767
- _7.sent();
10768
- _7.label = 5;
10898
+ _6.sent();
10899
+ _6.label = 5;
10769
10900
  case 5:
10770
10901
  if (!(renderedRelationEntityIds.length > 0)) return [3 /*break*/, 7];
10771
10902
  menuItem = {
@@ -10781,18 +10912,17 @@ function renderNavigator(params, bookmark, view) {
10781
10912
  item: menuItem
10782
10913
  })];
10783
10914
  case 6:
10784
- _7.sent();
10785
- _7.label = 7;
10915
+ _6.sent();
10916
+ _6.label = 7;
10786
10917
  case 7:
10787
10918
  gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
10788
10919
  if (gOcclusion == null) {
10789
- gOcclusion = (_6 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _6 === void 0 ? void 0 : _6.groundOcclusion;
10920
+ gOcclusion = (_5 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _5 === void 0 ? void 0 : _5.groundOcclusion;
10790
10921
  }
10791
10922
  if (gOcclusion == null) {
10792
10923
  // TODO: Need global default.
10793
10924
  gOcclusion = true;
10794
10925
  }
10795
- console.log("Applying Ground Occlusion", Boolean(gOcclusion));
10796
10926
  scene.globe.depthTestAgainstTerrain = Boolean(gOcclusion);
10797
10927
  return [2 /*return*/];
10798
10928
  }
@@ -10872,7 +11002,7 @@ var ViewRenderEngine;
10872
11002
  ViewRenderEngine.Render = Render;
10873
11003
  })(ViewRenderEngine || (ViewRenderEngine = {}));
10874
11004
 
10875
- var VERSION = "2.2.2";
11005
+ var VERSION = "2.2.5";
10876
11006
 
10877
11007
  export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils };
10878
11008
  //# sourceMappingURL=bruce-cesium.es5.js.map