bruce-cesium 2.8.3 → 2.8.5
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 +411 -197
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +409 -195
- 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 +1 -1
- package/dist/lib/rendering/menu-item-manager.js +22 -4
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/entity-label.js +371 -184
- package/dist/lib/rendering/render-managers/common/entity-label.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +13 -3
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/lib/viewer/viewer-utils.js +5 -2
- package/dist/lib/viewer/viewer-utils.js.map +1 -1
- package/dist/lib/widgets/widget-info-view.js +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/menu-item-manager.d.ts +3 -0
- package/dist/types/rendering/render-managers/common/entity-label.d.ts +35 -6
- package/dist/types/rendering/visuals-register.d.ts +7 -2
- package/dist/types/viewer/viewer-utils.d.ts +1 -0
- package/package.json +1 -1
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, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1,
|
|
3
|
+
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, JulianDate, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, SceneMode, Primitive, Cesium3DTileFeature, KmlDataSource, SceneTransforms, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, Cesium3DTileset, Model, OrthographicFrustum, EasingFunction, PolygonPipeline, CesiumInspector, Matrix4, Matrix3, IonResource, Ion, ColorMaterialProperty, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere } from 'cesium';
|
|
4
4
|
|
|
5
5
|
var TIME_LAG = 300;
|
|
6
6
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -1741,7 +1741,7 @@ function getName(api, entity) {
|
|
|
1741
1741
|
type: type,
|
|
1742
1742
|
defaultToId: false
|
|
1743
1743
|
});
|
|
1744
|
-
return [2 /*return*/, name_1 ? name_1 : "Unnamed
|
|
1744
|
+
return [2 /*return*/, name_1 ? name_1 : "Unnamed Entity"];
|
|
1745
1745
|
}
|
|
1746
1746
|
return [3 /*break*/, 4];
|
|
1747
1747
|
case 3:
|
|
@@ -3716,16 +3716,13 @@ var RelationRenderEngine;
|
|
|
3716
3716
|
})(Parabola = RelationRenderEngine.Parabola || (RelationRenderEngine.Parabola = {}));
|
|
3717
3717
|
})(RelationRenderEngine || (RelationRenderEngine = {}));
|
|
3718
3718
|
|
|
3719
|
-
// Key where the label instance is stored within the cesium entity.
|
|
3720
|
-
// Eg: cEntity[ATTACH_KEY] = new EntityLabel(...);
|
|
3721
|
-
var ATTACH_KEY = "nextspace-navigator-entity-label";
|
|
3722
3719
|
/**
|
|
3723
3720
|
* Returns cesium property's value.
|
|
3724
3721
|
* This will check if it's one that changes over time, or just a fixed value.
|
|
3725
3722
|
* Eg: const pos3d = getValue<Cesium.Cartesian3>(cViewer, cEntity.point.position);
|
|
3726
3723
|
* @param viewer
|
|
3727
3724
|
* @param obj
|
|
3728
|
-
|
|
3725
|
+
*/
|
|
3729
3726
|
function getValue$1(viewer, obj) {
|
|
3730
3727
|
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
3731
3728
|
return obj.getValue(viewer.scene.lastRenderTime);
|
|
@@ -3734,29 +3731,43 @@ function getValue$1(viewer, obj) {
|
|
|
3734
3731
|
}
|
|
3735
3732
|
/**
|
|
3736
3733
|
* Util for generating labels within cesium space on entities.
|
|
3737
|
-
|
|
3734
|
+
*/
|
|
3738
3735
|
var EntityLabel;
|
|
3739
3736
|
(function (EntityLabel) {
|
|
3737
|
+
// Key where the label instance is stored within the cesium entity.
|
|
3738
|
+
// Eg: rego[ATTACH_KEY] = new EntityLabel(...);
|
|
3739
|
+
EntityLabel.ATTACH_KEY = "nextspace-navigator-entity-label";
|
|
3740
3740
|
var Label = /** @class */ (function () {
|
|
3741
3741
|
function Label(params) {
|
|
3742
|
-
var
|
|
3742
|
+
var _a;
|
|
3743
|
+
// Counter to help differentiate between createLabel calls.
|
|
3744
|
+
this.counter = 0;
|
|
3743
3745
|
// The label element itself.
|
|
3744
3746
|
this.label = null;
|
|
3745
3747
|
// Callback to kill render listener.
|
|
3746
3748
|
this.renderRemoval = null;
|
|
3749
|
+
// Callback to kill terrain listener.
|
|
3750
|
+
this.terrChangedRemoval = null;
|
|
3747
3751
|
// Indicates the label was disposed and any actions will be ignored.
|
|
3748
3752
|
this.disposed = false;
|
|
3749
|
-
|
|
3753
|
+
// Calculated pos3d for the label.
|
|
3754
|
+
// Override to make it draw at a different position.
|
|
3755
|
+
this._pos3d = null;
|
|
3756
|
+
this.prePositioned = false;
|
|
3750
3757
|
this.rego = params.rego;
|
|
3751
3758
|
this.viewer = params.viewer;
|
|
3752
|
-
this.
|
|
3753
|
-
this.
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
console.error("Failed to create label", e);
|
|
3757
|
-
_this.creating = false;
|
|
3758
|
-
});
|
|
3759
|
+
this.api = params.api;
|
|
3760
|
+
this.visualRegister = params.visualRegister;
|
|
3761
|
+
this.prePositioned = !isNaN((_a = params.pos3d) === null || _a === void 0 ? void 0 : _a.x);
|
|
3762
|
+
this.createLabel(params.pos3d);
|
|
3759
3763
|
}
|
|
3764
|
+
Object.defineProperty(Label.prototype, "Rego", {
|
|
3765
|
+
get: function () {
|
|
3766
|
+
return this.rego;
|
|
3767
|
+
},
|
|
3768
|
+
enumerable: false,
|
|
3769
|
+
configurable: true
|
|
3770
|
+
});
|
|
3760
3771
|
Object.defineProperty(Label.prototype, "Disposed", {
|
|
3761
3772
|
get: function () {
|
|
3762
3773
|
return this.disposed;
|
|
@@ -3764,9 +3775,14 @@ var EntityLabel;
|
|
|
3764
3775
|
enumerable: false,
|
|
3765
3776
|
configurable: true
|
|
3766
3777
|
});
|
|
3767
|
-
Object.defineProperty(Label.prototype, "
|
|
3778
|
+
Object.defineProperty(Label.prototype, "pos3d", {
|
|
3768
3779
|
get: function () {
|
|
3769
|
-
return this.
|
|
3780
|
+
return this._pos3d;
|
|
3781
|
+
},
|
|
3782
|
+
set: function (val) {
|
|
3783
|
+
this._pos3d = val;
|
|
3784
|
+
this.prePositioned = !isNaN(val === null || val === void 0 ? void 0 : val.x);
|
|
3785
|
+
this.createLabel(val);
|
|
3770
3786
|
},
|
|
3771
3787
|
enumerable: false,
|
|
3772
3788
|
configurable: true
|
|
@@ -3780,176 +3796,320 @@ var EntityLabel;
|
|
|
3780
3796
|
return;
|
|
3781
3797
|
}
|
|
3782
3798
|
this.disposed = true;
|
|
3783
|
-
|
|
3784
|
-
this.label.parentElement) {
|
|
3785
|
-
this.label.parentElement.removeChild(this.label);
|
|
3786
|
-
this.label = null;
|
|
3787
|
-
}
|
|
3788
|
-
if (this.renderRemoval) {
|
|
3789
|
-
this.renderRemoval();
|
|
3790
|
-
this.renderRemoval = null;
|
|
3791
|
-
}
|
|
3799
|
+
this.removeLabel();
|
|
3792
3800
|
};
|
|
3793
3801
|
/**
|
|
3794
3802
|
* Creates cesium entity for the label if one does not exist.
|
|
3803
|
+
* @param starterPos3d optional position to create label at. Ignored for billboard labels.
|
|
3795
3804
|
*/
|
|
3796
|
-
Label.prototype.
|
|
3797
|
-
var _a, _b, _c;
|
|
3805
|
+
Label.prototype.createLabel = function (starterPos3d) {
|
|
3806
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3798
3807
|
return __awaiter(this, void 0, void 0, function () {
|
|
3799
|
-
var pos3d,
|
|
3808
|
+
var pos3d, counter, sizeInM, heightRef, pixelOffset, visual, hierarchy, posses, centerIndex, pos1, pos2, pos3, posses, isClamped, centerIndex, size, height, scale, posses, centerIndex, text, ele, _lastDistance, _lastCameraPos, getDistance, MAX_DISTANCE, updateLabel, terrTimeout;
|
|
3800
3809
|
var _this = this;
|
|
3801
|
-
return __generator(this, function (
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
pixelOffset = new Cartesian2(0, 0);
|
|
3809
|
-
visual = (_a = this.rego) === null || _a === void 0 ? void 0 : _a.visual;
|
|
3810
|
-
if (visual && visual instanceof Entity) {
|
|
3811
|
-
if (visual.polygon) {
|
|
3812
|
-
heightRef = getValue$1(this.viewer, visual.polygon.heightReference);
|
|
3813
|
-
}
|
|
3814
|
-
else if (visual.polyline) {
|
|
3815
|
-
isClamped = getValue$1(this.viewer, visual.polyline.clampToGround);
|
|
3816
|
-
heightRef = isClamped == false ? HeightReference.NONE : HeightReference.CLAMP_TO_GROUND;
|
|
3817
|
-
}
|
|
3818
|
-
else if (visual.model) {
|
|
3819
|
-
heightRef = getValue$1(this.viewer, visual.model.heightReference);
|
|
3820
|
-
}
|
|
3821
|
-
else if (visual.point) {
|
|
3822
|
-
heightRef = getValue$1(this.viewer, visual.point.heightReference);
|
|
3823
|
-
}
|
|
3824
|
-
else if (visual.billboard) {
|
|
3825
|
-
heightRef = getValue$1(this.viewer, visual.billboard.heightReference);
|
|
3826
|
-
height = getValue$1(this.viewer, visual.billboard.height);
|
|
3827
|
-
if (height) {
|
|
3828
|
-
scale = EnsureNumber(getValue$1(this.viewer, visual.billboard.scale), 1);
|
|
3829
|
-
pixelOffset.y = -(height * scale);
|
|
3810
|
+
return __generator(this, function (_k) {
|
|
3811
|
+
switch (_k.label) {
|
|
3812
|
+
case 0:
|
|
3813
|
+
pos3d = starterPos3d ? starterPos3d.clone() : null;
|
|
3814
|
+
counter = ++this.counter;
|
|
3815
|
+
if (this.disposed) {
|
|
3816
|
+
return [2 /*return*/];
|
|
3830
3817
|
}
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3818
|
+
this.removeLabel();
|
|
3819
|
+
sizeInM = 0;
|
|
3820
|
+
heightRef = null;
|
|
3821
|
+
pixelOffset = new Cartesian2(0, -5);
|
|
3822
|
+
if (!isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3823
|
+
heightRef = HeightReference.NONE;
|
|
3824
|
+
pixelOffset.y = -15;
|
|
3825
|
+
}
|
|
3826
|
+
visual = (_a = this.rego) === null || _a === void 0 ? void 0 : _a.visual;
|
|
3827
|
+
// If pos3d is already set we'll run through the visuals to figure out the entity's size.
|
|
3828
|
+
// If unset then we'll use the entity's position to draw the label.
|
|
3829
|
+
if (visual && visual instanceof Entity) {
|
|
3830
|
+
if (!this.prePositioned && visual.polygon) {
|
|
3831
|
+
hierarchy = getValue$1(this.viewer, visual.polygon.hierarchy);
|
|
3832
|
+
if ((_b = hierarchy === null || hierarchy === void 0 ? void 0 : hierarchy.positions) === null || _b === void 0 ? void 0 : _b.length) {
|
|
3833
|
+
posses = [].concat(hierarchy.positions);
|
|
3834
|
+
try {
|
|
3835
|
+
sizeInM = (_c = MeasureUtils.MeasurePolygon({
|
|
3836
|
+
posses: posses,
|
|
3837
|
+
})) === null || _c === void 0 ? void 0 : _c.area;
|
|
3838
|
+
if (isNaN(sizeInM)) {
|
|
3839
|
+
sizeInM = 0;
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
catch (e) {
|
|
3843
|
+
console.error("Failed to measure polygon", e);
|
|
3844
|
+
}
|
|
3845
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3846
|
+
heightRef = getValue$1(this.viewer, visual.polygon.heightReference);
|
|
3847
|
+
if (Cartes.IsRing3Closed(posses)) {
|
|
3848
|
+
posses.pop();
|
|
3849
|
+
}
|
|
3850
|
+
centerIndex = Math.floor(posses.length / 2);
|
|
3851
|
+
if (posses.length >= 3) {
|
|
3852
|
+
pos1 = posses[centerIndex];
|
|
3853
|
+
pos2 = posses[0];
|
|
3854
|
+
pos3 = posses[posses.length - 1];
|
|
3855
|
+
if (pos1 && pos2 && pos3) {
|
|
3856
|
+
pos3d = Cartesian3.midpoint(pos1, pos2, new Cartesian3());
|
|
3857
|
+
pos3d = Cartesian3.midpoint(pos3d, pos3, new Cartesian3());
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3861
|
+
pos3d = posses[centerIndex];
|
|
3862
|
+
}
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
else if (!this.prePositioned && visual.polyline) {
|
|
3867
|
+
posses = getValue$1(this.viewer, visual.polyline.positions);
|
|
3868
|
+
if (posses === null || posses === void 0 ? void 0 : posses.length) {
|
|
3869
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3870
|
+
isClamped = getValue$1(this.viewer, visual.polyline.clampToGround);
|
|
3871
|
+
heightRef = isClamped == false ? HeightReference.NONE : HeightReference.CLAMP_TO_GROUND;
|
|
3872
|
+
centerIndex = Math.floor(posses.length / 2);
|
|
3873
|
+
pos3d = posses[centerIndex];
|
|
3874
|
+
}
|
|
3875
|
+
try {
|
|
3876
|
+
sizeInM = (_d = MeasureUtils.MeasurePolyline({
|
|
3877
|
+
posses: posses,
|
|
3878
|
+
})) === null || _d === void 0 ? void 0 : _d.totalLength;
|
|
3879
|
+
if (isNaN(sizeInM)) {
|
|
3880
|
+
sizeInM = 0;
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
catch (e) {
|
|
3884
|
+
console.error("Failed to measure polyline", e);
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
else if (visual.model) {
|
|
3889
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3890
|
+
heightRef = getValue$1(this.viewer, visual.model.heightReference);
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
else if (visual.point) {
|
|
3894
|
+
heightRef = getValue$1(this.viewer, visual.point.heightReference);
|
|
3895
|
+
size = getValue$1(this.viewer, visual.point.pixelSize);
|
|
3896
|
+
if (size) {
|
|
3897
|
+
pixelOffset.y = -(size / 2);
|
|
3898
|
+
pixelOffset.y -= 5;
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3901
|
+
else if (visual.billboard) {
|
|
3902
|
+
heightRef = getValue$1(this.viewer, visual.billboard.heightReference);
|
|
3903
|
+
height = getValue$1(this.viewer, visual.billboard.height);
|
|
3904
|
+
if (height) {
|
|
3905
|
+
scale = EnsureNumber(getValue$1(this.viewer, visual.billboard.scale), 1);
|
|
3906
|
+
pixelOffset.y = -(height * scale);
|
|
3907
|
+
pixelOffset.y -= 5;
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
else if (!this.prePositioned && visual.corridor) {
|
|
3911
|
+
posses = getValue$1(this.viewer, visual.corridor.positions);
|
|
3912
|
+
if (posses === null || posses === void 0 ? void 0 : posses.length) {
|
|
3913
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3914
|
+
heightRef = getValue$1(this.viewer, visual.corridor.heightReference);
|
|
3915
|
+
centerIndex = Math.floor(posses.length / 2);
|
|
3916
|
+
pos3d = posses[centerIndex];
|
|
3917
|
+
}
|
|
3918
|
+
try {
|
|
3919
|
+
sizeInM = (_e = MeasureUtils.MeasurePolyline({
|
|
3920
|
+
posses: posses,
|
|
3921
|
+
})) === null || _e === void 0 ? void 0 : _e.totalLength;
|
|
3922
|
+
if (isNaN(sizeInM)) {
|
|
3923
|
+
sizeInM = 0;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
catch (e) {
|
|
3927
|
+
console.error("Failed to measure polyline", e);
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
else if (visual.ellipse) {
|
|
3932
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3933
|
+
heightRef = getValue$1(this.viewer, visual.ellipse.heightReference);
|
|
3934
|
+
}
|
|
3935
|
+
}
|
|
3936
|
+
if (visual.billboard || visual.point || isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3937
|
+
pos3d = getValue$1(this.viewer, visual.position);
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
3940
|
+
if (!isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) return [3 /*break*/, 2];
|
|
3941
|
+
return [4 /*yield*/, EntityUtils.GetPosAsync({
|
|
3942
|
+
viewer: this.viewer,
|
|
3943
|
+
api: this.api,
|
|
3944
|
+
entityId: (_f = this.rego) === null || _f === void 0 ? void 0 : _f.entityId,
|
|
3945
|
+
returnHeightRef: HeightReference.NONE,
|
|
3946
|
+
recordHeightRef: heightRef == null || isNaN(heightRef) ? HeightReference.NONE : heightRef,
|
|
3947
|
+
tilesetId: (_g = this.rego) === null || _g === void 0 ? void 0 : _g.tilesetId,
|
|
3948
|
+
visualRegister: this.visualRegister
|
|
3949
|
+
})];
|
|
3950
|
+
case 1:
|
|
3951
|
+
pos3d = _k.sent();
|
|
3952
|
+
heightRef = HeightReference.NONE;
|
|
3953
|
+
if (this.counter != counter) {
|
|
3954
|
+
return [2 /*return*/];
|
|
3955
|
+
}
|
|
3956
|
+
_k.label = 2;
|
|
3957
|
+
case 2:
|
|
3958
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3959
|
+
return [2 /*return*/];
|
|
3960
|
+
}
|
|
3961
|
+
pos3d = DrawingUtils.EnsurePosHeight({
|
|
3962
|
+
desiredHeightRef: HeightReference.NONE,
|
|
3963
|
+
heightRef: heightRef,
|
|
3964
|
+
pos3d: pos3d,
|
|
3965
|
+
viewer: this.viewer
|
|
3966
|
+
});
|
|
3967
|
+
if (isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3968
|
+
return [2 /*return*/];
|
|
3969
|
+
}
|
|
3970
|
+
this._pos3d = pos3d;
|
|
3971
|
+
text = (_j = (_h = this.rego) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : "Unnamed Entity";
|
|
3972
|
+
ele = document.createElement("div");
|
|
3973
|
+
ele.innerHTML = text;
|
|
3974
|
+
ele.setAttribute("style", "\n position: absolute;\n z-index: 0;\n display: none;\n pointer-events: none;\n padding: 6px 8px;\n border-radius: 6px;\n font-family: Arial;\n font-size: 12px;\n -webkit-backdrop-filter: blur(20px);\n backdrop-filter: blur(20px);\n background: rgba(33,39,42,.8);\n border-radius: 9px;\n box-shadow: 0 0 1px rgba(18,22,25,.36),0 18px 36px -4px rgba(18,22,25,.36);\n color: #ffffff;\n }");
|
|
3975
|
+
this.label = ele;
|
|
3976
|
+
this.viewer.container.appendChild(ele);
|
|
3977
|
+
_lastDistance = null;
|
|
3978
|
+
_lastCameraPos = null;
|
|
3979
|
+
getDistance = function () {
|
|
3980
|
+
var _a;
|
|
3981
|
+
if (_this.disposed) {
|
|
3982
|
+
return null;
|
|
3983
|
+
}
|
|
3984
|
+
var cameraPos = (_a = _this.viewer.camera) === null || _a === void 0 ? void 0 : _a.position;
|
|
3985
|
+
if (isNaN(cameraPos === null || cameraPos === void 0 ? void 0 : cameraPos.x)) {
|
|
3986
|
+
return null;
|
|
3987
|
+
}
|
|
3988
|
+
// If camera hasn't moved much then we can use the last distance.
|
|
3989
|
+
var TOLERANCE = 0.1;
|
|
3990
|
+
if (_lastCameraPos) {
|
|
3991
|
+
var totalMovement = Math.abs(_lastCameraPos.x - cameraPos.x) +
|
|
3992
|
+
Math.abs(_lastCameraPos.y - cameraPos.y) +
|
|
3993
|
+
Math.abs(_lastCameraPos.z - cameraPos.z);
|
|
3994
|
+
if (totalMovement < TOLERANCE) {
|
|
3995
|
+
return _lastDistance;
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
// Check if there is a raycast collision between camera and pos3d.
|
|
3999
|
+
// We'll let the labels draw through a ground collision.
|
|
4000
|
+
// Commented out while it is WIP.
|
|
4001
|
+
// const direction = Cesium.Cartesian3.subtract(pos3d, cameraPos, new Cesium.Cartesian3());
|
|
4002
|
+
// const ray = new Cesium.Ray(pos3d.clone(), direction);
|
|
4003
|
+
// const objects = (this.viewer.scene as any).drillPickFromRay(ray, 1, [visuals]);
|
|
4004
|
+
// if (objects && objects.length > 0) {
|
|
4005
|
+
// for (let i = 0; i < objects.length; ++i) {
|
|
4006
|
+
// const obj = objects[i];
|
|
4007
|
+
// if (!visuals.find(x => x == obj?.id)) {
|
|
4008
|
+
// let isGround = true;
|
|
4009
|
+
// if (obj.object) {
|
|
4010
|
+
// const url = obj.object?.primitive?._basePath;
|
|
4011
|
+
// if (url && typeof url == "string") {
|
|
4012
|
+
// isGround = url.includes("tile.googleapis.com");
|
|
4013
|
+
// }
|
|
4014
|
+
// else {
|
|
4015
|
+
// isGround = false;
|
|
4016
|
+
// }
|
|
4017
|
+
// }
|
|
4018
|
+
// if (!isGround) {
|
|
4019
|
+
// return null;
|
|
4020
|
+
// }
|
|
4021
|
+
// }
|
|
4022
|
+
// }
|
|
4023
|
+
// }
|
|
4024
|
+
var distance = Cartesian3.distance(cameraPos, _this._pos3d);
|
|
4025
|
+
_lastDistance = distance;
|
|
4026
|
+
_lastCameraPos = cameraPos.clone();
|
|
4027
|
+
return distance;
|
|
4028
|
+
};
|
|
4029
|
+
MAX_DISTANCE = 5000;
|
|
4030
|
+
if (sizeInM > 30) {
|
|
4031
|
+
MAX_DISTANCE = Math.max(MAX_DISTANCE, sizeInM / 2);
|
|
4032
|
+
}
|
|
4033
|
+
updateLabel = function () {
|
|
4034
|
+
var _a;
|
|
4035
|
+
if (_this.disposed || isNaN((_a = _this._pos3d) === null || _a === void 0 ? void 0 : _a.x)) {
|
|
4036
|
+
return;
|
|
4037
|
+
}
|
|
4038
|
+
if (!_this.viewer || _this.viewer.isDestroyed()) {
|
|
4039
|
+
_this.Dispose();
|
|
4040
|
+
return;
|
|
4041
|
+
}
|
|
4042
|
+
var distance = getDistance();
|
|
4043
|
+
if (isNaN(distance) || (!_this.prePositioned && distance >= MAX_DISTANCE)) {
|
|
4044
|
+
ele.style.display = "none";
|
|
4045
|
+
return;
|
|
4046
|
+
}
|
|
4047
|
+
var pos2d = SceneTransforms.wgs84ToWindowCoordinates(_this.viewer.scene, _this._pos3d);
|
|
4048
|
+
if (isNaN(pos2d === null || pos2d === void 0 ? void 0 : pos2d.x)) {
|
|
4049
|
+
ele.style.display = "none";
|
|
4050
|
+
return;
|
|
4051
|
+
}
|
|
4052
|
+
// If out of the screen then we can hide it.
|
|
4053
|
+
if (pos2d.x < 0 || pos2d.x > _this.viewer.canvas.clientWidth ||
|
|
4054
|
+
pos2d.y < 0 || pos2d.y > _this.viewer.canvas.clientHeight) {
|
|
4055
|
+
ele.style.display = "none";
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
ele.style.display = "block";
|
|
4059
|
+
// Check scale to apply based on distance between camera and pos3d.
|
|
4060
|
+
// We'll make the label smaller and less transparent when further away.
|
|
4061
|
+
var scale = _this.prePositioned ? 1 : 1 - (distance / MAX_DISTANCE);
|
|
4062
|
+
if (scale && scale > 0.15) {
|
|
4063
|
+
ele.style.transform = "scale(".concat(scale, ")");
|
|
4064
|
+
ele.style.opacity = "".concat(scale);
|
|
4065
|
+
var left = pos2d.x - (ele.clientWidth / 2) + pixelOffset.x;
|
|
4066
|
+
ele.style.left = "".concat(left, "px");
|
|
4067
|
+
var top_1 = pos2d.y - ele.clientHeight + (pixelOffset.y * scale);
|
|
4068
|
+
ele.style.top = "".concat(top_1, "px");
|
|
4069
|
+
}
|
|
4070
|
+
else {
|
|
4071
|
+
ele.style.transform = "";
|
|
4072
|
+
ele.style.opacity = "0";
|
|
4073
|
+
}
|
|
4074
|
+
};
|
|
4075
|
+
this.renderRemoval = this.viewer.scene.postUpdate.addEventListener(updateLabel);
|
|
4076
|
+
updateLabel();
|
|
4077
|
+
terrTimeout = null;
|
|
4078
|
+
this.terrChangedRemoval = this.viewer.scene.terrainProviderChanged.addEventListener(function () {
|
|
4079
|
+
if (_this.disposed) {
|
|
4080
|
+
return;
|
|
4081
|
+
}
|
|
4082
|
+
clearTimeout(terrTimeout);
|
|
4083
|
+
terrTimeout = setTimeout(function () {
|
|
4084
|
+
if (counter != _this.counter) {
|
|
4085
|
+
return;
|
|
4086
|
+
}
|
|
4087
|
+
_this.createLabel(starterPos3d);
|
|
4088
|
+
}, 2500);
|
|
4089
|
+
});
|
|
4090
|
+
return [2 /*return*/];
|
|
3845
4091
|
}
|
|
3846
|
-
carto = Cartographic.fromCartesian(pos3d);
|
|
3847
|
-
// TODO: Check if we need to use heightRef and adjust to absolute height.
|
|
3848
|
-
// TODO: We should be smarter and not just add 10m to the height. Eg: use polygon extrusion.
|
|
3849
|
-
carto.height += heightOffset;
|
|
3850
|
-
pos3d = Cartographic.toCartesian(carto);
|
|
3851
|
-
text = (_c = (_b = this.rego) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "Unnamed Entity";
|
|
3852
|
-
ele = document.createElement("div");
|
|
3853
|
-
ele.innerHTML = text;
|
|
3854
|
-
ele.setAttribute("style", "\n position: absolute;\n z-index: 1;\n display: none;\n pointer-events: none;\n padding: 6px;\n border-radius: 6px;\n font-family: sans-serif;\n font-size: 12px;\n background-color: #000000;\n color: #ffffff;\n }");
|
|
3855
|
-
this.label = ele;
|
|
3856
|
-
this.viewer.container.appendChild(ele);
|
|
3857
|
-
_lastDistance = null;
|
|
3858
|
-
_lastCameraPos = null;
|
|
3859
|
-
getDistance = function () {
|
|
3860
|
-
var _a;
|
|
3861
|
-
if (_this.disposed) {
|
|
3862
|
-
return null;
|
|
3863
|
-
}
|
|
3864
|
-
var cameraPos = (_a = _this.viewer.camera) === null || _a === void 0 ? void 0 : _a.position;
|
|
3865
|
-
if (isNaN(cameraPos === null || cameraPos === void 0 ? void 0 : cameraPos.x)) {
|
|
3866
|
-
return null;
|
|
3867
|
-
}
|
|
3868
|
-
// If camera hasn't moved much then we can use the last distance.
|
|
3869
|
-
var TOLERANCE = 0.1;
|
|
3870
|
-
if (_lastCameraPos) {
|
|
3871
|
-
var totalMovement = Math.abs(_lastCameraPos.x - cameraPos.x) +
|
|
3872
|
-
Math.abs(_lastCameraPos.y - cameraPos.y) +
|
|
3873
|
-
Math.abs(_lastCameraPos.z - cameraPos.z);
|
|
3874
|
-
if (totalMovement < TOLERANCE) {
|
|
3875
|
-
return _lastDistance;
|
|
3876
|
-
}
|
|
3877
|
-
}
|
|
3878
|
-
// Check if there is a raycast collision between camera and pos3d.
|
|
3879
|
-
// We'll let the labels draw through a ground collision.
|
|
3880
|
-
// Commented out while it is WIP.
|
|
3881
|
-
// const direction = Cesium.Cartesian3.subtract(pos3d, cameraPos, new Cesium.Cartesian3());
|
|
3882
|
-
// const ray = new Cesium.Ray(pos3d.clone(), direction);
|
|
3883
|
-
// const objects = (this.viewer.scene as any).drillPickFromRay(ray, 1, [visuals]);
|
|
3884
|
-
// if (objects && objects.length > 0) {
|
|
3885
|
-
// for (let i = 0; i < objects.length; ++i) {
|
|
3886
|
-
// const obj = objects[i];
|
|
3887
|
-
// if (!visuals.find(x => x == obj?.id)) {
|
|
3888
|
-
// let isGround = true;
|
|
3889
|
-
// if (obj.object) {
|
|
3890
|
-
// const url = obj.object?.primitive?._basePath;
|
|
3891
|
-
// if (url && typeof url == "string") {
|
|
3892
|
-
// isGround = url.includes("tile.googleapis.com");
|
|
3893
|
-
// }
|
|
3894
|
-
// else {
|
|
3895
|
-
// isGround = false;
|
|
3896
|
-
// }
|
|
3897
|
-
// }
|
|
3898
|
-
// if (!isGround) {
|
|
3899
|
-
// return null;
|
|
3900
|
-
// }
|
|
3901
|
-
// }
|
|
3902
|
-
// }
|
|
3903
|
-
// }
|
|
3904
|
-
var distance = Cartesian3.distance(cameraPos, pos3d);
|
|
3905
|
-
_lastDistance = distance;
|
|
3906
|
-
_lastCameraPos = cameraPos.clone();
|
|
3907
|
-
return distance;
|
|
3908
|
-
};
|
|
3909
|
-
MAX_DISTANCE = 5000;
|
|
3910
|
-
updateLabel = function () {
|
|
3911
|
-
if (_this.disposed || isNaN(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
3912
|
-
return;
|
|
3913
|
-
}
|
|
3914
|
-
var distance = getDistance();
|
|
3915
|
-
if (isNaN(distance) || distance >= MAX_DISTANCE) {
|
|
3916
|
-
ele.style.display = "none";
|
|
3917
|
-
return;
|
|
3918
|
-
}
|
|
3919
|
-
var pos2d = SceneTransforms.wgs84ToWindowCoordinates(_this.viewer.scene, pos3d);
|
|
3920
|
-
if (isNaN(pos2d === null || pos2d === void 0 ? void 0 : pos2d.x)) {
|
|
3921
|
-
ele.style.display = "none";
|
|
3922
|
-
return;
|
|
3923
|
-
}
|
|
3924
|
-
// If out of the screen then we can hide it.
|
|
3925
|
-
if (pos2d.x < 0 || pos2d.x > _this.viewer.canvas.clientWidth ||
|
|
3926
|
-
pos2d.y < 0 || pos2d.y > _this.viewer.canvas.clientHeight) {
|
|
3927
|
-
ele.style.display = "none";
|
|
3928
|
-
return;
|
|
3929
|
-
}
|
|
3930
|
-
ele.style.display = "block";
|
|
3931
|
-
// Check scale to apply based on distance between camera and pos3d.
|
|
3932
|
-
// We'll make the label smaller and less transparent when further away.
|
|
3933
|
-
var scale = 1 - (distance / MAX_DISTANCE);
|
|
3934
|
-
if (scale && scale > 0.15) {
|
|
3935
|
-
ele.style.transform = "scale(".concat(scale, ")");
|
|
3936
|
-
ele.style.opacity = "".concat(scale);
|
|
3937
|
-
var left = pos2d.x - (ele.clientWidth / 2) + pixelOffset.x;
|
|
3938
|
-
ele.style.left = "".concat(left, "px");
|
|
3939
|
-
var top_1 = pos2d.y - ele.clientHeight + (pixelOffset.y * scale);
|
|
3940
|
-
ele.style.top = "".concat(top_1, "px");
|
|
3941
|
-
}
|
|
3942
|
-
else {
|
|
3943
|
-
ele.style.transform = "";
|
|
3944
|
-
ele.style.opacity = "0";
|
|
3945
|
-
}
|
|
3946
|
-
};
|
|
3947
|
-
this.renderRemoval = this.viewer.scene.postUpdate.addEventListener(updateLabel);
|
|
3948
|
-
updateLabel();
|
|
3949
|
-
return [2 /*return*/];
|
|
3950
4092
|
});
|
|
3951
4093
|
});
|
|
3952
4094
|
};
|
|
4095
|
+
/**
|
|
4096
|
+
* Removes label from the viewer and unsubscribes from events.
|
|
4097
|
+
*/
|
|
4098
|
+
Label.prototype.removeLabel = function () {
|
|
4099
|
+
if (this.label &&
|
|
4100
|
+
this.label.parentElement) {
|
|
4101
|
+
this.label.parentElement.removeChild(this.label);
|
|
4102
|
+
this.label = null;
|
|
4103
|
+
}
|
|
4104
|
+
if (this.renderRemoval) {
|
|
4105
|
+
this.renderRemoval();
|
|
4106
|
+
this.renderRemoval = null;
|
|
4107
|
+
}
|
|
4108
|
+
if (this.terrChangedRemoval) {
|
|
4109
|
+
this.terrChangedRemoval();
|
|
4110
|
+
this.terrChangedRemoval = null;
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
3953
4113
|
return Label;
|
|
3954
4114
|
}());
|
|
3955
4115
|
EntityLabel.Label = Label;
|
|
@@ -3958,14 +4118,18 @@ var EntityLabel;
|
|
|
3958
4118
|
* If one exists then the action is ignored.
|
|
3959
4119
|
*/
|
|
3960
4120
|
function Attach(params) {
|
|
3961
|
-
var rego = params.rego, viewer = params.viewer;
|
|
3962
|
-
if (!rego || !viewer || rego[ATTACH_KEY]) {
|
|
4121
|
+
var rego = params.rego, viewer = params.viewer, pos3d = params.pos3d, visualRegister = params.visualRegister, api = params.api;
|
|
4122
|
+
if (!rego || !viewer || rego[EntityLabel.ATTACH_KEY]) {
|
|
3963
4123
|
return;
|
|
3964
4124
|
}
|
|
3965
|
-
rego[ATTACH_KEY] = new Label({
|
|
4125
|
+
rego[EntityLabel.ATTACH_KEY] = new Label({
|
|
3966
4126
|
rego: rego,
|
|
3967
|
-
viewer: viewer
|
|
4127
|
+
viewer: viewer,
|
|
4128
|
+
pos3d: pos3d,
|
|
4129
|
+
visualRegister: visualRegister,
|
|
4130
|
+
api: api
|
|
3968
4131
|
});
|
|
4132
|
+
return rego[EntityLabel.ATTACH_KEY];
|
|
3969
4133
|
}
|
|
3970
4134
|
EntityLabel.Attach = Attach;
|
|
3971
4135
|
/**
|
|
@@ -3973,15 +4137,34 @@ var EntityLabel;
|
|
|
3973
4137
|
* If one doesn't exist then the action is ignored.
|
|
3974
4138
|
*/
|
|
3975
4139
|
function Detatch(params) {
|
|
3976
|
-
var _a, _b;
|
|
3977
|
-
var rego = params.rego;
|
|
3978
|
-
if (!rego
|
|
4140
|
+
var _a, _b, _c;
|
|
4141
|
+
var rego = params.rego, label = params.label;
|
|
4142
|
+
if (!rego && label) {
|
|
4143
|
+
rego = label.Rego;
|
|
4144
|
+
}
|
|
4145
|
+
if (!rego || !rego[EntityLabel.ATTACH_KEY]) {
|
|
4146
|
+
if (label) {
|
|
4147
|
+
(_a = label.Dispose) === null || _a === void 0 ? void 0 : _a.call(label);
|
|
4148
|
+
}
|
|
3979
4149
|
return;
|
|
3980
4150
|
}
|
|
3981
|
-
(
|
|
3982
|
-
rego[ATTACH_KEY] = null;
|
|
4151
|
+
(_c = (_b = rego[EntityLabel.ATTACH_KEY]).Dispose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
4152
|
+
rego[EntityLabel.ATTACH_KEY] = null;
|
|
3983
4153
|
}
|
|
3984
4154
|
EntityLabel.Detatch = Detatch;
|
|
4155
|
+
/**
|
|
4156
|
+
* Returns label instance from given rego if one exists.
|
|
4157
|
+
* @param params
|
|
4158
|
+
* @returns
|
|
4159
|
+
*/
|
|
4160
|
+
function GetLabel(params) {
|
|
4161
|
+
var rego = params.rego;
|
|
4162
|
+
if (!rego) {
|
|
4163
|
+
return null;
|
|
4164
|
+
}
|
|
4165
|
+
return rego[EntityLabel.ATTACH_KEY];
|
|
4166
|
+
}
|
|
4167
|
+
EntityLabel.GetLabel = GetLabel;
|
|
3985
4168
|
})(EntityLabel || (EntityLabel = {}));
|
|
3986
4169
|
|
|
3987
4170
|
/**
|
|
@@ -4121,7 +4304,9 @@ function updateEntity(viewer, entityId, register) {
|
|
|
4121
4304
|
if (isLabelled && visible) {
|
|
4122
4305
|
EntityLabel.Attach({
|
|
4123
4306
|
rego: rego,
|
|
4124
|
-
viewer: viewer
|
|
4307
|
+
viewer: viewer,
|
|
4308
|
+
api: register.ApiGetters.GetBruceApi(),
|
|
4309
|
+
visualRegister: register
|
|
4125
4310
|
});
|
|
4126
4311
|
}
|
|
4127
4312
|
else {
|
|
@@ -4302,7 +4487,7 @@ var VisualsRegister;
|
|
|
4302
4487
|
EVisualUpdateType["DeselectAll"] = "DESELECT_ALL";
|
|
4303
4488
|
})(EVisualUpdateType = VisualsRegister.EVisualUpdateType || (VisualsRegister.EVisualUpdateType = {}));
|
|
4304
4489
|
var Register = /** @class */ (function () {
|
|
4305
|
-
function Register(
|
|
4490
|
+
function Register(params) {
|
|
4306
4491
|
this.id = ObjectUtils.UId();
|
|
4307
4492
|
this.rego = {};
|
|
4308
4493
|
this.onUpdate = null;
|
|
@@ -4315,7 +4500,8 @@ var VisualsRegister;
|
|
|
4315
4500
|
// It will be drawn on the "best" visual, and only while the entity is visible.
|
|
4316
4501
|
// Warning: this sucks for CAD entities.
|
|
4317
4502
|
this.labelledEntityIds = [];
|
|
4318
|
-
this.viewer = viewer;
|
|
4503
|
+
this.viewer = params.viewer;
|
|
4504
|
+
this.apiGetters = params.apiGetters;
|
|
4319
4505
|
}
|
|
4320
4506
|
Object.defineProperty(Register.prototype, "Id", {
|
|
4321
4507
|
get: function () {
|
|
@@ -4331,6 +4517,13 @@ var VisualsRegister;
|
|
|
4331
4517
|
enumerable: false,
|
|
4332
4518
|
configurable: true
|
|
4333
4519
|
});
|
|
4520
|
+
Object.defineProperty(Register.prototype, "ApiGetters", {
|
|
4521
|
+
get: function () {
|
|
4522
|
+
return this.apiGetters;
|
|
4523
|
+
},
|
|
4524
|
+
enumerable: false,
|
|
4525
|
+
configurable: true
|
|
4526
|
+
});
|
|
4334
4527
|
Object.defineProperty(Register.prototype, "OnUpdate", {
|
|
4335
4528
|
get: function () {
|
|
4336
4529
|
if (!this.onUpdate) {
|
|
@@ -9927,15 +10120,29 @@ var MenuItemManager;
|
|
|
9927
10120
|
function Manager(params) {
|
|
9928
10121
|
this.items = [];
|
|
9929
10122
|
this.onUpdate = null;
|
|
9930
|
-
var viewer = params.viewer, visualsRegister = params.visualsRegister;
|
|
10123
|
+
var viewer = params.viewer, visualsRegister = params.visualsRegister, getters = params.getters;
|
|
9931
10124
|
this.viewer = viewer;
|
|
10125
|
+
if (!getters) {
|
|
10126
|
+
getters = ENVIRONMENT.Api();
|
|
10127
|
+
}
|
|
10128
|
+
this.getters = getters;
|
|
9932
10129
|
if (!visualsRegister) {
|
|
9933
|
-
visualsRegister = new VisualsRegister.Register(
|
|
10130
|
+
visualsRegister = new VisualsRegister.Register({
|
|
10131
|
+
viewer: this.viewer,
|
|
10132
|
+
apiGetters: getters
|
|
10133
|
+
});
|
|
9934
10134
|
}
|
|
9935
10135
|
this.visualsRegister = visualsRegister;
|
|
9936
10136
|
this.sharedGetters = new SharedGetters.Cache();
|
|
9937
10137
|
this.sharedMonitor = new CesiumViewMonitor(this.viewer);
|
|
9938
10138
|
}
|
|
10139
|
+
Object.defineProperty(Manager.prototype, "Getters", {
|
|
10140
|
+
get: function () {
|
|
10141
|
+
return this.getters;
|
|
10142
|
+
},
|
|
10143
|
+
enumerable: false,
|
|
10144
|
+
configurable: true
|
|
10145
|
+
});
|
|
9939
10146
|
Object.defineProperty(Manager.prototype, "Viewer", {
|
|
9940
10147
|
get: function () {
|
|
9941
10148
|
return this.viewer;
|
|
@@ -9978,11 +10185,15 @@ var MenuItemManager;
|
|
|
9978
10185
|
if (this.viewer.isDestroyed()) {
|
|
9979
10186
|
return null;
|
|
9980
10187
|
}
|
|
10188
|
+
if (!params.getters) {
|
|
10189
|
+
params.getters = this.getters;
|
|
10190
|
+
}
|
|
10191
|
+
// Deprecated. Backwards compatibility.
|
|
9981
10192
|
if (!params.getters) {
|
|
9982
10193
|
params.getters = ENVIRONMENT.Api();
|
|
9983
10194
|
}
|
|
9984
|
-
if (params.apiGetter && !
|
|
9985
|
-
console.warn("RenderItem(): Please pass getters
|
|
10195
|
+
if (params.apiGetter && !this.getters) {
|
|
10196
|
+
console.warn("RenderItem(): Please pass getters within menu-item-manager constructor. 'getters' and 'apiGetter' within RenderItem are now deprecated.");
|
|
9986
10197
|
}
|
|
9987
10198
|
else if (!params.apiGetter) {
|
|
9988
10199
|
params.apiGetter = params.getters.GetBruceGetter();
|
|
@@ -15591,7 +15802,7 @@ var WidgetInfoView = /** @class */ (function (_super) {
|
|
|
15591
15802
|
defaultToId: false
|
|
15592
15803
|
});
|
|
15593
15804
|
if (!name_1) {
|
|
15594
|
-
name_1 = "Unnamed
|
|
15805
|
+
name_1 = "Unnamed Entity";
|
|
15595
15806
|
}
|
|
15596
15807
|
this._title.style.display = "block";
|
|
15597
15808
|
this._flyTo.style.display = "flex";
|
|
@@ -15817,12 +16028,15 @@ var ViewerUtils;
|
|
|
15817
16028
|
* @returns
|
|
15818
16029
|
*/
|
|
15819
16030
|
function GetManager(params) {
|
|
15820
|
-
var viewer = params.viewer, createIfMissing = params.createIfMissing;
|
|
16031
|
+
var viewer = params.viewer, createIfMissing = params.createIfMissing, getters = params.getters;
|
|
15821
16032
|
if (viewer[CESIUM_VIEWER_MANAGER_KEY]) {
|
|
15822
16033
|
return viewer[CESIUM_VIEWER_MANAGER_KEY];
|
|
15823
16034
|
}
|
|
15824
16035
|
else if (createIfMissing != false) {
|
|
15825
|
-
var manager = new MenuItemManager.Manager({
|
|
16036
|
+
var manager = new MenuItemManager.Manager({
|
|
16037
|
+
viewer: viewer,
|
|
16038
|
+
getters: getters
|
|
16039
|
+
});
|
|
15826
16040
|
viewer[CESIUM_VIEWER_MANAGER_KEY] = manager;
|
|
15827
16041
|
return manager;
|
|
15828
16042
|
}
|
|
@@ -15881,7 +16095,7 @@ var ViewerUtils;
|
|
|
15881
16095
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
15882
16096
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
15883
16097
|
|
|
15884
|
-
var VERSION$1 = "2.8.
|
|
16098
|
+
var VERSION$1 = "2.8.5";
|
|
15885
16099
|
|
|
15886
16100
|
export { VERSION$1 as 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, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
|
|
15887
16101
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|