bruce-cesium 1.7.3 → 1.7.4

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, 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, HeightReference, EllipsoidTerrainProvider, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, KmlDataSource, createOsmBuildings, Cesium3DTileStyle, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, OrthographicFrustum, JulianDate, ColorMaterialProperty, Matrix3, Matrix4, EasingFunction, GeometryInstance, Cesium3DTileset, IonResource, createGooglePhotorealistic3DTileset } from 'cesium';
3
+ import { Cartesian2, Cartographic, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, HeightReference, EllipsoidTerrainProvider, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, OrthographicFrustum, JulianDate, Cesium3DTileset, Matrix4, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance, createGooglePhotorealistic3DTileset } from 'cesium';
4
4
 
5
5
  var TIME_LAG = 300;
6
6
  var POSITION_CHECK_TIMER = 950;
@@ -8842,11 +8842,11 @@ function renderLegacyNavigator(params, bookmark, view) {
8842
8842
  * @param view
8843
8843
  */
8844
8844
  function renderNavigator(params, bookmark, view) {
8845
- 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;
8845
+ 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;
8846
8846
  return __awaiter(this, void 0, void 0, function () {
8847
- var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, terrain, gOcclusion, hillShades, baseColor, 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;
8848
- return __generator(this, function (_3) {
8849
- switch (_3.label) {
8847
+ var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, terrain, gOcclusion, hillShades, baseColor, globeHidden, 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;
8848
+ return __generator(this, function (_4) {
8849
+ switch (_4.label) {
8850
8850
  case 0:
8851
8851
  viewer = params.manager.Viewer;
8852
8852
  scene = viewer.scene;
@@ -8908,8 +8908,8 @@ function renderNavigator(params, bookmark, view) {
8908
8908
  viewer: params.manager.Viewer,
8909
8909
  })];
8910
8910
  case 1:
8911
- _3.sent();
8912
- _3.label = 2;
8911
+ _4.sent();
8912
+ _4.label = 2;
8913
8913
  case 2:
8914
8914
  gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
8915
8915
  if (gOcclusion == null) {
@@ -8937,9 +8937,17 @@ function renderNavigator(params, bookmark, view) {
8937
8937
  baseColor = "#0326BE";
8938
8938
  }
8939
8939
  scene.globe.baseColor = Color.fromCssColorString(baseColor);
8940
+ globeHidden = bSettings === null || bSettings === void 0 ? void 0 : bSettings.globeHidden;
8941
+ if (globeHidden == null) {
8942
+ globeHidden = (_s = defaults.settings) === null || _s === void 0 ? void 0 : _s.globeHidden;
8943
+ }
8944
+ if (globeHidden == null) {
8945
+ globeHidden = false;
8946
+ }
8947
+ scene.globe.show = !globeHidden;
8940
8948
  shadows = bSettings === null || bSettings === void 0 ? void 0 : bSettings.shadows;
8941
8949
  if (shadows == null) {
8942
- shadows = (_s = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _s === void 0 ? void 0 : _s.shadows;
8950
+ shadows = (_t = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _t === void 0 ? void 0 : _t.shadows;
8943
8951
  }
8944
8952
  if (shadows == null) {
8945
8953
  shadows = {
@@ -8966,7 +8974,7 @@ function renderNavigator(params, bookmark, view) {
8966
8974
  }
8967
8975
  ambientOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.ambientOcclusion;
8968
8976
  if (ambientOcclusion == null) {
8969
- ambientOcclusion = (_t = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _t === void 0 ? void 0 : _t.ambientOcclusion;
8977
+ ambientOcclusion = (_u = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _u === void 0 ? void 0 : _u.ambientOcclusion;
8970
8978
  }
8971
8979
  if (ambientOcclusion == null) {
8972
8980
  ambientOcclusion = {
@@ -8989,7 +8997,7 @@ function renderNavigator(params, bookmark, view) {
8989
8997
  }
8990
8998
  lighting = bSettings === null || bSettings === void 0 ? void 0 : bSettings.lighting;
8991
8999
  if (lighting == null) {
8992
- lighting = (_u = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _u === void 0 ? void 0 : _u.lighting;
9000
+ lighting = (_v = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _v === void 0 ? void 0 : _v.lighting;
8993
9001
  }
8994
9002
  if (lighting == null) {
8995
9003
  lighting = {
@@ -9004,7 +9012,7 @@ function renderNavigator(params, bookmark, view) {
9004
9012
  }
9005
9013
  quality = bSettings === null || bSettings === void 0 ? void 0 : bSettings.quality;
9006
9014
  if (quality == null) {
9007
- quality = (_v = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _v === void 0 ? void 0 : _v.quality;
9015
+ quality = (_w = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _w === void 0 ? void 0 : _w.quality;
9008
9016
  }
9009
9017
  if (quality == null) {
9010
9018
  quality = {
@@ -9015,7 +9023,7 @@ function renderNavigator(params, bookmark, view) {
9015
9023
  fxaa.enabled = Boolean(quality.fxaa);
9016
9024
  dateTime = bSettings === null || bSettings === void 0 ? void 0 : bSettings.dateTime;
9017
9025
  if (dateTime == null) {
9018
- dateTime = (_w = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _w === void 0 ? void 0 : _w.dateTime;
9026
+ dateTime = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.dateTime;
9019
9027
  }
9020
9028
  if (dateTime != null) {
9021
9029
  clock = viewer.clock;
@@ -9023,7 +9031,7 @@ function renderNavigator(params, bookmark, view) {
9023
9031
  }
9024
9032
  selectedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedEntityIds;
9025
9033
  if (selectedIds == null) {
9026
- selectedIds = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.selectedEntityIds;
9034
+ selectedIds = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.selectedEntityIds;
9027
9035
  }
9028
9036
  if (selectedIds != null) {
9029
9037
  params.manager.VisualsRegister.ClearSelected();
@@ -9036,7 +9044,7 @@ function renderNavigator(params, bookmark, view) {
9036
9044
  params.manager.VisualsRegister.ClearHidden();
9037
9045
  hiddenIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hiddenEntityIds;
9038
9046
  if (hiddenIds == null) {
9039
- hiddenIds = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.hiddenEntityIds;
9047
+ hiddenIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.hiddenEntityIds;
9040
9048
  }
9041
9049
  if (hiddenIds != null) {
9042
9050
  params.manager.VisualsRegister.SetHidden({
@@ -9047,7 +9055,7 @@ function renderNavigator(params, bookmark, view) {
9047
9055
  params.manager.VisualsRegister.ClearIsolated();
9048
9056
  isolatedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.isolatedEntityIds;
9049
9057
  if (isolatedIds == null) {
9050
- isolatedIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.isolatedEntityIds;
9058
+ isolatedIds = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.isolatedEntityIds;
9051
9059
  }
9052
9060
  if (isolatedIds != null) {
9053
9061
  params.manager.VisualsRegister.SetIsolated({
@@ -9058,7 +9066,7 @@ function renderNavigator(params, bookmark, view) {
9058
9066
  params.manager.VisualsRegister.ClearOpacity();
9059
9067
  entityOpacityMap = bSettings === null || bSettings === void 0 ? void 0 : bSettings.entityOpacityMap;
9060
9068
  if (entityOpacityMap == null) {
9061
- entityOpacityMap = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.entityOpacityMap;
9069
+ entityOpacityMap = (_1 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _1 === void 0 ? void 0 : _1.entityOpacityMap;
9062
9070
  }
9063
9071
  if (entityOpacityMap != null) {
9064
9072
  for (entityId in entityOpacityMap) {
@@ -9071,7 +9079,7 @@ function renderNavigator(params, bookmark, view) {
9071
9079
  }
9072
9080
  }
9073
9081
  }
9074
- imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (_1 = defaults.settings) === null || _1 === void 0 ? void 0 : _1.imagery;
9082
+ imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (_2 = defaults.settings) === null || _2 === void 0 ? void 0 : _2.imagery;
9075
9083
  if (imagery == null) {
9076
9084
  // TODO: Need global default.
9077
9085
  imagery = [
@@ -9093,15 +9101,15 @@ function renderNavigator(params, bookmark, view) {
9093
9101
  viewer: params.manager.Viewer,
9094
9102
  })];
9095
9103
  case 3:
9096
- _3.sent();
9104
+ _4.sent();
9097
9105
  renderedRelationEntityIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
9098
9106
  if (!renderedRelationEntityIds) {
9099
9107
  renderedRelationEntityIds = [];
9100
9108
  }
9101
9109
  curEnabled = params.manager.GetEnabledItemIds();
9102
- newItemIds = (_2 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _2 !== void 0 ? _2 : [];
9110
+ newItemIds = (_3 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _3 !== void 0 ? _3 : [];
9103
9111
  _i = 0, curEnabled_1 = curEnabled;
9104
- _3.label = 4;
9112
+ _4.label = 4;
9105
9113
  case 4:
9106
9114
  if (!(_i < curEnabled_1.length)) return [3 /*break*/, 7];
9107
9115
  id = curEnabled_1[_i];
@@ -9111,8 +9119,8 @@ function renderNavigator(params, bookmark, view) {
9111
9119
  menuItemId: id
9112
9120
  })];
9113
9121
  case 5:
9114
- _3.sent();
9115
- _3.label = 6;
9122
+ _4.sent();
9123
+ _4.label = 6;
9116
9124
  case 6:
9117
9125
  _i++;
9118
9126
  return [3 /*break*/, 4];
@@ -9125,8 +9133,8 @@ function renderNavigator(params, bookmark, view) {
9125
9133
  bookmark: bookmark
9126
9134
  })];
9127
9135
  case 8:
9128
- _3.sent();
9129
- _3.label = 9;
9136
+ _4.sent();
9137
+ _4.label = 9;
9130
9138
  case 9:
9131
9139
  if (!(renderedRelationEntityIds.length > 0)) return [3 /*break*/, 11];
9132
9140
  menuItem = {
@@ -9142,8 +9150,8 @@ function renderNavigator(params, bookmark, view) {
9142
9150
  item: menuItem
9143
9151
  })];
9144
9152
  case 10:
9145
- _3.sent();
9146
- _3.label = 11;
9153
+ _4.sent();
9154
+ _4.label = 11;
9147
9155
  case 11: return [2 /*return*/];
9148
9156
  }
9149
9157
  });