bruce-cesium 3.7.1 → 3.7.3

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.
Files changed (33) hide show
  1. package/dist/bruce-cesium.es5.js +100 -48
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +99 -47
  4. package/dist/bruce-cesium.umd.js.map +1 -1
  5. package/dist/lib/bruce-cesium.js +1 -1
  6. package/dist/lib/rendering/entity-render-engine.js +6 -2
  7. package/dist/lib/rendering/entity-render-engine.js.map +1 -1
  8. package/dist/lib/rendering/render-managers/common/entity-label.js +5 -1
  9. package/dist/lib/rendering/render-managers/common/entity-label.js.map +1 -1
  10. package/dist/lib/rendering/render-managers/common/point-clustering.js +8 -4
  11. package/dist/lib/rendering/render-managers/common/point-clustering.js.map +1 -1
  12. package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js +2 -2
  13. package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js.map +1 -1
  14. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +10 -6
  15. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
  16. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +10 -6
  17. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
  18. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +10 -6
  19. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  20. package/dist/lib/rendering/view-render-engine.js +3 -1
  21. package/dist/lib/rendering/view-render-engine.js.map +1 -1
  22. package/dist/lib/rendering/visual-register-culler.js +7 -3
  23. package/dist/lib/rendering/visual-register-culler.js.map +1 -1
  24. package/dist/lib/utils/cesium-entity-styler.js +9 -5
  25. package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
  26. package/dist/lib/utils/entity-utils.js +5 -1
  27. package/dist/lib/utils/entity-utils.js.map +1 -1
  28. package/dist/lib/utils/view-utils.js +12 -3
  29. package/dist/lib/utils/view-utils.js.map +1 -1
  30. package/dist/lib/viewer/viewer-utils.js +13 -8
  31. package/dist/lib/viewer/viewer-utils.js.map +1 -1
  32. package/dist/types/bruce-cesium.d.ts +1 -1
  33. package/package.json +2 -2
@@ -949,15 +949,19 @@
949
949
  if (!prop) {
950
950
  return Cesium.Color.WHITE;
951
951
  }
952
+ var date = viewer.scene.lastRenderTime;
953
+ if (!date) {
954
+ date = viewer.clock.currentTime;
955
+ }
952
956
  if (prop.getValue) {
953
- prop = prop.getValue(viewer.scene.lastRenderTime);
957
+ prop = prop.getValue(date);
954
958
  }
955
959
  if (prop instanceof Cesium.Color) {
956
960
  return prop;
957
961
  }
958
962
  var tmp = prop === null || prop === void 0 ? void 0 : prop.color;
959
963
  if (tmp === null || tmp === void 0 ? void 0 : tmp.getValue) {
960
- tmp = tmp.getValue(viewer.scene.lastRenderTime);
964
+ tmp = tmp.getValue(date);
961
965
  }
962
966
  return tmp ? tmp : Cesium.Color.WHITE;
963
967
  }
@@ -1087,7 +1091,7 @@
1087
1091
  graphic.color = color;
1088
1092
  }
1089
1093
  else if (graphic instanceof Cesium.ModelGraphics) {
1090
- graphic.color = color;
1094
+ graphic.color = new Cesium.ConstantProperty(color);
1091
1095
  }
1092
1096
  else if (graphic instanceof Cesium.PolygonGraphics) {
1093
1097
  graphic.material = new Cesium.ColorMaterialProperty(color);
@@ -1099,10 +1103,10 @@
1099
1103
  graphic.material = new Cesium.ColorMaterialProperty(color);
1100
1104
  }
1101
1105
  else if (graphic instanceof Cesium.PointGraphics) {
1102
- graphic.color = color;
1106
+ graphic.color = new Cesium.ConstantProperty(color);
1103
1107
  }
1104
1108
  else if (graphic instanceof Cesium.BillboardGraphics) {
1105
- graphic.color = color;
1109
+ graphic.color = new Cesium.ConstantProperty(color);
1106
1110
  }
