bruce-cesium 7.1.7 → 7.1.8

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.
@@ -2970,6 +2970,7 @@
2970
2970
  const CESIUM_MODEL_SPACE_KEY = "_nextspace_model_space";
2971
2971
  const DEFAULT_LIVE_PADDING_SECONDS = 30 * 60;
2972
2972
  const DEFAULT_BRIGHTNESS_SHIFT = 0.2;
2973
+ const DEFAULT_LIGHT_INTENSITY = 3;
2973
2974
  (function (ViewUtils) {
2974
2975
  function GatherLegacyMapTiles(params) {
2975
2976
  const viewer = params.viewer;
@@ -3320,23 +3321,32 @@
3320
3321
  */
3321
3322
  function ApplyDefaultBrightness(viewer, shift = DEFAULT_BRIGHTNESS_SHIFT) {
3322
3323
  const scene = viewer === null || viewer === void 0 ? void 0 : viewer.scene;
3323
- if (!scene || !(shift > 0)) {
3324
+ if (!scene) {
3324
3325
  return;
3325
3326
  }
3326
3327
  // Atmosphere settings moved from Globe onto Scene, and the sky keeps its own copy, so each is
3327
3328
  // probed rather than version checked: host apps bring their own CesiumJS.
3328
3329
  const SCENE = scene;
3329
- if (SCENE.atmosphere && typeof SCENE.atmosphere.brightnessShift === "number") {
3330
- SCENE.atmosphere.brightnessShift = shift;
3331
- }
3332
- if (SCENE.globe && typeof SCENE.globe.atmosphereBrightnessShift === "number") {
3333
- SCENE.globe.atmosphereBrightnessShift = shift;
3334
- }
3335
- if (SCENE.skyAtmosphere && typeof SCENE.skyAtmosphere.brightnessShift === "number") {
3336
- SCENE.skyAtmosphere.brightnessShift = shift;
3330
+ if (shift > 0) {
3331
+ if (SCENE.atmosphere && typeof SCENE.atmosphere.brightnessShift === "number") {
3332
+ SCENE.atmosphere.brightnessShift = shift;
3333
+ }
3334
+ if (SCENE.globe && typeof SCENE.globe.atmosphereBrightnessShift === "number") {
3335
+ SCENE.globe.atmosphereBrightnessShift = shift;
3336
+ }
3337
+ if (SCENE.skyAtmosphere && typeof SCENE.skyAtmosphere.brightnessShift === "number") {
3338
+ SCENE.skyAtmosphere.brightnessShift = shift;
3339
+ }
3337
3340
  }
3338
3341
  }
3339
3342
  ViewUtils.ApplyDefaultBrightness = ApplyDefaultBrightness;
3343
+ /**
3344
+ * Options handed to every tileset and model this library creates.
3345
+ */
3346
+ function DefaultEnvironmentMapOptions() {
3347
+ return { enabled: false };
3348
+ }
3349
+ ViewUtils.DefaultEnvironmentMapOptions = DefaultEnvironmentMapOptions;
3340
3350
  function SetGlobeDetails(params) {
3341
3351
  let { viewer, hidden, baseColor } = params;
3342
3352
  const scene = viewer === null || viewer === void 0 ? void 0 : viewer.scene;
@@ -14661,6 +14671,7 @@
14661
14671
  const defaultProps = {
14662
14672
  // "Optimization option. Reduce the screen space error for tiles that are further away from the camera.".
14663
14673
  dynamicScreenSpaceError: true,
14674
+ environmentMapOptions: exports.ViewUtils.DefaultEnvironmentMapOptions()
14664
14675
  };
14665
14676
  if (noMemoryLimit != true) {
14666
14677
  // "The maximum amount of memory in MB that can be used by the tileset.".
@@ -21376,7 +21387,8 @@
21376
21387
  return;
21377
21388
  }
21378
21389
  this.cTileset = await CESIUM.Cesium3DTileset.fromUrl(proxyRootUrl, {
21379
- showCreditsOnScreen: true
21390
+ showCreditsOnScreen: true,
21391
+ environmentMapOptions: exports.ViewUtils.DefaultEnvironmentMapOptions()
21380
21392
  });
21381
21393
  }
21382
21394
  else {
@@ -22912,6 +22924,7 @@
22912
22924
  const cEntity = this.viewer.entities.add({
22913
22925
  model: {
22914
22926
  uri: lod["ClientFile"].URL,
22927
+ environmentMapOptions: exports.ViewUtils.DefaultEnvironmentMapOptions(),
22915
22928
  heightReference: Cesium.HeightReference.NONE
22916
22929
  },
22917
22930
  // point: {
@@ -28969,7 +28982,7 @@
28969
28982
  if (lighting == null) {
28970
28983
  lighting = {
28971
28984
  color: Cesium.Color.WHITE.toCssColorString(),
28972
- intensity: 2
28985
+ intensity: DEFAULT_LIGHT_INTENSITY
28973
28986
  };
28974
28987
  }
28975
28988
  const light = viewer.scene.light;
@@ -38626,6 +38639,7 @@
38626
38639
  id: BModels.ObjectUtils.UId(15),
38627
38640
  model: {
38628
38641
  uri: params.lodUrl,
38642
+ environmentMapOptions: exports.ViewUtils.DefaultEnvironmentMapOptions(),
38629
38643
  heightReference: heightRef,
38630
38644
  scale: new Cesium.CallbackProperty(() => scale * styleScale, true),
38631
38645
  shadows: Cesium.ShadowMode.ENABLED,
@@ -39267,7 +39281,8 @@
39267
39281
  return await CESIUM.Model.fromGltfAsync({
39268
39282
  url: url,
39269
39283
  asynchronous: true,
39270
- scale: scale
39284
+ scale: scale,
39285
+ environmentMapOptions: exports.ViewUtils.DefaultEnvironmentMapOptions()
39271
39286
  });
39272
39287
  }
39273
39288
  // Older versions of Cesium have a fromGltf method.
@@ -43404,7 +43419,7 @@ void main() {
43404
43419
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
43405
43420
  })(exports.StyleUtils || (exports.StyleUtils = {}));
43406
43421
 
43407
- const VERSION = "7.1.7";
43422
+ const VERSION = "7.1.8";
43408
43423
  /**
43409
43424
  * Updates the environment instance used by bruce-cesium to one specified.
43410
43425
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
@@ -43436,6 +43451,7 @@ void main() {
43436
43451
  exports.CESIUM_MODEL_SPACE_KEY = CESIUM_MODEL_SPACE_KEY;
43437
43452
  exports.DEFAULT_LIVE_PADDING_SECONDS = DEFAULT_LIVE_PADDING_SECONDS;
43438
43453
  exports.DEFAULT_BRIGHTNESS_SHIFT = DEFAULT_BRIGHTNESS_SHIFT;
43454
+ exports.DEFAULT_LIGHT_INTENSITY = DEFAULT_LIGHT_INTENSITY;
43439
43455
  exports.Draw3dPolygon = Draw3dPolygon;
43440
43456
  exports.Draw3dPolyline = Draw3dPolyline;
43441
43457
  exports.WidgetControlViewBarSearch = WidgetControlViewBarSearch;