bruce-cesium 4.7.9 → 4.8.0

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
1
  import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttribute, EntityAttachment, EntityAttachmentType, AbstractApi, Session } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2549,7 +2549,7 @@ var EntityUtils;
2549
2549
  */
2550
2550
  function GetLocation(params) {
2551
2551
  return __awaiter(this, void 0, void 0, function () {
2552
- var api, viewer, samples, visualRegister, minimumAlt, paddingAlt, MAX_DISTANCE_BETWEEN_SAMPLES, MAX_TERRAIN_SAMPLES, terrainSamples, MAX_API_CALLS, apiCalls, MAX_VALID_SAMPLES, validSamples, data, spheres, processPosHeight, ensureHeightRefs, getEntityPositions, allPosses, i, sample, samplePosses, valid, j, samplePos, k, allPos, distance, rect, factor, marginX, marginY, carto, i, pos, radius, sphere, allPointSphere, rectSphere, combinedSphere;
2552
+ var api, viewer, samples, visualRegister, minimumAlt, paddingAlt, MAX_DISTANCE_BETWEEN_SAMPLES, MAX_TERRAIN_SAMPLES, terrainSamples, MAX_VALID_SAMPLES, validSamples, data, spheres, processPosHeight, ensureHeightRefs, getRenderedEntityPositions, getRecordEntityPositions, allPosses, recordSamples, i, sample, samplePosses, added, valid, j, samplePos, k, allPos, distance, toSearchIds, entities, entitiesMap, i, i, sample, e_1, i, sample, samplePosses, valid, j, samplePos, k, allPos, distance, rect, factor, marginX, marginY, carto, i, pos, radius, sphere, allPointSphere, rectSphere, combinedSphere;
2553
2553
  var _this = this;
2554
2554
  return __generator(this, function (_a) {
2555
2555
  switch (_a.label) {
@@ -2564,8 +2564,6 @@ var EntityUtils;
2564
2564
  MAX_DISTANCE_BETWEEN_SAMPLES = 5000;
2565
2565
  MAX_TERRAIN_SAMPLES = 25;
2566
2566
  terrainSamples = 0;
2567
- MAX_API_CALLS = 10;
2568
- apiCalls = 0;
2569
2567
  MAX_VALID_SAMPLES = 20;
2570
2568
  validSamples = 0;
2571
2569
  data = {
@@ -2656,16 +2654,15 @@ var EntityUtils;
2656
2654
  }
2657
2655
  });
2658
2656
  }); };
2659
- getEntityPositions = function (sample) { return __awaiter(_this, void 0, void 0, function () {
2660
- var entityId, entity, disallowRendered, evaluateRendered, evaluateRecord, renderedPosses, e_1, recordPosses, e_2, pos3d, eLocation, geometryRadius, sphere;
2657
+ getRenderedEntityPositions = function (sample) { return __awaiter(_this, void 0, void 0, function () {
2658
+ var entityId, entity, disallowRendered, evaluateRendered, renderedPosses;
2661
2659
  var _this = this;
2662
- var _a, _b;
2663
- return __generator(this, function (_c) {
2664
- switch (_c.label) {
2660
+ return __generator(this, function (_a) {
2661
+ switch (_a.label) {
2665
2662
  case 0:
2666
2663
  entityId = sample.entityId, entity = sample.entity, disallowRendered = sample.disallowRendered;
2667
2664
  evaluateRendered = function () { return __awaiter(_this, void 0, void 0, function () {
2668
- 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;
2665
+ var rego, posses, parts, i, part, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i_1, pPosses, pPossesSample, step, i_2, pPosses, pPossesSample, step, i_3, pos3d, toAdjust, modelExt, sphere, semiMajorAxis, semiMinorAxis, height, radius, sphere, data_1, pos3d, toAdjust, sphere;
2669
2666
  return __generator(this, function (_a) {
2670
2667
  switch (_a.label) {
2671
2668
  case 0:
@@ -2754,18 +2751,18 @@ var EntityUtils;
2754
2751
  _a.label = 13;
2755
2752
  case 13:
2756
2753
  if (!(part.point || part.model || part.billboard || part.ellipse)) return [3 /*break*/, 15];
2757
- pos3d_1 = GetValue(viewer, part.position);
2758
- if (!(pos3d_1 === null || pos3d_1 === void 0 ? void 0 : pos3d_1.x)) return [3 /*break*/, 15];
2759
- toAdjust = [pos3d_1];
2754
+ pos3d = GetValue(viewer, part.position);
2755
+ if (!(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) return [3 /*break*/, 15];
2756
+ toAdjust = [pos3d];
2760
2757
  return [4 /*yield*/, ensureHeightRefs(toAdjust, __assign(__assign({}, sample), { heightRef: visualHeightRef }))];
2761
2758
  case 14:
2762
2759
  _a.sent();
2763
- pos3d_1 = toAdjust[0];
2764
- posses.push(pos3d_1);
2760
+ pos3d = toAdjust[0];
2761
+ posses.push(pos3d);
2765
2762
  if (part.model) {
2766
2763
  modelExt = part.model;
2767
2764
  if (modelExt._radius && modelExt._radius > -1) {
2768
- sphere = BoundingSphere.fromPoints([pos3d_1]);
2765
+ sphere = BoundingSphere.fromPoints([pos3d]);
2769
2766
  sphere.radius = modelExt._radius;
2770
2767
  spheres.push(sphere);
2771
2768
  }
@@ -2785,7 +2782,7 @@ var EntityUtils;
2785
2782
  }
2786
2783
  radius = Math.max(semiMajorAxis, semiMinorAxis, height);
2787
2784
  if (radius && radius > 0) {
2788
- sphere = new BoundingSphere(pos3d_1, radius);
2785
+ sphere = new BoundingSphere(pos3d, radius);
2789
2786
  spheres.push(sphere);
2790
2787
  }
2791
2788
  }
@@ -2795,15 +2792,15 @@ var EntityUtils;
2795
2792
  if (!(part instanceof Cesium3DTileFeature)) return [3 /*break*/, 18];
2796
2793
  data_1 = getLocationFromFeature(part);
2797
2794
  if (!(data_1 != null)) return [3 /*break*/, 18];
2798
- pos3d_2 = Cartesian3.fromDegrees(data_1.location.longitude, data_1.location.latitude, data_1.location.altitude);
2799
- toAdjust = [pos3d_2];
2795
+ pos3d = Cartesian3.fromDegrees(data_1.location.longitude, data_1.location.latitude, data_1.location.altitude);
2796
+ toAdjust = [pos3d];
2800
2797
  return [4 /*yield*/, ensureHeightRefs(toAdjust, __assign(__assign({}, sample), { heightRef: data_1.isClamped ? HeightReference.CLAMP_TO_GROUND : HeightReference.NONE }))];
2801
2798
  case 17:
2802
2799
  _a.sent();
2803
- pos3d_2 = toAdjust[0];
2804
- posses.push(pos3d_2);
2800
+ pos3d = toAdjust[0];
2801
+ posses.push(pos3d);
2805
2802
  if (data_1.radius != null && !isNaN(data_1.radius)) {
2806
- sphere = new BoundingSphere(pos3d_2, data_1.radius);
2803
+ sphere = new BoundingSphere(pos3d, data_1.radius);
2807
2804
  spheres.push(sphere);
2808
2805
  }
2809
2806
  _a.label = 18;
@@ -2814,8 +2811,28 @@ var EntityUtils;
2814
2811
  }
2815
2812
  });
2816
2813
  }); };
2814
+ if (!(disallowRendered != true)) return [3 /*break*/, 2];
2815
+ return [4 /*yield*/, evaluateRendered()];
2816
+ case 1:
2817
+ renderedPosses = _a.sent();
2818
+ if (renderedPosses === null || renderedPosses === void 0 ? void 0 : renderedPosses.length) {
2819
+ return [2 /*return*/, renderedPosses];
2820
+ }
2821
+ _a.label = 2;
2822
+ case 2: return [2 /*return*/, []];
2823
+ }
2824
+ });
2825
+ }); };
2826
+ getRecordEntityPositions = function (sample) { return __awaiter(_this, void 0, void 0, function () {
2827
+ var entityId, entity, disallowRendered, evaluateRecord, recordPosses, pos3d, eLocation, geometryRadius, sphere, e_2;
2828
+ var _this = this;
2829
+ var _a;
2830
+ return __generator(this, function (_b) {
2831
+ switch (_b.label) {
2832
+ case 0:
2833
+ entityId = sample.entityId, entity = sample.entity, disallowRendered = sample.disallowRendered;
2817
2834
  evaluateRecord = function () { return __awaiter(_this, void 0, void 0, function () {
2818
- var posses, location, latitude, longitude, pos3d_3, geometry, pointStr, points, point, pos3d_4, lineStr, points, pPosses, pRings, boundary, points, pPosses, boundaries, point, bPosses;
2835
+ var posses, location, latitude, longitude, pos3d, geometry, pointStr, points, point, pos3d, lineStr, points, pPosses, pRings, boundary, points, pPosses, boundaries, point, bPosses;
2819
2836
  return __generator(this, function (_a) {
2820
2837
  switch (_a.label) {
2821
2838
  case 0:
@@ -2829,8 +2846,8 @@ var EntityUtils;
2829
2846
  longitude = EnsureNumber(location.longitude);
2830
2847
  // Disallowing exact 0.
2831
2848
  if (latitude || longitude) {
2832
- pos3d_3 = Cartesian3.fromDegrees(longitude, latitude, EnsureNumber(location.altitude));
2833
- posses.push(pos3d_3);
2849
+ pos3d = Cartesian3.fromDegrees(longitude, latitude, EnsureNumber(location.altitude));
2850
+ posses.push(pos3d);
2834
2851
  }
2835
2852
  }
2836
2853
  geometry = Entity$1.GetValue({
@@ -2845,8 +2862,8 @@ var EntityUtils;
2845
2862
  points = Geometry.ParsePoints(pointStr);
2846
2863
  point = points.length > 0 ? points[0] : null;
2847
2864
  if (point && Carto.ValidateCarto(point)) {
2848
- pos3d_4 = Cartesian3.fromDegrees(EnsureNumber(point.longitude), EnsureNumber(point.latitude), EnsureNumber(point.altitude));
2849
- posses.push(pos3d_4);
2865
+ pos3d = Cartesian3.fromDegrees(EnsureNumber(point.longitude), EnsureNumber(point.latitude), EnsureNumber(point.altitude));
2866
+ posses.push(pos3d);
2850
2867
  }
2851
2868
  }
2852
2869
  lineStr = geometry.LineString;
@@ -2896,78 +2913,26 @@ var EntityUtils;
2896
2913
  }
2897
2914
  });
2898
2915
  }); };
2899
- if (!(disallowRendered != true)) return [3 /*break*/, 2];
2900
- return [4 /*yield*/, evaluateRendered()];
2916
+ return [4 /*yield*/, evaluateRecord()];
2901
2917
  case 1:
2902
- renderedPosses = _c.sent();
2903
- if (renderedPosses === null || renderedPosses === void 0 ? void 0 : renderedPosses.length) {
2904
- return [2 /*return*/, renderedPosses];
2905
- }
2906
- _c.label = 2;
2918
+ recordPosses = _b.sent();
2919
+ if (!(recordPosses === null || recordPosses === void 0 ? void 0 : recordPosses.length)) return [3 /*break*/, 8];
2920
+ _b.label = 2;
2907
2921
  case 2:
2908
- if (!!entity) return [3 /*break*/, 6];
2909
- if (!(apiCalls < MAX_API_CALLS)) return [3 /*break*/, 6];
2910
- apiCalls += 1;
2911
- _c.label = 3;
2912
- case 3:
2913
- _c.trys.push([3, 5, , 6]);
2914
- return [4 /*yield*/, Entity$1.Get({
2915
- api: api,
2916
- entityId: entityId,
2917
- // Not expanding relative positions at first to see if the entity has valid location just by itself.
2918
- expandLocation: false,
2919
- migrated: true
2920
- })];
2921
- case 4:
2922
- entity = (_c.sent()).entity;
2923
- return [3 /*break*/, 6];
2924
- case 5:
2925
- e_1 = _c.sent();
2926
- console.error(e_1);
2927
- return [3 /*break*/, 6];
2928
- case 6:
2929
- if (!entity) {
2930
- return [2 /*return*/, []];
2931
- }
2932
- return [4 /*yield*/, evaluateRecord()];
2933
- case 7:
2934
- recordPosses = _c.sent();
2935
- if (recordPosses === null || recordPosses === void 0 ? void 0 : recordPosses.length) {
2936
- return [2 /*return*/, recordPosses];
2937
- }
2938
- if (!(apiCalls < MAX_API_CALLS && ((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyRootLocation) == null)) return [3 /*break*/, 11];
2939
- _c.label = 8;
2940
- case 8:
2941
- _c.trys.push([8, 10, , 11]);
2942
- apiCalls += 1;
2943
- return [4 /*yield*/, Entity$1.Get({
2944
- api: api,
2945
- entityId: entityId,
2946
- // We'll be expanding relative positioning and related assemblies now.
2947
- expandLocation: true,
2948
- migrated: true
2949
- })];
2950
- case 9:
2951
- entity = (_c.sent()).entity;
2952
- return [3 /*break*/, 11];
2953
- case 10:
2954
- e_2 = _c.sent();
2955
- console.warn(e_2);
2956
- return [3 /*break*/, 11];
2957
- case 11:
2922
+ _b.trys.push([2, 6, , 7]);
2958
2923
  pos3d = null;
2959
2924
  eLocation = Entity$1.GetValue({
2960
2925
  entity: entity,
2961
2926
  path: ["Bruce", "Location"]
2962
2927
  });
2963
- if (!((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) && ((_b = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _b === void 0 ? void 0 : _b.AssemblyRootLocation) != null)) return [3 /*break*/, 14];
2928
+ if (!((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) && ((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyRootLocation) != null)) return [3 /*break*/, 5];
2964
2929
  pos3d = Cartesian3.fromDegrees(EnsureNumber(eLocation.longitude), EnsureNumber(eLocation.latitude), EnsureNumber(eLocation.altitude));
2965
- if (!(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) return [3 /*break*/, 13];
2930
+ if (!(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) return [3 /*break*/, 4];
2966
2931
  return [4 /*yield*/, processPosHeight(pos3d, HeightReference.NONE)];
2967
- case 12:
2968
- pos3d = _c.sent();
2969
- _c.label = 13;
2970
- case 13:
2932
+ case 3:
2933
+ pos3d = _b.sent();
2934
+ _b.label = 4;
2935
+ case 4:
2971
2936
  geometryRadius = Entity$1.GetValue({
2972
2937
  entity: entity,
2973
2938
  path: ["Bruce", "GeometryRadius"]
@@ -2980,24 +2945,28 @@ var EntityUtils;
2980
2945
  spheres.push(sphere);
2981
2946
  }
2982
2947
  }
2983
- _c.label = 14;
2984
- case 14:
2985
- if (pos3d) {
2986
- return [2 /*return*/, [pos3d]];
2987
- }
2988
- return [2 /*return*/, []];
2948
+ _b.label = 5;
2949
+ case 5: return [3 /*break*/, 7];
2950
+ case 6:
2951
+ e_2 = _b.sent();
2952
+ console.error(e_2);
2953
+ return [3 /*break*/, 7];
2954
+ case 7: return [2 /*return*/, recordPosses];
2955
+ case 8: return [2 /*return*/, []];
2989
2956
  }
2990
2957
  });
2991
2958
  }); };
2992
2959
  allPosses = [];
2960
+ recordSamples = [];
2993
2961
  i = 0;
2994
2962
  _a.label = 1;
2995
2963
  case 1:
2996
2964
  if (!(i < samples.length)) return [3 /*break*/, 4];
2997
2965
  sample = samples[i];
2998
- return [4 /*yield*/, getEntityPositions(sample)];
2966
+ return [4 /*yield*/, getRenderedEntityPositions(sample)];
2999
2967
  case 2:
3000
2968
  samplePosses = _a.sent();
2969
+ added = false;
3001
2970
  if (samplePosses === null || samplePosses === void 0 ? void 0 : samplePosses.length) {
3002
2971
  valid = !(allPosses === null || allPosses === void 0 ? void 0 : allPosses.length);
3003
2972
  if (!valid) {
@@ -3018,17 +2987,91 @@ var EntityUtils;
3018
2987
  }
3019
2988
  if (valid) {
3020
2989
  allPosses = allPosses.concat(samplePosses);
2990
+ added = true;
3021
2991
  validSamples += 1;
3022
2992
  if (validSamples >= MAX_VALID_SAMPLES) {
3023
2993
  return [3 /*break*/, 4];
3024
2994
  }
3025
2995
  }
3026
2996
  }
2997
+ if (!added) {
2998
+ recordSamples.push(sample);
2999
+ }
3027
3000
  _a.label = 3;
3028
3001
  case 3:
3029
3002
  i++;
3030
3003
  return [3 /*break*/, 1];
3031
3004
  case 4:
3005
+ _a.trys.push([4, 7, , 8]);
3006
+ toSearchIds = recordSamples.filter(function (x) { return !x.entity && x.entityId; }).map(function (x) { return x.entityId; });
3007
+ if (!toSearchIds.length) return [3 /*break*/, 6];
3008
+ return [4 /*yield*/, Entity$1.GetListByIds({
3009
+ entityIds: toSearchIds,
3010
+ expandLocation: true,
3011
+ migrated: true,
3012
+ api: api
3013
+ })];
3014
+ case 5:
3015
+ entities = (_a.sent()).entities;
3016
+ entitiesMap = new Map();
3017
+ for (i = 0; i < entities.length; i++) {
3018
+ entitiesMap.set(entities[i].Bruce.ID, entities[i]);
3019
+ }
3020
+ for (i = 0; i < recordSamples.length; i++) {
3021
+ sample = recordSamples[i];
3022
+ if (!sample.entity && sample.entityId) {
3023
+ sample.entity = entitiesMap.get(sample.entityId);
3024
+ }
3025
+ }
3026
+ _a.label = 6;
3027
+ case 6:
3028
+ // Filter out samples that still don't have an entity.
3029
+ recordSamples = recordSamples.filter(function (x) { return !!x.entity; });
3030
+ return [3 /*break*/, 8];
3031
+ case 7:
3032
+ e_1 = _a.sent();
3033
+ console.error(e_1);
3034
+ return [3 /*break*/, 8];
3035
+ case 8:
3036
+ i = 0;
3037
+ _a.label = 9;
3038
+ case 9:
3039
+ if (!(i < recordSamples.length)) return [3 /*break*/, 12];
3040
+ sample = recordSamples[i];
3041
+ return [4 /*yield*/, getRecordEntityPositions(sample)];
3042
+ case 10:
3043
+ samplePosses = _a.sent();
3044
+ if (samplePosses === null || samplePosses === void 0 ? void 0 : samplePosses.length) {
3045
+ valid = !(allPosses === null || allPosses === void 0 ? void 0 : allPosses.length);
3046
+ if (!valid) {
3047
+ for (j = 0; j < samplePosses.length; j++) {
3048
+ samplePos = samplePosses[j];
3049
+ for (k = 0; k < allPosses.length; k++) {
3050
+ allPos = allPosses[k];
3051
+ distance = Cartesian3.distance(samplePos, allPos);
3052
+ if (distance < MAX_DISTANCE_BETWEEN_SAMPLES) {
3053
+ valid = true;
3054
+ break;
3055
+ }
3056
+ }
3057
+ if (valid) {
3058
+ break;
3059
+ }
3060
+ }
3061
+ }
3062
+ if (valid) {
3063
+ allPosses = allPosses.concat(samplePosses);
3064
+ validSamples += 1;
3065
+ if (validSamples >= MAX_VALID_SAMPLES) {
3066
+ return [3 /*break*/, 12];
3067
+ }
3068
+ }
3069
+ }
3070
+ _a.label = 11;
3071
+ case 11:
3072
+ i++;
3073
+ return [3 /*break*/, 9];
3074
+ case 12:
3032
3075
  if (allPosses.length > 1) {
3033
3076
  rect = allPosses.length == 1 ? null : Rectangle.fromCartesianArray(allPosses);
3034
3077
  if (rect.width > 0 && rect.height > 0) {
@@ -3103,9 +3146,9 @@ var EntityUtils;
3103
3146
  if ((rego === null || rego === void 0 ? void 0 : rego.visual) instanceof Entity) {
3104
3147
  var visual = rego.visual;
3105
3148
  if (visual.position) {
3106
- var pos3d_5 = GetValue(viewer, visual.position);
3149
+ var pos3d_1 = GetValue(viewer, visual.position);
3107
3150
  // Fix height reference.
3108
- if (pos3d_5 === null || pos3d_5 === void 0 ? void 0 : pos3d_5.x) {
3151
+ if (pos3d_1 === null || pos3d_1 === void 0 ? void 0 : pos3d_1.x) {
3109
3152
  var visualHeightRef = HeightReference.RELATIVE_TO_GROUND;
3110
3153
  if (visual.model) {
3111
3154
  visualHeightRef = GetValue(viewer, visual.model.heightReference);
@@ -3132,7 +3175,7 @@ var EntityUtils;
3132
3175
  return DrawingUtils.EnsurePosHeight({
3133
3176
  desiredHeightRef: params.returnHeightRef,
3134
3177
  heightRef: visualHeightRef,
3135
- pos3d: pos3d_5,
3178
+ pos3d: pos3d_1,
3136
3179
  viewer: viewer
3137
3180
  });
3138
3181
  }
@@ -28638,7 +28681,7 @@ var WidgetViewBar = /** @class */ (function (_super) {
28638
28681
  return WidgetViewBar;
28639
28682
  }(Widget.AWidget));
28640
28683
 
28641
- var VERSION = "4.7.9";
28684
+ var VERSION = "4.8.0";
28642
28685
 
28643
28686
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, 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, MeasureCreator, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
28644
28687
  //# sourceMappingURL=bruce-cesium.es5.js.map