bruce-cesium 1.4.8 → 1.5.0
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 +30 -23
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +29 -22
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/render-managers/render-manager.js +8 -1
- package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +21 -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, ObjectUtils, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, Tileset, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Color, HeightReference, Cartesian3, EllipsoidTerrainProvider, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, HeadingPitchRange, Cesium3DTileColorBlendMode, KmlDataSource, createOsmBuildings, Cesium3DTileStyle, Rectangle, CallbackProperty, OrthographicFrustum, JulianDate, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Matrix4, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -976,15 +976,22 @@ var RenderManager;
|
|
|
976
976
|
if (!pos) {
|
|
977
977
|
return null;
|
|
978
978
|
}
|
|
979
|
+
var is2d = viewer.scene.mode === SceneMode.SCENE2D;
|
|
979
980
|
var cameraPos = viewer.camera.position;
|
|
980
981
|
if (!Cartes.ValidateCartes3(cameraPos)) {
|
|
981
982
|
return null;
|
|
982
983
|
}
|
|
983
984
|
var distance = Cartesian3.distance(pos, cameraPos);
|
|
984
|
-
|
|
985
|
+
var zoomItem = (!distance && distance != 0) ? null : GetZoomControlFromDistance({
|
|
985
986
|
zoomControl: zoomControl,
|
|
986
987
|
distance: distance
|
|
987
988
|
});
|
|
989
|
+
// In 2d cesium gets camera position very wrong.
|
|
990
|
+
// TODO: Need to check if lat/lon is correct and use that for distance calc instead.
|
|
991
|
+
if (is2d && !zoomItem && zoomControl.length) {
|
|
992
|
+
zoomItem = zoomControl[zoomControl.length - 1];
|
|
993
|
+
}
|
|
994
|
+
return zoomItem;
|
|
988
995
|
}
|
|
989
996
|
RenderManager.DetermineZoomItem = DetermineZoomItem;
|
|
990
997
|
function GetZoomControlFromDistance(params) {
|
|
@@ -8125,18 +8132,18 @@ function renderLegacyNavigator(params, bookmark, view) {
|
|
|
8125
8132
|
* @param view
|
|
8126
8133
|
*/
|
|
8127
8134
|
function renderNavigator(params, bookmark, view) {
|
|
8128
|
-
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
|
|
8135
|
+
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;
|
|
8129
8136
|
return __awaiter(this, void 0, void 0, function () {
|
|
8130
8137
|
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, gOcclusion, hillShades, baseColor, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, terrain, selectedIds, hiddenIds, isolatedIds, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem;
|
|
8131
|
-
return __generator(this, function (
|
|
8132
|
-
switch (
|
|
8138
|
+
return __generator(this, function (_3) {
|
|
8139
|
+
switch (_3.label) {
|
|
8133
8140
|
case 0:
|
|
8134
8141
|
viewer = params.manager.Viewer;
|
|
8135
8142
|
scene = viewer.scene;
|
|
8136
8143
|
vSettings = view.Settings;
|
|
8137
8144
|
bSettings = ((_a = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) !== null && _a !== void 0 ? _a : {});
|
|
8138
8145
|
defaults = (_b = vSettings.defaults) !== null && _b !== void 0 ? _b : {};
|
|
8139
|
-
camera = ((_c = bookmark.Camera) !== null && _c !== void 0 ? _c : {});
|
|
8146
|
+
camera = ((_c = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Camera) !== null && _c !== void 0 ? _c : {});
|
|
8140
8147
|
if (!Carto.ValidateCarto(camera)) {
|
|
8141
8148
|
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 });
|
|
8142
8149
|
}
|
|
@@ -8293,7 +8300,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8293
8300
|
clock = viewer.clock;
|
|
8294
8301
|
clock.currentTime = JulianDate.fromIso8601(dateTime);
|
|
8295
8302
|
}
|
|
8296
|
-
terrain = (
|
|
8303
|
+
terrain = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain) != null ? bSettings === null || bSettings === void 0 ? void 0 : bSettings.terrain : (_w = defaults.settings) === null || _w === void 0 ? void 0 : _w.terrain;
|
|
8297
8304
|
if (!terrain) return [3 /*break*/, 2];
|
|
8298
8305
|
return [4 /*yield*/, TileRenderEngine.Terrain.Navigator.Render({
|
|
8299
8306
|
apiGetter: params.apiGetter,
|
|
@@ -8301,12 +8308,12 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8301
8308
|
viewer: params.manager.Viewer,
|
|
8302
8309
|
})];
|
|
8303
8310
|
case 1:
|
|
8304
|
-
|
|
8305
|
-
|
|
8311
|
+
_3.sent();
|
|
8312
|
+
_3.label = 2;
|
|
8306
8313
|
case 2:
|
|
8307
8314
|
selectedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedEntityIds;
|
|
8308
8315
|
if (selectedIds == null) {
|
|
8309
|
-
selectedIds = (
|
|
8316
|
+
selectedIds = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.selectedEntityIds;
|
|
8310
8317
|
}
|
|
8311
8318
|
if (selectedIds != null) {
|
|
8312
8319
|
params.manager.VisualsRegister.ClearSelected();
|
|
@@ -8319,7 +8326,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8319
8326
|
params.manager.VisualsRegister.ClearHidden();
|
|
8320
8327
|
hiddenIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hiddenEntityIds;
|
|
8321
8328
|
if (hiddenIds == null) {
|
|
8322
|
-
hiddenIds = (
|
|
8329
|
+
hiddenIds = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.hiddenEntityIds;
|
|
8323
8330
|
}
|
|
8324
8331
|
if (hiddenIds != null) {
|
|
8325
8332
|
params.manager.VisualsRegister.SetHidden({
|
|
@@ -8330,7 +8337,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8330
8337
|
params.manager.VisualsRegister.ClearIsolated();
|
|
8331
8338
|
isolatedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.isolatedEntityIds;
|
|
8332
8339
|
if (isolatedIds == null) {
|
|
8333
|
-
isolatedIds = (
|
|
8340
|
+
isolatedIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.isolatedEntityIds;
|
|
8334
8341
|
}
|
|
8335
8342
|
if (isolatedIds != null) {
|
|
8336
8343
|
params.manager.VisualsRegister.SetIsolated({
|
|
@@ -8341,7 +8348,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8341
8348
|
params.manager.VisualsRegister.ClearOpacity();
|
|
8342
8349
|
entityOpacityMap = bSettings === null || bSettings === void 0 ? void 0 : bSettings.entityOpacityMap;
|
|
8343
8350
|
if (entityOpacityMap == null) {
|
|
8344
|
-
entityOpacityMap = (
|
|
8351
|
+
entityOpacityMap = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.entityOpacityMap;
|
|
8345
8352
|
}
|
|
8346
8353
|
if (entityOpacityMap != null) {
|
|
8347
8354
|
for (entityId in entityOpacityMap) {
|
|
@@ -8354,7 +8361,7 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8354
8361
|
}
|
|
8355
8362
|
}
|
|
8356
8363
|
}
|
|
8357
|
-
imagery =
|
|
8364
|
+
imagery = bSettings.imagery != null ? bSettings.imagery : (_1 = defaults.settings) === null || _1 === void 0 ? void 0 : _1.imagery;
|
|
8358
8365
|
if (imagery == null) {
|
|
8359
8366
|
// TODO: Need global default.
|
|
8360
8367
|
imagery = [
|
|
@@ -8376,15 +8383,15 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8376
8383
|
viewer: params.manager.Viewer,
|
|
8377
8384
|
})];
|
|
8378
8385
|
case 3:
|
|
8379
|
-
|
|
8386
|
+
_3.sent();
|
|
8380
8387
|
renderedRelationEntityIds = bSettings.renderedEntityRelations;
|
|
8381
8388
|
if (!renderedRelationEntityIds) {
|
|
8382
8389
|
renderedRelationEntityIds = [];
|
|
8383
8390
|
}
|
|
8384
8391
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
8385
|
-
newItemIds = (
|
|
8392
|
+
newItemIds = (_2 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _2 !== void 0 ? _2 : [];
|
|
8386
8393
|
_i = 0, curEnabled_1 = curEnabled;
|
|
8387
|
-
|
|
8394
|
+
_3.label = 4;
|
|
8388
8395
|
case 4:
|
|
8389
8396
|
if (!(_i < curEnabled_1.length)) return [3 /*break*/, 7];
|
|
8390
8397
|
id = curEnabled_1[_i];
|
|
@@ -8394,8 +8401,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8394
8401
|
menuItemId: id
|
|
8395
8402
|
})];
|
|
8396
8403
|
case 5:
|
|
8397
|
-
|
|
8398
|
-
|
|
8404
|
+
_3.sent();
|
|
8405
|
+
_3.label = 6;
|
|
8399
8406
|
case 6:
|
|
8400
8407
|
_i++;
|
|
8401
8408
|
return [3 /*break*/, 4];
|
|
@@ -8408,8 +8415,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8408
8415
|
bookmark: bookmark
|
|
8409
8416
|
})];
|
|
8410
8417
|
case 8:
|
|
8411
|
-
|
|
8412
|
-
|
|
8418
|
+
_3.sent();
|
|
8419
|
+
_3.label = 9;
|
|
8413
8420
|
case 9:
|
|
8414
8421
|
if (!(renderedRelationEntityIds.length > 0)) return [3 /*break*/, 11];
|
|
8415
8422
|
menuItem = {
|
|
@@ -8425,8 +8432,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
8425
8432
|
item: menuItem
|
|
8426
8433
|
})];
|
|
8427
8434
|
case 10:
|
|
8428
|
-
|
|
8429
|
-
|
|
8435
|
+
_3.sent();
|
|
8436
|
+
_3.label = 11;
|
|
8430
8437
|
case 11: return [2 /*return*/];
|
|
8431
8438
|
}
|
|
8432
8439
|
});
|