bruce-cesium 0.3.8 → 0.3.9
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 +25 -22
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +24 -21
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +35 -21
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -4484,11 +4484,11 @@
|
|
|
4484
4484
|
});
|
|
4485
4485
|
}
|
|
4486
4486
|
function renderV2(params, bookmark, view) {
|
|
4487
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
4487
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
4488
4488
|
return __awaiter(this, void 0, void 0, function () {
|
|
4489
4489
|
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, gOcclusion, terrain, source, imagery, curEnabled, newItemIds, _i, curEnabled_1, id;
|
|
4490
|
-
return __generator(this, function (
|
|
4491
|
-
switch (
|
|
4490
|
+
return __generator(this, function (_u) {
|
|
4491
|
+
switch (_u.label) {
|
|
4492
4492
|
case 0:
|
|
4493
4493
|
viewer = params.manager.Viewer;
|
|
4494
4494
|
scene = viewer.scene;
|
|
@@ -4496,9 +4496,12 @@
|
|
|
4496
4496
|
bSettings = ((_a = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) !== null && _a !== void 0 ? _a : {});
|
|
4497
4497
|
defaults = (_b = vSettings.defaults) !== null && _b !== void 0 ? _b : {};
|
|
4498
4498
|
camera = ((_c = bookmark.Camera) !== null && _c !== void 0 ? _c : {});
|
|
4499
|
+
if (!bruceModels.Carto.ValidateCarto(camera)) {
|
|
4500
|
+
camera = __assign(__assign({}, camera), { altitude: (_d = defaults.camera) === null || _d === void 0 ? void 0 : _d.altitude, latitude: (_e = defaults.camera) === null || _e === void 0 ? void 0 : _e.latitude, longitude: (_f = defaults.camera) === null || _f === void 0 ? void 0 : _f.longitude, heading: (_g = defaults.camera) === null || _g === void 0 ? void 0 : _g.heading, pitch: (_h = defaults.camera) === null || _h === void 0 ? void 0 : _h.pitch, roll: (_j = defaults.camera) === null || _j === void 0 ? void 0 : _j.roll });
|
|
4501
|
+
}
|
|
4499
4502
|
newLens = camera.cameraFrustum;
|
|
4500
4503
|
if (newLens == null) {
|
|
4501
|
-
newLens = (
|
|
4504
|
+
newLens = (_k = defaults.camera) === null || _k === void 0 ? void 0 : _k.cameraFrustum;
|
|
4502
4505
|
}
|
|
4503
4506
|
if (newLens == null) {
|
|
4504
4507
|
// TODO: Need global default.
|
|
@@ -4519,7 +4522,7 @@
|
|
|
4519
4522
|
}
|
|
4520
4523
|
transition = params.skipTransition ? 0 : curLens === newLens ? camera.transition : 0;
|
|
4521
4524
|
if (transition == null) {
|
|
4522
|
-
transition = (
|
|
4525
|
+
transition = (_l = defaults.camera) === null || _l === void 0 ? void 0 : _l.transition;
|
|
4523
4526
|
}
|
|
4524
4527
|
if (transition == null) {
|
|
4525
4528
|
// TODO: Need global default.
|
|
@@ -4530,25 +4533,25 @@
|
|
|
4530
4533
|
scene.camera.flyTo({
|
|
4531
4534
|
destination: pos,
|
|
4532
4535
|
orientation: {
|
|
4533
|
-
heading: +camera.heading,
|
|
4534
|
-
pitch: +camera.pitch,
|
|
4535
|
-
roll: +camera.roll
|
|
4536
|
+
heading: Cesium.Math.toRadians(+camera.heading),
|
|
4537
|
+
pitch: Cesium.Math.toRadians(+camera.pitch),
|
|
4538
|
+
roll: Cesium.Math.toRadians(+camera.roll)
|
|
4536
4539
|
},
|
|
4537
4540
|
duration: transition != 0 ? transition / 1000 : 0
|
|
4538
4541
|
});
|
|
4539
4542
|
}
|
|
4540
4543
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
4541
4544
|
if (gOcclusion == null) {
|
|
4542
|
-
gOcclusion = (
|
|
4545
|
+
gOcclusion = (_m = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _m === void 0 ? void 0 : _m.groundOcclusion;
|
|
4543
4546
|
}
|
|
4544
4547
|
if (gOcclusion == null) {
|
|
4545
4548
|
// TODO: Need global default.
|
|
4546
4549
|
gOcclusion = true;
|
|
4547
4550
|
}
|
|
4548
4551
|
scene.globe.depthTestAgainstTerrain = Boolean(gOcclusion);
|
|
4549
|
-
terrain = (
|
|
4552
|
+
terrain = (_o = bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain) !== null && _o !== void 0 ? _o : (_p = defaults.settings) === null || _p === void 0 ? void 0 : _p.terrain;
|
|
4550
4553
|
if (!terrain) return [3 /*break*/, 2];
|
|
4551
|
-
source = (
|
|
4554
|
+
source = (_q = vSettings.terrains) === null || _q === void 0 ? void 0 : _q.find(function (x) { return x.accountId === terrain.accountId && x.tilesetId === terrain.tilesetId; });
|
|
4552
4555
|
if (!source) return [3 /*break*/, 2];
|
|
4553
4556
|
return [4 /*yield*/, exports.TileRenderEngine.Terrain.V2.Render({
|
|
4554
4557
|
apiGetter: params.apiGetter,
|
|
@@ -4557,10 +4560,10 @@
|
|
|
4557
4560
|
viewer: params.manager.Viewer,
|
|
4558
4561
|
})];
|
|
4559
4562
|
case 1:
|
|
4560
|
-
|
|
4561
|
-
|
|
4563
|
+
_u.sent();
|
|
4564
|
+
_u.label = 2;
|
|
4562
4565
|
case 2:
|
|
4563
|
-
imagery = (
|
|
4566
|
+
imagery = (_r = bSettings.imagery) !== null && _r !== void 0 ? _r : (_s = defaults.settings) === null || _s === void 0 ? void 0 : _s.imagery;
|
|
4564
4567
|
if (imagery == null) {
|
|
4565
4568
|
// TODO: Need global default.
|
|
4566
4569
|
imagery = [
|
|
@@ -4583,19 +4586,19 @@
|
|
|
4583
4586
|
viewer: params.manager.Viewer,
|
|
4584
4587
|
})];
|
|
4585
4588
|
case 3:
|
|
4586
|
-
|
|
4589
|
+
_u.sent();
|
|
4587
4590
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
4588
|
-
newItemIds = (
|
|
4591
|
+
newItemIds = (_t = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _t !== void 0 ? _t : [];
|
|
4589
4592
|
_i = 0, curEnabled_1 = curEnabled;
|
|
4590
|
-
|
|
4593
|
+
_u.label = 4;
|
|
4591
4594
|
case 4:
|
|
4592
4595
|
if (!(_i < curEnabled_1.length)) return [3 /*break*/, 7];
|
|
4593
4596
|
id = curEnabled_1[_i];
|
|
4594
4597
|
if (!(newItemIds.indexOf(id) === -1)) return [3 /*break*/, 6];
|
|
4595
4598
|
return [4 /*yield*/, params.manager.RemoveItemById(id)];
|
|
4596
4599
|
case 5:
|
|
4597
|
-
|
|
4598
|
-
|
|
4600
|
+
_u.sent();
|
|
4601
|
+
_u.label = 6;
|
|
4599
4602
|
case 6:
|
|
4600
4603
|
_i++;
|
|
4601
4604
|
return [3 /*break*/, 4];
|
|
@@ -4606,8 +4609,8 @@
|
|
|
4606
4609
|
manager: params.manager,
|
|
4607
4610
|
}, params.viewId, params.bookmarkId)];
|
|
4608
4611
|
case 8:
|
|
4609
|
-
|
|
4610
|
-
|
|
4612
|
+
_u.sent();
|
|
4613
|
+
_u.label = 9;
|
|
4611
4614
|
case 9: return [2 /*return*/];
|
|
4612
4615
|
}
|
|
4613
4616
|
});
|