1107
1111
  else if (graphic instanceof Cesium.EllipseGraphics) {
1108
1112
  graphic.material = new Cesium.ColorMaterialProperty(color);
@@ -1623,7 +1627,11 @@
1623
1627
  }
1624
1628
  function GetValue(viewer, obj) {
1625
1629
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
1626
- return obj.getValue(viewer.scene.lastRenderTime);
1630
+ var date = viewer.scene.lastRenderTime;
1631
+ if (!date) {
1632
+ date = viewer.clock.currentTime;
1633
+ }
1634
+ return obj.getValue(date);
1627
1635
  }
1628
1636
  return obj;
1629
1637
  }
@@ -3241,19 +3249,28 @@
3241
3249
  clock.startTime = startTime;
3242
3250
  }
3243
3251
  else if (startTimeIso) {
3244
- clock.startTime = Cesium.JulianDate.fromIso8601(params.startTimeIso);
3252
+ var startDate = Cesium.JulianDate.fromIso8601(startTimeIso);
3253
+ if (startDate) {
3254
+ clock.startTime = startDate;
3255
+ }
3245
3256
  }
3246
3257
  if (currentTime) {
3247
3258
  clock.currentTime = currentTime;
3248
3259
  }
3249
3260
  else if (currentTimeIso) {
3250
- clock.currentTime = Cesium.JulianDate.fromIso8601(params.currentTimeIso);
3261
+ var currentDate = Cesium.JulianDate.fromIso8601(currentTimeIso);
3262
+ if (currentDate) {
3263
+ clock.currentTime = currentDate;
3264
+ }
3251
3265
  }
3252
3266
  if (stopTime) {
3253
3267
  clock.stopTime = stopTime;
3254
3268
  }
3255
3269
  else if (stopTimeIso) {
3256
- clock.stopTime = Cesium.JulianDate.fromIso8601(params.stopTimeIso);
3270
+ var stopDate = Cesium.JulianDate.fromIso8601(stopTimeIso);
3271
+ if (stopDate) {
3272
+ clock.stopTime = stopDate;
3273
+ }
3257
3274
  }
3258
3275
  clock.clockRange = Cesium.ClockRange.LOOP_STOP;
3259
3276
  var areCesiumValues = clock[CESIUM_TIMELINE_KEY] != true;
@@ -3381,7 +3398,11 @@
3381
3398
  }
3382
3399
  function getValue(viewer, obj) {
3383
3400
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
3384
- return obj.getValue(viewer.scene.lastRenderTime);
3401
+ var date = viewer.scene.lastRenderTime;
3402
+ if (!date) {
3403
+ date = viewer.clock.currentTime;
3404
+ }
3405
+ return obj.getValue(date);
3385
3406
  }
3386
3407
  return obj;
3387
3408
  }
@@ -3992,7 +4013,11 @@
3992
4013
  }
3993
4014
  function getValue$1(viewer, obj) {
3994
4015
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
3995
- return obj.getValue(viewer.scene.lastRenderTime);
4016
+ var date = viewer.scene.lastRenderTime;
4017
+ if (!date) {
4018
+ date = viewer.clock.currentTime;
4019
+ }
4020
+ return obj.getValue(date);
3996
4021
  }
3997
4022
  return obj;
3998
4023
  }
@@ -5426,7 +5451,7 @@
5426
5451
  color: color,
5427
5452
  distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
5428
5453
  },
5429
- orientation: orientation,
5454
+ orientation: new Cesium.ConstantProperty(orientation),
5430
5455
  position: pos,
5431
5456
  show: true
5432
5457
  });
@@ -6339,7 +6364,11 @@
6339
6364
  */
