bruce-cesium 4.2.0 → 4.2.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.
@@ -1,6 +1,6 @@
1
- import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, EncryptUtils, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
1
+ import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, EasingFunction, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, HeadingPitchRange, Ion, Cesium3DTileStyle, Cesium3DTileColorBlendMode, KmlDataSource, OrthographicFrustum, EasingFunction, SceneTransforms, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4646,11 +4646,6 @@ function OneTimeError(key, message) {
4646
4646
  }
4647
4647
  }
4648
4648
 
4649
- // Hash of input geometry to the simplified geometry.
4650
- var _cache = new LRUCache(1000);
4651
- function getHash(entityId, geometry) {
4652
- return EncryptUtils.Cyrb53Hash(entityId + JSON.stringify(geometry));
4653
- }
4654
4649
  /**
4655
4650
  * Util for simplifying geometry on the fly.
4656
4651
  */
@@ -4701,11 +4696,6 @@ var SimplifyGeometry;
4701
4696
  if (!geometry || !turf || !turf.simplify) {
4702
4697
  return geometry;
4703
4698
  }
4704
- // Generate unique hash for the geometry.
4705
- var hash = getHash(entityId, geometry);
4706
- if (_cache.Get(hash)) {
4707
- return _cache.Get(hash);
4708
- }
4709
4699
  // Convert to geojson so that we can interact with turf.
