bruce-cesium 1.3.0 → 1.3.2

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.
@@ -1264,7 +1264,7 @@
1264
1264
  case 2:
1265
1265
  if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
1266
1266
  _loop_1 = function (i) {
1267
- var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity, firstEntity;
1267
+ var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
1268
1268
  return __generator(this, function (_a) {
1269
1269
  switch (_a.label) {
1270
1270
  case 0:
@@ -1300,16 +1300,19 @@
1300
1300
  rendered = rendered.concat(Object.values(cPoints));
1301
1301
  rendered = rendered.filter(function (x) { return x != null; });
1302
1302
  if (rendered.length) {
1303
- rootEntity = new Cesium.Entity({});
1304
- params.viewer.entities.add(rootEntity);
1305
- rootEntity._siblingGraphics = [];
1306
- rootEntity._renderGroup = getRenderGroupId(zoomItem);
1307
- rootEntity._siblingGraphics = rootEntity._siblingGraphics.concat(rendered);
1308
- cEntities[entity.Bruce.ID] = rootEntity;
1303
+ rootEntity_1 = new Cesium.Entity({});
1304
+ params.viewer.entities.add(rootEntity_1);
1305
+ rootEntity_1._siblingGraphics = [];
1306
+ rootEntity_1._renderGroup = getRenderGroupId(zoomItem);
1307
+ rootEntity_1._siblingGraphics = rootEntity_1._siblingGraphics.concat(rendered);
1308
+ cEntities[entity.Bruce.ID] = rootEntity_1;
1309
1309
  firstEntity = rendered[0];
1310
1310
  if (firstEntity) {
1311
- rootEntity.position = getValue(params.viewer, firstEntity.position.getValue);
1311
+ rootEntity_1.position = getValue(params.viewer, firstEntity.position.getValue);
1312
1312
  }
1313
+ rendered.forEach(function (child) {
1314
+ child._parentEntity = rootEntity_1;
1315
+ });
1313
1316
  }
1314
1317
  else {
1315
1318
  polygons.push(entity);
@@ -1698,9 +1701,9 @@
1698
1701
  var outerRing = pRings.find(function (x) { return x.Facing == bruceModels.Geometry.EPolygonRingType.Boundaries; });
1699
1702
  var points = bruceModels.Geometry.ParsePoints(outerRing === null || outerRing === void 0 ? void 0 : outerRing.LinearRing);
1700
1703
  var posses = points.map(function (x) { return Cesium.Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)); });
1704
+ bruceModels.Cartes.CloseRing3(posses);
1701
1705
  var extrusion = getPolygonExtrusion(entity, params.tags, outerRing, posses, heightRef, style);
1702
1706
  posses = extrusion.posses;
1703
- console.log("EXTRUSION", extrusion, style);
1704
1707
  var holeRings = pRings.filter(function (x) { return x.Facing == bruceModels.Geometry.EPolygonRingType.Hole; });
1705
1708
  var holePosses = holeRings.map(function (x) {
1706
1709
  var points = bruceModels.Geometry.ParsePoints(x.LinearRing);
@@ -1726,11 +1729,11 @@
1726
1729
  show: false
1727
1730
  });
1728
1731
  cEntity._siblingGraphics = [];
1729
- for (var i = 0; i < holePosses.length; i++) {
1730
- var posses_1 = holePosses[i];
1731
- var cEntityHole = new Cesium.Entity({
1732
+ console.count("POLYGON WIDTH = " + width + ", COLOR = " + (cLineColor === null || cLineColor === void 0 ? void 0 : cLineColor.toCssColorString()));
1733
+ if (width > 0 && cLineColor) {
1734
+ var cEntityBorder = new Cesium.Entity({
1732
1735
  polyline: new Cesium.PolylineGraphics({
1733
- positions: posses_1,
1736
+ positions: posses,
1734
1737
  material: cLineColor,
1735
1738
  width: width,
1736
1739
  clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
@@ -1740,9 +1743,28 @@
1740
1743
  }),
1741
1744
  show: false
1742
1745
  });
1743
- cEntity._siblingGraphics.push(cEntityHole);
1744
- cEntityHole._parentEntity = cEntity;
1745
- params.viewer.entities.add(cEntityHole);
1746
+ params.viewer.entities.add(cEntityBorder);
1747
+ cEntityBorder._parentEntity = cEntity;
1748
+ cEntity._siblingGraphics.push(cEntityBorder);
1749
+ for (var i = 0; i < holePosses.length; i++) {
1750
+ var posses_1 = holePosses[i];
1751
+ bruceModels.Cartes.CloseRing3(posses_1);
1752
+ var cEntityHole = new Cesium.Entity({
1753
+ polyline: new Cesium.PolylineGraphics({
1754
+ positions: posses_1,
1755
+ material: cLineColor,
1756
+ width: width,
1757
+ clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
1758
+ classificationType: Cesium.ClassificationType.TERRAIN,
1759
+ arcType: Cesium.ArcType.GEODESIC,
1760
+ zIndex: zIndex
1761
+ }),
1762
+ show: false
1763
+ });
1764
+ cEntity._siblingGraphics.push(cEntityHole);
1765
+ cEntityHole._parentEntity = cEntity;
1766
+ params.viewer.entities.add(cEntityHole);
1767
+ }
1746
1768
  }
1747
1769
  params.viewer.entities.add(cEntity);
1748
1770
  return cEntity;