earthsdk3-ue 3.4.0-beta.9 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-ue.iife.js +13 -13
- package/dist/earthsdk3-ue.js +358 -360
- package/dist/earthsdk3-ue.umd.cjs +3 -3
- package/dist/types/UeObjects/base/UeESSceneObject/index.d.ts.map +1 -1
- package/dist/types/UeObjects/general/UeESPath/index.d.ts +0 -1
- package/dist/types/UeObjects/general/UeESPath/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/earthsdk3-ue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Dr = Object.defineProperty;
|
|
2
2
|
var Br = (l, e, t) => e in l ? Dr(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
3
|
var v = (l, e, t) => Br(l, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { ESViewer as Ee, ESSceneObject as E, ESJPickedResult as Ae, ViewerCustomInteraction as hr, getGeoBoundingSphereFromPositions as _r, EngineObject as G, ES3DTileset as me, ESImageryLayer as U, ESTerrainLayer as Mr, ESAlarm as $r, ESApertureEffect as Wr, ESGeoPolygon as Ar, ESAreaMeasurement as O, ESBlastParticleSystem as Ur, ESBoxClipping as Nr, ESCameraView as zr, ESCameraVisibleRange as Hr, ESCar as
|
|
5
|
-
import { reactArrayWithUndefined as fr, Destroyable as m, HasOwner as Gn, createGuid as _, Event as S, createAnimateFrame as
|
|
4
|
+
import { ESViewer as Ee, ESSceneObject as E, ESJPickedResult as Ae, ViewerCustomInteraction as hr, getGeoBoundingSphereFromPositions as _r, EngineObject as G, ES3DTileset as me, ESImageryLayer as U, ESTerrainLayer as Mr, ESAlarm as $r, ESApertureEffect as Wr, ESGeoPolygon as Ar, ESAreaMeasurement as O, ESBlastParticleSystem as Ur, ESBoxClipping as Nr, ESCameraView as zr, ESCameraVisibleRange as Hr, ESCar as br, ESClassification as lt, ESClippingPlane as Jr, ESDataMesh as H, ESDatasmithRuntimeModel as Gr, ESDirectionMeasurement as Kr, ESDistanceMeasurement as Me, ESLocalPolygon as Xr, ESDynamicWater as Yr, ESEntityCluster as Zr, ESExcavate as qr, ESFireParticleSystem as Qr, ESForestTileset as N, ESGeoDiv as Ce, ESTextLabel as pr, ESCustomDiv as He, ESImageLabel as vr, ESGeoJson as Vr, ESGeoLineString as Or, ESGeoRectangle as jr, ESGeoWater as tn, rpToap as Fe, ESGltfModel as en, ESHeightMeasurement as rn, ESHuman as nn, ESLevelRuntimeModel as sn, ESLocalCircle as on, ESLocalPolygonZ as an, ESLocalRectangle as dn, ESLocalSkyBox as ln, ESLocationMeasurement as cn, ESPipeFence as un, ESPipeline as hn, ESPipeserTileset as pn, ESPit as vn, ESPoi2D as fn, ESPoi3D as gn, ESPoiTileset as wn, ESPolygonFence as yn, ESPolygonFlattenedPlane as mn, ESPolygonWithHole as Cn, ESRtsTileset as Fn, ESSeparateFoliage as In, addTreesCallFunc as En, removeAllTreesCallFunc as Sn, updateTreeParamsCallFunc as Tn, cutDownTreesCallFunc as xn, growthSimulationCallFunc as Rn, ESSubmergingAnalysis as Ln, ESSunshineAnalysis as Pn, ESSurfaceAreaMeasurement as kn, ESUEWidget as Dn, ESUnrealActor as $e, ESVideoFusion as Bn, ESViewShed as _n, ESVisibilityAnalysis as Mn, ESVolumeMeasurement as $n, ESWidget as Wn, ESHumanPoi as An, ESNavigator as j, ESPath as Un, ESViewerStatusBar as A, ESGaussianSplatting as Nn, ESRtsFeatureEditing as zn, ESMsTileset as Hn, ESGeoExtrudedPolygon as ye, ESStaticMesh as bn, ESSkylineAnalysis as Jn } from "earthsdk3";
|
|
5
|
+
import { reactArrayWithUndefined as fr, Destroyable as m, HasOwner as Gn, createGuid as _, Event as S, createAnimateFrame as be, createInterval as Se, react as W, createNextAnimateFrameEvent as P, ObjResettingWithEvent as L, createProcessingFromAsyncFunc as Te, sleep as Kn, extendClassProps as Xn, reactJson as Je, bind as k, track as F, PosFloatDiv as Yn } from "xbsj-base";
|
|
6
6
|
import { Logger as gr, Config as wr, TextParameters as Zn, Flags as ot, NumericParameters as yr, PixelStreaming as mr } from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.2";
|
|
7
7
|
import qn from "html2canvas";
|
|
8
8
|
const Qn = {
|
|
@@ -57,7 +57,7 @@ function xe() {
|
|
|
57
57
|
}), e;
|
|
58
58
|
}
|
|
59
59
|
function Ge(l) {
|
|
60
|
-
const { defaults: e } =
|
|
60
|
+
const { defaults: e } = J, t = xe(), i = {};
|
|
61
61
|
return t.forEach((r) => {
|
|
62
62
|
i[r] = l[r] ?? e[r];
|
|
63
63
|
}), i;
|
|
@@ -312,7 +312,7 @@ const we = async (l, e, t, i, r, n = "default") => {
|
|
|
312
312
|
}).catch((r) => {
|
|
313
313
|
console.error("SetNodeScale:", r);
|
|
314
314
|
});
|
|
315
|
-
},
|
|
315
|
+
}, b = async (l, e) => {
|
|
316
316
|
if (e.mode == "Follow") {
|
|
317
317
|
const i = E.getSceneObject(e.objectId);
|
|
318
318
|
e.objectId = i ? (i.components.main ?? i).id : e.objectId;
|
|
@@ -581,7 +581,7 @@ const we = async (l, e, t, i, r, n = "default") => {
|
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
583
|
return r.error !== "" && console.warn("SaveStringToFile: ", r.error), r;
|
|
584
|
-
},
|
|
584
|
+
}, bs = async function(l, e, t = !0) {
|
|
585
585
|
const i = await l.callUeFunc({
|
|
586
586
|
f: "HighlightActorByTag",
|
|
587
587
|
p: {
|
|
@@ -590,7 +590,7 @@ const we = async (l, e, t, i, r, n = "default") => {
|
|
|
590
590
|
}
|
|
591
591
|
});
|
|
592
592
|
return i.error !== "" && console.warn("HighlightActorByTag: ", i.error), i;
|
|
593
|
-
},
|
|
593
|
+
}, Js = async function(l, e) {
|
|
594
594
|
const t = await l.callUeFunc({
|
|
595
595
|
f: "SendCustomMessage",
|
|
596
596
|
p: { Message: e }
|
|
@@ -696,9 +696,9 @@ class Qs extends Gn {
|
|
|
696
696
|
let n = r.target.result, s = new Uint32Array(n), o = 0;
|
|
697
697
|
if (s[0] === qs.Response) {
|
|
698
698
|
o += 4;
|
|
699
|
-
let
|
|
699
|
+
let h = s[o / 4];
|
|
700
700
|
o += 4;
|
|
701
|
-
for (let a = 0; a <
|
|
701
|
+
for (let a = 0; a < h; a++) {
|
|
702
702
|
let g = s[o / 4];
|
|
703
703
|
o += 4;
|
|
704
704
|
let p = new TextDecoder("utf-8").decode(n.slice(o, o + g));
|
|
@@ -761,9 +761,9 @@ class Os extends m {
|
|
|
761
761
|
}), this._handerPixelStreamEvent(), this._esMsgWsWrapper = this._initEsMsgWsWrapper(s);
|
|
762
762
|
const o = this;
|
|
763
763
|
if (o.esMsgWsWrapper) {
|
|
764
|
-
const
|
|
764
|
+
const h = o.webRtcController.sendMessageController.dataChannelSender.sendData;
|
|
765
765
|
o.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData = function(a) {
|
|
766
|
-
o.esMsgWsWrapper ? o.esMsgWsWrapper.sendInputData(a) :
|
|
766
|
+
o.esMsgWsWrapper ? o.esMsgWsWrapper.sendInputData(a) : h.call(this, a);
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
769
|
}
|
|
@@ -866,9 +866,9 @@ class Os extends m {
|
|
|
866
866
|
this.esMsgWsWrapper.emitDescriptorWithString(Ie.UIInteraction, `${o}-0/1-` + r);
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
869
|
-
const
|
|
870
|
-
[...new Array(
|
|
871
|
-
this.esMsgWsWrapper && this.esMsgWsWrapper.emitDescriptorWithString(Ie.UIInteraction, `${o}-${p}/${
|
|
869
|
+
const h = Math.ceil(s / n) | 0;
|
|
870
|
+
[...new Array(h).keys()].map((g) => r.slice(g * n, (g + 1) * n)).forEach((g, p) => {
|
|
871
|
+
this.esMsgWsWrapper && this.esMsgWsWrapper.emitDescriptorWithString(Ie.UIInteraction, `${o}-${p}/${h}-` + g);
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
874
|
}
|
|
@@ -981,32 +981,32 @@ class to extends Be {
|
|
|
981
981
|
this._esueViewerWrapper = this.dv(new js(t, i, r));
|
|
982
982
|
const o = this._esueViewerWrapper;
|
|
983
983
|
{
|
|
984
|
-
const
|
|
985
|
-
|
|
984
|
+
const u = () => o.debug = s.debug ?? !1;
|
|
985
|
+
u(), this.d(s.debugChanged.don(u));
|
|
986
986
|
}
|
|
987
|
-
let
|
|
987
|
+
let h = !1;
|
|
988
988
|
{
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
989
|
+
const u = () => {
|
|
990
|
+
if (h) return;
|
|
991
991
|
const c = o.webSocketReady;
|
|
992
992
|
if (this.videoinited && this.webRtcConnected && c) {
|
|
993
993
|
console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]", "background: #a6ec99; color: black");
|
|
994
994
|
const f = { eventType: "init", params: {} };
|
|
995
|
-
o.emitUIInteractionForBigData(f), this._readyEvent.emit(),
|
|
995
|
+
o.emitUIInteractionForBigData(f), this._readyEvent.emit(), h = !0;
|
|
996
996
|
}
|
|
997
997
|
};
|
|
998
998
|
this.d(this.videoinitedChanged.don(() => {
|
|
999
|
-
|
|
999
|
+
u();
|
|
1000
1000
|
})), this.d(this.webRtcConnectedChanged.don(() => {
|
|
1001
|
-
|
|
1001
|
+
u();
|
|
1002
1002
|
})), this.d(this.esmsgwsopenChanged.don(() => {
|
|
1003
|
-
|
|
1003
|
+
u();
|
|
1004
1004
|
}));
|
|
1005
1005
|
}
|
|
1006
|
-
this.d(o.event.don((
|
|
1007
|
-
if (
|
|
1006
|
+
this.d(o.event.don((u, c) => {
|
|
1007
|
+
if (u === "error")
|
|
1008
1008
|
this._errorEvent.emit(c);
|
|
1009
|
-
else if (
|
|
1009
|
+
else if (u === "ueevent") {
|
|
1010
1010
|
const f = JSON.parse(c);
|
|
1011
1011
|
if (f.t === "cr") {
|
|
1012
1012
|
const w = f;
|
|
@@ -1014,12 +1014,12 @@ class to extends Be {
|
|
|
1014
1014
|
for (let y of w.ers)
|
|
1015
1015
|
this._ueEvent.emit(y);
|
|
1016
1016
|
}
|
|
1017
|
-
} else
|
|
1017
|
+
} else u === "webRtcConnected" ? this.webRtcConnected = !0 : u === "videoinited" ? this.videoinited = !0 : u === "esmsgwsopen" && (this.esmsgwsopen = !0);
|
|
1018
1018
|
}));
|
|
1019
1019
|
{
|
|
1020
|
-
const
|
|
1020
|
+
const u = this.dv(be());
|
|
1021
1021
|
let c, f;
|
|
1022
|
-
|
|
1022
|
+
u.start(() => {
|
|
1023
1023
|
if (c !== t.offsetWidth || f !== t.offsetHeight) {
|
|
1024
1024
|
if (c = t.offsetWidth, f = t.offsetHeight, c === void 0 || f === void 0 || !Number.isFinite(c) || !Number.isFinite(f) || c < 0 || f < 0) {
|
|
1025
1025
|
console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${c} ${f}`);
|
|
@@ -1029,19 +1029,19 @@ class to extends Be {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
|
-
this.d(this._ueFuncResultWithIdsEvent.don((
|
|
1033
|
-
for (const c of
|
|
1032
|
+
this.d(this._ueFuncResultWithIdsEvent.don((u) => {
|
|
1033
|
+
for (const c of u) {
|
|
1034
1034
|
const f = this._waitingUeFuncIdAndResultCallbacks.get(c.fid);
|
|
1035
1035
|
f && (this._waitingUeFuncIdAndResultCallbacks.delete(c.fid), f.resultCallback(c.r));
|
|
1036
1036
|
}
|
|
1037
1037
|
}));
|
|
1038
1038
|
let a = 0;
|
|
1039
|
-
const g = (
|
|
1039
|
+
const g = (u) => {
|
|
1040
1040
|
const c = {
|
|
1041
1041
|
n: a++,
|
|
1042
1042
|
tt: Date.now(),
|
|
1043
1043
|
t: "c",
|
|
1044
|
-
fs:
|
|
1044
|
+
fs: u
|
|
1045
1045
|
};
|
|
1046
1046
|
this._waitingUeCalls.add(c), s.debug && (console.group(
|
|
1047
1047
|
"%cxe2 => ue",
|
|
@@ -1053,13 +1053,13 @@ class to extends Be {
|
|
|
1053
1053
|
this._waitingUeCalls.delete(c);
|
|
1054
1054
|
});
|
|
1055
1055
|
}, p = () => {
|
|
1056
|
-
if (!
|
|
1057
|
-
const
|
|
1056
|
+
if (!h || this._ueFuncWithIdAndResultCallbacks.length === 0) return;
|
|
1057
|
+
const u = this._ueFuncWithIdAndResultCallbacks.map((([c]) => c));
|
|
1058
1058
|
for (const [c, f] of this._ueFuncWithIdAndResultCallbacks)
|
|
1059
1059
|
this._waitingUeFuncIdAndResultCallbacks.set(c.fid, f);
|
|
1060
1060
|
this._ueFuncWithIdAndResultCallbacks.length = 0;
|
|
1061
1061
|
{
|
|
1062
|
-
const c = window.g_emitDescriptor_maxBytes, f =
|
|
1062
|
+
const c = window.g_emitDescriptor_maxBytes, f = u.map((R) => ({ f: R, s: JSON.stringify(R).length }));
|
|
1063
1063
|
let w = f.length, y = 0, x = 0, C = [];
|
|
1064
1064
|
do {
|
|
1065
1065
|
do {
|
|
@@ -1200,8 +1200,8 @@ class so extends m {
|
|
|
1200
1200
|
const n = (s) => {
|
|
1201
1201
|
const o = this._pixelStream._webRtcController.mouseController;
|
|
1202
1202
|
setTimeout(() => {
|
|
1203
|
-
const
|
|
1204
|
-
g && g([s.button,
|
|
1203
|
+
const h = o.coordinateConverter.normalizeAndQuantizeUnsigned(s.offsetX, s.offsetY), g = o.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");
|
|
1204
|
+
g && g([s.button, h.x, h.y]), s.preventDefault();
|
|
1205
1205
|
});
|
|
1206
1206
|
};
|
|
1207
1207
|
this.container.addEventListener("dblclick", n), this.d(() => {
|
|
@@ -1276,9 +1276,9 @@ class so extends m {
|
|
|
1276
1276
|
this.sendData(JSON.stringify(g));
|
|
1277
1277
|
return;
|
|
1278
1278
|
}
|
|
1279
|
-
const
|
|
1280
|
-
[...new Array(
|
|
1281
|
-
const d = { type: "earthsdk", time: (/* @__PURE__ */ new Date()).getTime(), params: `${o}-${p}/${
|
|
1279
|
+
const h = Math.ceil(s / n) | 0;
|
|
1280
|
+
[...new Array(h).keys()].map((g) => r.slice(g * n, (g + 1) * n)).forEach((g, p) => {
|
|
1281
|
+
const d = { type: "earthsdk", time: (/* @__PURE__ */ new Date()).getTime(), params: `${o}-${p}/${h}-` + g };
|
|
1282
1282
|
this.sendData(JSON.stringify(d));
|
|
1283
1283
|
});
|
|
1284
1284
|
}
|
|
@@ -1386,12 +1386,12 @@ class ao extends Be {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
{
|
|
1388
1388
|
let d = !1;
|
|
1389
|
-
const
|
|
1389
|
+
const u = this.dv(P(
|
|
1390
1390
|
this._videoInitialized.changed,
|
|
1391
1391
|
this._webRtcConnected.changed,
|
|
1392
1392
|
this._webSocketOpen.changed
|
|
1393
1393
|
));
|
|
1394
|
-
this.d(
|
|
1394
|
+
this.d(u.don(() => {
|
|
1395
1395
|
if (d) return;
|
|
1396
1396
|
const c = this._ue5ViewerWrapper.instance.webSocketReady;
|
|
1397
1397
|
if (this.videoInitialized && this.webRtcConnected && c) {
|
|
@@ -1402,9 +1402,9 @@ class ao extends Be {
|
|
|
1402
1402
|
console.warn("webSocketReady", c), d = !1;
|
|
1403
1403
|
}));
|
|
1404
1404
|
}
|
|
1405
|
-
this.d(o.event.don((d,
|
|
1405
|
+
this.d(o.event.don((d, u) => {
|
|
1406
1406
|
if (d === "errorEvent")
|
|
1407
|
-
this._errorEvent.emit(
|
|
1407
|
+
this._errorEvent.emit(u);
|
|
1408
1408
|
else if (d === "videoInitialized")
|
|
1409
1409
|
this._videoInitialized.value = !0;
|
|
1410
1410
|
else if (d === "webRtcConnected")
|
|
@@ -1412,7 +1412,7 @@ class ao extends Be {
|
|
|
1412
1412
|
else if (d === "webSocketOpen")
|
|
1413
1413
|
this._webSocketOpen.value = !0;
|
|
1414
1414
|
else if (d === "ueevent") {
|
|
1415
|
-
const c = JSON.parse(
|
|
1415
|
+
const c = JSON.parse(u);
|
|
1416
1416
|
if (c.t === "cr") {
|
|
1417
1417
|
const f = c;
|
|
1418
1418
|
if (f.frs && this._ueFuncResultWithIdsEvent.emit(f.frs), f.ers)
|
|
@@ -1422,49 +1422,49 @@ class ao extends Be {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
}));
|
|
1424
1424
|
{
|
|
1425
|
-
const d = this.dv(
|
|
1426
|
-
let
|
|
1425
|
+
const d = this.dv(be());
|
|
1426
|
+
let u, c, f;
|
|
1427
1427
|
d.start(() => {
|
|
1428
|
-
if (
|
|
1429
|
-
if (
|
|
1430
|
-
console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${
|
|
1428
|
+
if (u !== t.offsetWidth || c !== t.offsetHeight || f !== s.resolutionScale) {
|
|
1429
|
+
if (u = t.offsetWidth, c = t.offsetHeight, u === void 0 || c === void 0 || !Number.isFinite(u) || !Number.isFinite(c) || u < 0 || c < 0) {
|
|
1430
|
+
console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${u} ${c}`);
|
|
1431
1431
|
return;
|
|
1432
1432
|
}
|
|
1433
|
-
f = s.resolutionScale, o.resize(
|
|
1433
|
+
f = s.resolutionScale, o.resize(u / f, c / f);
|
|
1434
1434
|
}
|
|
1435
1435
|
});
|
|
1436
1436
|
}
|
|
1437
1437
|
this.d(this._ueFuncResultWithIdsEvent.don((d) => {
|
|
1438
|
-
for (const
|
|
1439
|
-
const c = this._waitingUeFuncIdAndResultCallbacks.get(
|
|
1440
|
-
c && (this._waitingUeFuncIdAndResultCallbacks.delete(
|
|
1438
|
+
for (const u of d) {
|
|
1439
|
+
const c = this._waitingUeFuncIdAndResultCallbacks.get(u.fid);
|
|
1440
|
+
c && (this._waitingUeFuncIdAndResultCallbacks.delete(u.fid), c.resultCallback(u.r));
|
|
1441
1441
|
}
|
|
1442
1442
|
}));
|
|
1443
|
-
let
|
|
1443
|
+
let h = 0;
|
|
1444
1444
|
const a = (d) => {
|
|
1445
|
-
const
|
|
1446
|
-
n:
|
|
1445
|
+
const u = {
|
|
1446
|
+
n: h++,
|
|
1447
1447
|
tt: Date.now(),
|
|
1448
1448
|
t: "c",
|
|
1449
1449
|
fs: d
|
|
1450
1450
|
};
|
|
1451
|
-
this._waitingUeCalls.add(
|
|
1451
|
+
this._waitingUeCalls.add(u), s.debug && (console.group(
|
|
1452
1452
|
"%cxe2 => ue",
|
|
1453
1453
|
" background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"
|
|
1454
1454
|
), console.log(
|
|
1455
|
-
`%c${JSON.stringify(
|
|
1455
|
+
`%c${JSON.stringify(u, void 0, "")}`,
|
|
1456
1456
|
" border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"
|
|
1457
|
-
), console.groupEnd()), this._ue5ViewerWrapper.emitUIInteractionForBigData(
|
|
1458
|
-
this._waitingUeCalls.delete(
|
|
1457
|
+
), console.groupEnd()), this._ue5ViewerWrapper.emitUIInteractionForBigData(u, () => {
|
|
1458
|
+
this._waitingUeCalls.delete(u);
|
|
1459
1459
|
});
|
|
1460
1460
|
}, g = () => {
|
|
1461
1461
|
if (!this._ue5ViewerWrapper.instance.webSocketReady || this._ueFuncWithIdAndResultCallbacks.length === 0) return;
|
|
1462
|
-
const
|
|
1462
|
+
const u = this._ueFuncWithIdAndResultCallbacks.map((([c]) => c));
|
|
1463
1463
|
for (const [c, f] of this._ueFuncWithIdAndResultCallbacks)
|
|
1464
1464
|
this._waitingUeFuncIdAndResultCallbacks.set(c.fid, f);
|
|
1465
1465
|
this._ueFuncWithIdAndResultCallbacks.length = 0;
|
|
1466
1466
|
{
|
|
1467
|
-
const c = window.g_emitDescriptor_maxBytes, f =
|
|
1467
|
+
const c = window.g_emitDescriptor_maxBytes, f = u.map((R) => ({ f: R, s: JSON.stringify(R).length }));
|
|
1468
1468
|
let w = f.length, y = 0, x = 0, C = [];
|
|
1469
1469
|
do {
|
|
1470
1470
|
do {
|
|
@@ -1549,8 +1549,8 @@ class lo extends m {
|
|
|
1549
1549
|
this._vIframe = o, o.style.cssText = "width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;", t.appendChild(o), this.d(() => {
|
|
1550
1550
|
o && t.removeChild(o);
|
|
1551
1551
|
});
|
|
1552
|
-
const
|
|
1553
|
-
o.src =
|
|
1552
|
+
const h = E.getStrFromEnv(r + `/web/${i}.html`);
|
|
1553
|
+
o.src = h, o.onload = () => {
|
|
1554
1554
|
const a = o.contentWindow;
|
|
1555
1555
|
if (!a) {
|
|
1556
1556
|
console.error("iframeWindow is null");
|
|
@@ -1587,8 +1587,8 @@ const Ze = typeof TextDecoder < "u" ? new TextDecoder() : void 0, co = (l, e = 0
|
|
|
1587
1587
|
n += String.fromCharCode((s & 31) << 6 | o);
|
|
1588
1588
|
continue;
|
|
1589
1589
|
}
|
|
1590
|
-
var
|
|
1591
|
-
if ((s & 240) == 224 ? s = (s & 15) << 12 | o << 6 |
|
|
1590
|
+
var h = l[e++] & 63;
|
|
1591
|
+
if ((s & 240) == 224 ? s = (s & 15) << 12 | o << 6 | h : ((s & 248) != 240 && console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), s = (s & 7) << 18 | o << 12 | h << 6 | l[e++] & 63), s < 65536)
|
|
1592
1592
|
n += String.fromCharCode(s);
|
|
1593
1593
|
else {
|
|
1594
1594
|
var a = s - 65536;
|
|
@@ -1602,13 +1602,13 @@ class uo extends m {
|
|
|
1602
1602
|
super();
|
|
1603
1603
|
{
|
|
1604
1604
|
const r = () => {
|
|
1605
|
-
const
|
|
1606
|
-
t.setGlobalProperty(
|
|
1605
|
+
const h = Ge(t);
|
|
1606
|
+
t.setGlobalProperty(h);
|
|
1607
1607
|
};
|
|
1608
1608
|
r();
|
|
1609
1609
|
const n = xe(), s = [];
|
|
1610
|
-
n.forEach((
|
|
1611
|
-
const a = t[
|
|
1610
|
+
n.forEach((h) => {
|
|
1611
|
+
const a = t[h + "Changed"];
|
|
1612
1612
|
s.push(a);
|
|
1613
1613
|
});
|
|
1614
1614
|
const o = this.dv(P(...s));
|
|
@@ -1624,13 +1624,13 @@ class uo extends m {
|
|
|
1624
1624
|
} catch (n) {
|
|
1625
1625
|
console.error("ueViewer propChanged:" + n);
|
|
1626
1626
|
}
|
|
1627
|
-
})), t.useCustomInteraction = !1, this.dv(new hr(t, e)), this.dv(new L(t.statusUpdateIntervalChanged, (r) => {
|
|
1627
|
+
})), t.useCustomInteraction = !1, this.dv(new hr(t, e)), this.dv(new L(t.statusUpdateIntervalChanged, ((r) => {
|
|
1628
1628
|
if ((t.statusUpdateInterval ?? 0.5) === 0) return;
|
|
1629
1629
|
const s = new m();
|
|
1630
1630
|
return s.d(i.disposableOnUeEvent("statusUpdate", (o) => {
|
|
1631
1631
|
t.statusUpdateEvent.emit(o);
|
|
1632
1632
|
})), s;
|
|
1633
|
-
})), this.dv(new L(t.propChangedListeningChanged, () => {
|
|
1633
|
+
}))), this.dv(new L(t.propChangedListeningChanged, () => {
|
|
1634
1634
|
if (!(t.propChangedListening ?? !0)) return;
|
|
1635
1635
|
const n = new m();
|
|
1636
1636
|
return n.d(i.disposableOnUeEvent("propChanged", (s) => {
|
|
@@ -1665,8 +1665,8 @@ class uo extends m {
|
|
|
1665
1665
|
const n = new m();
|
|
1666
1666
|
return n.d(i.disposableOnUeEvent("editingEvent", (s) => {
|
|
1667
1667
|
s.objectIDs = s.objectIDs.map((o) => {
|
|
1668
|
-
var
|
|
1669
|
-
return ((
|
|
1668
|
+
var h;
|
|
1669
|
+
return ((h = E.getSceneObjById(o)) == null ? void 0 : h.parentID) ?? o;
|
|
1670
1670
|
}), t.editingEvent.emit(s);
|
|
1671
1671
|
})), n;
|
|
1672
1672
|
})), this.ad(i.disposableOnUeEvent("cameraChanged", () => {
|
|
@@ -1694,10 +1694,10 @@ class po extends Be {
|
|
|
1694
1694
|
v(this, "_ueEvent", this.dv(new S()));
|
|
1695
1695
|
this._ueViewer = n;
|
|
1696
1696
|
const s = this._ueViewer, o = this.dv(new lo(t, i, r, s));
|
|
1697
|
-
let
|
|
1697
|
+
let h = !1, a = null;
|
|
1698
1698
|
this.d(o.onRuntimeInitialized.don(() => {
|
|
1699
|
-
var
|
|
1700
|
-
if (
|
|
1699
|
+
var u;
|
|
1700
|
+
if (h = !0, (u = o == null ? void 0 : o.vIframe) != null && u.contentWindow) {
|
|
1701
1701
|
a = o.vIframe.contentWindow;
|
|
1702
1702
|
const c = o.vIframe.contentWindow.document.getElementById("mainarea");
|
|
1703
1703
|
c ? this.dv(new uo(c, s, this)) : console.error("h5Container is null");
|
|
@@ -1725,16 +1725,16 @@ class po extends Be {
|
|
|
1725
1725
|
console.error("UE_JSHTML5Communication.UESendMessageToJS error:", f);
|
|
1726
1726
|
}
|
|
1727
1727
|
} : console.error("UE_JSHTML5Communication UESendMessageToJS not found");
|
|
1728
|
-
})), this.dispose(this._ueFuncResultWithIdsEvent.disposableOn((
|
|
1729
|
-
for (const c of
|
|
1728
|
+
})), this.dispose(this._ueFuncResultWithIdsEvent.disposableOn((u) => {
|
|
1729
|
+
for (const c of u) {
|
|
1730
1730
|
const f = this._waitingUeFuncIdAndResultCallbacks.get(c.fid);
|
|
1731
1731
|
f && (this._waitingUeFuncIdAndResultCallbacks.delete(c.fid), f(c.r));
|
|
1732
1732
|
}
|
|
1733
1733
|
}));
|
|
1734
1734
|
let g = 0;
|
|
1735
1735
|
const p = () => {
|
|
1736
|
-
if (!
|
|
1737
|
-
const
|
|
1736
|
+
if (!h || !a || !a.UE_JSHTML5Communication || !a.UE_JSHTML5Communication.JSSendMessageToUE || this._ueFuncWithIdAndResultCallbacks.length === 0) return;
|
|
1737
|
+
const u = this._ueFuncWithIdAndResultCallbacks.map((([T]) => T)), c = { n: g++, tt: Date.now(), t: "c", fs: u, callid: _() };
|
|
1738
1738
|
for (const [T, B] of this._ueFuncWithIdAndResultCallbacks)
|
|
1739
1739
|
this._waitingUeFuncIdAndResultCallbacks.set(T.fid, B);
|
|
1740
1740
|
this._ueFuncWithIdAndResultCallbacks.length = 0, this._waitingUeCalls.set(c.callid, c), s.debug && (console.group(
|
|
@@ -1824,9 +1824,9 @@ class fo extends Be {
|
|
|
1824
1824
|
try {
|
|
1825
1825
|
const d = JSON.parse(p);
|
|
1826
1826
|
if (d.t === "cr") {
|
|
1827
|
-
const
|
|
1828
|
-
if (
|
|
1829
|
-
for (let c of
|
|
1827
|
+
const u = d;
|
|
1828
|
+
if (u.frs && this._ueFuncResultWithIdsEvent.emit(u.frs), u.ers)
|
|
1829
|
+
for (let c of u.ers)
|
|
1830
1830
|
this._ueEvent.emit(c);
|
|
1831
1831
|
}
|
|
1832
1832
|
} catch (d) {
|
|
@@ -1839,16 +1839,16 @@ class fo extends Be {
|
|
|
1839
1839
|
}
|
|
1840
1840
|
}));
|
|
1841
1841
|
let o = 0;
|
|
1842
|
-
const
|
|
1842
|
+
const h = () => {
|
|
1843
1843
|
if (!n || this._ueFuncWithIdAndResultCallbacks.length === 0) return;
|
|
1844
|
-
const g = this._ueFuncWithIdAndResultCallbacks.map(([
|
|
1844
|
+
const g = this._ueFuncWithIdAndResultCallbacks.map((([u]) => u)), p = {
|
|
1845
1845
|
n: o++,
|
|
1846
1846
|
tt: Date.now(),
|
|
1847
1847
|
t: "c",
|
|
1848
1848
|
fs: g
|
|
1849
1849
|
};
|
|
1850
|
-
for (const [
|
|
1851
|
-
this._waitingUeFuncIdAndResultCallbacks.set(
|
|
1850
|
+
for (const [u, c] of this._ueFuncWithIdAndResultCallbacks)
|
|
1851
|
+
this._waitingUeFuncIdAndResultCallbacks.set(u.fid, c);
|
|
1852
1852
|
this._ueFuncWithIdAndResultCallbacks.length = 0, this._waitingUeCalls.add(p), r.debug && (console.group(
|
|
1853
1853
|
"%cxe2 => ue",
|
|
1854
1854
|
" background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"
|
|
@@ -1861,7 +1861,7 @@ class fo extends Be {
|
|
|
1861
1861
|
this._waitingUeCalls.delete(p);
|
|
1862
1862
|
});
|
|
1863
1863
|
};
|
|
1864
|
-
this.dv(Se()).start(
|
|
1864
|
+
this.dv(Se()).start(h, 50);
|
|
1865
1865
|
}
|
|
1866
1866
|
callUeFunc(t) {
|
|
1867
1867
|
return new Promise((i) => {
|
|
@@ -1904,8 +1904,8 @@ class go extends m {
|
|
|
1904
1904
|
i();
|
|
1905
1905
|
const r = xe(), n = [];
|
|
1906
1906
|
r.forEach((o) => {
|
|
1907
|
-
const
|
|
1908
|
-
n.push(
|
|
1907
|
+
const h = e[o + "Changed"];
|
|
1908
|
+
n.push(h);
|
|
1909
1909
|
});
|
|
1910
1910
|
const s = this.dv(P(...n));
|
|
1911
1911
|
this.d(s.don(i));
|
|
@@ -1920,13 +1920,13 @@ class go extends m {
|
|
|
1920
1920
|
} catch (r) {
|
|
1921
1921
|
console.error("ueViewer propChanged:" + r);
|
|
1922
1922
|
}
|
|
1923
|
-
})), this.dv(new L(e.statusUpdateIntervalChanged, (i) => {
|
|
1923
|
+
})), this.dv(new L(e.statusUpdateIntervalChanged, ((i) => {
|
|
1924
1924
|
if ((e.statusUpdateInterval ?? 0.5) === 0) return;
|
|
1925
1925
|
const n = new m();
|
|
1926
1926
|
return n.d(t.disposableOnUeEvent("statusUpdate", (s) => {
|
|
1927
1927
|
e.statusUpdateEvent.emit(s);
|
|
1928
1928
|
})), n;
|
|
1929
|
-
})), this.dv(new L(e.propChangedListeningChanged, () => {
|
|
1929
|
+
}))), this.dv(new L(e.propChangedListeningChanged, () => {
|
|
1930
1930
|
if (!(e.propChangedListening ?? !0)) return;
|
|
1931
1931
|
const r = new m();
|
|
1932
1932
|
return r.d(t.disposableOnUeEvent("propChanged", (n) => {
|
|
@@ -1984,8 +1984,8 @@ class wo extends m {
|
|
|
1984
1984
|
const g = t[a + "Changed"];
|
|
1985
1985
|
o.push(g);
|
|
1986
1986
|
});
|
|
1987
|
-
const
|
|
1988
|
-
this.d(
|
|
1987
|
+
const h = this.dv(P(...o));
|
|
1988
|
+
this.d(h.don(n));
|
|
1989
1989
|
}
|
|
1990
1990
|
this.d(t.propChanged.don((n) => {
|
|
1991
1991
|
if (n.objId === "")
|
|
@@ -2009,20 +2009,20 @@ class wo extends m {
|
|
|
2009
2009
|
n(a, !1);
|
|
2010
2010
|
}, o = (a) => {
|
|
2011
2011
|
n(a, !0);
|
|
2012
|
-
},
|
|
2012
|
+
}, h = (a) => {
|
|
2013
2013
|
n(a, !1);
|
|
2014
2014
|
};
|
|
2015
|
-
r.addEventListener("mouseenter", s), r.addEventListener("mouseleave", o), r.addEventListener("mousemove",
|
|
2016
|
-
r.removeEventListener("mouseenter", s), r.removeEventListener("mouseleave", o), r.removeEventListener("mousemove",
|
|
2015
|
+
r.addEventListener("mouseenter", s), r.addEventListener("mouseleave", o), r.addEventListener("mousemove", h), this.d(() => {
|
|
2016
|
+
r.removeEventListener("mouseenter", s), r.removeEventListener("mouseleave", o), r.removeEventListener("mousemove", h);
|
|
2017
2017
|
});
|
|
2018
2018
|
}
|
|
2019
|
-
t.useCustomInteraction = !1, this.dv(new hr(t, r)), this.dv(new L(t.statusUpdateIntervalChanged, (n) => {
|
|
2019
|
+
t.useCustomInteraction = !1, this.dv(new hr(t, r)), this.dv(new L(t.statusUpdateIntervalChanged, ((n) => {
|
|
2020
2020
|
if ((t.statusUpdateInterval ?? 0.5) === 0) return;
|
|
2021
2021
|
const o = new m();
|
|
2022
|
-
return o.d(i.disposableOnUeEvent("statusUpdate", (
|
|
2023
|
-
t.statusUpdateEvent.emit(
|
|
2022
|
+
return o.d(i.disposableOnUeEvent("statusUpdate", (h) => {
|
|
2023
|
+
t.statusUpdateEvent.emit(h);
|
|
2024
2024
|
})), o;
|
|
2025
|
-
})), this.dv(new L(t.propChangedListeningChanged, () => {
|
|
2025
|
+
}))), this.dv(new L(t.propChangedListeningChanged, () => {
|
|
2026
2026
|
if (!(t.propChangedListening ?? !0)) return;
|
|
2027
2027
|
const s = new m();
|
|
2028
2028
|
return s.d(i.disposableOnUeEvent("propChanged", (o) => {
|
|
@@ -2056,9 +2056,9 @@ class wo extends m {
|
|
|
2056
2056
|
if (!(t.editingEventListening ?? !0)) return;
|
|
2057
2057
|
const s = new m();
|
|
2058
2058
|
return s.d(i.disposableOnUeEvent("editingEvent", (o) => {
|
|
2059
|
-
o.objectIDs = o.objectIDs.map((
|
|
2059
|
+
o.objectIDs = o.objectIDs.map((h) => {
|
|
2060
2060
|
var a;
|
|
2061
|
-
return ((a = E.getSceneObjById(
|
|
2061
|
+
return ((a = E.getSceneObjById(h)) == null ? void 0 : a.parentID) ?? h;
|
|
2062
2062
|
}), t.editingEvent.emit(o);
|
|
2063
2063
|
})), s;
|
|
2064
2064
|
})), this.ad(i.disposableOnUeEvent("cameraChanged", () => {
|
|
@@ -2095,7 +2095,7 @@ class yo extends m {
|
|
|
2095
2095
|
this.d(() => {
|
|
2096
2096
|
r.setStatus("Raw"), r.setStatusLog(""), t && p && t.removeChild(p) && (p = void 0);
|
|
2097
2097
|
});
|
|
2098
|
-
const d = this.dv(Te(async (
|
|
2098
|
+
const d = this.dv(Te(async (u) => {
|
|
2099
2099
|
r.viewer && !r.viewer.isDestroyed() && r.viewer.destroy(), r.viewer = void 0, p && t.removeChild(p) && (p = void 0), p = document.createElement("div"), p.setAttribute("earthsdk3-ue", "earthsdk3-ue-videoContainer"), p.style.cssText = "position:relative; height: 100%;width:100%;", t.appendChild(p);
|
|
2100
2100
|
let c, f, w;
|
|
2101
2101
|
if (n(i.options, "ws")) {
|
|
@@ -2108,7 +2108,7 @@ class yo extends m {
|
|
|
2108
2108
|
B.endsWith("/") || (B += "/");
|
|
2109
2109
|
const Tr = Xe ? `?essstoken=${Xe}` : "", Ye = `/${_e}/${R ?? 1920}/${T ?? 1080}` + Tr;
|
|
2110
2110
|
console.log(`请求信令服务器: ${B}instance${Ye}`);
|
|
2111
|
-
const xr = await
|
|
2111
|
+
const xr = await u.promise(fetch(`${B}instance${Ye}`, { method: "GET" })), V = await u.promise(xr.json());
|
|
2112
2112
|
if (V && V.status !== "ok") {
|
|
2113
2113
|
r.setStatus("Error"), r.setStatusLog(`信令服务器请求失败 ${V.status}`), this._reconnectEvent.emit(void 0);
|
|
2114
2114
|
return;
|
|
@@ -2126,21 +2126,21 @@ class yo extends m {
|
|
|
2126
2126
|
this.d(() => r.viewer = void 0), this.d(y.errorEvent.don((R) => {
|
|
2127
2127
|
const T = `[${R}]:像素流连接错误!`;
|
|
2128
2128
|
r.setStatus("Error"), r.setStatusLog(T), this._reconnectEvent.emit(y);
|
|
2129
|
-
})), await
|
|
2129
|
+
})), await u.promise(new Promise((R) => this.d(y.readyEvent.donce(R)))), r.setStatus("Created"), r.setStatusLog("云渲染视口创建成功!"), s = 0, o && clearTimeout(o), o = void 0;
|
|
2130
2130
|
const { offsetWidth: x, offsetHeight: C } = p;
|
|
2131
2131
|
y.resize(x * window.devicePixelRatio, C * window.devicePixelRatio), r.viewer = y, this.d(() => r.viewer = void 0), this.dv(new go(r, y));
|
|
2132
2132
|
}));
|
|
2133
|
-
d.start(), this.d(this._reconnectEvent.don((
|
|
2134
|
-
o === void 0 && (
|
|
2133
|
+
d.start(), this.d(this._reconnectEvent.don((u) => {
|
|
2134
|
+
o === void 0 && (u && !u.isDestroyed() && u.destroy(), r.viewer && !r.viewer.isDestroyed() && r.viewer.destroy(), r.viewer = void 0, r.autoReconnect && (r.setStatus("Reconnecting"), r.setStatusLog("正在尝试重新连接..."), s = s + 5e3 > 3e4 ? 3e4 : s + 5e3, console.warn(`间隔:${s / 1e3}s,正在尝试重新连接...`), o = window.setTimeout(() => {
|
|
2135
2135
|
d.restart();
|
|
2136
2136
|
}, s)));
|
|
2137
|
-
})), this.d(d.errorEvent.don((
|
|
2138
|
-
r.setStatus("Error"), r.setStatusLog("云渲染视口创建失败!"), console.warn("云渲染视口创建失败!",
|
|
2137
|
+
})), this.d(d.errorEvent.don((u) => {
|
|
2138
|
+
r.setStatus("Error"), r.setStatusLog("云渲染视口创建失败!"), console.warn("云渲染视口创建失败!", u), this._reconnectEvent.emit(void 0);
|
|
2139
2139
|
}));
|
|
2140
2140
|
} else if (n(i.options, "project")) {
|
|
2141
|
-
const p = i, d = p.options.project,
|
|
2141
|
+
const p = i, d = p.options.project, u = p.options.baseUrl;
|
|
2142
2142
|
r.setStatus("Creating"), r.setStatusLog("下载编译中...");
|
|
2143
|
-
const c = this.dv(new po(t, d,
|
|
2143
|
+
const c = this.dv(new po(t, d, u, r));
|
|
2144
2144
|
r.viewer = c, this.d(() => r.viewer = void 0);
|
|
2145
2145
|
} else
|
|
2146
2146
|
r.setStatus("Error"), r.setStatusLog("视口创建失败!"), console.warn("视口创建失败: 参数错误!");
|
|
@@ -2218,7 +2218,7 @@ const K = class K extends Ee {
|
|
|
2218
2218
|
console.warn("ChangeNavigationMode: viewer is undefined");
|
|
2219
2219
|
return;
|
|
2220
2220
|
}
|
|
2221
|
-
const i = await
|
|
2221
|
+
const i = await b(this.viewer, t);
|
|
2222
2222
|
return i && !i.error && (this._navigationMode.value = t.mode), i;
|
|
2223
2223
|
}
|
|
2224
2224
|
async resetWithCurrentCamera(t) {
|
|
@@ -2432,14 +2432,14 @@ const K = class K extends Ee {
|
|
|
2432
2432
|
console.warn("HighlightActorByTag: viewer is undefined");
|
|
2433
2433
|
return;
|
|
2434
2434
|
}
|
|
2435
|
-
return await
|
|
2435
|
+
return await bs(this.viewer, t, i);
|
|
2436
2436
|
}
|
|
2437
2437
|
async sendCustomMessage(t) {
|
|
2438
2438
|
if (!this.viewer) {
|
|
2439
2439
|
console.warn("SendCustomMessage: viewer is undefined");
|
|
2440
2440
|
return;
|
|
2441
2441
|
}
|
|
2442
|
-
return await
|
|
2442
|
+
return await Js(this.viewer, t);
|
|
2443
2443
|
}
|
|
2444
2444
|
async getStatus() {
|
|
2445
2445
|
if (!this.viewer) {
|
|
@@ -2464,8 +2464,8 @@ const K = class K extends Ee {
|
|
|
2464
2464
|
if (!this.viewer) return;
|
|
2465
2465
|
let n = t;
|
|
2466
2466
|
if (t && window.ue && this.container) {
|
|
2467
|
-
const [s, o] = t, { x:
|
|
2468
|
-
n = [
|
|
2467
|
+
const [s, o] = t, { x: h, y: a } = this.container.getBoundingClientRect();
|
|
2468
|
+
n = [h + s, a + o];
|
|
2469
2469
|
}
|
|
2470
2470
|
return await hs(this.viewer, n, i, r);
|
|
2471
2471
|
}
|
|
@@ -2504,8 +2504,8 @@ const K = class K extends Ee {
|
|
|
2504
2504
|
[t[2], t[1], 0]
|
|
2505
2505
|
], s = _r(n);
|
|
2506
2506
|
if (!s) return;
|
|
2507
|
-
const { center: o, radius:
|
|
2508
|
-
distance: i ??
|
|
2507
|
+
const { center: o, radius: h } = s, a = {
|
|
2508
|
+
distance: i ?? h,
|
|
2509
2509
|
heading: 0,
|
|
2510
2510
|
pitch: -90,
|
|
2511
2511
|
flyDuration: r,
|
|
@@ -2536,7 +2536,7 @@ const K = class K extends Ee {
|
|
|
2536
2536
|
*/
|
|
2537
2537
|
async changeToWalk(t, i = 4.2, r = 1.6) {
|
|
2538
2538
|
if (!this.viewer) return;
|
|
2539
|
-
const n = { mode: "Walk", position: t, jumpZVelocity: i, eyeHeight: r }, s = await
|
|
2539
|
+
const n = { mode: "Walk", position: t, jumpZVelocity: i, eyeHeight: r }, s = await b(this.viewer, n);
|
|
2540
2540
|
return s && !s.error && (this._navigationMode.value = n.mode), s;
|
|
2541
2541
|
}
|
|
2542
2542
|
/**
|
|
@@ -2545,7 +2545,7 @@ const K = class K extends Ee {
|
|
|
2545
2545
|
*/
|
|
2546
2546
|
async changeToMap() {
|
|
2547
2547
|
if (!this.viewer) return;
|
|
2548
|
-
const t = { mode: "Map" }, i = await
|
|
2548
|
+
const t = { mode: "Map" }, i = await b(this.viewer, t);
|
|
2549
2549
|
return i && !i.error && (this._navigationMode.value = t.mode), i;
|
|
2550
2550
|
}
|
|
2551
2551
|
/**
|
|
@@ -2557,7 +2557,7 @@ const K = class K extends Ee {
|
|
|
2557
2557
|
*/
|
|
2558
2558
|
async changeToRotateGlobe(t = 38, i = 1e7, r = 60) {
|
|
2559
2559
|
if (!this.viewer) return;
|
|
2560
|
-
const n = { mode: "RotateGlobe", latitude: t, height: i, cycleTime: r }, s = await
|
|
2560
|
+
const n = { mode: "RotateGlobe", latitude: t, height: i, cycleTime: r }, s = await b(this.viewer, n);
|
|
2561
2561
|
return s && !s.error && (this._navigationMode.value = n.mode), s;
|
|
2562
2562
|
}
|
|
2563
2563
|
/**
|
|
@@ -2572,8 +2572,8 @@ const K = class K extends Ee {
|
|
|
2572
2572
|
*/
|
|
2573
2573
|
async changeToLine(t, i = 10, r = 10, n = !0, s = 10, o = "auto") {
|
|
2574
2574
|
if (!this.viewer) return;
|
|
2575
|
-
const
|
|
2576
|
-
return a && !a.error && (this._navigationMode.value =
|
|
2575
|
+
const h = { mode: "Line", geoLineStringId: t, speed: i, heightOffset: r, loop: n, turnRateDPS: s, lineMode: o }, a = await b(this.viewer, h);
|
|
2576
|
+
return a && !a.error && (this._navigationMode.value = h.mode), a;
|
|
2577
2577
|
}
|
|
2578
2578
|
/**
|
|
2579
2579
|
* 切换导航模式为“UserDefined” 仅UE支持。
|
|
@@ -2582,7 +2582,7 @@ const K = class K extends Ee {
|
|
|
2582
2582
|
*/
|
|
2583
2583
|
async changeToUserDefined(t) {
|
|
2584
2584
|
if (!this.viewer) return;
|
|
2585
|
-
const i = { mode: "UserDefined", userDefinedPawn: t }, r = await
|
|
2585
|
+
const i = { mode: "UserDefined", userDefinedPawn: t }, r = await b(this.viewer, i);
|
|
2586
2586
|
return r && !r.error && (this._navigationMode.value = i.mode), r;
|
|
2587
2587
|
}
|
|
2588
2588
|
/**
|
|
@@ -2602,8 +2602,8 @@ const K = class K extends Ee {
|
|
|
2602
2602
|
orbitPeriod: r,
|
|
2603
2603
|
heading: n,
|
|
2604
2604
|
pitch: s
|
|
2605
|
-
},
|
|
2606
|
-
return
|
|
2605
|
+
}, h = await b(this.viewer, o);
|
|
2606
|
+
return h && !h.error && (this._navigationMode.value = o.mode), h;
|
|
2607
2607
|
}
|
|
2608
2608
|
/**
|
|
2609
2609
|
* 切换导航模式为“Follow”(跟随)跟随模式。 此模式允许视角跟随ES对象。
|
|
@@ -2614,8 +2614,8 @@ const K = class K extends Ee {
|
|
|
2614
2614
|
*/
|
|
2615
2615
|
async changeToFollow(t, i = 0, r = 0, n = -30, s = !0) {
|
|
2616
2616
|
if (!this.viewer) return;
|
|
2617
|
-
const o = { mode: "Follow", objectId: t, distance: i, heading: r, pitch: n, relativeRotation: s },
|
|
2618
|
-
return
|
|
2617
|
+
const o = { mode: "Follow", objectId: t, distance: i, heading: r, pitch: n, relativeRotation: s }, h = await b(this.viewer, o);
|
|
2618
|
+
return h && !h.error && (this._navigationMode.value = o.mode), h;
|
|
2619
2619
|
}
|
|
2620
2620
|
getFPS() {
|
|
2621
2621
|
return this._statusInfo.fps;
|
|
@@ -2677,7 +2677,7 @@ const K = class K extends Ee {
|
|
|
2677
2677
|
}
|
|
2678
2678
|
};
|
|
2679
2679
|
v(K, "type", K.register("ESUeViewer", K)), v(K, "defaults", { ...Qn });
|
|
2680
|
-
let
|
|
2680
|
+
let J = K;
|
|
2681
2681
|
((l) => {
|
|
2682
2682
|
l.createDefaultProps = () => ({
|
|
2683
2683
|
...Ee.createDefaultProps(),
|
|
@@ -2696,57 +2696,56 @@ let b = K;
|
|
|
2696
2696
|
speechRecognitionListening: void 0,
|
|
2697
2697
|
customMessageListening: void 0
|
|
2698
2698
|
});
|
|
2699
|
-
})(
|
|
2700
|
-
Xn(
|
|
2699
|
+
})(J || (J = {}));
|
|
2700
|
+
Xn(J.prototype, J.createDefaultProps);
|
|
2701
2701
|
class at extends G {
|
|
2702
2702
|
constructor(e, t) {
|
|
2703
2703
|
super(e, t);
|
|
2704
2704
|
const i = t.viewer;
|
|
2705
|
-
if (i
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
const
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
const f =
|
|
2713
|
-
|
|
2705
|
+
if (!i) return;
|
|
2706
|
+
const r = this.ad(W(!1));
|
|
2707
|
+
e.components.main || this.d(this.createdEvent.don(() => {
|
|
2708
|
+
const n = this.constructor.propValFuncs, s = e.defaultProps, o = Object.keys(s).filter((u) => n[u] !== null);
|
|
2709
|
+
o.push(...this.constructor.forceUeUpdateProps);
|
|
2710
|
+
const h = e.constructor.defaults, a = { val: {} }, g = [];
|
|
2711
|
+
for (let u of o) {
|
|
2712
|
+
const c = u + "Changed", f = e[c];
|
|
2713
|
+
g.push(f);
|
|
2714
|
+
const w = n[u];
|
|
2715
|
+
if (w === null)
|
|
2714
2716
|
throw console.error("vf === null error"), new Error("vf === null error");
|
|
2715
|
-
const
|
|
2716
|
-
const
|
|
2717
|
-
let
|
|
2718
|
-
if (
|
|
2719
|
-
console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${
|
|
2717
|
+
const y = () => {
|
|
2718
|
+
const x = e[u] ?? h[u] ?? e.constructor[`default${u.charAt(0).toUpperCase() + u.slice(1)}`];
|
|
2719
|
+
let C = w ? w(x, this, t, e) : x;
|
|
2720
|
+
if (C === void 0) {
|
|
2721
|
+
console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${u} 对象名:${e.name} 对象id: ${e.id}`);
|
|
2720
2722
|
return;
|
|
2721
2723
|
}
|
|
2722
|
-
|
|
2724
|
+
a.val[u] = C;
|
|
2723
2725
|
};
|
|
2724
|
-
|
|
2726
|
+
y(), this.d(f.don(y));
|
|
2725
2727
|
}
|
|
2726
|
-
const
|
|
2728
|
+
const p = () => {
|
|
2727
2729
|
i.callUeFunc({
|
|
2728
2730
|
f: "update",
|
|
2729
2731
|
p: {
|
|
2730
2732
|
id: e.id,
|
|
2731
|
-
...
|
|
2733
|
+
...a.val
|
|
2732
2734
|
}
|
|
2733
|
-
}),
|
|
2734
|
-
},
|
|
2735
|
-
this.d(
|
|
2736
|
-
})),
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
r = !0;
|
|
2748
|
-
}).catch((n) => console.error(n));
|
|
2749
|
-
}
|
|
2735
|
+
}), a.val = {};
|
|
2736
|
+
}, d = this.dv(P(...g));
|
|
2737
|
+
this.d(d.don(p)), this.d(r.changed.don(p)), this.d(e.flushEvent.don(() => d.flush()));
|
|
2738
|
+
})), e.components.main || (this.d(() => {
|
|
2739
|
+
r.value && Fr(i, e.id);
|
|
2740
|
+
}), i.callUeFunc({
|
|
2741
|
+
f: "create",
|
|
2742
|
+
p: {
|
|
2743
|
+
type: e.typeName,
|
|
2744
|
+
id: e.id
|
|
2745
|
+
}
|
|
2746
|
+
}).then(() => {
|
|
2747
|
+
r.value = !0;
|
|
2748
|
+
}).catch((n) => console.error(n)));
|
|
2750
2749
|
}
|
|
2751
2750
|
}
|
|
2752
2751
|
// null 表示不设置,undefined表示不做任何转换
|
|
@@ -2803,59 +2802,59 @@ class I extends M {
|
|
|
2803
2802
|
));
|
|
2804
2803
|
this.d(n.don(() => {
|
|
2805
2804
|
setTimeout(r, 0);
|
|
2806
|
-
})), this.d(e.smoothMoveEvent.don((
|
|
2807
|
-
De(i, e.id,
|
|
2808
|
-
})), this.d(e.smoothMoveWithRotationEvent.don((
|
|
2809
|
-
Le(i, e.id,
|
|
2810
|
-
})), this.d(e.smoothMoveOnGroundEvent.don((
|
|
2811
|
-
Pe(i, e.id,
|
|
2812
|
-
})), this.d(e.smoothMoveWithRotationOnGroundEvent.don((
|
|
2813
|
-
ke(i, e.id,
|
|
2814
|
-
})), this.d(e.smoothMoveKeepPitchEvent.don(async (
|
|
2805
|
+
})), this.d(e.smoothMoveEvent.don((h, a) => {
|
|
2806
|
+
De(i, e.id, h, a);
|
|
2807
|
+
})), this.d(e.smoothMoveWithRotationEvent.don((h, a, g) => {
|
|
2808
|
+
Le(i, e.id, h, a, g);
|
|
2809
|
+
})), this.d(e.smoothMoveOnGroundEvent.don((h, a, g, p) => {
|
|
2810
|
+
Pe(i, e.id, h, a, p, g);
|
|
2811
|
+
})), this.d(e.smoothMoveWithRotationOnGroundEvent.don((h, a, g, p, d) => {
|
|
2812
|
+
ke(i, e.id, h, a, g, p, d);
|
|
2813
|
+
})), this.d(e.smoothMoveKeepPitchEvent.don(async (h, a) => {
|
|
2815
2814
|
const g = await i.callUeFunc({
|
|
2816
2815
|
f: "SmoothMoveKeepPitch",
|
|
2817
2816
|
p: {
|
|
2818
2817
|
id: e.id,
|
|
2819
|
-
Destination:
|
|
2818
|
+
Destination: h,
|
|
2820
2819
|
Time: a
|
|
2821
2820
|
}
|
|
2822
2821
|
});
|
|
2823
2822
|
g.error && console.error("SmoothMoveKeepPitch:", g.error);
|
|
2824
|
-
})), this.d(e.automaticLandingEvent.don((
|
|
2823
|
+
})), this.d(e.automaticLandingEvent.don((h) => {
|
|
2825
2824
|
const a = [e.position[0], e.position[1]];
|
|
2826
2825
|
t.getHeightByLonLat(e.position[0], e.position[1], "Visibility").then((g) => {
|
|
2827
|
-
g !== null && (e.position = [...a, g], e.collision =
|
|
2826
|
+
g !== null && (e.position = [...a, g], e.collision = h);
|
|
2828
2827
|
});
|
|
2829
2828
|
}));
|
|
2830
|
-
const s = async (
|
|
2831
|
-
const { viewer: d } =
|
|
2829
|
+
const s = async (h, a, g, p) => {
|
|
2830
|
+
const { viewer: d } = h;
|
|
2832
2831
|
if (!d) {
|
|
2833
2832
|
console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");
|
|
2834
2833
|
return;
|
|
2835
2834
|
}
|
|
2836
|
-
const
|
|
2835
|
+
const u = await d.callUeFunc({
|
|
2837
2836
|
f: "SmoothMoveRelatively",
|
|
2838
2837
|
p: { id: a, RelativePosition: g, Time: p }
|
|
2839
2838
|
});
|
|
2840
|
-
return
|
|
2839
|
+
return u.error && console.error("SmoothMoveRelatively:", u.error), u;
|
|
2841
2840
|
};
|
|
2842
|
-
this.d(e.smoothMoveRelativelyEvent.don((
|
|
2843
|
-
s(t, e.id,
|
|
2841
|
+
this.d(e.smoothMoveRelativelyEvent.don((h, a) => {
|
|
2842
|
+
s(t, e.id, h, a);
|
|
2844
2843
|
}));
|
|
2845
|
-
const o = async (
|
|
2846
|
-
const { viewer:
|
|
2847
|
-
if (!
|
|
2844
|
+
const o = async (h, a, g, p, d) => {
|
|
2845
|
+
const { viewer: u } = h;
|
|
2846
|
+
if (!u) {
|
|
2848
2847
|
console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");
|
|
2849
2848
|
return;
|
|
2850
2849
|
}
|
|
2851
|
-
const c = await
|
|
2850
|
+
const c = await u.callUeFunc({
|
|
2852
2851
|
f: "SmoothMoveRelativelyWithRotation",
|
|
2853
2852
|
p: { id: a, RelativePosition: g, NewRotation: p, Time: d }
|
|
2854
2853
|
});
|
|
2855
2854
|
return c.error && console.error("SmoothMoveRelativelyWithRotation:", c.error), c;
|
|
2856
2855
|
};
|
|
2857
|
-
this.d(e.smoothMoveRelativelyWithRotationEvent.don((
|
|
2858
|
-
o(t, e.id,
|
|
2856
|
+
this.d(e.smoothMoveRelativelyWithRotationEvent.don((h, a, g) => {
|
|
2857
|
+
o(t, e.id, h, a, g);
|
|
2859
2858
|
}));
|
|
2860
2859
|
}
|
|
2861
2860
|
}
|
|
@@ -2980,7 +2979,7 @@ const qe = (l) => {
|
|
|
2980
2979
|
materialOverrideMap: t.materialOverrideMap
|
|
2981
2980
|
}
|
|
2982
2981
|
});
|
|
2983
|
-
},
|
|
2982
|
+
}, h = this.dv(P(
|
|
2984
2983
|
t.urlChanged,
|
|
2985
2984
|
t.showChanged,
|
|
2986
2985
|
t.flyToParamChanged,
|
|
@@ -2998,7 +2997,7 @@ const qe = (l) => {
|
|
|
2998
2997
|
t.colorBlendModeChanged,
|
|
2999
2998
|
t.materialOverrideMapChanged
|
|
3000
2999
|
));
|
|
3001
|
-
o(), this.d(
|
|
3000
|
+
o(), this.d(h.don(o)), Reflect.has(t, "colorMode") && this.d(t.colorModeChanged.don(() => o()));
|
|
3002
3001
|
const a = this.dv(W(void 0));
|
|
3003
3002
|
{
|
|
3004
3003
|
const p = this.dv(P(
|
|
@@ -3050,17 +3049,17 @@ const qe = (l) => {
|
|
|
3050
3049
|
g();
|
|
3051
3050
|
});
|
|
3052
3051
|
{
|
|
3053
|
-
const p = this.dv(Te(async (
|
|
3052
|
+
const p = this.dv(Te(async (u) => {
|
|
3054
3053
|
if (a.value === void 0) {
|
|
3055
|
-
await
|
|
3054
|
+
await u.promise(g());
|
|
3056
3055
|
return;
|
|
3057
3056
|
}
|
|
3058
3057
|
if (a.value.type === "ActorTag") {
|
|
3059
3058
|
const { actorTag: c } = a.value;
|
|
3060
|
-
if (n !== c && await
|
|
3059
|
+
if (n !== c && await u.promise(g()), n !== void 0 || c === void 0) return;
|
|
3061
3060
|
try {
|
|
3062
3061
|
n = c;
|
|
3063
|
-
const f = await
|
|
3062
|
+
const f = await u.promise(i.bind3DTilesetByTag(t.id, c));
|
|
3064
3063
|
if (!f) return;
|
|
3065
3064
|
if (f.error !== "") {
|
|
3066
3065
|
console.warn(`UeES3DTileset Bind3DTilesetByTag: ${f.error}`);
|
|
@@ -3082,7 +3081,7 @@ const qe = (l) => {
|
|
|
3082
3081
|
if (c !== s && await g(), s !== void 0 || c === void 0) return;
|
|
3083
3082
|
try {
|
|
3084
3083
|
s = c;
|
|
3085
|
-
const f = await
|
|
3084
|
+
const f = await u.promise(r.callUeFunc({
|
|
3086
3085
|
f: "create",
|
|
3087
3086
|
p: {
|
|
3088
3087
|
type: t.typeName,
|
|
@@ -3099,7 +3098,7 @@ const qe = (l) => {
|
|
|
3099
3098
|
return;
|
|
3100
3099
|
}
|
|
3101
3100
|
}
|
|
3102
|
-
await
|
|
3101
|
+
await u.promise(o());
|
|
3103
3102
|
})), d = async () => {
|
|
3104
3103
|
p.restart();
|
|
3105
3104
|
};
|
|
@@ -3109,21 +3108,21 @@ const qe = (l) => {
|
|
|
3109
3108
|
Vn(r, t.id);
|
|
3110
3109
|
})), this.d(t.flyToEvent.don(async (p, d) => {
|
|
3111
3110
|
if (!n && !s) return;
|
|
3112
|
-
const
|
|
3111
|
+
const u = await we(r, t.id, p);
|
|
3113
3112
|
let c = "over";
|
|
3114
|
-
|
|
3113
|
+
u === void 0 ? c = "error" : u.endType === 0 ? c = "over" : u.endType === 1 && (c = "cancelled"), t.flyOverEvent.emit(d, c, i);
|
|
3115
3114
|
})), this.d(t.calcFlyToParamEvent.don(() => {
|
|
3116
3115
|
!n && !s || dt(r, t.id);
|
|
3117
3116
|
})), this.d(t.calcFlyInParamEvent.don(async () => {
|
|
3118
3117
|
if (!n && !s || !i.actived) return;
|
|
3119
3118
|
const p = await i.getCurrentCameraInfo();
|
|
3120
3119
|
if (!p) return;
|
|
3121
|
-
const { position: d, rotation:
|
|
3122
|
-
t.flyInParam = { position: d, rotation:
|
|
3120
|
+
const { position: d, rotation: u } = p;
|
|
3121
|
+
t.flyInParam = { position: d, rotation: u, flyDuration: 1 };
|
|
3123
3122
|
})), this.d(i.propChanged.don((p) => {
|
|
3124
3123
|
!n && !s || p.objId === t.id && Object.keys(p.props).forEach((d) => {
|
|
3125
|
-
const
|
|
3126
|
-
t[d] =
|
|
3124
|
+
const u = p.props[d] === null ? void 0 : p.props[d];
|
|
3125
|
+
t[d] = u;
|
|
3127
3126
|
});
|
|
3128
3127
|
})), this.d(i.objectEvent.don((p) => {
|
|
3129
3128
|
!n && !s || p.id !== t.id || p.type !== "3DTilesetReady" || t.tilesetReady.emit(p.p);
|
|
@@ -3149,7 +3148,7 @@ const qe = (l) => {
|
|
|
3149
3148
|
console.warn(`UeES3DTileset SetFeatureVisable: ${y.error}`);
|
|
3150
3149
|
return;
|
|
3151
3150
|
}
|
|
3152
|
-
},
|
|
3151
|
+
}, u = async () => {
|
|
3153
3152
|
if (!n && !s) return;
|
|
3154
3153
|
const f = await r.callUeFunc({
|
|
3155
3154
|
f: "ResetFeatureStyle",
|
|
@@ -3177,7 +3176,7 @@ const qe = (l) => {
|
|
|
3177
3176
|
const y = [...this.styleVisable, ...w];
|
|
3178
3177
|
this.styleVisable = [...y], d(f, y);
|
|
3179
3178
|
})), this.d(t.resetFeatureStyleEvent.don(() => {
|
|
3180
|
-
|
|
3179
|
+
u(), this.styleColor = [], this.styleVisable = [];
|
|
3181
3180
|
})), this.d(t.setFeatureStyleEvent.don((f) => {
|
|
3182
3181
|
c(f);
|
|
3183
3182
|
}));
|
|
@@ -3262,7 +3261,7 @@ const Qe = (l) => {
|
|
|
3262
3261
|
return;
|
|
3263
3262
|
}
|
|
3264
3263
|
let r, n;
|
|
3265
|
-
const s = this.dv(W(void 0)), o = this.ad(
|
|
3264
|
+
const s = this.dv(W(void 0)), o = this.ad(Je(""));
|
|
3266
3265
|
{
|
|
3267
3266
|
const p = () => {
|
|
3268
3267
|
if (typeof e.url == "string")
|
|
@@ -3274,7 +3273,7 @@ const Qe = (l) => {
|
|
|
3274
3273
|
};
|
|
3275
3274
|
p(), this.ad(e.urlChanged.don(p));
|
|
3276
3275
|
}
|
|
3277
|
-
const
|
|
3276
|
+
const h = async () => {
|
|
3278
3277
|
if (!r && !n) return;
|
|
3279
3278
|
let p = e.targetID ?? U.defaults.targetID;
|
|
3280
3279
|
if (p && p != "") {
|
|
@@ -3317,7 +3316,7 @@ const Qe = (l) => {
|
|
|
3317
3316
|
e.opacityChanged,
|
|
3318
3317
|
e.splitDirectionChanged
|
|
3319
3318
|
));
|
|
3320
|
-
this.d(a.don(
|
|
3319
|
+
this.d(a.don(h));
|
|
3321
3320
|
const g = async () => {
|
|
3322
3321
|
const { id: p } = e;
|
|
3323
3322
|
if (r !== void 0) {
|
|
@@ -3353,17 +3352,17 @@ const Qe = (l) => {
|
|
|
3353
3352
|
g();
|
|
3354
3353
|
});
|
|
3355
3354
|
{
|
|
3356
|
-
const p = this.dv(Te(async (
|
|
3355
|
+
const p = this.dv(Te(async (u) => {
|
|
3357
3356
|
if (s.value === void 0) {
|
|
3358
|
-
await
|
|
3357
|
+
await u.promise(g());
|
|
3359
3358
|
return;
|
|
3360
3359
|
}
|
|
3361
3360
|
if (s.value.type === "ActorTag") {
|
|
3362
3361
|
const { actorTag: c, componentTag: f } = s.value;
|
|
3363
|
-
if (r !== c && await
|
|
3362
|
+
if (r !== c && await u.promise(g()), r !== void 0 || c === void 0) return;
|
|
3364
3363
|
try {
|
|
3365
3364
|
r = c;
|
|
3366
|
-
const w = await
|
|
3365
|
+
const w = await u.promise(t.bindImageryByTag(e.id, c, f));
|
|
3367
3366
|
if (!w) return;
|
|
3368
3367
|
if (w.error !== "") {
|
|
3369
3368
|
console.warn(`ESImageryLayer BindImageryByTag: ${w.error}`);
|
|
@@ -3382,10 +3381,10 @@ const Qe = (l) => {
|
|
|
3382
3381
|
}
|
|
3383
3382
|
} else if (s.value.type === "CreatedUrl") {
|
|
3384
3383
|
const { url: c } = s.value;
|
|
3385
|
-
if (c !== n && await
|
|
3384
|
+
if (c !== n && await u.promise(g()), n !== void 0 || c === void 0) return;
|
|
3386
3385
|
try {
|
|
3387
3386
|
n = c;
|
|
3388
|
-
const f = await
|
|
3387
|
+
const f = await u.promise(i.callUeFunc({
|
|
3389
3388
|
f: "create",
|
|
3390
3389
|
p: {
|
|
3391
3390
|
type: "ESImageryLayer",
|
|
@@ -3402,7 +3401,7 @@ const Qe = (l) => {
|
|
|
3402
3401
|
return;
|
|
3403
3402
|
}
|
|
3404
3403
|
}
|
|
3405
|
-
await
|
|
3404
|
+
await u.promise(h());
|
|
3406
3405
|
})), d = async () => {
|
|
3407
3406
|
p.restart();
|
|
3408
3407
|
};
|
|
@@ -3427,27 +3426,27 @@ const Qe = (l) => {
|
|
|
3427
3426
|
}
|
|
3428
3427
|
this.d(e.flyToEvent.don(async (p, d) => {
|
|
3429
3428
|
if (!r && !n) return;
|
|
3430
|
-
const
|
|
3429
|
+
const u = await we(i, e.id, p);
|
|
3431
3430
|
let c = "over";
|
|
3432
|
-
|
|
3431
|
+
u === void 0 ? c = "error" : u.endType === 0 ? c = "over" : u.endType === 1 && (c = "cancelled"), e.flyOverEvent.emit(d, c, t);
|
|
3433
3432
|
})), this.d(e.flyInEvent.don(async (p, d) => {
|
|
3434
3433
|
var f, w;
|
|
3435
3434
|
if (!r && !n) return;
|
|
3436
|
-
const
|
|
3435
|
+
const u = await Re(i, e.id, (f = e.flyInParam) == null ? void 0 : f.position, (w = e.flyInParam) == null ? void 0 : w.rotation, p ?? 1);
|
|
3437
3436
|
let c = "over";
|
|
3438
|
-
|
|
3437
|
+
u === void 0 ? c = "error" : u.endType === 0 ? c = "over" : u.endType === 1 && (c = "cancelled"), e.flyOverEvent.emit(d, c, t);
|
|
3439
3438
|
})), this.d(e.calcFlyToParamEvent.don(() => {
|
|
3440
3439
|
!r && !n || dt(i, e.id);
|
|
3441
3440
|
})), this.d(e.calcFlyInParamEvent.don(async () => {
|
|
3442
3441
|
if (!t.actived) return;
|
|
3443
3442
|
const p = await t.getCurrentCameraInfo();
|
|
3444
3443
|
if (!p) return;
|
|
3445
|
-
const { position: d, rotation:
|
|
3446
|
-
e.flyInParam = { position: d, rotation:
|
|
3444
|
+
const { position: d, rotation: u } = p;
|
|
3445
|
+
e.flyInParam = { position: d, rotation: u, flyDuration: 1 };
|
|
3447
3446
|
})), this.d(t.propChanged.don((p) => {
|
|
3448
3447
|
!r && !n || p.objId === e.id && Object.keys(p.props).forEach((d) => {
|
|
3449
|
-
const
|
|
3450
|
-
e[d] =
|
|
3448
|
+
const u = p.props[d] === null ? void 0 : p.props[d];
|
|
3449
|
+
e[d] = u;
|
|
3451
3450
|
});
|
|
3452
3451
|
}));
|
|
3453
3452
|
}
|
|
@@ -3573,8 +3572,8 @@ const wt = class wt extends I {
|
|
|
3573
3572
|
return;
|
|
3574
3573
|
}
|
|
3575
3574
|
this.dispose(e.flyInEvent.don((r, n, s = "default") => {
|
|
3576
|
-
const { id: o, duration:
|
|
3577
|
-
Re(i, o, a, g,
|
|
3575
|
+
const { id: o, duration: h, position: a, rotation: g } = e;
|
|
3576
|
+
Re(i, o, a, g, h ?? r, s);
|
|
3578
3577
|
})), this.dispose(e.resetWithCurrentCameraEvent.don(() => {
|
|
3579
3578
|
Ir(i, e.id);
|
|
3580
3579
|
})), this.dispose(e.captureEvent.don((r, n) => {
|
|
@@ -3604,7 +3603,7 @@ const mt = class mt extends I {
|
|
|
3604
3603
|
}
|
|
3605
3604
|
}
|
|
3606
3605
|
};
|
|
3607
|
-
v(mt, "type", mt.register("ESUeViewer",
|
|
3606
|
+
v(mt, "type", mt.register("ESUeViewer", br.type, mt));
|
|
3608
3607
|
let oi = mt;
|
|
3609
3608
|
const Ct = class Ct extends D {
|
|
3610
3609
|
constructor(e, t) {
|
|
@@ -3646,7 +3645,7 @@ const et = class et extends I {
|
|
|
3646
3645
|
}
|
|
3647
3646
|
}
|
|
3648
3647
|
};
|
|
3649
|
-
v(et, "type", et.register("ESUeViewer",
|
|
3648
|
+
v(et, "type", et.register("ESUeViewer", Jr.type, et)), // null 表示不设置,undefined表示不做任何转换
|
|
3650
3649
|
v(et, "propValFuncs", {
|
|
3651
3650
|
...I.propValFuncs,
|
|
3652
3651
|
targetID: (e) => {
|
|
@@ -3664,14 +3663,14 @@ const Ft = class Ft extends I {
|
|
|
3664
3663
|
console.warn("viewer is undefined!");
|
|
3665
3664
|
return;
|
|
3666
3665
|
}
|
|
3667
|
-
const r = this.ad(
|
|
3666
|
+
const r = this.ad(Je(""));
|
|
3668
3667
|
{
|
|
3669
3668
|
const o = () => {
|
|
3670
3669
|
if (typeof e.url == "string")
|
|
3671
3670
|
r.value = E.context.getStrFromEnv(e.url ?? H.defaults.url);
|
|
3672
3671
|
else {
|
|
3673
|
-
const
|
|
3674
|
-
|
|
3672
|
+
const h = e.url;
|
|
3673
|
+
h.url = E.context.getStrFromEnv(h.url ?? H.defaults.url), r.value = h;
|
|
3675
3674
|
}
|
|
3676
3675
|
};
|
|
3677
3676
|
o(), this.ad(e.urlChanged.don(o));
|
|
@@ -3821,14 +3820,14 @@ const Pt = class Pt extends M {
|
|
|
3821
3820
|
console.warn("viewer is undefined!");
|
|
3822
3821
|
return;
|
|
3823
3822
|
}
|
|
3824
|
-
const r = this.ad(
|
|
3823
|
+
const r = this.ad(Je(""));
|
|
3825
3824
|
{
|
|
3826
3825
|
const o = () => {
|
|
3827
3826
|
if (typeof e.url == "string")
|
|
3828
3827
|
r.value = E.context.getStrFromEnv(e.url);
|
|
3829
3828
|
else {
|
|
3830
|
-
const
|
|
3831
|
-
|
|
3829
|
+
const h = e.url;
|
|
3830
|
+
h.url = E.context.getStrFromEnv(h.url), r.value = h;
|
|
3832
3831
|
}
|
|
3833
3832
|
};
|
|
3834
3833
|
o(), this.ad(e.urlChanged.don(o));
|
|
@@ -3884,28 +3883,28 @@ class mo extends m {
|
|
|
3884
3883
|
dt(r, n.id);
|
|
3885
3884
|
})), this.dispose(t.calcFlyInParamEvent.disposableOn(async () => {
|
|
3886
3885
|
if (!i.actived) return;
|
|
3887
|
-
const
|
|
3888
|
-
if (!
|
|
3889
|
-
const { position: a, rotation: g } =
|
|
3886
|
+
const h = await i.getCurrentCameraInfo();
|
|
3887
|
+
if (!h) return;
|
|
3888
|
+
const { position: a, rotation: g } = h;
|
|
3890
3889
|
t.flyInParam = { position: a, rotation: g, flyDuration: 1 };
|
|
3891
|
-
})), this.dispose(t.smoothMoveEvent.disposableOn((
|
|
3892
|
-
De(r, n.id,
|
|
3893
|
-
})), this.dispose(t.smoothMoveWithRotationEvent.disposableOn((
|
|
3894
|
-
Le(r, n.id,
|
|
3895
|
-
})), this.dispose(t.smoothMoveOnGroundEvent.disposableOn((
|
|
3896
|
-
Pe(r, n.id,
|
|
3897
|
-
})), this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((
|
|
3898
|
-
ke(r, n.id,
|
|
3899
|
-
})), this.dispose(t.flyToEvent.disposableOn((
|
|
3900
|
-
n.flyTo(
|
|
3901
|
-
})), this.dispose(t.flyInEvent.don((
|
|
3902
|
-
n.flyIn(
|
|
3890
|
+
})), this.dispose(t.smoothMoveEvent.disposableOn((h, a) => {
|
|
3891
|
+
De(r, n.id, h, a);
|
|
3892
|
+
})), this.dispose(t.smoothMoveWithRotationEvent.disposableOn((h, a, g) => {
|
|
3893
|
+
Le(r, n.id, h, a, g);
|
|
3894
|
+
})), this.dispose(t.smoothMoveOnGroundEvent.disposableOn((h, a, g, p) => {
|
|
3895
|
+
Pe(r, n.id, h, a, p, g);
|
|
3896
|
+
})), this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((h, a, g, p, d) => {
|
|
3897
|
+
ke(r, n.id, h, a, g, p, d);
|
|
3898
|
+
})), this.dispose(t.flyToEvent.disposableOn((h, a) => {
|
|
3899
|
+
n.flyTo(h);
|
|
3900
|
+
})), this.dispose(t.flyInEvent.don((h) => {
|
|
3901
|
+
n.flyIn(h);
|
|
3903
3902
|
}));
|
|
3904
3903
|
const s = this._screenPosition, o = this.disposeVar(new He());
|
|
3905
3904
|
o.parentID = t.id, i.add(o), this.dispose(() => i.delete(o)), this.dispose(k([o, "allowPicking"], [t, "allowPicking"]));
|
|
3906
3905
|
{
|
|
3907
|
-
const
|
|
3908
|
-
t.show ?
|
|
3906
|
+
const h = this.disposeVar(be()), a = () => {
|
|
3907
|
+
t.show ? h.restart(void 0, async () => {
|
|
3909
3908
|
if (!t.position) return;
|
|
3910
3909
|
const g = await i.lonLatAltToScreenPosition(t.position);
|
|
3911
3910
|
if (!this.isDestroyed())
|
|
@@ -3915,13 +3914,13 @@ class mo extends m {
|
|
|
3915
3914
|
const [p, d] = g;
|
|
3916
3915
|
p === -1 && d === -1 ? this._screenPosition.value = void 0 : this._screenPosition.value = [p, d];
|
|
3917
3916
|
}
|
|
3918
|
-
}) :
|
|
3917
|
+
}) : h.cancel();
|
|
3919
3918
|
};
|
|
3920
3919
|
a(), this.dispose(t.showChanged.disposableOn(a));
|
|
3921
3920
|
}
|
|
3922
3921
|
{
|
|
3923
|
-
const
|
|
3924
|
-
constructor(d,
|
|
3922
|
+
const h = () => class extends m {
|
|
3923
|
+
constructor(d, u, c) {
|
|
3925
3924
|
if (super(), this._subContainer = d, !c) return;
|
|
3926
3925
|
if (!t.instanceClass)
|
|
3927
3926
|
throw new Error("!sceneObject.instanceClass");
|
|
@@ -3971,7 +3970,7 @@ class mo extends m {
|
|
|
3971
3970
|
}
|
|
3972
3971
|
}, a = () => {
|
|
3973
3972
|
try {
|
|
3974
|
-
t.instanceClass ? o.instanceClass =
|
|
3973
|
+
t.instanceClass ? o.instanceClass = h() : o.instanceClass = void 0;
|
|
3975
3974
|
} catch (p) {
|
|
3976
3975
|
console.error(p);
|
|
3977
3976
|
}
|
|
@@ -4020,8 +4019,8 @@ class Co extends m {
|
|
|
4020
4019
|
if (g.style.opacity = t.opacity.toString() ?? Ce.defaults.opacity, g.style.position = "fixed", g.style.zIndex = "-1", g.style.top = "0px", !document.body.contains(g)) {
|
|
4021
4020
|
document.body.appendChild(g);
|
|
4022
4021
|
let d = g ? g.querySelectorAll("*[class]") : [];
|
|
4023
|
-
for (let
|
|
4024
|
-
const c = d[
|
|
4022
|
+
for (let u = 0; u < d.length; u++) {
|
|
4023
|
+
const c = d[u];
|
|
4025
4024
|
var p = c.getBoundingClientRect();
|
|
4026
4025
|
this._hasClassDivAndPos[c.className] = [
|
|
4027
4026
|
c.offsetLeft,
|
|
@@ -4051,11 +4050,11 @@ class Co extends m {
|
|
|
4051
4050
|
}
|
|
4052
4051
|
};
|
|
4053
4052
|
o();
|
|
4054
|
-
const
|
|
4053
|
+
const h = this.dv(P(
|
|
4055
4054
|
t.instanceClassChanged,
|
|
4056
4055
|
t.opacityChanged
|
|
4057
4056
|
));
|
|
4058
|
-
this.d(
|
|
4057
|
+
this.d(h.don(o));
|
|
4059
4058
|
}
|
|
4060
4059
|
{
|
|
4061
4060
|
const s = () => {
|
|
@@ -4067,32 +4066,32 @@ class Co extends m {
|
|
|
4067
4066
|
n.automaticLanding();
|
|
4068
4067
|
})), this.d(i.widgetEvent.don((s) => {
|
|
4069
4068
|
if (s.objId !== this._imageLabel.id) return;
|
|
4070
|
-
const { type: o, add:
|
|
4071
|
-
if (o === "leftClick" &&
|
|
4072
|
-
const a = (
|
|
4069
|
+
const { type: o, add: h } = s;
|
|
4070
|
+
if (o === "leftClick" && h) {
|
|
4071
|
+
const a = (h == null ? void 0 : h.classNames) ?? [], g = Object.keys(this._hasClassDivAndPos);
|
|
4073
4072
|
for (let p = 0; p < g.length; p++) {
|
|
4074
4073
|
const d = g[p];
|
|
4075
|
-
let
|
|
4076
|
-
|
|
4074
|
+
let u = this._hasClassDivAndPos[d];
|
|
4075
|
+
h && h.mouseRelativePos && h.mouseRelativePos[0] >= u[0] && h.mouseRelativePos[0] <= u[2] && h.mouseRelativePos[1] >= u[1] && h.mouseRelativePos[1] <= u[3] && a.push(d);
|
|
4077
4076
|
}
|
|
4078
|
-
|
|
4077
|
+
h.classNames = a;
|
|
4079
4078
|
}
|
|
4080
|
-
t.widgetEvent.emit({ type: o, add:
|
|
4079
|
+
t.widgetEvent.emit({ type: o, add: h });
|
|
4081
4080
|
})), this.d(t.calcFlyToParamEvent.don(() => {
|
|
4082
4081
|
dt(r, n.id);
|
|
4083
4082
|
})), this.d(t.calcFlyInParamEvent.don(() => {
|
|
4084
4083
|
const s = i.getCurrentCameraInfo();
|
|
4085
4084
|
if (!s) return;
|
|
4086
|
-
const { position: o, rotation:
|
|
4087
|
-
t.flyInParam = { position: o, rotation:
|
|
4085
|
+
const { position: o, rotation: h } = s;
|
|
4086
|
+
t.flyInParam = { position: o, rotation: h, flyDuration: 1 };
|
|
4088
4087
|
})), this.d(t.smoothMoveEvent.don((s, o) => {
|
|
4089
4088
|
De(r, n.id, s, o);
|
|
4090
|
-
})), this.d(t.smoothMoveWithRotationEvent.don((s, o,
|
|
4091
|
-
Le(r, n.id, s, o,
|
|
4092
|
-
})), this.d(t.smoothMoveOnGroundEvent.don((s, o,
|
|
4093
|
-
Pe(r, n.id, s, o, a,
|
|
4094
|
-
})), this.d(t.smoothMoveWithRotationOnGroundEvent.don((s, o,
|
|
4095
|
-
ke(r, n.id, s, o,
|
|
4089
|
+
})), this.d(t.smoothMoveWithRotationEvent.don((s, o, h) => {
|
|
4090
|
+
Le(r, n.id, s, o, h);
|
|
4091
|
+
})), this.d(t.smoothMoveOnGroundEvent.don((s, o, h, a) => {
|
|
4092
|
+
Pe(r, n.id, s, o, a, h);
|
|
4093
|
+
})), this.d(t.smoothMoveWithRotationOnGroundEvent.don((s, o, h, a, g) => {
|
|
4094
|
+
ke(r, n.id, s, o, h, a, g);
|
|
4096
4095
|
})), this.d(t.flyToEvent.don((s, o) => {
|
|
4097
4096
|
n.flyTo(s);
|
|
4098
4097
|
})), this.d(t.flyInEvent.don((s) => {
|
|
@@ -4207,7 +4206,7 @@ const Wt = class Wt extends I {
|
|
|
4207
4206
|
console.warn("viewer is undefined!");
|
|
4208
4207
|
return;
|
|
4209
4208
|
}
|
|
4210
|
-
const r = async (s, o,
|
|
4209
|
+
const r = async (s, o, h, a) => {
|
|
4211
4210
|
const { viewer: g } = s;
|
|
4212
4211
|
if (!g) {
|
|
4213
4212
|
console.error("AIMoveTo: ueViewer.viewer is undefined");
|
|
@@ -4215,7 +4214,7 @@ const Wt = class Wt extends I {
|
|
|
4215
4214
|
}
|
|
4216
4215
|
const p = await g.callUeFunc({
|
|
4217
4216
|
f: "AIMoveTo",
|
|
4218
|
-
p: { id: o, Destination:
|
|
4217
|
+
p: { id: o, Destination: h, Time: a }
|
|
4219
4218
|
});
|
|
4220
4219
|
return p.error && console.error("AIMoveTo:", p.error), p;
|
|
4221
4220
|
};
|
|
@@ -4223,12 +4222,12 @@ const Wt = class Wt extends I {
|
|
|
4223
4222
|
r(t, e.id, s, o);
|
|
4224
4223
|
}));
|
|
4225
4224
|
const n = async (s, o) => {
|
|
4226
|
-
const { viewer:
|
|
4227
|
-
if (!
|
|
4225
|
+
const { viewer: h } = s;
|
|
4226
|
+
if (!h) {
|
|
4228
4227
|
console.error("StopAIMove: ueViewer.viewer is undefined");
|
|
4229
4228
|
return;
|
|
4230
4229
|
}
|
|
4231
|
-
const a = await
|
|
4230
|
+
const a = await h.callUeFunc({
|
|
4232
4231
|
f: "StopAIMove",
|
|
4233
4232
|
p: { id: o }
|
|
4234
4233
|
});
|
|
@@ -4308,7 +4307,7 @@ const Ht = class Ht extends I {
|
|
|
4308
4307
|
};
|
|
4309
4308
|
v(Ht, "type", Ht.register("ESUeViewer", ln.type, Ht));
|
|
4310
4309
|
let ki = Ht;
|
|
4311
|
-
const
|
|
4310
|
+
const bt = class bt extends I {
|
|
4312
4311
|
constructor(e, t) {
|
|
4313
4312
|
if (super(e, t), !t.viewer) {
|
|
4314
4313
|
console.warn("viewer is undefined!");
|
|
@@ -4316,9 +4315,9 @@ const Jt = class Jt extends I {
|
|
|
4316
4315
|
}
|
|
4317
4316
|
}
|
|
4318
4317
|
};
|
|
4319
|
-
v(
|
|
4320
|
-
let Di =
|
|
4321
|
-
const
|
|
4318
|
+
v(bt, "type", bt.register("ESUeViewer", cn.type, bt));
|
|
4319
|
+
let Di = bt;
|
|
4320
|
+
const Jt = class Jt extends D {
|
|
4322
4321
|
constructor(e, t) {
|
|
4323
4322
|
if (super(e, t), !t.viewer) {
|
|
4324
4323
|
console.warn("viewer is undefined!");
|
|
@@ -4326,8 +4325,8 @@ const bt = class bt extends D {
|
|
|
4326
4325
|
}
|
|
4327
4326
|
}
|
|
4328
4327
|
};
|
|
4329
|
-
v(
|
|
4330
|
-
let Bi =
|
|
4328
|
+
v(Jt, "type", Jt.register("ESUeViewer", un.type, Jt));
|
|
4329
|
+
let Bi = Jt;
|
|
4331
4330
|
const Gt = class Gt extends ze {
|
|
4332
4331
|
constructor(e, t) {
|
|
4333
4332
|
if (super(e, t), !t.viewer) {
|
|
@@ -4350,8 +4349,8 @@ const Kt = class Kt extends Ue {
|
|
|
4350
4349
|
const n = typeof r == "number" ? r.toString() : r;
|
|
4351
4350
|
rs(i, e.id, n);
|
|
4352
4351
|
})), this.d(e.highlightFeatureAndFlyToEvent.don((r, n, s, o) => {
|
|
4353
|
-
const
|
|
4354
|
-
ns(i, e.id,
|
|
4352
|
+
const h = typeof r == "number" ? r.toString() : r;
|
|
4353
|
+
ns(i, e.id, h, o ?? 1);
|
|
4355
4354
|
})), this.d(e.setLayerVisibleEvent.don((r, n) => {
|
|
4356
4355
|
let s = "";
|
|
4357
4356
|
typeof n != "string" ? s = JSON.stringify(n) : s = n, ss(i, e.id, s);
|
|
@@ -4476,36 +4475,36 @@ const Vt = class Vt extends at {
|
|
|
4476
4475
|
{
|
|
4477
4476
|
const r = (o) => {
|
|
4478
4477
|
o = o.toLocaleLowerCase();
|
|
4479
|
-
let
|
|
4478
|
+
let h = [255, 255, 255, 1];
|
|
4480
4479
|
if (o.startsWith("#")) {
|
|
4481
4480
|
if (o.length === 4) {
|
|
4482
4481
|
let a = parseInt(o[1] + o[1], 16), g = parseInt(o[2] + o[2], 16), p = parseInt(o[3] + o[3], 16);
|
|
4483
|
-
|
|
4482
|
+
h = [a, g, p, 1];
|
|
4484
4483
|
} else if (o.length === 7) {
|
|
4485
4484
|
let a = parseInt(o.substring(1, 3), 16), g = parseInt(o.substring(3, 5), 16), p = parseInt(o.substring(5, 7), 16);
|
|
4486
|
-
|
|
4485
|
+
h = [a, g, p, 1];
|
|
4487
4486
|
}
|
|
4488
4487
|
} else if (o.startsWith("rgba")) {
|
|
4489
4488
|
let a = o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);
|
|
4490
4489
|
if (a) {
|
|
4491
|
-
let g = parseInt(a[1]), p = parseInt(a[2]), d = parseInt(a[3]),
|
|
4492
|
-
|
|
4490
|
+
let g = parseInt(a[1]), p = parseInt(a[2]), d = parseInt(a[3]), u = parseFloat(a[4]);
|
|
4491
|
+
h = [g, p, d, u];
|
|
4493
4492
|
}
|
|
4494
4493
|
} else if (o.startsWith("rgb")) {
|
|
4495
4494
|
let a = o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
4496
4495
|
if (a) {
|
|
4497
4496
|
let g = parseInt(a[1]), p = parseInt(a[2]), d = parseInt(a[3]);
|
|
4498
|
-
|
|
4497
|
+
h = [g, p, d, 1];
|
|
4499
4498
|
}
|
|
4500
4499
|
} else
|
|
4501
4500
|
console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");
|
|
4502
|
-
return [
|
|
4501
|
+
return [h[0] / 255, h[1] / 255, h[2] / 255, h[3]];
|
|
4503
4502
|
}, n = () => {
|
|
4504
4503
|
const o = e.layerConfig;
|
|
4505
4504
|
if (!o) return;
|
|
4506
|
-
const
|
|
4505
|
+
const h = [];
|
|
4507
4506
|
o.forEach((a) => {
|
|
4508
|
-
o.filter((p) => p.dataset == a.dataset).length == 1 ?
|
|
4507
|
+
o.filter((p) => p.dataset == a.dataset).length == 1 ? h.push({
|
|
4509
4508
|
condition: [{
|
|
4510
4509
|
field: "dataset",
|
|
4511
4510
|
op: "==",
|
|
@@ -4513,7 +4512,7 @@ const Vt = class Vt extends at {
|
|
|
4513
4512
|
}],
|
|
4514
4513
|
color: r(a.value.color ?? "rgb(255,255,255)"),
|
|
4515
4514
|
show: a.value.visible
|
|
4516
|
-
}) :
|
|
4515
|
+
}) : h.push({
|
|
4517
4516
|
condition: [{
|
|
4518
4517
|
field: "layer",
|
|
4519
4518
|
op: "==",
|
|
@@ -4526,7 +4525,7 @@ const Vt = class Vt extends at {
|
|
|
4526
4525
|
color: r(a.value.color ?? "rgb(255,255,255)"),
|
|
4527
4526
|
show: a.value.visible
|
|
4528
4527
|
});
|
|
4529
|
-
}), e.setFeatureStyle(
|
|
4528
|
+
}), e.setFeatureStyle(h);
|
|
4530
4529
|
};
|
|
4531
4530
|
n();
|
|
4532
4531
|
const s = this.dv(P(
|
|
@@ -4540,7 +4539,7 @@ const Vt = class Vt extends at {
|
|
|
4540
4539
|
}
|
|
4541
4540
|
};
|
|
4542
4541
|
v(Vt, "type", Vt.register("ESUeViewer", Fn.type, Vt));
|
|
4543
|
-
let
|
|
4542
|
+
let bi = Vt;
|
|
4544
4543
|
const Ot = class Ot extends M {
|
|
4545
4544
|
constructor(e, t) {
|
|
4546
4545
|
if (super(e, t), !t.viewer) {
|
|
@@ -4561,7 +4560,7 @@ const Ot = class Ot extends M {
|
|
|
4561
4560
|
}
|
|
4562
4561
|
};
|
|
4563
4562
|
v(Ot, "type", Ot.register("ESUeViewer", In.type, Ot));
|
|
4564
|
-
let
|
|
4563
|
+
let Ji = Ot;
|
|
4565
4564
|
const jt = class jt extends I {
|
|
4566
4565
|
constructor(e, t) {
|
|
4567
4566
|
if (super(e, t), !t.viewer) {
|
|
@@ -4717,7 +4716,7 @@ const qi = (l) => {
|
|
|
4717
4716
|
));
|
|
4718
4717
|
this.d(n.don(r)), this.d(e.flushEvent.don(() => n.flush()));
|
|
4719
4718
|
let s, o;
|
|
4720
|
-
const
|
|
4719
|
+
const h = async () => {
|
|
4721
4720
|
a() || (await i.callUeFunc({
|
|
4722
4721
|
f: "update",
|
|
4723
4722
|
p: {
|
|
@@ -4726,8 +4725,8 @@ const qi = (l) => {
|
|
|
4726
4725
|
}
|
|
4727
4726
|
}), (t.debug ?? !1) && console.log(`updatePostion:${e.position},actorTag:${e.actorTag},actorClass:${e.actorClass}`));
|
|
4728
4727
|
}, a = () => !s && !o ? (console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`), !0) : !1, g = async () => {
|
|
4729
|
-
const { id: d } = e,
|
|
4730
|
-
|
|
4728
|
+
const { id: d } = e, u = await t.unBindActorByID(d);
|
|
4729
|
+
u && u.error !== "" && console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${u.error}`), s = void 0;
|
|
4731
4730
|
const c = await i.callUeFunc({ f: "destroy", p: { id: d } });
|
|
4732
4731
|
if (c && c.error !== "") {
|
|
4733
4732
|
console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${c.error}`);
|
|
@@ -4743,7 +4742,7 @@ const qi = (l) => {
|
|
|
4743
4742
|
e.actorClassChanged,
|
|
4744
4743
|
e.actorTagChanged
|
|
4745
4744
|
// sceneObject.positionChanged,
|
|
4746
|
-
)),
|
|
4745
|
+
)), u = async () => {
|
|
4747
4746
|
e.actorTag !== "" ? p.value = {
|
|
4748
4747
|
type: "ActorTag",
|
|
4749
4748
|
actorTag: e.actorTag
|
|
@@ -4754,7 +4753,7 @@ const qi = (l) => {
|
|
|
4754
4753
|
// position: sceneObject.position,
|
|
4755
4754
|
};
|
|
4756
4755
|
};
|
|
4757
|
-
|
|
4756
|
+
u(), this.d(d.don(u)), this.d(e.flushEvent.don(() => d.flush()));
|
|
4758
4757
|
}
|
|
4759
4758
|
{
|
|
4760
4759
|
const d = this.dv(Te(async (c) => {
|
|
@@ -4801,50 +4800,50 @@ const qi = (l) => {
|
|
|
4801
4800
|
return;
|
|
4802
4801
|
}
|
|
4803
4802
|
}
|
|
4804
|
-
await c.promise(r()), await c.promise(
|
|
4805
|
-
})),
|
|
4803
|
+
await c.promise(r()), await c.promise(h());
|
|
4804
|
+
})), u = async () => {
|
|
4806
4805
|
d.restart();
|
|
4807
4806
|
};
|
|
4808
|
-
|
|
4807
|
+
u(), this.d(p.changed.don(u));
|
|
4809
4808
|
}
|
|
4810
|
-
this.d(e.positionChanged.don(
|
|
4809
|
+
this.d(e.positionChanged.don(h)), this.d(e.callFunctionEvent.don(async (d, u) => {
|
|
4811
4810
|
if (a()) {
|
|
4812
4811
|
e.__callFunctionResultEvent.emit(void 0);
|
|
4813
4812
|
return;
|
|
4814
4813
|
}
|
|
4815
|
-
const c = await Er(i, e.id, d,
|
|
4814
|
+
const c = await Er(i, e.id, d, u);
|
|
4816
4815
|
e.__callFunctionResultEvent.emit(c);
|
|
4817
|
-
})), this.d(e.smoothMoveEvent.don((d,
|
|
4818
|
-
a() || De(i, e.id, d,
|
|
4819
|
-
})), this.d(e.smoothMoveWithRotationEvent.don((d,
|
|
4820
|
-
a() || Le(i, e.id, d,
|
|
4821
|
-
})), this.d(e.smoothMoveOnGroundEvent.don((d,
|
|
4822
|
-
a() || Pe(i, e.id, d,
|
|
4823
|
-
})), this.d(e.smoothMoveWithRotationOnGroundEvent.don((d,
|
|
4824
|
-
a() || ke(i, e.id, d,
|
|
4816
|
+
})), this.d(e.smoothMoveEvent.don((d, u) => {
|
|
4817
|
+
a() || De(i, e.id, d, u);
|
|
4818
|
+
})), this.d(e.smoothMoveWithRotationEvent.don((d, u, c) => {
|
|
4819
|
+
a() || Le(i, e.id, d, u, c);
|
|
4820
|
+
})), this.d(e.smoothMoveOnGroundEvent.don((d, u, c, f) => {
|
|
4821
|
+
a() || Pe(i, e.id, d, u, f, c);
|
|
4822
|
+
})), this.d(e.smoothMoveWithRotationOnGroundEvent.don((d, u, c, f, w) => {
|
|
4823
|
+
a() || ke(i, e.id, d, u, c, f, w);
|
|
4825
4824
|
})), this.d(e.automaticLandingEvent.don((d) => {
|
|
4826
4825
|
if (a()) return;
|
|
4827
|
-
const
|
|
4826
|
+
const u = [e.position[0], e.position[1]];
|
|
4828
4827
|
t.getHeightByLonLat(e.position[0], e.position[1], "Visibility").then((c) => {
|
|
4829
|
-
c !== null && (e.position = [...
|
|
4828
|
+
c !== null && (e.position = [...u, c], e.collision = d);
|
|
4830
4829
|
});
|
|
4831
|
-
})), this.d(e.flyToEvent.don(async (d,
|
|
4830
|
+
})), this.d(e.flyToEvent.don(async (d, u) => {
|
|
4832
4831
|
if (a()) return;
|
|
4833
4832
|
const c = await we(i, e.id, d);
|
|
4834
4833
|
let f = "over";
|
|
4835
|
-
c === void 0 ? f = "error" : c.endType === 0 ? f = "over" : c.endType === 1 && (f = "cancelled"), e.flyOverEvent.emit(
|
|
4834
|
+
c === void 0 ? f = "error" : c.endType === 0 ? f = "over" : c.endType === 1 && (f = "cancelled"), e.flyOverEvent.emit(u, f, t);
|
|
4836
4835
|
})), this.d(e.calcFlyToParamEvent.don(() => {
|
|
4837
4836
|
a() || dt(i, e.id);
|
|
4838
4837
|
})), this.d(e.calcFlyInParamEvent.don(async () => {
|
|
4839
4838
|
if (!t.actived) return;
|
|
4840
4839
|
const d = await t.getCurrentCameraInfo();
|
|
4841
4840
|
if (!d) return;
|
|
4842
|
-
const { position:
|
|
4843
|
-
e.flyInParam = { position:
|
|
4841
|
+
const { position: u, rotation: c } = d;
|
|
4842
|
+
e.flyInParam = { position: u, rotation: c, flyDuration: 1 };
|
|
4844
4843
|
})), this.d(t.propChanged.don((d) => {
|
|
4845
|
-
a() || d.objId === e.id && Object.keys(d.props).forEach((
|
|
4846
|
-
const c = d.props[
|
|
4847
|
-
e[
|
|
4844
|
+
a() || d.objId === e.id && Object.keys(d.props).forEach((u) => {
|
|
4845
|
+
const c = d.props[u] === null ? void 0 : d.props[u];
|
|
4846
|
+
e[u] = c;
|
|
4848
4847
|
});
|
|
4849
4848
|
}));
|
|
4850
4849
|
}
|
|
@@ -4948,13 +4947,13 @@ const le = class le extends G {
|
|
|
4948
4947
|
// subContainer是外部视口的div容器,可以在这里创建自己需要的DOM元素
|
|
4949
4948
|
// customDiv指向当前的CustomDiv场景对象
|
|
4950
4949
|
// viewer指定当前的视口
|
|
4951
|
-
constructor(s, o,
|
|
4950
|
+
constructor(s, o, h) {
|
|
4952
4951
|
super(), this._subContainer = s;
|
|
4953
4952
|
const a = document.createElement("div");
|
|
4954
4953
|
this._subContainer.appendChild(a), this.dispose(() => this._subContainer.removeChild(a));
|
|
4955
4954
|
{
|
|
4956
4955
|
const d = async () => {
|
|
4957
|
-
const
|
|
4956
|
+
const u = await t.getCurrentCameraInfo(), c = u == null ? void 0 : u.position, w = [...u == null ? void 0 : u.rotation];
|
|
4958
4957
|
w[0] = 360, t.flyIn(c, w);
|
|
4959
4958
|
};
|
|
4960
4959
|
a.addEventListener("click", d), a.style.cursor = "pointer", this.dispose(() => a.removeEventListener("click", d));
|
|
@@ -4986,13 +4985,13 @@ const le = class le extends G {
|
|
|
4986
4985
|
const w = -t.getCurrentCameraInfo().rotation[0];
|
|
4987
4986
|
p.style.transform = `rotate(${w}deg)`;
|
|
4988
4987
|
};
|
|
4989
|
-
let
|
|
4988
|
+
let u;
|
|
4990
4989
|
const c = async () => {
|
|
4991
|
-
d(), e.show ? (a.style.display = "block",
|
|
4990
|
+
d(), e.show ? (a.style.display = "block", u = setInterval(() => {
|
|
4992
4991
|
d();
|
|
4993
|
-
}, 1e3)) : (a.style.display = "none", clearInterval(
|
|
4992
|
+
}, 1e3)) : (a.style.display = "none", clearInterval(u));
|
|
4994
4993
|
};
|
|
4995
|
-
this.dispose(e.showChanged.disposableOn(c)), c(), this.dispose(() => clearInterval(
|
|
4994
|
+
this.dispose(e.showChanged.disposableOn(c)), c(), this.dispose(() => clearInterval(u));
|
|
4996
4995
|
}
|
|
4997
4996
|
p.style.transformOrigin = "50% 50%";
|
|
4998
4997
|
}
|
|
@@ -5020,15 +5019,14 @@ const Q = class Q extends D {
|
|
|
5020
5019
|
}
|
|
5021
5020
|
});
|
|
5022
5021
|
};
|
|
5023
|
-
this.dispose(e.materialModeChanged.disposableOn(r))
|
|
5022
|
+
this.dispose(e.materialModeChanged.disposableOn(r));
|
|
5024
5023
|
}
|
|
5025
5024
|
}
|
|
5026
5025
|
};
|
|
5027
5026
|
v(Q, "type", Q.register("ESUeViewer", Un.type, Q)), v(Q, "forceUeUpdateProps", [
|
|
5028
5027
|
...D.forceUeUpdateProps
|
|
5029
5028
|
]), v(Q, "propValFuncs", {
|
|
5030
|
-
...D.propValFuncs
|
|
5031
|
-
materialMode: null
|
|
5029
|
+
...D.propValFuncs
|
|
5032
5030
|
});
|
|
5033
5031
|
let nr = Q;
|
|
5034
5032
|
async function Io(l) {
|
|
@@ -5046,8 +5044,8 @@ const ce = class ce extends G {
|
|
|
5046
5044
|
}
|
|
5047
5045
|
const r = this.disposeVar(new He());
|
|
5048
5046
|
t.add(r), this.dispose(() => t.delete(r)), r.instanceClass = class extends m {
|
|
5049
|
-
constructor(s, o,
|
|
5050
|
-
if (super(), this._subContainer = s, !
|
|
5047
|
+
constructor(s, o, h) {
|
|
5048
|
+
if (super(), this._subContainer = s, !h || !(h instanceof J)) return;
|
|
5051
5049
|
const a = document.createElement("div");
|
|
5052
5050
|
this._subContainer.appendChild(a), this.dispose(() => this._subContainer.removeChild(a)), a.style.width = "100%", a.style.position = "absolute", a.style.height = `${A.defaults.height}px`, a.style.left = "0", a.style.bottom = "0", a.style.color = "#fff", a.style.padding = "0 20px 0 0", a.style.boxSizing = "border-box", a.style.lineHeight = `${A.defaults.height}px`, a.style.zIndex = "100", a.style.alignContent = "center", a.style.justifyContent = "space-between";
|
|
5053
5051
|
const g = document.createElement("span");
|
|
@@ -5059,8 +5057,8 @@ const ce = class ce extends G {
|
|
|
5059
5057
|
let c = d.innerHTML;
|
|
5060
5058
|
c.startsWith("鼠标位置") && (c = c.slice(5)), Io(c);
|
|
5061
5059
|
}), d.style.cursor = "pointer", this.dispose(() => g.removeChild(d));
|
|
5062
|
-
const
|
|
5063
|
-
a.appendChild(
|
|
5060
|
+
const u = document.createElement("span");
|
|
5061
|
+
a.appendChild(u), this.dispose(() => a.removeChild(u));
|
|
5064
5062
|
{
|
|
5065
5063
|
const c = () => {
|
|
5066
5064
|
a.style.height = (e.height ?? A.defaults.height) + "px", a.style.lineHeight = (e.height ?? A.defaults.height) + "px";
|
|
@@ -5079,15 +5077,15 @@ const ce = class ce extends G {
|
|
|
5079
5077
|
};
|
|
5080
5078
|
this.dispose(e.bgColorChanged.disposableOn(c)), c();
|
|
5081
5079
|
}
|
|
5082
|
-
|
|
5083
|
-
c && (
|
|
5080
|
+
h.getVersion().then((c) => {
|
|
5081
|
+
c && (u.innerText = `Ue 版本 : ${c[0]} `);
|
|
5084
5082
|
}).catch((c) => {
|
|
5085
5083
|
console.log(c);
|
|
5086
5084
|
});
|
|
5087
5085
|
{
|
|
5088
5086
|
const c = () => {
|
|
5089
5087
|
let y = "", x = "";
|
|
5090
|
-
y += `帧率:${
|
|
5088
|
+
y += `帧率:${h.getFPS().toFixed(0)}FPS`, p.innerText = y;
|
|
5091
5089
|
const C = t.getCurrentCameraInfo();
|
|
5092
5090
|
y += ` 经度: ${C.position[0].toFixed(5)}° 纬度: ${C.position[1].toFixed(5)}° 高度: ${C.position[2].toFixed(2)}米 偏航角: ${C.rotation[0].toFixed(2)}° 俯仰角: ${C.rotation[1].toFixed(2)}° 翻滚角:${C.rotation[2].toFixed(2)}° `, p.innerText = y, t.pick().then((R) => {
|
|
5093
5091
|
if (R) {
|
|
@@ -5233,7 +5231,7 @@ const fe = class fe extends I {
|
|
|
5233
5231
|
}
|
|
5234
5232
|
}
|
|
5235
5233
|
};
|
|
5236
|
-
v(fe, "type", fe.register("ESUeViewer",
|
|
5234
|
+
v(fe, "type", fe.register("ESUeViewer", bn.type, fe));
|
|
5237
5235
|
let cr = fe;
|
|
5238
5236
|
const ge = class ge extends D {
|
|
5239
5237
|
constructor(e, t) {
|
|
@@ -5260,10 +5258,10 @@ const ge = class ge extends D {
|
|
|
5260
5258
|
}));
|
|
5261
5259
|
}
|
|
5262
5260
|
};
|
|
5263
|
-
v(ge, "type", ge.register("ESUeViewer",
|
|
5261
|
+
v(ge, "type", ge.register("ESUeViewer", Jn.type, ge));
|
|
5264
5262
|
let ur = ge, We;
|
|
5265
5263
|
try {
|
|
5266
|
-
const l = "earthsdk3-ue", e = "3.4.
|
|
5264
|
+
const l = "earthsdk3-ue", e = "3.4.1", t = "2025-09-16T08:13:00.000Z", i = "北京西部世界科技有限公司", r = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", n = "edc6b1a5e35b2412fad91ee205c768829c64b897", o = ((Date.now() - 175801038e4) / 36e5).toFixed(1), h = `%c🌏 ${l}%c ${e}.${n.slice(0, 8)}.${t} (距今${o}个小时)
|
|
5267
5265
|
%c${r ? r + `
|
|
5268
5266
|
` : ""}当前网站正在使用${l},此软件版权归${i}所有
|
|
5269
5267
|
`;
|
|
@@ -5277,15 +5275,15 @@ try {
|
|
|
5277
5275
|
},
|
|
5278
5276
|
// @ts-ignore
|
|
5279
5277
|
get gituri() {
|
|
5280
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
5278
|
+
return GITURI_ && GITURI_.replace("${commitId}", "edc6b1a5e35b2412fad91ee205c768829c64b897");
|
|
5281
5279
|
},
|
|
5282
5280
|
// @ts-ignore
|
|
5283
5281
|
get info() {
|
|
5284
|
-
return
|
|
5282
|
+
return h;
|
|
5285
5283
|
},
|
|
5286
5284
|
// @ts-ignore
|
|
5287
5285
|
get date() {
|
|
5288
|
-
return "2025-09-
|
|
5286
|
+
return "2025-09-16T08:13:00.000Z";
|
|
5289
5287
|
},
|
|
5290
5288
|
// @ts-ignore
|
|
5291
5289
|
get author() {
|
|
@@ -5293,7 +5291,7 @@ try {
|
|
|
5293
5291
|
},
|
|
5294
5292
|
// @ts-ignore
|
|
5295
5293
|
get version() {
|
|
5296
|
-
return "3.4.
|
|
5294
|
+
return "3.4.1";
|
|
5297
5295
|
},
|
|
5298
5296
|
// @ts-ignore
|
|
5299
5297
|
get name() {
|
|
@@ -5301,7 +5299,7 @@ try {
|
|
|
5301
5299
|
},
|
|
5302
5300
|
// @ts-ignore
|
|
5303
5301
|
get commitId() {
|
|
5304
|
-
return "
|
|
5302
|
+
return "edc6b1a5e35b2412fad91ee205c768829c64b897";
|
|
5305
5303
|
},
|
|
5306
5304
|
print(a = !1) {
|
|
5307
5305
|
!a && window._xe2_no_copy_print || console.info(
|
|
@@ -5332,7 +5330,7 @@ try {
|
|
|
5332
5330
|
} catch {
|
|
5333
5331
|
}
|
|
5334
5332
|
export {
|
|
5335
|
-
|
|
5333
|
+
J as ESUeViewer,
|
|
5336
5334
|
Co as GeoDivFromESImageLabel,
|
|
5337
5335
|
mo as GeoDivFromESTextLabel,
|
|
5338
5336
|
ns as HighlightFeatureAndFlyToCallFunc,
|
|
@@ -5400,9 +5398,9 @@ export {
|
|
|
5400
5398
|
zi as UeESPolygonFlattenedPlane,
|
|
5401
5399
|
Hi as UeESPolygonWithHole,
|
|
5402
5400
|
ar as UeESRtsFeatureEditing,
|
|
5403
|
-
|
|
5401
|
+
bi as UeESRtsTileset,
|
|
5404
5402
|
at as UeESSceneObject,
|
|
5405
|
-
|
|
5403
|
+
Ji as UeESSeparateFoliage,
|
|
5406
5404
|
ur as UeESSkylineAnalysis,
|
|
5407
5405
|
cr as UeESStaticMesh,
|
|
5408
5406
|
Gi as UeESSubmergingAnalysis,
|
|
@@ -5425,7 +5423,7 @@ export {
|
|
|
5425
5423
|
dt as calcFlyToParamCallFunc,
|
|
5426
5424
|
Er as callFunctionCallFunc,
|
|
5427
5425
|
gs as captureCallFunc,
|
|
5428
|
-
|
|
5426
|
+
b as changeNavigationModeCallFunc,
|
|
5429
5427
|
We as copyright,
|
|
5430
5428
|
Bs as createActorByClassCallFunc,
|
|
5431
5429
|
Fr as destroyCallFunc,
|
|
@@ -5448,7 +5446,7 @@ export {
|
|
|
5448
5446
|
Ss as getStrokeMaterialParamInfoCallFunc,
|
|
5449
5447
|
Zs as getTilesetMaterialIDListCallFunc,
|
|
5450
5448
|
Fs as getVersionCallFunc,
|
|
5451
|
-
|
|
5449
|
+
bs as highlightActorByTagCallFunc,
|
|
5452
5450
|
es as mountPakFiles,
|
|
5453
5451
|
Ys as moveObjectsCallFunc,
|
|
5454
5452
|
ws as partialCaptureCallFunc,
|
|
@@ -5459,7 +5457,7 @@ export {
|
|
|
5459
5457
|
Ir as resetWithCurrentCameraCallFunc,
|
|
5460
5458
|
Ps as restoreOriginalSceneCallFunc,
|
|
5461
5459
|
Hs as saveStringToFileCallFunc,
|
|
5462
|
-
|
|
5460
|
+
Js as sendCustomMessageCallFunc,
|
|
5463
5461
|
cs as setGlobalPropertyCallFunc,
|
|
5464
5462
|
as as setNodePositionCallFunc,
|
|
5465
5463
|
ds as setNodeRotationCallFunc,
|