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.es5.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, DelayQueue, Entity as Entity$1, BatchedDataGetter, ObjectUtils, Tileset, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, TilesetExtMapTiles, Camera, MathUtils } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1, Viewer, ArcGisMapServerImageryProvider, ScreenSpaceEventType, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, HeadingPitchRange,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Viewer, ArcGisMapServerImageryProvider, ScreenSpaceEventType, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, HeadingPitchRange, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, OrthographicFrustum, createOsmBuildings, Cesium3DTileStyle, Rectangle, EllipsoidGeodesic, Matrix4, Cesium3DTileset } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -4524,11 +4524,11 @@ function renderV1(params, bookmark, view) {
|
|
|
4524
4524
|
});
|
|
4525
4525
|
}
|
|
4526
4526
|
function renderV2(params, bookmark, view) {
|
|
4527
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
4527
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
4528
4528
|
return __awaiter(this, void 0, void 0, function () {
|
|
4529
4529
|
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, gOcclusion, terrain, source, imagery, curEnabled, newItemIds, _i, curEnabled_1, id;
|
|
4530
|
-
return __generator(this, function (
|
|
4531
|
-
switch (
|
|
4530
|
+
return __generator(this, function (_u) {
|
|
4531
|
+
switch (_u.label) {
|
|
4532
4532
|
case 0:
|
|
4533
4533
|
viewer = params.manager.Viewer;
|
|
4534
4534
|
scene = viewer.scene;
|
|
@@ -4536,9 +4536,12 @@ function renderV2(params, bookmark, view) {
|
|
|
4536
4536
|
bSettings = ((_a = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) !== null && _a !== void 0 ? _a : {});
|
|
4537
4537
|
defaults = (_b = vSettings.defaults) !== null && _b !== void 0 ? _b : {};
|
|
4538
4538
|
camera = ((_c = bookmark.Camera) !== null && _c !== void 0 ? _c : {});
|
|
4539
|
+
if (!Carto.ValidateCarto(camera)) {
|
|
4540
|
+
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 });
|
|
4541
|
+
}
|
|
4539
4542
|
newLens = camera.cameraFrustum;
|
|
4540
4543
|
if (newLens == null) {
|
|
4541
|
-
newLens = (
|
|
4544
|
+
newLens = (_k = defaults.camera) === null || _k === void 0 ? void 0 : _k.cameraFrustum;
|
|
4542
4545
|
}
|
|
4543
4546
|
if (newLens == null) {
|
|
4544
4547
|
// TODO: Need global default.
|
|
@@ -4559,7 +4562,7 @@ function renderV2(params, bookmark, view) {
|
|
|
4559
4562
|
}
|
|
4560
4563
|
transition = params.skipTransition ? 0 : curLens === newLens ? camera.transition : 0;
|
|
4561
4564
|
if (transition == null) {
|
|
4562
|
-
transition = (
|
|
4565
|
+
transition = (_l = defaults.camera) === null || _l === void 0 ? void 0 : _l.transition;
|
|
4563
4566
|
}
|
|
4564
4567
|
if (transition == null) {
|
|
4565
4568
|
// TODO: Need global default.
|
|
@@ -4570,25 +4573,25 @@ function renderV2(params, bookmark, view) {
|
|
|
4570
4573
|
scene.camera.flyTo({
|
|
4571
4574
|
destination: pos,
|
|
4572
4575
|
orientation: {
|
|
4573
|
-
heading: +camera.heading,
|
|
4574
|
-
pitch: +camera.pitch,
|
|
4575
|
-
roll: +camera.roll
|
|
4576
|
+
heading: Math$1.toRadians(+camera.heading),
|
|
4577
|
+
pitch: Math$1.toRadians(+camera.pitch),
|
|
4578
|
+
roll: Math$1.toRadians(+camera.roll)
|
|
4576
4579
|
},
|
|
4577
4580
|
duration: transition != 0 ? transition / 1000 : 0
|
|
4578
4581
|
});
|
|
4579
4582
|
}
|
|
4580
4583
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
4581
4584
|
if (gOcclusion == null) {
|
|
4582
|
-
gOcclusion = (
|
|
4585
|
+
gOcclusion = (_m = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _m === void 0 ? void 0 : _m.groundOcclusion;
|
|
4583
4586
|
}
|
|
4584
4587
|
if (gOcclusion == null) {
|
|
4585
4588
|
// TODO: Need global default.
|
|
4586
4589
|
gOcclusion = true;
|
|
4587
4590
|
}
|
|
4588
4591
|
scene.globe.depthTestAgainstTerrain = Boolean(gOcclusion);
|
|
4589
|
-
terrain = (
|
|
4592
|
+
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;
|
|
4590
4593
|
if (!terrain) return [3 /*break*/, 2];
|
|
4591
|
-
source = (
|
|
4594
|
+
source = (_q = vSettings.terrains) === null || _q === void 0 ? void 0 : _q.find(function (x) { return x.accountId === terrain.accountId && x.tilesetId === terrain.tilesetId; });
|
|
4592
4595
|
if (!source) return [3 /*break*/, 2];
|
|
4593
4596
|
return [4 /*yield*/, TileRenderEngine.Terrain.V2.Render({
|
|
4594
4597
|
apiGetter: params.apiGetter,
|
|
@@ -4597,10 +4600,10 @@ function renderV2(params, bookmark, view) {
|
|
|
4597
4600
|
viewer: params.manager.Viewer,
|
|
4598
4601
|
})];
|
|
4599
4602
|
case 1:
|
|
4600
|
-
|
|
4601
|
-
|
|
4603
|
+
_u.sent();
|
|
4604
|
+
_u.label = 2;
|
|
4602
4605
|
case 2:
|
|
4603
|
-
imagery = (
|
|
4606
|
+
imagery = (_r = bSettings.imagery) !== null && _r !== void 0 ? _r : (_s = defaults.settings) === null || _s === void 0 ? void 0 : _s.imagery;
|
|
4604
4607
|
if (imagery == null) {
|
|
4605
4608
|
// TODO: Need global default.
|
|
4606
4609
|
imagery = [
|
|
@@ -4623,19 +4626,19 @@ function renderV2(params, bookmark, view) {
|
|
|
4623
4626
|
viewer: params.manager.Viewer,
|
|
4624
4627
|
})];
|
|
4625
4628
|
case 3:
|
|
4626
|
-
|
|
4629
|
+
_u.sent();
|
|
4627
4630
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
4628
|
-
newItemIds = (
|
|
4631
|
+
newItemIds = (_t = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _t !== void 0 ? _t : [];
|
|
4629
4632
|
_i = 0, curEnabled_1 = curEnabled;
|
|
4630
|
-
|
|
4633
|
+
_u.label = 4;
|
|
4631
4634
|
case 4:
|
|
4632
4635
|
if (!(_i < curEnabled_1.length)) return [3 /*break*/, 7];
|
|
4633
4636
|
id = curEnabled_1[_i];
|
|
4634
4637
|
if (!(newItemIds.indexOf(id) === -1)) return [3 /*break*/, 6];
|
|
4635
4638
|
return [4 /*yield*/, params.manager.RemoveItemById(id)];
|
|
4636
4639
|
case 5:
|
|
4637
|
-
|
|
4638
|
-
|
|
4640
|
+
_u.sent();
|
|
4641
|
+
_u.label = 6;
|
|
4639
4642
|
case 6:
|
|
4640
4643
|
_i++;
|
|
4641
4644
|
return [3 /*break*/, 4];
|
|
@@ -4646,8 +4649,8 @@ function renderV2(params, bookmark, view) {
|
|
|
4646
4649
|
manager: params.manager,
|
|
4647
4650
|
}, params.viewId, params.bookmarkId)];
|
|
4648
4651
|
case 8:
|
|
4649
|
-
|
|
4650
|
-
|
|
4652
|
+
_u.sent();
|
|
4653
|
+
_u.label = 9;
|
|
4651
4654
|
case 9: return [2 /*return*/];
|
|
4652
4655
|
}
|
|
4653
4656
|
});
|