6340
6365
  function getValue$2(viewer, obj) {
6341
6366
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
6342
- return obj.getValue(viewer.scene.lastRenderTime);
6367
+ var date = viewer.scene.lastRenderTime;
6368
+ if (!date) {
6369
+ date = viewer.clock.currentTime;
6370
+ }
6371
+ return obj.getValue(date);
6343
6372
  }
6344
6373
  return obj;
6345
6374
  }
@@ -7938,7 +7967,11 @@
7938
7967
 
7939
7968
  function GetValue$1(viewer, obj) {
7940
7969
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
7941
- return obj.getValue(viewer.scene.lastRenderTime);
7970
+ var date = viewer.scene.lastRenderTime;
7971
+ if (!date) {
7972
+ date = viewer.clock.currentTime;
7973
+ }
7974
+ return obj.getValue(date);
7942
7975
  }
7943
7976
  return obj;
7944
7977
  }
@@ -8538,12 +8571,12 @@
8538
8571
  var centroid = this_1.calculateCentroid(cluster.points);
8539
8572
  var count = cluster.points.length;
8540
8573
  if (clusterEntity) {
8541
- clusterEntity.position = Cesium.Cartesian3.fromDegrees(centroid.lon, centroid.lat, 150);
8574
+ clusterEntity.position = new Cesium.ConstantPositionProperty(Cesium.Cartesian3.fromDegrees(centroid.lon, centroid.lat, 150));
8542
8575
  clusterEntity.billboard.image = new Cesium.CallbackProperty(function () {
8543
8576
  return getCanvas(count);
8544
8577
  }, false),
8545
- clusterEntity.billboard.width = getScale(cluster.points.length);
8546
- clusterEntity.billboard.height = getScale(cluster.points.length);
8578
+ clusterEntity.billboard.width = new Cesium.ConstantProperty(getScale(cluster.points.length));
8579
+ clusterEntity.billboard.height = new Cesium.ConstantProperty(getScale(cluster.points.length));
8547
8580
  }
8548
8581
  else {
8549
8582
  clusterEntity = this_1.viewer.entities.add({
@@ -8798,7 +8831,11 @@
8798
8831
  var CHECK_BATCH_SIZE = 250;
8799
8832
  function getValue$3(viewer, obj) {
8800
8833
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
8801
- return obj.getValue(viewer.scene.lastRenderTime);
8834
+ var date = viewer.scene.lastRenderTime;
8835
+ if (!date) {
8836
+ date = viewer.clock.currentTime;
8837
+ }
8838
+ return obj.getValue(date);
8802
8839
  }
8803
8840
  return obj;
8804
8841
  }
@@ -9378,9 +9415,9 @@
9378
9415
  curWidth == width) {
9379
9416
  return;
9380
9417
  }
9381
- thing.polygon.material = cFillColor_1;
9382
- thing.polygon.outlineColor = cLineColor_1;
9383
- thing.polygon.outlineWidth = width;
9418
+ thing.polygon.material = new Cesium.ColorMaterialProperty(cFillColor_1);
9419
+ thing.polygon.outlineColor = new Cesium.ConstantProperty(cLineColor_1);
9420
+ thing.polygon.outlineWidth = new Cesium.ConstantProperty(width);
9384
9421
  }
9385
9422
  else if (thing.polyline) {
9386
9423
  var bColor = lStyle.lineColor ? bruceModels.Calculator.GetColor(lStyle.lineColor, data, []) : null;
@@ -9402,8 +9439,8 @@
9402
9439
  curWidth == width) {
9403
9440
  return;
9404
9441
  }
9405
- thing.polyline.material = cColor;
9406
- thing.polyline.width = width;
9442
+ thing.polyline.material = new Cesium.ColorMaterialProperty(cColor);
9443
+ thing.polyline.width = new Cesium.ConstantProperty(width);
9407
9444
  }
9408
9445
  };
9409
9446
  toForceUpdate = [];
@@ -9665,7 +9702,11 @@
9665
9702
  var CHECK_BATCH_SIZE$1 = 250;
