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.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, BoundingSphere, GeometryInstance, CesiumInspector, ClockRange, 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.
|
|
@@ -2417,11 +2417,11 @@ var EntityUtils;
|
|
|
2417
2417
|
});
|
|
2418
2418
|
}); };
|
|
2419
2419
|
getEntityPositions = function (sample) { return __awaiter(_this, void 0, void 0, function () {
|
|
2420
|
-
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;
|
|
2420
|
+
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;
|
|
2421
2421
|
var _this = this;
|
|
2422
|
-
var _a, _b, _c, _d
|
|
2423
|
-
return __generator(this, function (
|
|
2424
|
-
switch (
|
|
2422
|
+
var _a, _b, _c, _d;
|
|
2423
|
+
return __generator(this, function (_e) {
|
|
2424
|
+
switch (_e.label) {
|
|
2425
2425
|
case 0:
|
|
2426
2426
|
entityId = sample.entityId, entity = sample.entity, tileset = sample.tileset, tilesetId = sample.tilesetId, disallowRendered = sample.disallowRendered;
|
|
2427
2427
|
evaluateRendered = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -2582,7 +2582,7 @@ var EntityUtils;
|
|
|
2582
2582
|
posses = [];
|
|
2583
2583
|
location = Entity$1.GetValue({
|
|
2584
2584
|
entity: entity,
|
|
2585
|
-
path: ["location"]
|
|
2585
|
+
path: ["Bruce", "location"]
|
|
2586
2586
|
});
|
|
2587
2587
|
if (location && typeof location == "object" && Carto.ValidateCarto(location)) {
|
|
2588
2588
|
latitude = EnsureNumber(location.latitude);
|
|
@@ -2595,7 +2595,7 @@ var EntityUtils;
|
|
|
2595
2595
|
}
|
|
2596
2596
|
geometry = Entity$1.GetValue({
|
|
2597
2597
|
entity: entity,
|
|
2598
|
-
path: ["geometry"]
|
|
2598
|
+
path: ["Bruce", "geometry"]
|
|
2599
2599
|
});
|
|
2600
2600
|
if (!(geometry && typeof geometry == "object")) return [3 /*break*/, 4];
|
|
2601
2601
|
pointStr = geometry.Point;
|
|
@@ -2659,18 +2659,18 @@ var EntityUtils;
|
|
|
2659
2659
|
if (!(disallowRendered != true)) return [3 /*break*/, 2];
|
|
2660
2660
|
return [4 /*yield*/, evaluateRendered()];
|
|
2661
2661
|
case 1:
|
|
2662
|
-
renderedPosses =
|
|
2662
|
+
renderedPosses = _e.sent();
|
|
2663
2663
|
if (renderedPosses === null || renderedPosses === void 0 ? void 0 : renderedPosses.length) {
|
|
2664
2664
|
return [2 /*return*/, renderedPosses];
|
|
2665
2665
|
}
|
|
2666
|
-
|
|
2666
|
+
_e.label = 2;
|
|
2667
2667
|
case 2:
|
|
2668
2668
|
if (!!entity) return [3 /*break*/, 6];
|
|
2669
2669
|
if (!(apiCalls < MAX_API_CALLS)) return [3 /*break*/, 6];
|
|
2670
2670
|
apiCalls += 1;
|
|
2671
|
-
|
|
2671
|
+
_e.label = 3;
|
|
2672
2672
|
case 3:
|
|
2673
|
-
|
|
2673
|
+
_e.trys.push([3, 5, , 6]);
|
|
2674
2674
|
return [4 /*yield*/, Entity$1.Get({
|
|
2675
2675
|
api: api,
|
|
2676
2676
|
entityId: entityId,
|
|
@@ -2678,10 +2678,10 @@ var EntityUtils;
|
|
|
2678
2678
|
expandLocation: false
|
|
2679
2679
|
})];
|
|
2680
2680
|
case 4:
|
|
2681
|
-
entity = (
|
|
2681
|
+
entity = (_e.sent()).entity;
|
|
2682
2682
|
return [3 /*break*/, 6];
|
|
2683
2683
|
case 5:
|
|
2684
|
-
e_1 =
|
|
2684
|
+
e_1 = _e.sent();
|
|
2685
2685
|
console.error(e_1);
|
|
2686
2686
|
return [3 /*break*/, 6];
|
|
2687
2687
|
case 6:
|
|
@@ -2690,14 +2690,14 @@ var EntityUtils;
|
|
|
2690
2690
|
}
|
|
2691
2691
|
return [4 /*yield*/, evaluateRecord()];
|
|
2692
2692
|
case 7:
|
|
2693
|
-
recordPosses =
|
|
2693
|
+
recordPosses = _e.sent();
|
|
2694
2694
|
if (recordPosses === null || recordPosses === void 0 ? void 0 : recordPosses.length) {
|
|
2695
2695
|
return [2 /*return*/, recordPosses];
|
|
2696
2696
|
}
|
|
2697
2697
|
if (!(apiCalls < MAX_API_CALLS)) return [3 /*break*/, 11];
|
|
2698
|
-
|
|
2698
|
+
_e.label = 8;
|
|
2699
2699
|
case 8:
|
|
2700
|
-
|
|
2700
|
+
_e.trys.push([8, 10, , 11]);
|
|
2701
2701
|
apiCalls += 1;
|
|
2702
2702
|
return [4 /*yield*/, Entity$1.Get({
|
|
2703
2703
|
api: api,
|
|
@@ -2706,15 +2706,19 @@ var EntityUtils;
|
|
|
2706
2706
|
expandLocation: true
|
|
2707
2707
|
})];
|
|
2708
2708
|
case 9:
|
|
2709
|
-
entity = (
|
|
2709
|
+
entity = (_e.sent()).entity;
|
|
2710
2710
|
return [3 /*break*/, 11];
|
|
2711
2711
|
case 10:
|
|
2712
|
-
e_2 =
|
|
2712
|
+
e_2 = _e.sent();
|
|
2713
2713
|
console.warn(e_2);
|
|
2714
2714
|
return [3 /*break*/, 11];
|
|
2715
2715
|
case 11:
|
|
2716
2716
|
if (!tilesetId) {
|
|
2717
|
-
|
|
2717
|
+
tilesetIds = Entity$1.GetValue({
|
|
2718
|
+
entity: entity,
|
|
2719
|
+
path: ["Bruce", "tilesetID"]
|
|
2720
|
+
});
|
|
2721
|
+
tilesetId = (tilesetIds === null || tilesetIds === void 0 ? void 0 : tilesetIds.length) ? tilesetIds[0] : tilesetId;
|
|
2718
2722
|
}
|
|
2719
2723
|
if (!!tileset) return [3 /*break*/, 13];
|
|
2720
2724
|
if (!(tilesetId && apiCalls < MAX_API_CALLS)) return [3 /*break*/, 13];
|
|
@@ -2724,16 +2728,16 @@ var EntityUtils;
|
|
|
2724
2728
|
tilesetId: tilesetId
|
|
2725
2729
|
})];
|
|
2726
2730
|
case 12:
|
|
2727
|
-
tileset = (
|
|
2728
|
-
|
|
2731
|
+
tileset = (_e.sent()).tileset;
|
|
2732
|
+
_e.label = 13;
|
|
2729
2733
|
case 13:
|
|
2730
2734
|
tSettings = tileset === null || tileset === void 0 ? void 0 : tileset.settings;
|
|
2731
2735
|
pos3d = null;
|
|
2732
2736
|
eLocation = Entity$1.GetValue({
|
|
2733
2737
|
entity: entity,
|
|
2734
|
-
path: ["location"]
|
|
2738
|
+
path: ["Bruce", "location"]
|
|
2735
2739
|
});
|
|
2736
|
-
if (!((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) || ((
|
|
2740
|
+
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];
|
|
2737
2741
|
if (eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) {
|
|
2738
2742
|
alt = +eLocation.altitude;
|
|
2739
2743
|
if (isNaN(alt)) {
|
|
@@ -2748,10 +2752,14 @@ var EntityUtils;
|
|
|
2748
2752
|
}
|
|
2749
2753
|
pos3d = Cartesian3.fromDegrees(+tSettings.location.longitude, +tSettings.location.latitude, alt);
|
|
2750
2754
|
}
|
|
2751
|
-
|
|
2755
|
+
worldPosition = Entity$1.GetValue({
|
|
2756
|
+
entity: entity,
|
|
2757
|
+
path: ["Bruce", "worldPosition"]
|
|
2758
|
+
});
|
|
2759
|
+
if (!worldPosition) return [3 /*break*/, 16];
|
|
2752
2760
|
eTransform = Entity$1.GetValue({
|
|
2753
2761
|
entity: entity,
|
|
2754
|
-
path: ["transform"]
|
|
2762
|
+
path: ["Bruce", "transform"]
|
|
2755
2763
|
});
|
|
2756
2764
|
heading = 0;
|
|
2757
2765
|
pitch = 0;
|
|
@@ -2759,19 +2767,19 @@ var EntityUtils;
|
|
|
2759
2767
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.heading) {
|
|
2760
2768
|
heading = eTransform.heading;
|
|
2761
2769
|
}
|
|
2762
|
-
else if ((
|
|
2770
|
+
else if ((_b = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _b === void 0 ? void 0 : _b.heading) {
|
|
2763
2771
|
heading = tSettings.transform.heading;
|
|
2764
2772
|
}
|
|
2765
2773
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.pitch) {
|
|
2766
2774
|
pitch = eTransform.pitch;
|
|
2767
2775
|
}
|
|
2768
|
-
else if ((
|
|
2776
|
+
else if ((_c = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _c === void 0 ? void 0 : _c.pitch) {
|
|
2769
2777
|
pitch = tSettings.transform.pitch;
|
|
2770
2778
|
}
|
|
2771
2779
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.roll) {
|
|
2772
2780
|
roll = eTransform.roll;
|
|
2773
2781
|
}
|
|
2774
|
-
else if ((
|
|
2782
|
+
else if ((_d = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _d === void 0 ? void 0 : _d.roll) {
|
|
2775
2783
|
roll = tSettings.transform.roll;
|
|
2776
2784
|
}
|
|
2777
2785
|
heading = +heading;
|
|
@@ -2786,11 +2794,15 @@ var EntityUtils;
|
|
|
2786
2794
|
if (isNaN(roll)) {
|
|
2787
2795
|
roll = 0;
|
|
2788
2796
|
}
|
|
2789
|
-
matrix4 =
|
|
2797
|
+
matrix4 = worldPosition;
|
|
2790
2798
|
offset = new Cartesian3(+matrix4[0][3], +matrix4[1][3], +matrix4[2][3]);
|
|
2791
|
-
|
|
2799
|
+
worldPivot = Entity$1.GetValue({
|
|
2800
|
+
entity: entity,
|
|
2801
|
+
path: ["Bruce", "worldPivot"]
|
|
2802
|
+
});
|
|
2803
|
+
if (worldPivot) //the position from worldMatrix + center of geometry offset
|
|
2792
2804
|
{
|
|
2793
|
-
offset = new Cartesian3(
|
|
2805
|
+
offset = new Cartesian3(worldPivot[0], worldPivot[1], worldPivot[2]);
|
|
2794
2806
|
}
|
|
2795
2807
|
m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
2796
2808
|
hpr = HeadingPitchRoll.fromDegrees(heading, pitch, roll, new HeadingPitchRoll());
|
|
@@ -2800,18 +2812,22 @@ var EntityUtils;
|
|
|
2800
2812
|
if (!(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) return [3 /*break*/, 15];
|
|
2801
2813
|
return [4 /*yield*/, processPosHeight(pos3d, HeightReference.NONE)];
|
|
2802
2814
|
case 14:
|
|
2803
|
-
pos3d =
|
|
2804
|
-
|
|
2815
|
+
pos3d = _e.sent();
|
|
2816
|
+
_e.label = 15;
|
|
2805
2817
|
case 15:
|
|
2806
|
-
|
|
2818
|
+
geometryRadius = Entity$1.GetValue({
|
|
2819
|
+
entity: entity,
|
|
2820
|
+
path: ["Bruce", "geometryRadius"]
|
|
2821
|
+
});
|
|
2822
|
+
if (geometryRadius && (pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
2807
2823
|
sphere = BoundingSphere.fromPoints([pos3d]);
|
|
2808
2824
|
// For now making sure it's less than x amount because we had a bug which made it huge.
|
|
2809
|
-
if (
|
|
2810
|
-
sphere.radius =
|
|
2825
|
+
if (geometryRadius && geometryRadius < 500 && geometryRadius > 1) {
|
|
2826
|
+
sphere.radius = geometryRadius;
|
|
2811
2827
|
spheres.push(sphere);
|
|
2812
2828
|
}
|
|
2813
2829
|
}
|
|
2814
|
-
|
|
2830
|
+
_e.label = 16;
|
|
2815
2831
|
case 16:
|
|
2816
2832
|
if (pos3d) {
|
|
2817
2833
|
return [2 /*return*/, [pos3d]];
|
|
@@ -2974,7 +2990,7 @@ var EntityUtils;
|
|
|
2974
2990
|
function evaluateRecord() {
|
|
2975
2991
|
var location = Entity$1.GetValue({
|
|
2976
2992
|
entity: entity,
|
|
2977
|
-
path: ["location"]
|
|
2993
|
+
path: ["Bruce", "location"]
|
|
2978
2994
|
});
|
|
2979
2995
|
if (location && typeof location == "object" && Carto.ValidateCarto(location)) {
|
|
2980
2996
|
var latitude = EnsureNumber(location.latitude);
|
|
@@ -2986,7 +3002,7 @@ var EntityUtils;
|
|
|
2986
3002
|
}
|
|
2987
3003
|
var geometry = Entity$1.GetValue({
|
|
2988
3004
|
entity: entity,
|
|
2989
|
-
path: ["geometry"]
|
|
3005
|
+
path: ["Bruce", "geometry"]
|
|
2990
3006
|
});
|
|
2991
3007
|
if (geometry && typeof geometry == "object") {
|
|
2992
3008
|
var pointStr = geometry.Point;
|
|
@@ -3034,7 +3050,7 @@ var EntityUtils;
|
|
|
3034
3050
|
}
|
|
3035
3051
|
var boundaries = Entity$1.GetValue({
|
|
3036
3052
|
entity: entity,
|
|
3037
|
-
path: ["boundaries"]
|
|
3053
|
+
path: ["Bruce", "boundaries"]
|
|
3038
3054
|
});
|
|
3039
3055
|
if (boundaries && typeof boundaries == "object") {
|
|
3040
3056
|
var point = {
|
|
@@ -3071,54 +3087,54 @@ var EntityUtils;
|
|
|
3071
3087
|
* @returns
|
|
3072
3088
|
*/
|
|
3073
3089
|
function GetPosAsync(params) {
|
|
3074
|
-
var _a, _b, _c, _d
|
|
3090
|
+
var _a, _b, _c, _d;
|
|
3075
3091
|
return __awaiter(this, void 0, void 0, function () {
|
|
3076
|
-
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;
|
|
3077
|
-
return __generator(this, function (
|
|
3078
|
-
switch (
|
|
3092
|
+
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;
|
|
3093
|
+
return __generator(this, function (_e) {
|
|
3094
|
+
switch (_e.label) {
|
|
3079
3095
|
case 0:
|
|
3080
3096
|
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;
|
|
3081
3097
|
if (!!entity) return [3 /*break*/, 9];
|
|
3082
3098
|
lat = 0;
|
|
3083
3099
|
lon = 0;
|
|
3084
|
-
|
|
3100
|
+
_e.label = 1;
|
|
3085
3101
|
case 1:
|
|
3086
|
-
|
|
3102
|
+
_e.trys.push([1, 3, , 4]);
|
|
3087
3103
|
return [4 /*yield*/, Entity$1.Get({
|
|
3088
3104
|
api: api,
|
|
3089
3105
|
entityId: entityId,
|
|
3090
3106
|
expandLocation: false
|
|
3091
3107
|
})];
|
|
3092
3108
|
case 2:
|
|
3093
|
-
entity = (
|
|
3109
|
+
entity = (_e.sent()).entity;
|
|
3094
3110
|
if (entity) {
|
|
3095
3111
|
location_1 = Entity$1.GetValue({
|
|
3096
3112
|
entity: entity,
|
|
3097
|
-
path: ["location"]
|
|
3113
|
+
path: ["Bruce", "location"]
|
|
3098
3114
|
});
|
|
3099
3115
|
lat = +(location_1 === null || location_1 === void 0 ? void 0 : location_1.latitude);
|
|
3100
3116
|
lon = +(location_1 === null || location_1 === void 0 ? void 0 : location_1.longitude);
|
|
3101
3117
|
}
|
|
3102
3118
|
return [3 /*break*/, 4];
|
|
3103
3119
|
case 3:
|
|
3104
|
-
e_3 =
|
|
3120
|
+
e_3 = _e.sent();
|
|
3105
3121
|
console.error(e_3);
|
|
3106
3122
|
return [3 /*break*/, 4];
|
|
3107
3123
|
case 4:
|
|
3108
3124
|
if (!(entity && (isNaN(lat) || isNaN(lon) || (lat == 0 && lon == 0)))) return [3 /*break*/, 9];
|
|
3109
|
-
|
|
3125
|
+
_e.label = 5;
|
|
3110
3126
|
case 5:
|
|
3111
|
-
|
|
3127
|
+
_e.trys.push([5, 7, , 9]);
|
|
3112
3128
|
return [4 /*yield*/, Entity$1.Get({
|
|
3113
3129
|
api: api,
|
|
3114
3130
|
entityId: entityId,
|
|
3115
3131
|
expandLocation: true
|
|
3116
3132
|
})];
|
|
3117
3133
|
case 6:
|
|
3118
|
-
entity = (
|
|
3134
|
+
entity = (_e.sent()).entity;
|
|
3119
3135
|
return [3 /*break*/, 9];
|
|
3120
3136
|
case 7:
|
|
3121
|
-
e_4 =
|
|
3137
|
+
e_4 = _e.sent();
|
|
3122
3138
|
console.warn(e_4);
|
|
3123
3139
|
return [4 /*yield*/, Entity$1.Get({
|
|
3124
3140
|
api: api,
|
|
@@ -3126,14 +3142,18 @@ var EntityUtils;
|
|
|
3126
3142
|
expandLocation: false
|
|
3127
3143
|
})];
|
|
3128
3144
|
case 8:
|
|
3129
|
-
entity = (
|
|
3145
|
+
entity = (_e.sent()).entity;
|
|
3130
3146
|
return [3 /*break*/, 9];
|
|
3131
3147
|
case 9:
|
|
3132
3148
|
if (!entity) {
|
|
3133
3149
|
return [2 /*return*/, null];
|
|
3134
3150
|
}
|
|
3135
3151
|
if (!tilesetId) {
|
|
3136
|
-
|
|
3152
|
+
tilesetIds = Entity$1.GetValue({
|
|
3153
|
+
entity: entity,
|
|
3154
|
+
path: ["Bruce", "tilesetID"]
|
|
3155
|
+
});
|
|
3156
|
+
tilesetId = (tilesetIds === null || tilesetIds === void 0 ? void 0 : tilesetIds.length) ? tilesetIds[0] : tilesetId;
|
|
3137
3157
|
}
|
|
3138
3158
|
pos3d = tilesetId ? null : GetPos({
|
|
3139
3159
|
viewer: viewer,
|
|
@@ -3152,15 +3172,15 @@ var EntityUtils;
|
|
|
3152
3172
|
tilesetId: tilesetId
|
|
3153
3173
|
})];
|
|
3154
3174
|
case 10:
|
|
3155
|
-
tileset = (
|
|
3156
|
-
|
|
3175
|
+
tileset = (_e.sent()).tileset;
|
|
3176
|
+
_e.label = 11;
|
|
3157
3177
|
case 11:
|
|
3158
3178
|
tSettings = tileset === null || tileset === void 0 ? void 0 : tileset.settings;
|
|
3159
3179
|
eLocation = Entity$1.GetValue({
|
|
3160
3180
|
entity: entity,
|
|
3161
|
-
path: ["location"]
|
|
3181
|
+
path: ["Bruce", "location"]
|
|
3162
3182
|
});
|
|
3163
|
-
if ((eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) || ((
|
|
3183
|
+
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)) {
|
|
3164
3184
|
if (eLocation === null || eLocation === void 0 ? void 0 : eLocation.longitude) {
|
|
3165
3185
|
alt = +eLocation.altitude;
|
|
3166
3186
|
if (isNaN(alt)) {
|
|
@@ -3175,31 +3195,34 @@ var EntityUtils;
|
|
|
3175
3195
|
}
|
|
3176
3196
|
pos3d = Cartesian3.fromDegrees(+tSettings.location.longitude, +tSettings.location.latitude, alt);
|
|
3177
3197
|
}
|
|
3178
|
-
|
|
3179
|
-
|
|
3198
|
+
worldPosition = Entity$1.GetValue({
|
|
3199
|
+
entity: entity,
|
|
3200
|
+
path: ["Bruce", "worldPosition"]
|
|
3201
|
+
});
|
|
3202
|
+
if (worldPosition) {
|
|
3180
3203
|
heading = 0;
|
|
3181
3204
|
pitch = 0;
|
|
3182
3205
|
roll = 0;
|
|
3183
3206
|
eTransform = Entity$1.GetValue({
|
|
3184
3207
|
entity: entity,
|
|
3185
|
-
path: ["transform"]
|
|
3208
|
+
path: ["Bruce", "transform"]
|
|
3186
3209
|
});
|
|
3187
3210
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.heading) {
|
|
3188
3211
|
heading = eTransform.heading;
|
|
3189
3212
|
}
|
|
3190
|
-
else if ((
|
|
3213
|
+
else if ((_b = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _b === void 0 ? void 0 : _b.heading) {
|
|
3191
3214
|
heading = tSettings.transform.heading;
|
|
3192
3215
|
}
|
|
3193
3216
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.pitch) {
|
|
3194
3217
|
pitch = eTransform.pitch;
|
|
3195
3218
|
}
|
|
3196
|
-
else if ((
|
|
3219
|
+
else if ((_c = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _c === void 0 ? void 0 : _c.pitch) {
|
|
3197
3220
|
pitch = tSettings.transform.pitch;
|
|
3198
3221
|
}
|
|
3199
3222
|
if (eTransform === null || eTransform === void 0 ? void 0 : eTransform.roll) {
|
|
3200
3223
|
roll = eTransform.roll;
|
|
3201
3224
|
}
|
|
3202
|
-
else if ((
|
|
3225
|
+
else if ((_d = tSettings === null || tSettings === void 0 ? void 0 : tSettings.transform) === null || _d === void 0 ? void 0 : _d.roll) {
|
|
3203
3226
|
roll = tSettings.transform.roll;
|
|
3204
3227
|
}
|
|
3205
3228
|
heading = +heading;
|
|
@@ -3214,11 +3237,15 @@ var EntityUtils;
|
|
|
3214
3237
|
if (isNaN(roll)) {
|
|
3215
3238
|
roll = 0;
|
|
3216
3239
|
}
|
|
3217
|
-
matrix4 =
|
|
3240
|
+
matrix4 = worldPosition;
|
|
3218
3241
|
offset = new Cartesian3(+matrix4[0][3], +matrix4[1][3], +matrix4[2][3]);
|
|
3219
|
-
|
|
3242
|
+
worldPivot = Entity$1.GetValue({
|
|
3243
|
+
entity: entity,
|
|
3244
|
+
path: ["Bruce", "worldPivot"]
|
|
3245
|
+
});
|
|
3246
|
+
if (worldPivot) //the position from worldMatrix + center of geometry offset
|
|
3220
3247
|
{
|
|
3221
|
-
offset = new Cartesian3(
|
|
3248
|
+
offset = new Cartesian3(worldPivot[0], worldPivot[1], worldPivot[2]);
|
|
3222
3249
|
}
|
|
3223
3250
|
m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
3224
3251
|
hpr = HeadingPitchRoll.fromDegrees(heading, pitch, roll, new HeadingPitchRoll());
|
|
@@ -3485,15 +3512,15 @@ function createCacheKey(point, entity) {
|
|
|
3485
3512
|
};
|
|
3486
3513
|
var location_1 = Entity$1.GetValue({
|
|
3487
3514
|
entity: entity,
|
|
3488
|
-
path: ["location"]
|
|
3515
|
+
path: ["Bruce", "location"]
|
|
3489
3516
|
});
|
|
3490
3517
|
var geometry = Entity$1.GetValue({
|
|
3491
3518
|
entity: entity,
|
|
3492
|
-
path: ["geometry"]
|
|
3519
|
+
path: ["Bruce", "geometry"]
|
|
3493
3520
|
});
|
|
3494
3521
|
var boundaries = Entity$1.GetValue({
|
|
3495
3522
|
entity: entity,
|
|
3496
|
-
path: ["boundaries"]
|
|
3523
|
+
path: ["Bruce", "boundaries"]
|
|
3497
3524
|
});
|
|
3498
3525
|
var entityData = __assign(__assign(__assign({}, location_1), geometry), boundaries);
|
|
3499
3526
|
return JSON.stringify(pointData) + '|' + JSON.stringify(entityData);
|
|
@@ -3522,7 +3549,7 @@ function calculateDistance(point, entity) {
|
|
|
3522
3549
|
var entityPos3d = null;
|
|
3523
3550
|
var location = Entity$1.GetValue({
|
|
3524
3551
|
entity: entity,
|
|
3525
|
-
path: ["location"]
|
|
3552
|
+
path: ["Bruce", "location"]
|
|
3526
3553
|
});
|
|
3527
3554
|
if (location && location.latitude) {
|
|
3528
3555
|
var latitude = EnsureNumber(location.latitude);
|
|
@@ -3539,7 +3566,7 @@ function calculateDistance(point, entity) {
|
|
|
3539
3566
|
// Check geometry if it's available.
|
|
3540
3567
|
var geometry = Entity$1.GetValue({
|
|
3541
3568
|
entity: entity,
|
|
3542
|
-
path: ["geometry"]
|
|
3569
|
+
path: ["Bruce", "geometry"]
|
|
3543
3570
|
});
|
|
3544
3571
|
if (geometry) {
|
|
3545
3572
|
var passedGeometry = false;
|
|
@@ -3587,7 +3614,7 @@ function calculateDistance(point, entity) {
|
|
|
3587
3614
|
if (minDistance === Infinity) {
|
|
3588
3615
|
var boundaries = Entity$1.GetValue({
|
|
3589
3616
|
entity: entity,
|
|
3590
|
-
path: ["boundaries"]
|
|
3617
|
+
path: ["Bruce", "boundaries"]
|
|
3591
3618
|
});
|
|
3592
3619
|
if (boundaries && typeof boundaries == "object") {
|
|
3593
3620
|
var point_1 = {
|
|
@@ -4630,7 +4657,7 @@ function getPolygonStyleExtrusion(pStyle, entity, tags, heightRef) {
|
|
|
4630
4657
|
*/
|
|
4631
4658
|
var height = Entity$1.GetValue({
|
|
4632
4659
|
entity: entity,
|
|
4633
|
-
path: ["location", "altitude"]
|
|
4660
|
+
path: ["Bruce", "location", "altitude"]
|
|
4634
4661
|
});
|
|
4635
4662
|
return heightRef != HeightReference.CLAMP_TO_GROUND ? extrusion + height : extrusion;
|
|
4636
4663
|
}
|
|
@@ -4653,7 +4680,7 @@ function getPolygonExtrusion(entity, tags, ring, posses, heightRef, pStyle) {
|
|
|
4653
4680
|
// This let's us have a consistent extrusion height, and be adjustable easier by user.
|
|
4654
4681
|
var alt_1 = Entity$1.GetValue({
|
|
4655
4682
|
entity: entity,
|
|
4656
|
-
path: ["location", "altitude"]
|
|
4683
|
+
path: ["Bruce", "location", "altitude"]
|
|
4657
4684
|
});
|
|
4658
4685
|
if (!alt_1) {
|
|
4659
4686
|
alt_1 = 0;
|
|
@@ -4710,7 +4737,7 @@ function getCylinderStyleExtrusion(style, entity, tags, heightRef) {
|
|
|
4710
4737
|
*/
|
|
4711
4738
|
var height = EnsureNumber(Entity$1.GetValue({
|
|
4712
4739
|
entity: entity,
|
|
4713
|
-
path: ["location", "altitude"]
|
|
4740
|
+
path: ["Bruce", "location", "altitude"]
|
|
4714
4741
|
}), 0);
|
|
4715
4742
|
return heightRef != HeightReference.CLAMP_TO_GROUND ? extrusion + height : extrusion;
|
|
4716
4743
|
}
|
|
@@ -4934,7 +4961,7 @@ function getSizeOfPolygonEntity(entity) {
|
|
|
4934
4961
|
var hasCalculatedBounds = false;
|
|
4935
4962
|
var bounds = Entity$1.GetValue({
|
|
4936
4963
|
entity: entity,
|
|
4937
|
-
path: ["boundaries"]
|
|
4964
|
+
path: ["Bruce", "boundaries"]
|
|
4938
4965
|
});
|
|
4939
4966
|
var calculateBounds = function () {
|
|
4940
4967
|
hasCalculatedBounds = true;
|
|
@@ -5302,7 +5329,7 @@ var EntityRenderEngine;
|
|
|
5302
5329
|
entity = params.entities[i];
|
|
5303
5330
|
geometry = Entity$1.GetValue({
|
|
5304
5331
|
entity: entity,
|
|
5305
|
-
path: ["geometry"]
|
|
5332
|
+
path: ["Bruce", "geometry"]
|
|
5306
5333
|
});
|
|
5307
5334
|
if (((_a = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
5308
5335
|
// Not migrated to internal, set in both places.
|
|
@@ -5373,7 +5400,7 @@ var EntityRenderEngine;
|
|
|
5373
5400
|
else if (displayType == ZoomControl.EDisplayType.Geometry) {
|
|
5374
5401
|
geometry = Entity$1.GetValue({
|
|
5375
5402
|
entity: entity,
|
|
5376
|
-
path: ["geometry"]
|
|
5403
|
+
path: ["Bruce", "geometry"]
|
|
5377
5404
|
});
|
|
5378
5405
|
if ((_f = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _f === void 0 ? void 0 : _f.length) {
|
|
5379
5406
|
multiGeometry.push(entity);
|
|
@@ -5416,7 +5443,7 @@ var EntityRenderEngine;
|
|
|
5416
5443
|
entity = multiGeometry[i];
|
|
5417
5444
|
geometry = Entity$1.GetValue({
|
|
5418
5445
|
entity: entity,
|
|
5419
|
-
path: ["geometry"]
|
|
5446
|
+
path: ["Bruce", "geometry"]
|
|
5420
5447
|
});
|
|
5421
5448
|
if (!((_g = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _g === void 0 ? void 0 : _g.length)) {
|
|
5422
5449
|
polygons.push(entity);
|
|
@@ -6144,7 +6171,7 @@ var EntityRenderEngine;
|
|
|
6144
6171
|
var entity = params.entity;
|
|
6145
6172
|
var lineString = Entity$1.GetValue({
|
|
6146
6173
|
entity: entity,
|
|
6147
|
-
path: ["geometry", "LineString"]
|
|
6174
|
+
path: ["Bruce", "geometry", "LineString"]
|
|
6148
6175
|
});
|
|
6149
6176
|
var points = lineString && typeof lineString == "string" ? Geometry.ParsePoints(lineString) : [];
|
|
6150
6177
|
if (!points || points.length < 2) {
|
|
@@ -6408,7 +6435,7 @@ var EntityRenderEngine;
|
|
|
6408
6435
|
var entity = params.entity;
|
|
6409
6436
|
var pRings = Entity$1.GetValue({
|
|
6410
6437
|
entity: entity,
|
|
6411
|
-
path: ["geometry", "Polygon"]
|
|
6438
|
+
path: ["Bruce", "geometry", "Polygon"]
|
|
6412
6439
|
});
|
|
6413
6440
|
if (pRings == null || !Array.isArray(pRings) || pRings.length <= 0) {
|
|
6414
6441
|
return null;
|
|
@@ -6786,7 +6813,7 @@ var EntityRenderEngine;
|
|
|
6786
6813
|
}
|
|
6787
6814
|
var transform = Entity$1.GetValue({
|
|
6788
6815
|
entity: entity,
|
|
6789
|
-
path: ["transform"]
|
|
6816
|
+
path: ["Bruce", "transform"]
|
|
6790
6817
|
});
|
|
6791
6818
|
var heading = EnsureNumber(transform === null || transform === void 0 ? void 0 : transform.heading);
|
|
6792
6819
|
heading = (heading + 90) % 360;
|
|
@@ -24557,7 +24584,7 @@ var ViewRenderEngine;
|
|
|
24557
24584
|
ViewRenderEngine.Render = Render;
|
|
24558
24585
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
24559
24586
|
|
|
24560
|
-
var VERSION = "4.0.
|
|
24587
|
+
var VERSION = "4.0.2";
|
|
24561
24588
|
|
|
24562
24589
|
export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline };
|
|
24563
24590
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|