4710
4700
  var gFeature = Geometry.ToGeoJsonFeature({
4711
4701
  geometry: geometry
@@ -4729,9 +4719,6 @@ var SimplifyGeometry;
4729
4719
  geometry = (_a = Geometry.FromGeoJson({
4730
4720
  geoJson: gFeature
4731
4721
  })) === null || _a === void 0 ? void 0 : _a.geometry;
4732
- // Store cached result to avoid recalculating.
4733
- // Hashing a large geometry string is slow, but all these operations are slower.
4734
- _cache.Set(hash, geometry);
4735
4722
  return geometry;
4736
4723
  }
4737
4724
  SimplifyGeometry.Simplify = Simplify;
@@ -4752,22 +4739,49 @@ function untangleFeature(feature) {
4752
4739
  try {
4753
4740
  // Dedupe the coordinates to avoid issues with unkink.
4754
4741
  coords = dedupeCoordinates(coords);
4755
- var tmpFeature = turf.polygon(coords);
4756
- var untangled = turf.unkinkPolygon(tmpFeature);
4757
- if (untangled.features.length) {
4758
- if (untangled.type == "FeatureCollection") {
4759
- for (var i = 0; i < untangled.features.length; i++) {
4760
- collection.geometries.push(untangled.features[i].geometry);
4742
+ var outer = [];
4743
+ var inner = [];
4744
+ // We'll unkink each ring separately as this is killing the holes when it is done as a whole.
4745
+ // So we'll do it separate then recombine.
4746
+ for (var i = 0; i < coords.length; i++) {
4747
+ var ring = coords[i];
4748
+ var unkink = turf.unkinkPolygon({
4749
+ type: "Polygon",
4750
+ coordinates: [ring]
4751
+ });
4752
+ if (unkink.type == "FeatureCollection") {
4753
+ var target = i == 0 ? outer : inner;
4754
+ for (var j = 0; j < unkink.features.length; j++) {
4755
+ var unkinked = unkink.features[j].geometry.coordinates;
4756
+ if (unkinked.length > 0) {
4757
+ target.push(unkinked[0]);
4758
+ }
4761
4759
  }
4762
- return true;
4763
4760
  }
4764
4761
  else {
4765
- console.error("Unexpected unkink result.", untangled);
4762
+ console.error("Unexpected unkink result.", unkink);
4763
+ }
4764
+ }
4765
+ // Recreate the rings and reapply to the collection.
4766
+ if (outer.length > 0) {
4767
+ var combinedCoords = [outer[0]];
4768
+ for (var i = 0; i < inner.length; i++) {
4769
+ combinedCoords.push(inner[i]);
4766
4770
  }
4771
+ // Add the combined coordinates to the collection
4772
+ var polygon = {
4773
+ type: "Polygon",
4774
+ coordinates: combinedCoords
4775
+ };
4776
+ // Ensure right-hand rule is followed.
4777
+ ensureRightHandRule(polygon);
4778
+ // Add to the collection.
4779
+ collection.geometries.push(polygon);
4780
+ return true;
4767
4781
  }
4768
4782
  }
4769
4783
  catch (e) {
4770
- console.error("Failed to unkink polygon.", e);
4784
+ // console.error("Failed to unkink polygon.", e);
4771
4785
  }
4772
4786
  return false;
4773
4787
  };
@@ -4889,7 +4903,7 @@ function unionFeature(feature) {
4889
4903
  }
4890
4904
  }
4891
4905
  catch (e) {
4892
- console.error("Failed to union polygons.", e);
4906
+ // console.error("Failed to union polygons.", e);
4893
4907
  return;
4894
4908
  }
4895
4909
  // Re-assign the geometry.
@@ -4925,6 +4939,31 @@ function dedupeCoordinates(inputCoords) {
4925
4939
  return dedupeCoords;
4926
4940
  });
4927
4941
  }
4942
+ function ensureRightHandRule(polygon) {
4943
+ // Ensure the outer ring follows the right-hand rule
4944
+ if (polygon.coordinates.length > 0) {
4945
+ var outerRing = polygon.coordinates[0];
4946
+ if (isClockwise(outerRing)) {
4947
+ polygon.coordinates[0] = outerRing.reverse();
4948
+ }
4949
+ }
4950
+ // Ensure any inner rings (holes) follow the right-hand rule
4951
+ for (var i = 1; i < polygon.coordinates.length; i++) {
4952
+ var innerRing = polygon.coordinates[i];
4953
+ if (!isClockwise(innerRing)) {
4954
+ polygon.coordinates[i] = innerRing.reverse();
4955
+ }
4956
+ }
4957
+ }
4958
+ function isClockwise(ring) {
4959
+ var sum = 0;
4960
+ for (var i = 0; i < ring.length - 1; i++) {
4961
+ var p1 = ring[i];
4962
+ var p2 = ring[i + 1];
4963
+ sum += (p2[0] - p1[0]) * (p2[1] + p1[1]);
4964
+ }
4965
+ return sum > 0;
4966
+ }
4928
4967
 
4929
4968
  function colorToCColor(color) {
4930
4969
  return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
@@ -5599,11 +5638,11 @@ function compareColorMaterials(viewer, a, b) {
5599
5638
  var EntityRenderEngine;
5600
5639
  (function (EntityRenderEngine) {
5601
5640
  function Render(params) {
5602
- var _a, _b, _c, _d, _e, _f, _g;
5641
+ var _a, _b, _c, _d, _e, _f;
5603
5642
  return __awaiter(this, void 0, void 0, function () {
5604
- var groupRenderParams, i, entity, geometry, optimized, updated, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, geometry, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
5605
- return __generator(this, function (_h) {
5606
- switch (_h.label) {
5643
+ var groupRenderParams, updated, cEntities, models, multiGeometry, polygons, polylines, points, prepareGeometry, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, geometry, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
5644
+ return __generator(this, function (_g) {
5645
+ switch (_g.label) {
5607
5646
  case 0:
5608
5647
  groupRenderParams = {
5609
5648
  apiGetter: params.apiGetter,
@@ -5613,10 +5652,16 @@ var EntityRenderEngine;
5613
5652
  menuItemId: params.menuItemId,
5614
5653
  visualRegister: params.visualRegister
5615
5654
  };
5616
- // Flatten multi-geometry if it's only got 1 piece.
5617
- for (i = 0; i < params.entities.length; i++) {
5618
- entity = params.entities[i];
5619
- geometry = Entity$1.GetValue({
5655
+ updated = new Map();
5656
+ cEntities = new Map();
5657
+ models = [];
5658
+ multiGeometry = [];
5659
+ polygons = [];
5660
+ polylines = [];
5661
+ points = [];
5662
+ prepareGeometry = function (entity) {
5663
+ var _a;
5664
+ var geometry = Entity$1.GetValue({
5620
5665
  entity: entity,
5621
5666
  path: ["Bruce", "VectorGeometry"]
5622
5667
  });
@@ -5631,14 +5676,13 @@ var EntityRenderEngine;
5631
5676
  if (params.optimizeTolerance == null) {
5632
5677
  params.optimizeTolerance = 0.00001;
5633
5678
  }
5634
- optimized = SimplifyGeometry.Simplify(entity.Bruce.ID, geometry, params.optimizeTolerance);
5679
+ var optimized = SimplifyGeometry.Simplify(entity.Bruce.ID, geometry, params.optimizeTolerance);
5635
5680
  if (optimized) {
5636
5681
  // Continue on with the rendering using the optimized geometry.
5637
5682
  geometry = optimized;
5638
5683
  // Dereference the Entity object now that we have done a destructive operation.
5639
5684
  entity = Object.assign({}, entity);
5640
5685
  entity.Bruce = Object.assign({}, entity.Bruce);
5641
- params.entities[i] = entity;
5642
5686
  }
5643
5687
  }
5644
5688
  }
@@ -5651,14 +5695,8 @@ var EntityRenderEngine;
5651
5695
  else {
5652
5696
  entity.Bruce.VectorGeometry = geometry;
5653
5697
  }
5654
- }
5655
- updated = new Map();
5656
- cEntities = new Map();
5657
- models = [];
5658
- multiGeometry = [];
5659
- polygons = [];
5660
- polylines = [];
5661
- points = [];
5698
+ return entity;
5699
+ };
5662
5700
  // Initial sorting.
5663
5701
  for (i = 0; i < params.entities.length; i++) {
5664
5702
  entity = params.entities[i];
@@ -5682,12 +5720,12 @@ var EntityRenderEngine;
5682
5720
  menuItemId: params.menuItemId
5683
5721
  });
5684
5722
  newRenderId = getRenderGroupId(zoomItem);
5685
- oldRenderId = (_b = existingRego === null || existingRego === void 0 ? void 0 : existingRego.visual) === null || _b === void 0 ? void 0 : _b._renderGroup;
5723
+ oldRenderId = (_a = existingRego === null || existingRego === void 0 ? void 0 : existingRego.visual) === null || _a === void 0 ? void 0 : _a._renderGroup;
5686
5724
  if (!params.force &&
5687
5725
  newRenderId == oldRenderId &&
5688
5726
  !(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
5689
5727
  // If historic metadata is different then it's also stale.
5690
- ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.HistoricDateTime))) {
5728
+ ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.HistoricDateTime))) {
5691
5729
  // No sorting category needed. Already rendered the way we want.
5692
5730
  cEntities.set(id, existingRego.visual);
5693
5731
  }
@@ -5698,20 +5736,22 @@ var EntityRenderEngine;
5698
5736
  // Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
5699
5737
  existingRego.stale = false;
5700
5738
  // Update metadata for the same reason.
5701
- existingRego.historicDateTime = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricDateTime;
5702
- existingRego.historicAttrKey = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.HistoricAttrKey;
5739
+ existingRego.historicDateTime = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.HistoricDateTime;
5740
+ existingRego.historicAttrKey = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricAttrKey;
5703
5741
  existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
5704
5742
  updated.set(id, true);
5705
5743
  }
5706
5744
  if (displayType == ZoomControl.EDisplayType.Model3D) {
5745
+ entity = params.entities[i] = prepareGeometry(entity);
5707
5746
  models.push(entity);
5708
5747
  }
5709
5748
  else if (displayType == ZoomControl.EDisplayType.Geometry) {
5749
+ entity = params.entities[i] = prepareGeometry(entity);
5710
5750
  geometry = Entity$1.GetValue({
5711
5751
  entity: entity,
5712
5752
  path: ["Bruce", "VectorGeometry"]
5713
5753
  });
5714
- if ((_f = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _f === void 0 ? void 0 : _f.length) {
5754
+ if ((_e = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _e === void 0 ? void 0 : _e.length) {
5715
5755
  multiGeometry.push(entity);
5716
5756
  }
5717
5757
  else {
@@ -5729,7 +5769,7 @@ var EntityRenderEngine;
5729
5769
  mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric });
5730
5770
  return [4 /*yield*/, Model3d.RenderGroup(mParams)];
5731
5771
  case 1:
5732
- mEntities = _h.sent();
5772
+ mEntities = _g.sent();
5733
5773
  for (i = 0; i < mParams.entities.length; i++) {
5734
5774
  entity = mParams.entities[i];
5735
5775
  id = entity.Bruce.ID;
@@ -5741,20 +5781,20 @@ var EntityRenderEngine;
5741
5781
  multiGeometry.push(entity);
5742
5782
  }
5743
5783
  }
5744
- _h.label = 2;
5784
+ _g.label = 2;
5745
5785
  case 2:
5746
5786
  if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
5747
5787
  _loop_1 = function (i) {
5748
5788
  var entity, geometry, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
5749
- return __generator(this, function (_j) {
5750
- switch (_j.label) {
5789
+ return __generator(this, function (_h) {
5790
+ switch (_h.label) {
5751
5791
  case 0:
5752
5792
  entity = multiGeometry[i];
5753
5793
  geometry = Entity$1.GetValue({
5754
5794
  entity: entity,
5755
5795
  path: ["Bruce", "VectorGeometry"]
5756
5796
  });
5757
- if (!((_g = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _g === void 0 ? void 0 : _g.length)) {
5797
+ if (!((_f = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _f === void 0 ? void 0 : _f.length)) {
5758
5798
  polygons.push(entity);
5759
5799
  return [2 /*return*/, "continue"];
5760
5800
  }
@@ -5768,7 +5808,7 @@ var EntityRenderEngine;
5768
5808
  }
5769
5809
  return [4 /*yield*/, Polygon.RenderGroup(pParams)];
5770
5810
  case 1:
5771
- cPoly = _j.sent();
5811
+ cPoly = _h.sent();
5772
5812
  Array.from(cPoly.keys()).forEach(function (key) {
5773
5813
  if (cPoly.get(key)) {
5774
5814
  pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
@@ -5777,7 +5817,7 @@ var EntityRenderEngine;
5777
5817
  rendered = Array.from(cPoly.values());
5778
5818
  return [4 /*yield*/, Polyline.RenderGroup(pParams)];
5779
5819
  case 2:
5780
- cLines = _j.sent();
5820
+ cLines = _h.sent();
5781
5821
  Array.from(cLines.keys()).forEach(function (key) {
5782
5822
  if (cLines.get(key)) {
5783
5823
  pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
@@ -5787,9 +5827,9 @@ var EntityRenderEngine;
5787
5827
  if (!!rendered.length) return [3 /*break*/, 4];
5788
5828
  return [4 /*yield*/, Point.RenderGroup(pParams)];
5789
5829
  case 3:
5790
- cPoints = _j.sent();
5830
+ cPoints = _h.sent();
5791
5831
  rendered = rendered.concat(Array.from(cPoints.values()));
5792
- _j.label = 4;
5832
+ _h.label = 4;
5793
5833
  case 4:
5794
5834
  rendered = rendered.filter(function (x) { return x != null; });
5795
5835
  if (rendered.length) {
@@ -5816,13 +5856,13 @@ var EntityRenderEngine;
5816
5856
  });
5817
5857
  };
5818
5858
  i = 0;
5819
- _h.label = 3;
5859
+ _g.label = 3;
5820
5860
  case 3:
5821
5861
  if (!(i < multiGeometry.length)) return [3 /*break*/, 6];
5822
5862
  return [5 /*yield**/, _loop_1(i)];
5823
5863
  case 4:
5824
- _h.sent();
5825
- _h.label = 5;
5864
+ _g.sent();
5865
+ _g.label = 5;
5826
5866
  case 5:
5827
5867
  i++;
5828
5868
  return [3 /*break*/, 3];
@@ -5831,7 +5871,7 @@ var EntityRenderEngine;
5831
5871
  pParams = __assign(__assign({}, groupRenderParams), { entities: polygons, rendered: cEntities });
5832
5872
  return [4 /*yield*/, Polygon.RenderGroup(pParams)];
5833
5873
  case 7:
5834
- pEntities = _h.sent();
5874
+ pEntities = _g.sent();
5835
5875
  for (i = 0; i < pParams.entities.length; i++) {
5836
5876
  entity = pParams.entities[i];
5837
5877
  cEntity = pEntities.get(entity.Bruce.ID);
@@ -5842,13 +5882,13 @@ var EntityRenderEngine;
5842
5882
  polylines.push(entity);
5843
5883
  }
5844
5884
  }
5845
- _h.label = 8;
5885
+ _g.label = 8;
5846
5886
  case 8:
5847
5887
  if (!(polylines.length > 0)) return [3 /*break*/, 10];
5848
5888
  pParams = __assign(__assign({}, groupRenderParams), { entities: polylines, rendered: cEntities });
5849
5889
  return [4 /*yield*/, Polyline.RenderGroup(pParams)];
5850
5890
  case 9:
5851
- pEntities = _h.sent();
5891
+ pEntities = _g.sent();
5852
5892
  for (i = 0; i < pParams.entities.length; i++) {
5853
5893
  entity = pParams.entities[i];
5854
5894
  cEntity = pEntities.get(entity.Bruce.ID);
@@ -5859,13 +5899,13 @@ var EntityRenderEngine;
5859
5899
  points.push(entity);
5860
5900
  }
5861
5901
  }
5862
- _h.label = 10;
5902
+ _g.label = 10;
5863
5903
  case 10:
5864
5904
  if (!(points.length > 0)) return [3 /*break*/, 12];
5865
5905
  pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric });
5866
5906
  return [4 /*yield*/, Point.RenderGroup(pParams)];
5867
5907
  case 11:
5868
- pEntities = _h.sent();
5908
+ pEntities = _g.sent();
5869
5909
  for (i = 0; i < pParams.entities.length; i++) {
5870
5910
  entity = pParams.entities[i];
5871
5911
  cEntity = pEntities.get(entity.Bruce.ID);
@@ -5873,7 +5913,7 @@ var EntityRenderEngine;
5873
5913
  cEntities.set(entity.Bruce.ID, cEntity);
5874
5914
  }
5875
5915
  }
5876
- _h.label = 12;
5916
+ _g.label = 12;
5877
5917
  case 12: return [2 /*return*/, {
5878
5918
  entities: cEntities,
5879
5919
  updated: updated
@@ -6787,6 +6827,7 @@ var EntityRenderEngine;
6787
6827
  var points = Geometry.ParsePoints(x.LinearRing);
6788
6828
  var holePosses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)); });
6789
6829
  holePosses = cullDuplicatePoints(holePosses);
6830
+ Cartes.CloseRing3(holePosses);
6790
6831
  return holePosses;
6791
6832
  }).filter(function (x) { return x.length >= 4; });
6792
6833
  var zIndex = getZIndex(style, entity, params.tags);
@@ -25711,7 +25752,7 @@ var ViewRenderEngine;
25711
25752
  ViewRenderEngine.Render = Render;
25712
25753
  })(ViewRenderEngine || (ViewRenderEngine = {}));
25713
25754
 
25714
- var VERSION = "4.2.0";
25755
+ var VERSION = "4.2.1";
25715
25756
 
25716
25757
  export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline };
25717
25758
  //# sourceMappingURL=bruce-cesium.es5.js.map