9666
9703
  function getValue$4(viewer, obj) {
9667
9704
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
9668
- return obj.getValue(viewer.scene.lastRenderTime);
9705
+ var date = viewer.scene.lastRenderTime;
9706
+ if (!date) {
9707
+ date = viewer.clock.currentTime;
9708
+ }
9709
+ return obj.getValue(date);
9669
9710
  }
9670
9711
  return obj;
9671
9712
  }
@@ -10185,9 +10226,9 @@
10185
10226
  curWidth == width) {
10186
10227
  return;
10187
10228
  }
10188
- thing.polygon.material = cFillColor_1;
10189
- thing.polygon.outlineColor = cLineColor_1;
10190
- thing.polygon.outlineWidth = width;
10229
+ thing.polygon.material = new Cesium.ColorMaterialProperty(cFillColor_1);
10230
+ thing.polygon.outlineColor = new Cesium.ConstantProperty(cLineColor_1);
10231
+ thing.polygon.outlineWidth = new Cesium.ConstantProperty(width);
10191
10232
  }
10192
10233
  else if (thing.polyline) {
10193
10234
  var bColor = lStyle.lineColor ? bruceModels.Calculator.GetColor(lStyle.lineColor, data, []) : null;
@@ -10209,8 +10250,8 @@
10209
10250
  curWidth == width) {
10210
10251
  return;
10211
10252
  }
10212
- thing.polyline.material = cColor;
10213
- thing.polyline.width = width;
10253
+ thing.polyline.material = new Cesium.ColorMaterialProperty(cColor);
10254
+ thing.polyline.width = new Cesium.ConstantProperty(width);
10214
10255
  }
10215
10256
  };
10216
10257
  toForceUpdate = [];
@@ -10380,7 +10421,11 @@
10380
10421
  var BATCH_SIZE$2 = 500;
10381
10422
  function getValue$5(viewer, obj) {
10382
10423
  if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
10383
- return obj.getValue(viewer.scene.lastRenderTime);
10424
+ var date = viewer.scene.lastRenderTime;
10425
+ if (!date) {
10426
+ date = viewer.clock.currentTime;
10427
+ }
10428
+ return obj.getValue(date);
10384
10429
  }
10385
10430
  return obj;
10386
10431
  }
@@ -10785,9 +10830,9 @@
10785
10830
  curWidth == width) {
10786
10831
  return;
10787
10832
  }
10788
- thing.polygon.material = cFillColor_1;
10789
- thing.polygon.outlineColor = cLineColor_1;
10790
- thing.polygon.outlineWidth = width;
10833
+ thing.polygon.material = new Cesium.ColorMaterialProperty(cFillColor_1);
10834
+ thing.polygon.outlineColor = new Cesium.ConstantProperty(cLineColor_1);
10835
+ thing.polygon.outlineWidth = new Cesium.ConstantProperty(width);
10791
10836
  }
10792
10837
  else if (thing.polyline) {
10793
10838
  var bColor = lStyle.lineColor ? bruceModels.Calculator.GetColor(lStyle.lineColor, data, []) : null;
@@ -10809,8 +10854,8 @@
10809
10854
  curWidth == width) {
10810
10855
  return;
10811
10856
  }
10812
- thing.polyline.material = cColor;
10813
- thing.polyline.width = width;
10857
+ thing.polyline.material = new Cesium.ColorMaterialProperty(cColor);
10858
+ thing.polyline.width = new Cesium.ConstantProperty(width);
10814
10859
  }
10815
10860
  };
10816
10861
  toForceUpdate = [];
@@ -15839,7 +15884,7 @@
15839
15884
  var radians = Cesium.Math.toRadians(interpolatedHeading - 90);
15840
15885
  var quaternion = Cesium.Transforms.headingPitchRollQuaternion(currentPosition, new Cesium.HeadingPitchRoll(radians, 0, 0));
