bruce-cesium 4.0.0 → 4.0.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.
- package/dist/bruce-cesium.es5.js +112 -85
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +111 -84
- 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 +10 -10
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/render-manager.js +6 -6
- package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +94 -67
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -2409,11 +2409,11 @@
|
|
|
2409
2409
|
});
|
|
2410
2410
|
}); };
|
|
2411
2411
|
getEntityPositions = function (sample) { return __awaiter(_this, void 0, void 0, function () {
|
|
2412
|
-
var entityId, entity, tileset, tilesetId, disallowRendered, evaluateRendered, evaluateRecord, renderedPosses, e_1, recordPosses, e_2, tSettings, pos3d, eLocation, alt, alt, eTransform, heading, pitch, roll, matrix4, offset, m1, hpr, transform, transformedOffset, sphere;
|
|
2412
|
+
var entityId, entity, tileset, tilesetId, disallowRendered, evaluateRendered, evaluateRecord, renderedPosses, e_1, recordPosses, e_2, tilesetIds, tSettings, pos3d, eLocation, alt, alt, worldPosition, eTransform, heading, pitch, roll, matrix4, offset, worldPivot, m1, hpr, transform, transformedOffset, geometryRadius, sphere;
|
|
2413
2413
|
var _this = this;
|
|
2414
|
-
var _a, _b, _c, _d
|
|
2415
|
-
return __generator(this, function (
|
|
2416
|
-
switch (
|
|
2414
|
+
var _a, _b, _c, _d;
|
|
2415
|
+
return __generator(this, function (_e) {
|
|
2416
|
+
switch (_e.label) {
|
|
2417
2417
|
case 0:
|
|
2418
2418
|
entityId = sample.entityId, entity = sample.entity, tileset = sample.tileset, tilesetId = sample.tilesetId, disallowRendered = sample.disallowRendered;
|
|
2419
2419
|
evaluateRendered = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -2574,7 +2574,7 @@
|
|
|
2574
2574
|
posses = [];
|
|
2575
2575
|
location = bruceModels.Entity.GetValue({
|
|
2576
2576
|
entity: entity,
|
|
2577
|
-
path: ["location"]
|
|
2577
|
+
path: ["Bruce", "location"]
|
|
2578
2578
|
});
|
|
2579
2579
|
if (location && typeof location == "object" && bruceModels.Carto.ValidateCarto(location)) {
|
|
2580
2580
|
latitude = EnsureNumber(location.latitude);
|
|
@@ -2587,7 +2587,7 @@
|
|
|
2587
2587
|
}
|
|
2588
2588
|
geometry = bruceModels.Entity.GetValue({
|
|
2589
2589
|
entity: entity,
|
|
2590
|
-
path: ["geometry"]
|
|
2590
|
+
path: ["Bruce", "geometry"]
|
|
2591
2591
|
});
|
|
2592
2592
|
if (!(geometry && typeof geometry == "object")) return [3 /*break*/, 4];
|
|
2593
2593
|
pointStr = geometry.Point;
|
|
@@ -2651,18 +2651,18 @@
|
|
|
2651
2651
|
if (!(disallowRendered != true)) return [3 /*break*/, 2];
|
|
2652
2652
|
return [4 /*yield*/, evaluateRendered()];
|
|
2653
2653
|
case 1:
|
|
2654
|
-
renderedPosses =
|
|
2654
|
+
renderedPosses = _e.sent();
|
|
2655
2655
|
if (renderedPosses === null || renderedPosses === void 0 ? void 0 : renderedPosses.length) {
|
|
2656
2656
|
return [2 /*return*/, renderedPosses];
|
|
2657
2657
|
}
|
|
2658
|
-
|
|
2658
|
+
_e.label = 2;
|
|
2659
2659
|
case 2:
|
|
2660
2660
|
if (!!entity) return [3 /*break*/, 6];
|
|
2661
2661
|
if (!(apiCalls < MAX_API_CALLS)) return [3 /*break*/, 6];
|
|
2662
2662
|
apiCalls += 1;
|
|
2663
|
-
|
|
2663
|
+
_e.label = 3;
|
|
2664
2664
|
case 3:
|
|
2665
|
-
|
|
2665
|
+
_e.trys.push([3, 5, , 6]);
|
|
2666
2666
|
return [4 /*yield*/, bruceModels.Entity.Get({
|
|
2667
2667
|
api: api,
|
|
2668
2668
|
entityId: entityId,
|
|
@@ -2670,10 +2670,10 @@
|
|
|
2670
2670
|
expandLocation: false
|
|
2671
2671
|
})];
|
|
2672
2672
|
case 4:
|
|
2673
|
-
entity = (
|
|
2673
|
+
entity = (_e.sent()).entity;
|
|
2674
2674
|
return [3 /*break*/, 6];
|
|
2675
2675
|
case 5:
|
|
2676
|
-
e_1 =
|
|
2676
|
+
e_1 = _e.sent();
|
|
2677
2677
|
console.error(e_1);
|
|
2678
2678
|
return [3 /*break*/, 6];
|
|
2679
2679
|
case 6:
|
|
@@ -2682,14 +2682,14 @@
|
|
|
2682
2682
|
}
|
|
2683
2683
|
return [4 /*yield*/, evaluateRecord()];
|
|
2684
2684
|
case 7:
|
|
2685
|
-
recordPosses =
|
|
2685
|
+
recordPosses = _e.sent();
|
|
2686
2686
|
if (recordPosses === null || recordPosses === void 0 ? void 0 : recordPosses.length) {
|
|
2687
2687
|
return [2 /*return*/, recordPosses];
|
|
2688
2688
|
}
|
|
2689
2689
|
if (!(apiCalls < MAX_API_CALLS)) return [3 /*break*/, 11];
|
|
2690
|
-
|
|
2690
|
+
_e.label = 8;
|
|
2691
2691
|
case 8:
|
|
2692
|
-
|
|
2692
|
+
_e.trys.push([8, 10, , 11]);
|
|
2693
2693
|
apiCalls += 1;
|
|
2694
2694
|
return [4 /*yield*/, bruceModels.Entity.Get({
|
|
2695
2695
|
api: api,
|
|
@@ -2698,15 +2698,19 @@
|
|
|
2698
2698
|
expandLocation: true
|
|
2699
2699
|
})];
|
|
2700
2700
|
case 9:
|
|
2701
|
-
entity = (
|
|
2701
|
+
entity = (_e.sent()).entity;
|
|
2702
2702
|
return [3 /*break*/, 11];
|
|
2703
2703
|
case 10:
|
|
2704
|
-
e_2 =
|
|
2704
|
+
e_2 = _e.sent();
|
|
2705
2705
|
console.warn(e_2);
|
|
2706
2706
|
return [3 /*break*/, 11];
|
|
2707
2707
|
case 11:
|
|
2708
2708
|
if (!tilesetId) {
|
|
2709
|
-
|
|
2709
|
+
tilesetIds = bruceModels.Entity.GetValue({
|
|
2710
|
+
entity: entity,
|
|
2711
|
+
path: ["Bruce", "tilesetID"]
|
|
2712
|
+
});
|
|
2713
|
+
tilesetId = (tilesetIds === null || tilesetIds === void 0 ? void 0 : tilesetIds.length) ? tilesetIds[0] : tilesetId;
|
|
2710
2714
|
}
|
|
2711
2715
|
if (!!tileset) return [3 /*break*/, 13];
|
|
2712
2716
|
if (!(tilesetId && apiCalls < MAX_API_CALLS)) return [3 /*break*/, 13];
|
|
@@ -2716,16 +2720,16 @@
|
|
|
2716
2720
|
tilesetId: tilesetId
|
|
2717
2721
|
})];
|
|
2718
2722
|
case 12:
|
|
2719
|
-
tileset = (
|
|
2720
|
-
|
|
2723
|
+
tileset = (_e.sent()).tileset;
|
|
2724
|
+
_e.label = 13;
|
|
2721
2725
|
case 13:
|
|
2722
2726
|
tSettings = tileset === null || tileset === void 0 ? void 0 : tileset.settings;
|
|
2723
2727
|
pos3d = null;
|
|
2724
2728
|
eLocation = bruceModels.Entity.GetValue({
|
|
2725
2729
|
entity: entity,
|
|
2726
|
-
path: ["location"]
|
|
2730
|
+
path: ["Bruce", "location"]
|
|
2727
2731
|
});
|
|
2728
|
-
if (!((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) || ((
|
|
2732
|
+
if (!((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) || ((_a = tSettings === null || tSettings === void 0 ? void 0 : tSettings.location) === null || _a === void 0 ? void 0 : _a.longitude))) return [3 /*break*/, 16];
|
|
2729
2733
|
if (eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) {
|
|
2730
2734
|
alt = +eLocation.altitude;
|
|
2731
2735
|
if (isNaN(alt)) {
|
|
@@ -2740,10 +2744,14 @@
|
|
|
2740
2744
|
}
|
|
2741
2745
|
pos3d = Cesium.Cartesian3.fromDegrees(+tSettings.location.longitude, +tSettings.location.latitude, alt);
|
|
2742
2746
|
}
|
|
2743
|
-
|
|
2747
|
+
worldPosition = bruceModels.Entity.GetValue({
|
|
2748
|
+
entity: entity,
|
|
2749
|
+
path: ["Bruce", "worldPosition"]
|
|
2750
|
+
});
|
|
2751
|
+
if (!worldPosition) return [3 /*break*/, 16];
|
|
2744
2752
|
eTransform = bruceModels.Entity.GetValue({
|
|
2745
2753
|
entity: entity,
|
|
2746
|
-
path: ["transform"]
|
|
2754
|
+
path: ["Bruce", "transform"]
|
|
2747
2755
|
});
|
|
2748
2756
|
heading = 0;
|
|
2749
2757
|
pitch = 0;
|
|
@@ -2751,19 +2759,19 @@
|
|
|
2751
2759
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.heading) {
|
|
2752
2760
|
heading = eTransform.heading;
|
|
2753
2761
|
}
|
|
2754
|
-
else if ((
|
|
2762
|
+
else if ((_b = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _b === void 0 ? void 0 : _b.heading) {
|
|
2755
2763
|
heading = tSettings.transform.heading;
|
|
2756
2764
|
}
|
|
2757
2765
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.pitch) {
|
|
2758
2766
|
pitch = eTransform.pitch;
|
|
2759
2767
|
}
|
|
2760
|
-
else if ((
|
|
2768
|
+
else if ((_c = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _c === void 0 ? void 0 : _c.pitch) {
|
|
2761
2769
|
pitch = tSettings.transform.pitch;
|
|
2762
2770
|
}
|
|
2763
2771
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.roll) {
|
|
2764
2772
|
roll = eTransform.roll;
|
|
2765
2773
|
}
|
|
2766
|
-
else if ((
|
|
2774
|
+
else if ((_d = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _d === void 0 ? void 0 : _d.roll) {
|
|
2767
2775
|
roll = tSettings.transform.roll;
|
|
2768
2776
|
}
|
|
2769
2777
|
heading = +heading;
|
|
@@ -2778,11 +2786,15 @@
|
|
|
2778
2786
|
if (isNaN(roll)) {
|
|
2779
2787
|
roll = 0;
|
|
2780
2788
|
}
|
|
2781
|
-
matrix4 =
|
|
2789
|
+
matrix4 = worldPosition;
|
|
2782
2790
|
offset = new Cesium.Cartesian3(+matrix4[0][3], +matrix4[1][3], +matrix4[2][3]);
|
|
2783
|
-
|
|
2791
|
+
worldPivot = bruceModels.Entity.GetValue({
|
|
2792
|
+
entity: entity,
|
|
2793
|
+
path: ["Bruce", "worldPivot"]
|
|
2794
|
+
});
|
|
2795
|
+
if (worldPivot) //the position from worldMatrix + center of geometry offset
|
|
2784
2796
|
{
|
|
2785
|
-
offset = new Cesium.Cartesian3(
|
|
2797
|
+
offset = new Cesium.Cartesian3(worldPivot[0], worldPivot[1], worldPivot[2]);
|
|
2786
2798
|
}
|
|
2787
2799
|
m1 = Cesium.Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
2788
2800
|
hpr = Cesium.HeadingPitchRoll.fromDegrees(heading, pitch, roll, new Cesium.HeadingPitchRoll());
|
|
@@ -2792,18 +2804,22 @@
|
|
|
2792
2804
|
if (!(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) return [3 /*break*/, 15];
|
|
2793
2805
|
return [4 /*yield*/, processPosHeight(pos3d, Cesium.HeightReference.NONE)];
|
|
2794
2806
|
case 14:
|
|
2795
|
-
pos3d =
|
|
2796
|
-
|
|
2807
|
+
pos3d = _e.sent();
|
|
2808
|
+
_e.label = 15;
|
|
2797
2809
|
case 15:
|
|
2798
|
-
|
|
2810
|
+
geometryRadius = bruceModels.Entity.GetValue({
|
|
2811
|
+
entity: entity,
|
|
2812
|
+
path: ["Bruce", "geometryRadius"]
|
|
2813
|
+
});
|
|
2814
|
+
if (geometryRadius && (pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
2799
2815
|
sphere = Cesium.BoundingSphere.fromPoints([pos3d]);
|
|
2800
2816
|
// For now making sure it's less than x amount because we had a bug which made it huge.
|
|
2801
|
-
if (
|
|
2802
|
-
sphere.radius =
|
|
2817
|
+
if (geometryRadius && geometryRadius < 500 && geometryRadius > 1) {
|
|
2818
|
+
sphere.radius = geometryRadius;
|
|
2803
2819
|
spheres.push(sphere);
|
|
2804
2820
|
}
|
|
2805
2821
|
}
|
|
2806
|
-
|
|
2822
|
+
_e.label = 16;
|
|
2807
2823
|
case 16:
|
|
2808
2824
|
if (pos3d) {
|
|
2809
2825
|
return [2 /*return*/, [pos3d]];
|
|
@@ -2966,7 +2982,7 @@
|
|
|
2966
2982
|
function evaluateRecord() {
|
|
2967
2983
|
var location = bruceModels.Entity.GetValue({
|
|
2968
2984
|
entity: entity,
|
|
2969
|
-
path: ["location"]
|
|
2985
|
+
path: ["Bruce", "location"]
|
|
2970
2986
|
});
|
|
2971
2987
|
if (location && typeof location == "object" && bruceModels.Carto.ValidateCarto(location)) {
|
|
2972
2988
|
var latitude = EnsureNumber(location.latitude);
|
|
@@ -2978,7 +2994,7 @@
|
|
|
2978
2994
|
}
|
|
2979
2995
|
var geometry = bruceModels.Entity.GetValue({
|
|
2980
2996
|
entity: entity,
|
|
2981
|
-
path: ["geometry"]
|
|
2997
|
+
path: ["Bruce", "geometry"]
|
|
2982
2998
|
});
|
|
2983
2999
|
if (geometry && typeof geometry == "object") {
|
|
2984
3000
|
var pointStr = geometry.Point;
|
|
@@ -3026,7 +3042,7 @@
|
|
|
3026
3042
|
}
|
|
3027
3043
|
var boundaries = bruceModels.Entity.GetValue({
|
|
3028
3044
|
entity: entity,
|
|
3029
|
-
path: ["boundaries"]
|
|
3045
|
+
path: ["Bruce", "boundaries"]
|
|
3030
3046
|
});
|
|
3031
3047
|
if (boundaries && typeof boundaries == "object") {
|
|
3032
3048
|
var point = {
|
|
@@ -3063,54 +3079,54 @@
|
|
|
3063
3079
|
* @returns
|
|
3064
3080
|
*/
|
|
3065
3081
|
function GetPosAsync(params) {
|
|
3066
|
-
var _a, _b, _c, _d
|
|
3082
|
+
var _a, _b, _c, _d;
|
|
3067
3083
|
return __awaiter(this, void 0, void 0, function () {
|
|
3068
|
-
var viewer, entityId, entity, tileset, tilesetId, visualRegister, returnHeightRef, recordHeightRef, api, lat, lon, location_1, e_3, e_4, pos3d, tSettings, eLocation, alt, alt, heading, pitch, roll, eTransform, matrix4, offset, m1, hpr, transform, transformedOffset;
|
|
3069
|
-
return __generator(this, function (
|
|
3070
|
-
switch (
|
|
3084
|
+
var viewer, entityId, entity, tileset, tilesetId, visualRegister, returnHeightRef, recordHeightRef, api, lat, lon, location_1, e_3, e_4, tilesetIds, pos3d, tSettings, eLocation, alt, alt, worldPosition, heading, pitch, roll, eTransform, matrix4, offset, worldPivot, m1, hpr, transform, transformedOffset;
|
|
3085
|
+
return __generator(this, function (_e) {
|
|
3086
|
+
switch (_e.label) {
|
|
3071
3087
|
case 0:
|
|
3072
3088
|
viewer = params.viewer, entityId = params.entityId, entity = params.entity, tileset = params.tileset, tilesetId = params.tilesetId, visualRegister = params.visualRegister, returnHeightRef = params.returnHeightRef, recordHeightRef = params.recordHeightRef, api = params.api;
|
|
3073
3089
|
if (!!entity) return [3 /*break*/, 9];
|
|
3074
3090
|
lat = 0;
|
|
3075
3091
|
lon = 0;
|
|
3076
|
-
|
|
3092
|
+
_e.label = 1;
|
|
3077
3093
|
case 1:
|
|
3078
|
-
|
|
3094
|
+
_e.trys.push([1, 3, , 4]);
|
|
3079
3095
|
return [4 /*yield*/, bruceModels.Entity.Get({
|
|
3080
3096
|
api: api,
|
|
3081
3097
|
entityId: entityId,
|
|
3082
3098
|
expandLocation: false
|
|
3083
3099
|
})];
|
|
3084
3100
|
case 2:
|
|
3085
|
-
entity = (
|
|
3101
|
+
entity = (_e.sent()).entity;
|
|
3086
3102
|
if (entity) {
|
|
3087
3103
|
location_1 = bruceModels.Entity.GetValue({
|
|
3088
3104
|
entity: entity,
|
|
3089
|
-
path: ["location"]
|
|
3105
|
+
path: ["Bruce", "location"]
|
|
3090
3106
|
});
|
|
3091
3107
|
lat = +(location_1 === null || location_1 === void 0 ? void 0 : location_1.latitude);
|
|
3092
3108
|
lon = +(location_1 === null || location_1 === void 0 ? void 0 : location_1.longitude);
|
|
3093
3109
|
}
|
|
3094
3110
|
return [3 /*break*/, 4];
|
|
3095
3111
|
case 3:
|
|
3096
|
-
e_3 =
|
|
3112
|
+
e_3 = _e.sent();
|
|
3097
3113
|
console.error(e_3);
|
|
3098
3114
|
return [3 /*break*/, 4];
|
|
3099
3115
|
case 4:
|
|
3100
3116
|
if (!(entity && (isNaN(lat) || isNaN(lon) || (lat == 0 && lon == 0)))) return [3 /*break*/, 9];
|
|
3101
|
-
|
|
3117
|
+
_e.label = 5;
|
|
3102
3118
|
case 5:
|
|
3103
|
-
|
|
3119
|
+
_e.trys.push([5, 7, , 9]);
|
|
3104
3120
|
return [4 /*yield*/, bruceModels.Entity.Get({
|
|
3105
3121
|
api: api,
|
|
3106
3122
|
entityId: entityId,
|
|
3107
3123
|
expandLocation: true
|
|
3108
3124
|
})];
|
|
3109
3125
|
case 6:
|
|
3110
|
-
entity = (
|
|
3126
|
+
entity = (_e.sent()).entity;
|
|
3111
3127
|
return [3 /*break*/, 9];
|
|
3112
3128
|
case 7:
|
|
3113
|
-
e_4 =
|
|
3129
|
+
e_4 = _e.sent();
|
|
3114
3130
|
console.warn(e_4);
|
|
3115
3131
|
return [4 /*yield*/, bruceModels.Entity.Get({
|
|
3116
3132
|
api: api,
|
|
@@ -3118,14 +3134,18 @@
|
|
|
3118
3134
|
expandLocation: false
|
|
3119
3135
|
})];
|
|
3120
3136
|
case 8:
|
|
3121
|
-
entity = (
|
|
3137
|
+
entity = (_e.sent()).entity;
|
|
3122
3138
|
return [3 /*break*/, 9];
|
|
3123
3139
|
case 9:
|
|
3124
3140
|
if (!entity) {
|
|
3125
3141
|
return [2 /*return*/, null];
|
|
3126
3142
|
}
|
|
3127
3143
|
if (!tilesetId) {
|
|
3128
|
-
|
|
3144
|
+
tilesetIds = bruceModels.Entity.GetValue({
|
|
3145
|
+
entity: entity,
|
|
3146
|
+
path: ["Bruce", "tilesetID"]
|
|
3147
|
+
});
|
|
3148
|
+
tilesetId = (tilesetIds === null || tilesetIds === void 0 ? void 0 : tilesetIds.length) ? tilesetIds[0] : tilesetId;
|
|
3129
3149
|
}
|
|
3130
3150
|
pos3d = tilesetId ? null : GetPos({
|
|
3131
3151
|
viewer: viewer,
|
|
@@ -3144,15 +3164,15 @@
|
|
|
3144
3164
|
tilesetId: tilesetId
|
|
3145
3165
|
})];
|
|
3146
3166
|
case 10:
|
|
3147
|
-
tileset = (
|
|
3148
|
-
|
|
3167
|
+
tileset = (_e.sent()).tileset;
|
|
3168
|
+
_e.label = 11;
|
|
3149
3169
|
case 11:
|
|
3150
3170
|
tSettings = tileset === null || tileset === void 0 ? void 0 : tileset.settings;
|
|
3151
3171
|
eLocation = bruceModels.Entity.GetValue({
|
|
3152
3172
|
entity: entity,
|
|
3153
|
-
path: ["location"]
|
|
3173
|
+
path: ["Bruce", "location"]
|
|
3154
3174
|
});
|
|
3155
|
-
if ((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) || ((
|
|
3175
|
+
if ((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) || ((_a = tSettings === null || tSettings === void 0 ? void 0 : tSettings.location) === null || _a === void 0 ? void 0 : _a.longitude)) {
|
|
3156
3176
|
if (eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) {
|
|
3157
3177
|
alt = +eLocation.altitude;
|
|
3158
3178
|
if (isNaN(alt)) {
|
|
@@ -3167,31 +3187,34 @@
|
|
|
3167
3187
|
}
|
|
3168
3188
|
pos3d = Cesium.Cartesian3.fromDegrees(+tSettings.location.longitude, +tSettings.location.latitude, alt);
|
|
3169
3189
|
}
|
|
3170
|
-
|
|
3171
|
-
|
|
3190
|
+
worldPosition = bruceModels.Entity.GetValue({
|
|
3191
|
+
entity: entity,
|
|
3192
|
+
path: ["Bruce", "worldPosition"]
|
|
3193
|
+
});
|
|
3194
|
+
if (worldPosition) {
|
|
3172
3195
|
heading = 0;
|
|
3173
3196
|
pitch = 0;
|
|
3174
3197
|
roll = 0;
|
|
3175
3198
|
eTransform = bruceModels.Entity.GetValue({
|
|
3176
3199
|
entity: entity,
|
|
3177
|
-
path: ["transform"]
|
|
3200
|
+
path: ["Bruce", "transform"]
|
|
3178
3201
|
});
|
|
3179
3202
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.heading) {
|
|
3180
3203
|
heading = eTransform.heading;
|
|
3181
3204
|
}
|
|
3182
|
-
else if ((
|
|
3205
|
+
else if ((_b = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _b === void 0 ? void 0 : _b.heading) {
|
|
3183
3206
|
heading = tSettings.transform.heading;
|
|
3184
3207
|
}
|
|
3185
3208
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.pitch) {
|
|
3186
3209
|
pitch = eTransform.pitch;
|
|
3187
3210
|
}
|
|
3188
|
-
else if ((
|
|
3211
|
+
else if ((_c = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _c === void 0 ? void 0 : _c.pitch) {
|
|
3189
3212
|
pitch = tSettings.transform.pitch;
|
|
3190
3213
|
}
|
|
3191
3214
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.roll) {
|
|
3192
3215
|
roll = eTransform.roll;
|
|
3193
3216
|
}
|
|
3194
|
-
else if ((
|
|
3217
|
+
else if ((_d = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _d === void 0 ? void 0 : _d.roll) {
|
|
3195
3218
|
roll = tSettings.transform.roll;
|
|
3196
3219
|
}
|
|
3197
3220
|
heading = +heading;
|
|
@@ -3206,11 +3229,15 @@
|
|
|
3206
3229
|
if (isNaN(roll)) {
|
|
3207
3230
|
roll = 0;
|
|
3208
3231
|
}
|
|
3209
|
-
matrix4 =
|
|
3232
|
+
matrix4 = worldPosition;
|
|
3210
3233
|
offset = new Cesium.Cartesian3(+matrix4[0][3], +matrix4[1][3], +matrix4[2][3]);
|
|
3211
|
-
|
|
3234
|
+
worldPivot = bruceModels.Entity.GetValue({
|
|
3235
|
+
entity: entity,
|
|
3236
|
+
path: ["Bruce", "worldPivot"]
|
|
3237
|
+
});
|
|
3238
|
+
if (worldPivot) //the position from worldMatrix + center of geometry offset
|
|
3212
3239
|
{
|
|
3213
|
-
offset = new Cesium.Cartesian3(
|
|
3240
|
+
offset = new Cesium.Cartesian3(worldPivot[0], worldPivot[1], worldPivot[2]);
|
|
3214
3241
|
}
|
|
3215
3242
|
m1 = Cesium.Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
3216
3243
|
hpr = Cesium.HeadingPitchRoll.fromDegrees(heading, pitch, roll, new Cesium.HeadingPitchRoll());
|
|
@@ -3477,15 +3504,15 @@
|
|
|
3477
3504
|
};
|
|
3478
3505
|
var location_1 = bruceModels.Entity.GetValue({
|
|
3479
3506
|
entity: entity,
|
|
3480
|
-
path: ["location"]
|
|
3507
|
+
path: ["Bruce", "location"]
|
|
3481
3508
|
});
|
|
3482
3509
|
var geometry = bruceModels.Entity.GetValue({
|
|
3483
3510
|
entity: entity,
|
|
3484
|
-
path: ["geometry"]
|
|
3511
|
+
path: ["Bruce", "geometry"]
|
|
3485
3512
|
});
|
|
3486
3513
|
var boundaries = bruceModels.Entity.GetValue({
|
|
3487
3514
|
entity: entity,
|
|
3488
|
-
path: ["boundaries"]
|
|
3515
|
+
path: ["Bruce", "boundaries"]
|
|
3489
3516
|
});
|
|
3490
3517
|
var entityData = __assign(__assign(__assign({}, location_1), geometry), boundaries);
|
|
3491
3518
|
return JSON.stringify(pointData) + '|' + JSON.stringify(entityData);
|
|
@@ -3514,7 +3541,7 @@
|
|
|
3514
3541
|
var entityPos3d = null;
|
|
3515
3542
|
var location = bruceModels.Entity.GetValue({
|
|
3516
3543
|
entity: entity,
|
|
3517
|
-
path: ["location"]
|
|
3544
|
+
path: ["Bruce", "location"]
|
|
3518
3545
|
});
|
|
3519
3546
|
if (location && location.latitude) {
|
|
3520
3547
|
var latitude = EnsureNumber(location.latitude);
|
|
@@ -3531,7 +3558,7 @@
|
|
|
3531
3558
|
// Check geometry if it's available.
|
|
3532
3559
|
var geometry = bruceModels.Entity.GetValue({
|
|
3533
3560
|
entity: entity,
|
|
3534
|
-
path: ["geometry"]
|
|
3561
|
+
path: ["Bruce", "geometry"]
|
|
3535
3562
|
});
|
|
3536
3563
|
if (geometry) {
|
|
3537
3564
|
var passedGeometry = false;
|
|
@@ -3579,7 +3606,7 @@
|
|
|
3579
3606
|
if (minDistance === Infinity) {
|
|
3580
3607
|
var boundaries = bruceModels.Entity.GetValue({
|
|
3581
3608
|
entity: entity,
|
|
3582
|
-
path: ["boundaries"]
|
|
3609
|
+
path: ["Bruce", "boundaries"]
|
|
3583
3610
|
});
|
|
3584
3611
|
if (boundaries && typeof boundaries == "object") {
|
|
3585
3612
|
var point_1 = {
|
|
@@ -4620,7 +4647,7 @@
|
|
|
4620
4647
|
*/
|
|
4621
4648
|
var height = bruceModels.Entity.GetValue({
|
|
4622
4649
|
entity: entity,
|
|
4623
|
-
path: ["location", "altitude"]
|
|
4650
|
+
path: ["Bruce", "location", "altitude"]
|
|
4624
4651
|
});
|
|
4625
4652
|
return heightRef != Cesium.HeightReference.CLAMP_TO_GROUND ? extrusion + height : extrusion;
|
|
4626
4653
|
}
|
|
@@ -4643,7 +4670,7 @@
|
|
|
4643
4670
|
// This let's us have a consistent extrusion height, and be adjustable easier by user.
|
|
4644
4671
|
var alt_1 = bruceModels.Entity.GetValue({
|
|
4645
4672
|
entity: entity,
|
|
4646
|
-
path: ["location", "altitude"]
|
|
4673
|
+
path: ["Bruce", "location", "altitude"]
|
|
4647
4674
|
});
|
|
4648
4675
|
if (!alt_1) {
|
|
4649
4676
|
alt_1 = 0;
|
|
@@ -4700,7 +4727,7 @@
|
|
|
4700
4727
|
*/
|
|
4701
4728
|
var height = EnsureNumber(bruceModels.Entity.GetValue({
|
|
4702
4729
|
entity: entity,
|
|
4703
|
-
path: ["location", "altitude"]
|
|
4730
|
+
path: ["Bruce", "location", "altitude"]
|
|
4704
4731
|
}), 0);
|
|
4705
4732
|
return heightRef != Cesium.HeightReference.CLAMP_TO_GROUND ? extrusion + height : extrusion;
|
|
4706
4733
|
}
|
|
@@ -4924,7 +4951,7 @@
|
|
|
4924
4951
|
var hasCalculatedBounds = false;
|
|
4925
4952
|
var bounds = bruceModels.Entity.GetValue({
|
|
4926
4953
|
entity: entity,
|
|
4927
|
-
path: ["boundaries"]
|
|
4954
|
+
path: ["Bruce", "boundaries"]
|
|
4928
4955
|
});
|
|
4929
4956
|
var calculateBounds = function () {
|
|
4930
4957
|
hasCalculatedBounds = true;
|
|
@@ -5291,7 +5318,7 @@
|
|
|
5291
5318
|
entity = params.entities[i];
|
|
5292
5319
|
geometry = bruceModels.Entity.GetValue({
|
|
5293
5320
|
entity: entity,
|
|
5294
|
-
path: ["geometry"]
|
|
5321
|
+
path: ["Bruce", "geometry"]
|
|
5295
5322
|
});
|
|
5296
5323
|
if (((_a = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
5297
5324
|
// Not migrated to internal, set in both places.
|
|
@@ -5362,7 +5389,7 @@
|
|
|
5362
5389
|
else if (displayType == bruceModels.ZoomControl.EDisplayType.Geometry) {
|
|
5363
5390
|
geometry = bruceModels.Entity.GetValue({
|
|
5364
5391
|
entity: entity,
|
|
5365
|
-
path: ["geometry"]
|
|
5392
|
+
path: ["Bruce", "geometry"]
|
|
5366
5393
|
});
|
|
5367
5394
|
if ((_f = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _f === void 0 ? void 0 : _f.length) {
|
|
5368
5395
|
multiGeometry.push(entity);
|
|
@@ -5405,7 +5432,7 @@
|
|
|
5405
5432
|
entity = multiGeometry[i];
|
|
5406
5433
|
geometry = bruceModels.Entity.GetValue({
|
|
5407
5434
|
entity: entity,
|
|
5408
|
-
path: ["geometry"]
|
|
5435
|
+
path: ["Bruce", "geometry"]
|
|
5409
5436
|
});
|
|
5410
5437
|
if (!((_g = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _g === void 0 ? void 0 : _g.length)) {
|
|
5411
5438
|
polygons.push(entity);
|
|
@@ -6133,7 +6160,7 @@
|
|
|
6133
6160
|
var entity = params.entity;
|
|
6134
6161
|
var lineString = bruceModels.Entity.GetValue({
|
|
6135
6162
|
entity: entity,
|
|
6136
|
-
path: ["geometry", "LineString"]
|
|
6163
|
+
path: ["Bruce", "geometry", "LineString"]
|
|
6137
6164
|
});
|
|
6138
6165
|
var points = lineString && typeof lineString == "string" ? bruceModels.Geometry.ParsePoints(lineString) : [];
|
|
6139
6166
|
if (!points || points.length < 2) {
|
|
@@ -6397,7 +6424,7 @@
|
|
|
6397
6424
|
var entity = params.entity;
|
|
6398
6425
|
var pRings = bruceModels.Entity.GetValue({
|
|
6399
6426
|
entity: entity,
|
|
6400
|
-
path: ["geometry", "Polygon"]
|
|
6427
|
+
path: ["Bruce", "geometry", "Polygon"]
|
|
6401
6428
|
});
|
|
6402
6429
|
if (pRings == null || !Array.isArray(pRings) || pRings.length <= 0) {
|
|
6403
6430
|
return null;
|
|
@@ -6775,7 +6802,7 @@
|
|
|
6775
6802
|
}
|
|
6776
6803
|
var transform = bruceModels.Entity.GetValue({
|
|
6777
6804
|
entity: entity,
|
|
6778
|
-
path: ["transform"]
|
|
6805
|
+
path: ["Bruce", "transform"]
|
|
6779
6806
|
});
|
|
6780
6807
|
var heading = EnsureNumber(transform === null || transform === void 0 ? void 0 : transform.heading);
|
|
6781
6808
|
heading = (heading + 90) % 360;
|
|
@@ -24491,7 +24518,7 @@
|
|
|
24491
24518
|
ViewRenderEngine.Render = Render;
|
|
24492
24519
|
})(exports.ViewRenderEngine || (exports.ViewRenderEngine = {}));
|
|
24493
24520
|
|
|
24494
|
-
var VERSION = "4.0.
|
|
24521
|
+
var VERSION = "4.0.2";
|
|
24495
24522
|
|
|
24496
24523
|
exports.VERSION = VERSION;
|
|
24497
24524
|
exports.CesiumParabola = CesiumParabola;
|