bruce-cesium 7.1.8 → 7.1.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.
@@ -2971,6 +2971,7 @@
2971
2971
  const DEFAULT_LIVE_PADDING_SECONDS = 30 * 60;
2972
2972
  const DEFAULT_BRIGHTNESS_SHIFT = 0.2;
2973
2973
  const DEFAULT_LIGHT_INTENSITY = 3;
2974
+ const LIGHTING_SETTINGS_VERSION = 2;
2974
2975
  (function (ViewUtils) {
2975
2976
  function GatherLegacyMapTiles(params) {
2976
2977
  const viewer = params.viewer;
@@ -3340,6 +3341,24 @@
3340
3341
  }
3341
3342
  }
3342
3343
  ViewUtils.ApplyDefaultBrightness = ApplyDefaultBrightness;
3344
+ /**
3345
+ * Resolves the sun colour and intensity to apply for a bookmark's lighting settings.
3346
+ * @param lighting the bookmark's lighting settings, or null when it carries none.
3347
+ * @returns the colour and intensity to put on the scene light.
3348
+ */
3349
+ function ResolveLightSettings(lighting) {
3350
+ const raw = lighting === null || lighting === void 0 ? void 0 : lighting.color;
3351
+ // An unreadable or missing colour would otherwise leave the light undefined.
3352
+ const parsed = raw ? Cesium.Color.fromCssColorString(raw) : null;
3353
+ const version = Number(lighting === null || lighting === void 0 ? void 0 : lighting.lightingVer);
3354
+ const stale = !Number.isFinite(version) || version <= 1;
3355
+ const intensity = Number(lighting === null || lighting === void 0 ? void 0 : lighting.intensity);
3356
+ return {
3357
+ color: parsed || Cesium.Color.WHITE,
3358
+ intensity: stale || !Number.isFinite(intensity) ? DEFAULT_LIGHT_INTENSITY : intensity
3359
+ };
3360
+ }
3361
+ ViewUtils.ResolveLightSettings = ResolveLightSettings;
3343
3362
  /**
3344
3363
  * Options handed to every tileset and model this library creates.
3345
3364
  */
@@ -28982,13 +29001,15 @@
28982
29001
  if (lighting == null) {
28983
29002
  lighting = {
28984
29003
  color: Cesium.Color.WHITE.toCssColorString(),
28985
- intensity: DEFAULT_LIGHT_INTENSITY
29004
+ intensity: DEFAULT_LIGHT_INTENSITY,
29005
+ lightingVer: LIGHTING_SETTINGS_VERSION
28986
29006
  };
28987
29007
  }
28988
29008
  const light = viewer.scene.light;
28989
29009
  if (light) {
28990
- light.color = Cesium.Color.fromCssColorString(lighting.color);
28991
- light.intensity = EnsureNumber(lighting.intensity);
29010
+ const resolved = exports.ViewUtils.ResolveLightSettings(lighting);
29011
+ light.color = resolved.color;
29012
+ light.intensity = resolved.intensity;
28992
29013
  }
28993
29014
  exports.ViewUtils.ApplyDefaultBrightness(viewer, EnsureNumber(lighting.brightnessShift, DEFAULT_BRIGHTNESS_SHIFT));
28994
29015
  let quality = bSettings === null || bSettings === void 0 ? void 0 : bSettings.quality;
@@ -43419,7 +43440,7 @@ void main() {
43419
43440
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
43420
43441
  })(exports.StyleUtils || (exports.StyleUtils = {}));
43421
43442
 
43422
- const VERSION = "7.1.8";
43443
+ const VERSION = "7.1.9";
43423
43444
  /**
43424
43445
  * Updates the environment instance used by bruce-cesium to one specified.
43425
43446
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
@@ -43452,6 +43473,7 @@ void main() {
43452
43473
  exports.DEFAULT_LIVE_PADDING_SECONDS = DEFAULT_LIVE_PADDING_SECONDS;
43453
43474
  exports.DEFAULT_BRIGHTNESS_SHIFT = DEFAULT_BRIGHTNESS_SHIFT;
43454
43475
  exports.DEFAULT_LIGHT_INTENSITY = DEFAULT_LIGHT_INTENSITY;
43476
+ exports.LIGHTING_SETTINGS_VERSION = LIGHTING_SETTINGS_VERSION;
43455
43477
  exports.Draw3dPolygon = Draw3dPolygon;
43456
43478
  exports.Draw3dPolyline = Draw3dPolyline;
43457
43479
  exports.WidgetControlViewBarSearch = WidgetControlViewBarSearch;