15841
15886
  if (!isNaN(quaternion.w) && !isNaN(quaternion.x) && !isNaN(quaternion.y) && !isNaN(quaternion.z)) {
15842
- vehicleEntity.orientation = quaternion;
15887
+ vehicleEntity.orientation = new Cesium.ConstantProperty(quaternion);
15843
15888
  return;
15844
15889
  }
15845
15890
  else {
@@ -15857,7 +15902,7 @@
15857
15902
  var direction = Cesium.Cartesian3.subtract(currentPosition, previousPosition, new Cesium.Cartesian3());
15858
15903
  Cesium.Cartesian3.normalize(direction, direction);
15859
15904
  var rotationMatrix = Cesium.Transforms.rotationMatrixFromPositionVelocity(previousPosition, direction);
15860
- vehicleEntity.orientation = Cesium.Quaternion.fromRotationMatrix(rotationMatrix);
15905
+ vehicleEntity.orientation = new Cesium.ConstantProperty(Cesium.Quaternion.fromRotationMatrix(rotationMatrix));
15861
15906
  }
15862
15907
  }
15863
15908
  function interpolateHeading(dateTimeIndex, rows, currentTime, headingIndex) {
@@ -19639,16 +19684,21 @@
19639
19684
  clearInterval(interval);
19640
19685
  return;
19641
19686
  }
19642
- // Check if last render time is greater than 3 seconds ago.
19643
- // We check in case something else is also requesting renders.
19644
- var lastRenderTime = viewer.scene.lastRenderTime;
19645
- if (!lastRenderTime || Cesium.JulianDate.secondsDifference(Cesium.JulianDate.now(), lastRenderTime) > 3) {
19646
- // Check if window is active/in focus.
19647
- // TODO: Should render the moment it is in focus as well.
19648
- if (document.hasFocus()) {
19649
- viewer.scene.requestRender();
19687
+ try {
19688
+ // Check if last render time is greater than 3 seconds ago.
19689
+ // We check in case something else is also requesting renders.
19690
+ var lastRenderTime = viewer.scene.lastRenderTime;
19691
+ if (!lastRenderTime || Cesium.JulianDate.secondsDifference(Cesium.JulianDate.now(), lastRenderTime) > 3) {
19692
+ // Check if window is active/in focus.
19693
+ // TODO: Should render the moment it is in focus as well.
19694
+ if (document.hasFocus()) {
19695
+ viewer.scene.requestRender();
19696
+ }
19650
19697
  }
19651
19698
  }
19699
+ catch (e) {
19700
+ console.error("backgroundRendering", e);
19701
+ }
19652
19702
  }, 1500);
19653
19703
  }
19654
19704
  // Cache of Cesium Token -> Validity.
@@ -21827,7 +21877,9 @@
21827
21877
  if (pointer != null) {
21828
21878
  clock = manager.Viewer.clock;
21829
21879
  timeStr = Cesium.JulianDate.toIso8601(pointer);
21830
- clock.currentTime = Cesium.JulianDate.fromIso8601(timeStr);
21880
+ if (timeStr) {
21881
+ clock.currentTime = Cesium.JulianDate.fromIso8601(timeStr);
21882
+ }
21831
21883
  }
21832
21884
  enabledItems = manager.GetEnabledItemIds();
21833
21885
  newItemIds = (_d = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedItemIds) !== null && _d !== void 0 ? _d : [];
@@ -22462,7 +22514,7 @@
22462
22514
  ViewRenderEngine.Render = Render;
22463
22515
  })(exports.ViewRenderEngine || (exports.ViewRenderEngine = {}));
22464
22516
 
22465
- var VERSION = "3.7.1";
22517
+ var VERSION = "3.7.3";
22466
22518
 
22467
22519
  exports.VERSION = VERSION;
22468
22520
  exports.CesiumParabola = CesiumParabola;