bruce-cesium 2.2.4 → 2.2.6
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.
- package/dist/bruce-cesium.es5.js +181 -54
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +180 -53
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/render-manager.js +3 -3
- package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +43 -49
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/utils/drawing-utils.js +78 -0
- package/dist/lib/utils/drawing-utils.js.map +1 -1
- package/dist/lib/utils/view-utils.js +55 -0
- package/dist/lib/utils/view-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/drawing-utils.d.ts +7 -0
- package/dist/types/utils/view-utils.d.ts +13 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -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 {
|
|
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, Primitive, Cesium3DTileFeature, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, PolygonPipeline, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, OrthographicFrustum, JulianDate, CesiumInspector, defined, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, Model, ColorMaterialProperty, Matrix3, Matrix4, EasingFunction, GeometryInstance, IonResource } 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
|
|
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
|
|
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 (
|
|
1399
|
+
if (isFlatEarth && !zoomItem && zoomControl.length) {
|
|
1322
1400
|
zoomItem = zoomControl[zoomControl.length - 1];
|
|
1323
1401
|
}
|
|
1324
1402
|
return zoomItem;
|
|
@@ -10315,6 +10393,61 @@ var ViewUtils;
|
|
|
10315
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;
|
|
10316
10394
|
}
|
|
10317
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;
|
|
10318
10451
|
})(ViewUtils || (ViewUtils = {}));
|
|
10319
10452
|
|
|
10320
10453
|
// TODO: Move these to the data model.
|
|
@@ -10468,11 +10601,11 @@ function renderLegacyNavigator(params, bookmark, view) {
|
|
|
10468
10601
|
* @param view
|
|
10469
10602
|
*/
|
|
10470
10603
|
function renderNavigator(params, bookmark, view) {
|
|
10471
|
-
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
|
|
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;
|
|
10472
10605
|
return __awaiter(this, void 0, void 0, function () {
|
|
10473
|
-
var viewer, scene, vSettings, bSettings, defaults, camera, newLens,
|
|
10474
|
-
return __generator(this, function (
|
|
10475
|
-
switch (
|
|
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) {
|
|
10476
10609
|
case 0:
|
|
10477
10610
|
viewer = params.manager.Viewer;
|
|
10478
10611
|
scene = viewer.scene;
|
|
@@ -10491,25 +10624,21 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10491
10624
|
// TODO: Need global default.
|
|
10492
10625
|
newLens = Camera.EFrustum.Perspective;
|
|
10493
10626
|
}
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
else {
|
|
10505
|
-
modePicker_1.viewModel._morphTo2D();
|
|
10506
|
-
}
|
|
10507
|
-
}
|
|
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
|
+
});
|
|
10508
10637
|
}
|
|
10509
10638
|
if (!params.skipCamera) {
|
|
10510
|
-
transition = params.skipTransition ? 0 :
|
|
10639
|
+
transition = params.skipTransition ? 0 : shouldBe2d === curIs2d ? camera.transition : 0;
|
|
10511
10640
|
if (transition == null) {
|
|
10512
|
-
transition = (
|
|
10641
|
+
transition = (_l = defaults.camera) === null || _l === void 0 ? void 0 : _l.transition;
|
|
10513
10642
|
}
|
|
10514
10643
|
if (transition == null) {
|
|
10515
10644
|
// TODO: Need global default.
|
|
@@ -10528,7 +10657,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10528
10657
|
});
|
|
10529
10658
|
}
|
|
10530
10659
|
}
|
|
10531
|
-
terrain = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain) != null ? bSettings === null || bSettings === void 0 ? void 0 : bSettings.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;
|
|
10532
10661
|
if (!terrain) return [3 /*break*/, 2];
|
|
10533
10662
|
return [4 /*yield*/, TileRenderEngine.Terrain.Navigator.Render({
|
|
10534
10663
|
apiGetter: params.apiGetter,
|
|
@@ -10536,12 +10665,12 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10536
10665
|
viewer: params.manager.Viewer,
|
|
10537
10666
|
})];
|
|
10538
10667
|
case 1:
|
|
10539
|
-
|
|
10540
|
-
|
|
10668
|
+
_6.sent();
|
|
10669
|
+
_6.label = 2;
|
|
10541
10670
|
case 2:
|
|
10542
|
-
hillShades = (
|
|
10671
|
+
hillShades = (_o = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) === null || _o === void 0 ? void 0 : _o.hillShades;
|
|
10543
10672
|
if (hillShades == null) {
|
|
10544
|
-
hillShades = (
|
|
10673
|
+
hillShades = (_p = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _p === void 0 ? void 0 : _p.hillShades;
|
|
10545
10674
|
}
|
|
10546
10675
|
if (hillShades == null) {
|
|
10547
10676
|
hillShades = true;
|
|
@@ -10549,7 +10678,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10549
10678
|
scene.globe.enableLighting = Boolean(hillShades);
|
|
10550
10679
|
baseColor = bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeColor;
|
|
10551
10680
|
if (baseColor == null) {
|
|
10552
|
-
baseColor = (
|
|
10681
|
+
baseColor = (_q = defaults.settings) === null || _q === void 0 ? void 0 : _q.globeColor;
|
|
10553
10682
|
}
|
|
10554
10683
|
if (baseColor == null) {
|
|
10555
10684
|
// TODO: Need global default.
|
|
@@ -10558,7 +10687,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10558
10687
|
scene.globe.baseColor = Color.fromCssColorString(baseColor);
|
|
10559
10688
|
globeHidden = bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeHidden;
|
|
10560
10689
|
if (globeHidden == null) {
|
|
10561
|
-
globeHidden = (
|
|
10690
|
+
globeHidden = (_r = defaults.settings) === null || _r === void 0 ? void 0 : _r.globeHidden;
|
|
10562
10691
|
}
|
|
10563
10692
|
if (globeHidden == null) {
|
|
10564
10693
|
globeHidden = false;
|
|
@@ -10566,7 +10695,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10566
10695
|
scene.globe.show = !globeHidden;
|
|
10567
10696
|
terrainWireframe = bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrainWireframe;
|
|
10568
10697
|
if (terrainWireframe == null) {
|
|
10569
|
-
terrainWireframe = (
|
|
10698
|
+
terrainWireframe = (_s = defaults.settings) === null || _s === void 0 ? void 0 : _s.terrainWireframe;
|
|
10570
10699
|
}
|
|
10571
10700
|
if (terrainWireframe == null) {
|
|
10572
10701
|
terrainWireframe = false;
|
|
@@ -10577,7 +10706,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10577
10706
|
});
|
|
10578
10707
|
globeAlpha = +(bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeAlpha);
|
|
10579
10708
|
if (isNaN(globeAlpha)) {
|
|
10580
|
-
globeAlpha = +((
|
|
10709
|
+
globeAlpha = +((_t = defaults.settings) === null || _t === void 0 ? void 0 : _t.globeAlpha);
|
|
10581
10710
|
}
|
|
10582
10711
|
if (!scene.globe.translucency.enabled) {
|
|
10583
10712
|
scene.globe.translucency.enabled = true;
|
|
@@ -10587,12 +10716,11 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10587
10716
|
scene.globe.translucency.frontFaceAlphaByDistance.nearValue = EnsureNumber(globeAlpha, 1);
|
|
10588
10717
|
shadows = bSettings === null || bSettings === void 0 ? void 0 : bSettings.shadows;
|
|
10589
10718
|
if (shadows == null) {
|
|
10590
|
-
shadows = (
|
|
10719
|
+
shadows = (_u = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _u === void 0 ? void 0 : _u.shadows;
|
|
10591
10720
|
}
|
|
10592
10721
|
if (shadows == null) {
|
|
10593
|
-
// Experimenting with default on.
|
|
10594
10722
|
shadows = {
|
|
10595
|
-
enabled:
|
|
10723
|
+
enabled: false
|
|
10596
10724
|
};
|
|
10597
10725
|
}
|
|
10598
10726
|
if (shadows.enabled) {
|
|
@@ -10615,7 +10743,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10615
10743
|
}
|
|
10616
10744
|
ambientOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.ambientOcclusion;
|
|
10617
10745
|
if (ambientOcclusion == null) {
|
|
10618
|
-
ambientOcclusion = (
|
|
10746
|
+
ambientOcclusion = (_v = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _v === void 0 ? void 0 : _v.ambientOcclusion;
|
|
10619
10747
|
}
|
|
10620
10748
|
if (ambientOcclusion == null) {
|
|
10621
10749
|
ambientOcclusion = {
|
|
@@ -10638,7 +10766,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10638
10766
|
}
|
|
10639
10767
|
lighting = bSettings === null || bSettings === void 0 ? void 0 : bSettings.lighting;
|
|
10640
10768
|
if (lighting == null) {
|
|
10641
|
-
lighting = (
|
|
10769
|
+
lighting = (_w = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _w === void 0 ? void 0 : _w.lighting;
|
|
10642
10770
|
}
|
|
10643
10771
|
if (lighting == null) {
|
|
10644
10772
|
lighting = {
|
|
@@ -10653,7 +10781,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10653
10781
|
}
|
|
10654
10782
|
quality = bSettings === null || bSettings === void 0 ? void 0 : bSettings.quality;
|
|
10655
10783
|
if (quality == null) {
|
|
10656
|
-
quality = (
|
|
10784
|
+
quality = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.quality;
|
|
10657
10785
|
}
|
|
10658
10786
|
if (quality == null) {
|
|
10659
10787
|
quality = {
|
|
@@ -10664,7 +10792,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10664
10792
|
fxaa.enabled = Boolean(quality.fxaa);
|
|
10665
10793
|
dateTime = bSettings === null || bSettings === void 0 ? void 0 : bSettings.dateTime;
|
|
10666
10794
|
if (dateTime == null) {
|
|
10667
|
-
dateTime = (
|
|
10795
|
+
dateTime = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.dateTime;
|
|
10668
10796
|
}
|
|
10669
10797
|
if (dateTime != null) {
|
|
10670
10798
|
clock = viewer.clock;
|
|
@@ -10672,7 +10800,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10672
10800
|
}
|
|
10673
10801
|
selectedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedEntityIds;
|
|
10674
10802
|
if (selectedIds == null) {
|
|
10675
|
-
selectedIds = (
|
|
10803
|
+
selectedIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.selectedEntityIds;
|
|
10676
10804
|
}
|
|
10677
10805
|
if (selectedIds != null) {
|
|
10678
10806
|
params.manager.VisualsRegister.ClearSelected();
|
|
@@ -10685,7 +10813,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10685
10813
|
params.manager.VisualsRegister.ClearHidden();
|
|
10686
10814
|
hiddenIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hiddenEntityIds;
|
|
10687
10815
|
if (hiddenIds == null) {
|
|
10688
|
-
hiddenIds = (
|
|
10816
|
+
hiddenIds = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.hiddenEntityIds;
|
|
10689
10817
|
}
|
|
10690
10818
|
if (hiddenIds != null) {
|
|
10691
10819
|
params.manager.VisualsRegister.SetHidden({
|
|
@@ -10696,7 +10824,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10696
10824
|
params.manager.VisualsRegister.ClearIsolated();
|
|
10697
10825
|
isolatedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.isolatedEntityIds;
|
|
10698
10826
|
if (isolatedIds == null) {
|
|
10699
|
-
isolatedIds = (
|
|
10827
|
+
isolatedIds = (_1 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _1 === void 0 ? void 0 : _1.isolatedEntityIds;
|
|
10700
10828
|
}
|
|
10701
10829
|
if (isolatedIds != null) {
|
|
10702
10830
|
params.manager.VisualsRegister.SetIsolated({
|
|
@@ -10707,7 +10835,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10707
10835
|
params.manager.VisualsRegister.ClearOpacity();
|
|
10708
10836
|
entityOpacityMap = bSettings === null || bSettings === void 0 ? void 0 : bSettings.entityOpacityMap;
|
|
10709
10837
|
if (entityOpacityMap == null) {
|
|
10710
|
-
entityOpacityMap = (
|
|
10838
|
+
entityOpacityMap = (_2 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _2 === void 0 ? void 0 : _2.entityOpacityMap;
|
|
10711
10839
|
}
|
|
10712
10840
|
if (entityOpacityMap != null) {
|
|
10713
10841
|
for (entityId in entityOpacityMap) {
|
|
@@ -10720,7 +10848,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10720
10848
|
}
|
|
10721
10849
|
}
|
|
10722
10850
|
}
|
|
10723
|
-
imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (
|
|
10851
|
+
imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (_3 = defaults.settings) === null || _3 === void 0 ? void 0 : _3.imagery;
|
|
10724
10852
|
if (imagery == null) {
|
|
10725
10853
|
// TODO: Need global default.
|
|
10726
10854
|
imagery = [
|
|
@@ -10742,13 +10870,13 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10742
10870
|
viewer: params.manager.Viewer,
|
|
10743
10871
|
})];
|
|
10744
10872
|
case 3:
|
|
10745
|
-
|
|
10873
|
+
_6.sent();
|
|
10746
10874
|
renderedRelationEntityIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
|
|
10747
10875
|
if (!renderedRelationEntityIds) {
|
|
10748
10876
|
renderedRelationEntityIds = [];
|
|
10749
10877
|
}
|
|
10750
10878
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
10751
|
-
newItemIds = (
|
|
10879
|
+
newItemIds = (_4 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _4 !== void 0 ? _4 : [];
|
|
10752
10880
|
for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
|
|
10753
10881
|
id = curEnabled_1[_i];
|
|
10754
10882
|
if (newItemIds.indexOf(id) === -1 ||
|
|
@@ -10766,8 +10894,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10766
10894
|
bookmark: bookmark
|
|
10767
10895
|
})];
|
|
10768
10896
|
case 4:
|
|
10769
|
-
|
|
10770
|
-
|
|
10897
|
+
_6.sent();
|
|
10898
|
+
_6.label = 5;
|
|
10771
10899
|
case 5:
|
|
10772
10900
|
if (!(renderedRelationEntityIds.length > 0)) return [3 /*break*/, 7];
|
|
10773
10901
|
menuItem = {
|
|
@@ -10783,18 +10911,17 @@ function renderNavigator(params, bookmark, view) {
|
|
|
10783
10911
|
item: menuItem
|
|
10784
10912
|
})];
|
|
10785
10913
|
case 6:
|
|
10786
|
-
|
|
10787
|
-
|
|
10914
|
+
_6.sent();
|
|
10915
|
+
_6.label = 7;
|
|
10788
10916
|
case 7:
|
|
10789
10917
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
10790
10918
|
if (gOcclusion == null) {
|
|
10791
|
-
gOcclusion = (
|
|
10919
|
+
gOcclusion = (_5 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _5 === void 0 ? void 0 : _5.groundOcclusion;
|
|
10792
10920
|
}
|
|
10793
10921
|
if (gOcclusion == null) {
|
|
10794
10922
|
// TODO: Need global default.
|
|
10795
10923
|
gOcclusion = true;
|
|
10796
10924
|
}
|
|
10797
|
-
console.log("Applying Ground Occlusion", Boolean(gOcclusion));
|
|
10798
10925
|
scene.globe.depthTestAgainstTerrain = Boolean(gOcclusion);
|
|
10799
10926
|
return [2 /*return*/];
|
|
10800
10927
|
}
|
|
@@ -10874,7 +11001,7 @@ var ViewRenderEngine;
|
|
|
10874
11001
|
ViewRenderEngine.Render = Render;
|
|
10875
11002
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
10876
11003
|
|
|
10877
|
-
var VERSION = "2.2.
|
|
11004
|
+
var VERSION = "2.2.6";
|
|
10878
11005
|
|
|
10879
11006
|
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 };
|
|
10880
11007
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|