bruce-cesium 3.3.0 → 3.3.1

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.
@@ -1301,7 +1301,7 @@
1301
1301
  case 0:
1302
1302
  entityId = sample.entityId, entity = sample.entity, tileset = sample.tileset, tilesetId = sample.tilesetId;
1303
1303
  evaluateRendered = function () { return __awaiter(_this, void 0, void 0, function () {
1304
- var rego, posses, parts, i, part, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i_1, pPosses, pPossesSample, step, i_2, pPosses, pPossesSample, step, i_3, pos3d_1, toAdjust, modelExt, sphere, data_1, pos3d_2, toAdjust, sphere;
1304
+ var rego, posses, parts, i, part, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i_1, pPosses, pPossesSample, step, i_2, pPosses, pPossesSample, step, i_3, pos3d_1, toAdjust, modelExt, sphere, semiMajorAxis, semiMinorAxis, height, radius, sphere, data_1, pos3d_2, toAdjust, sphere;
1305
1305
  return __generator(this, function (_a) {
1306
1306
  switch (_a.label) {
1307
1307
  case 0:
@@ -1406,6 +1406,25 @@
1406
1406
  spheres.push(sphere);
1407
1407
  }
1408
1408
  }
1409
+ else if (part.ellipse) {
1410
+ semiMajorAxis = GetValue(viewer, part.ellipse.semiMajorAxis);
1411
+ if (!semiMajorAxis || isNaN(semiMajorAxis)) {
1412
+ semiMajorAxis = 0;
1413
+ }
1414
+ semiMinorAxis = GetValue(viewer, part.ellipse.semiMinorAxis);
1415
+ if (!semiMinorAxis || isNaN(semiMinorAxis)) {
1416
+ semiMinorAxis = 0;
1417
+ }
1418
+ height = GetValue(viewer, part.ellipse.extrudedHeight);
1419
+ if (!height || isNaN(height)) {
1420
+ height = 0;
1421
+ }
1422
+ radius = Math.max(semiMajorAxis, semiMinorAxis, height);
1423
+ if (radius && radius > 0) {
1424
+ sphere = new Cesium.BoundingSphere(pos3d_1, radius);
1425
+ spheres.push(sphere);
1426
+ }
1427
+ }
1409
1428
  _a.label = 15;
1410
1429
  case 15: return [3 /*break*/, 18];
1411
1430
  case 16:
@@ -1685,31 +1704,36 @@
1685
1704
  case 4:
1686
1705
  if (allPosses.length > 1) {
1687
1706
  rect = allPosses.length == 1 ? null : Cesium.Rectangle.fromCartesianArray(allPosses);
1688
- factor = 0.1;
1689
- marginX = rect.width * factor / 2;
1690
- marginY = rect.height * factor / 2;
1691
- rect.east += marginX;
1692
- rect.west -= marginX;
1693
- rect.north += marginY;
1694
- rect.south -= marginY;
1695
- data.rectangle = rect;
1696
- carto = Cesium.Rectangle.center(rect);
1697
- carto.height = 0;
1698
- for (i = 0; i < allPosses.length; i++) {
1699
- pos = allPosses[i];
1700
- carto.height += Cesium.Cartographic.fromCartesian(pos).height;
1701
- }
1702
- if (carto.height != 0) {
1703
- carto.height /= allPosses.length;
1707
+ if (rect.width > 0 && rect.height > 0) {
1708
+ factor = 0.1;
1709
+ marginX = rect.width * factor / 2;
1710
+ marginY = rect.height * factor / 2;
1711
+ rect.east += marginX;
1712
+ rect.west -= marginX;
1713
+ rect.north += marginY;
1714
+ rect.south -= marginY;
1715
+ data.rectangle = rect;
1716
+ carto = Cesium.Rectangle.center(rect);
1717
+ carto.height = 0;
1718
+ for (i = 0; i < allPosses.length; i++) {
1719
+ pos = allPosses[i];
1720
+ carto.height += Cesium.Cartographic.fromCartesian(pos).height;
1721
+ }
1722
+ if (carto.height != 0) {
1723
+ carto.height /= allPosses.length;
1724
+ }
1725
+ data.pos3d = Cesium.Cartesian3.fromRadians(carto.longitude, carto.latitude, carto.height);
1726
+ radius = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromRadians(rect.west, rect.north), Cesium.Cartesian3.fromRadians(rect.east, rect.south));
1727
+ if (radius != 0) {
1728
+ radius /= 2;
1729
+ }
1730
+ sphere = new Cesium.BoundingSphere(data.pos3d, radius);
1731
+ spheres.push(sphere);
1732
+ data.sphere = sphere;
1704
1733
  }
1705
- data.pos3d = Cesium.Cartesian3.fromRadians(carto.longitude, carto.latitude, carto.height);
1706
- radius = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromRadians(rect.west, rect.north), Cesium.Cartesian3.fromRadians(rect.east, rect.south));
1707
- if (radius != 0) {
1708
- radius /= 2;
1734
+ else {
1735
+ data.pos3d = allPosses[0];
1709
1736
  }
1710
- sphere = new Cesium.BoundingSphere(data.pos3d, radius);
1711
- spheres.push(sphere);
1712
- data.sphere = sphere;
1713
1737
  }
1714
1738
  else if (allPosses.length == 1) {
1715
1739
  data.pos3d = allPosses[0];
@@ -1724,6 +1748,9 @@
1724
1748
  combinedSphere = Cesium.BoundingSphere.fromBoundingSpheres(spheres);
1725
1749
  data.sphere = combinedSphere;
1726
1750
  }
1751
+ if (data.sphere && data.sphere.radius <= 0) {
1752
+ data.sphere = null;
1753
+ }
1727
1754
  return [2 /*return*/, data];
1728
1755
  }
1729
1756
  });
@@ -19947,7 +19974,7 @@
19947
19974
  CesiumViewMonitor.Monitor = Monitor;
19948
19975
  })(exports.CesiumViewMonitor || (exports.CesiumViewMonitor = {}));
19949
19976
 
19950
- var VERSION$1 = "3.3.0";
19977
+ var VERSION$1 = "3.3.1";
19951
19978
 
19952
19979
  exports.VERSION = VERSION$1;
19953
19980
  exports.CesiumParabola = CesiumParabola;