bruce-cesium 4.7.9 → 4.8.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.
- package/dist/bruce-cesium.es5.js +153 -110
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +151 -108
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine.js +2 -2
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +4 -4
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +2 -2
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +142 -97
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/getters/entity-filter-getter.d.ts +1 -1
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +1 -1
- package/dist/types/rendering/tileset-render-engine.d.ts +2 -2
- package/dist/types/rendering/visuals-register.d.ts +1 -1
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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,
|
|
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, AbstractApi, Session, EntityAttribute, EntityAttachment, EntityAttachmentType } 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,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, OrthographicFrustum, EasingFunction, NearFarScalar, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, Matrix4, Matrix3, IonResource, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, 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,
|
|
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
|
-
|
|
2660
|
-
var entityId, entity, disallowRendered, evaluateRendered,
|
|
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
|
-
|
|
2663
|
-
|
|
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,
|
|
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
|
-
|
|
2758
|
-
if (!(
|
|
2759
|
-
toAdjust = [
|
|
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
|
-
|
|
2764
|
-
posses.push(
|
|
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([
|
|
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(
|
|
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
|
-
|
|
2799
|
-
toAdjust = [
|
|
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
|
-
|
|
2804
|
-
posses.push(
|
|
2800
|
+
pos3d = toAdjust[0];
|
|
2801
|
+
posses.push(pos3d);
|
|
2805
2802
|
if (data_1.radius != null && !isNaN(data_1.radius)) {
|
|
2806
|
-
sphere = new BoundingSphere(
|
|
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,
|
|
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
|
-
|
|
2833
|
-
posses.push(
|
|
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
|
-
|
|
2849
|
-
posses.push(
|
|
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
|
-
|
|
2900
|
-
return [4 /*yield*/, evaluateRendered()];
|
|
2916
|
+
return [4 /*yield*/, evaluateRecord()];
|
|
2901
2917
|
case 1:
|
|
2902
|
-
|
|
2903
|
-
if (
|
|
2904
|
-
|
|
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
|
-
|
|
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) && ((
|
|
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*/,
|
|
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
|
|
2968
|
-
pos3d =
|
|
2969
|
-
|
|
2970
|
-
case
|
|
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
|
-
|
|
2984
|
-
case
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
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*/,
|
|
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
|
|
3149
|
+
var pos3d_1 = GetValue(viewer, visual.position);
|
|
3107
3150
|
// Fix height reference.
|
|
3108
|
-
if (
|
|
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:
|
|
3178
|
+
pos3d: pos3d_1,
|
|
3136
3179
|
viewer: viewer
|
|
3137
3180
|
});
|
|
3138
3181
|
}
|
|
@@ -8210,7 +8253,7 @@ var EntityRenderEngine;
|
|
|
8210
8253
|
!(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
|
|
8211
8254
|
// If historic/scenario metadata is different then it's also stale.
|
|
8212
8255
|
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.HistoricDateTime)) &&
|
|
8213
|
-
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.scenario) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c
|
|
8256
|
+
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.scenario) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.Scenario))) {
|
|
8214
8257
|
// No sorting category needed. Already rendered the way we want.
|
|
8215
8258
|
cEntities.set(id, existingRego.visual);
|
|
8216
8259
|
}
|
|
@@ -8224,7 +8267,7 @@ var EntityRenderEngine;
|
|
|
8224
8267
|
existingRego.historicDateTime = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricDateTime;
|
|
8225
8268
|
existingRego.historicAttrKey = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.HistoricAttrKey;
|
|
8226
8269
|
existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
8227
|
-
existingRego.scenario = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f
|
|
8270
|
+
existingRego.scenario = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.Scenario;
|
|
8228
8271
|
updated.set(id, true);
|
|
8229
8272
|
}
|
|
8230
8273
|
if (displayType == ZoomControl.EDisplayType.Model3D) {
|
|
@@ -12019,7 +12062,7 @@ var EntitiesRenderManager;
|
|
|
12019
12062
|
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
12020
12063
|
this.zoomControl = [this.zoomControl[0]];
|
|
12021
12064
|
}
|
|
12022
|
-
this.scenario = (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b
|
|
12065
|
+
this.scenario = (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.Scenario;
|
|
12023
12066
|
var isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
|
|
12024
12067
|
var tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
|
|
12025
12068
|
if (!tagsToRender) {
|
|
@@ -12674,7 +12717,7 @@ var EntitiesRenderManager;
|
|
|
12674
12717
|
})) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
|
|
12675
12718
|
cdn: _this.item.cdnEnabled,
|
|
12676
12719
|
collection: source.entities,
|
|
12677
|
-
scenario: (_f = (_e = group.data) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f
|
|
12720
|
+
scenario: (_f = (_e = group.data) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f.Scenario
|
|
12678
12721
|
};
|
|
12679
12722
|
group.rego = rego;
|
|
12680
12723
|
_this.visualsManager.AddRego({
|
|
@@ -12827,7 +12870,7 @@ var EntitiesRenderManager;
|
|
|
12827
12870
|
cdn: this.item.cdnEnabled,
|
|
12828
12871
|
historicDateTime: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.HistoricDateTime,
|
|
12829
12872
|
historicAttrKey: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.HistoricAttrKey,
|
|
12830
|
-
scenario: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h
|
|
12873
|
+
scenario: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Scenario
|
|
12831
12874
|
};
|
|
12832
12875
|
this.visualsManager.AddRego({
|
|
12833
12876
|
rego: rego_1,
|
|
@@ -12843,7 +12886,7 @@ var EntitiesRenderManager;
|
|
|
12843
12886
|
rego.historicAttrKey = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.HistoricAttrKey;
|
|
12844
12887
|
rego.cdn = this.item.cdnEnabled;
|
|
12845
12888
|
rego.schemaId = (_m = entity.Bruce) === null || _m === void 0 ? void 0 : _m.SchemaID;
|
|
12846
|
-
rego.scenario = (_o = entity.Bruce) === null || _o === void 0 ? void 0 : _o
|
|
12889
|
+
rego.scenario = (_o = entity.Bruce) === null || _o === void 0 ? void 0 : _o.Scenario;
|
|
12847
12890
|
// Marked as stale meaning some change was performed that requires a refresh.
|
|
12848
12891
|
// This usually means a new sibling was added that we need to update.
|
|
12849
12892
|
if (rego.stale) {
|
|
@@ -15932,7 +15975,7 @@ var TilesetCadRenderManager;
|
|
|
15932
15975
|
expandSources: (_a = _this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.ExpandSources,
|
|
15933
15976
|
menuItemId: _this.item.id,
|
|
15934
15977
|
register: _this.visualsManager,
|
|
15935
|
-
scenario: (_b = _this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b
|
|
15978
|
+
scenario: (_b = _this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.Scenario
|
|
15936
15979
|
});
|
|
15937
15980
|
_this.viewer.scene.requestRender();
|
|
15938
15981
|
}
|
|
@@ -16011,7 +16054,7 @@ var TilesetCadRenderManager;
|
|
|
16011
16054
|
rootId: this.rootId,
|
|
16012
16055
|
// TODO: Scenario is tied to the record, not to the Tileset.
|
|
16013
16056
|
// So we need a way to update it when we load the record from styling.
|
|
16014
|
-
scenario: (_d = this.item.BruceEntity) === null || _d === void 0 ? void 0 : _d
|
|
16057
|
+
scenario: (_d = this.item.BruceEntity) === null || _d === void 0 ? void 0 : _d.Scenario
|
|
16015
16058
|
};
|
|
16016
16059
|
var featureAny = feature;
|
|
16017
16060
|
var propertyNames = featureAny.getPropertyNames ? featureAny.getPropertyNames() : (_e = featureAny.getPropertyIds) === null || _e === void 0 ? void 0 : _e.call(featureAny);
|
|
@@ -28638,7 +28681,7 @@ var WidgetViewBar = /** @class */ (function (_super) {
|
|
|
28638
28681
|
return WidgetViewBar;
|
|
28639
28682
|
}(Widget.AWidget));
|
|
28640
28683
|
|
|
28641
|
-
var VERSION = "4.
|
|
28684
|
+
var VERSION = "4.8.1";
|
|
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
|