bruce-cesium 3.2.9 → 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
  });
@@ -3870,7 +3897,7 @@
3870
3897
  Point.CreateCircleBillboard = CreateCircleBillboard;
3871
3898
  function Render(params) {
3872
3899
  return __awaiter(this, void 0, void 0, function () {
3873
- var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl_1, res, blob_1, e_4, e_5, iconScale, disableDepthTest, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, heightRef, pos3d, extrusion, outlineExtrusion, bColor, cColor, size, heightRef, circleBillboard;
3900
+ var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl_1, res, blob_1, e_4, e_5, iconScale, disableDepthTest, bColor, cColor, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, heightRef, pos3d, extrusion, outlineExtrusion, bColor, cColor, size, heightRef, circleBillboard;
3874
3901
  return __generator(this, function (_a) {
3875
3902
  switch (_a.label) {
3876
3903
  case 0:
@@ -3960,6 +3987,8 @@
3960
3987
  }
3961
3988
  disableDepthTest = Boolean(style.renderOnTop);
3962
3989
  if (iconScale > 0) {
3990
+ bColor = style.iconTintColor ? bruceModels.Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
3991
+ cColor = bColor ? colorToCColor(bColor) : undefined;
3963
3992
  heightRef = getHeightRef(style);
3964
3993
  cEntity = new Cesium.Entity({
3965
3994
  id: bruceModels.ObjectUtils.UId(10),
@@ -3970,7 +3999,8 @@
3970
3999
  heightReference: getHeightRef(style),
3971
4000
  scale: iconScale,
3972
4001
  disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined,
3973
- distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
4002
+ distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
4003
+ color: cColor
3974
4004
  // Would be great once we have a setting for this.
3975
4005
  // translucencyByDistance: getTranslucencyByDistance(params.minDistance, params.maxDistance),
3976
4006
  },
@@ -19944,7 +19974,7 @@
19944
19974
  CesiumViewMonitor.Monitor = Monitor;
19945
19975
  })(exports.CesiumViewMonitor || (exports.CesiumViewMonitor = {}));
19946
19976
 
19947
- var VERSION$1 = "3.2.9";
19977
+ var VERSION$1 = "3.3.1";
19948
19978
 
19949
19979
  exports.VERSION = VERSION$1;
19950
19980
  exports.CesiumParabola = CesiumParabola;