@vsleem-realsee-viewer/shared 2.0.20 → 2.0.22
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/README.internal.md +2 -2
- package/dist/index.d.ts +20 -9
- package/dist/index.mjs +344 -339
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var b = /* @__PURE__ */ ((s) => (s[s.CADModel = 5] = "CADModel", s[s.BIMModel = 6] = "BIMModel", s[s.ForgeModel = 7] = "ForgeModel", s[s.ThreeDModel = 8] = "ThreeDModel", s[s.GeoModel = 9] = "GeoModel", s[s.ScaleModel = 101] = "ScaleModel", s))(b || {}), st = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(st || {}), M = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(M || {}), O = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(O || {}), Y = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))(Y || {}), x = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(x || {}), L = /* @__PURE__ */ ((s) => (s.JSON = "application/json", s.FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8", s.FORM_DATA = "multipart/form-data;charset=UTF-8", s.OCTET_STREAM = "'application/octet-stream", s))(L || {}), it = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(it || {}), p = /* @__PURE__ */ ((s) => (s[s.GeoPointNoPlane = 9e3] = "GeoPointNoPlane", s[s.PointUnmappedGIS = 9010] = "PointUnmappedGIS", s[s.PointNoXYZ = 9011] = "PointNoXYZ", s[s.PointNoPlane = 9012] = "PointNoPlane", s[s.RelativePlaneUnmatch = 9020] = "RelativePlaneUnmatch", s[s.RelativeNoPlane = 9021] = "RelativeNoPlane", s[s.RelativeJsonError = 9022] = "RelativeJsonError", s[s.RequestCodeError = 9030] = "RequestCodeError", s[s.RequestResultError = 9031] = "RequestResultError", s[s.RequestUnknownError = 9032] = "RequestUnknownError", s))(p || {});
|
|
2
|
+
const nt = {
|
|
3
3
|
baseUrl: "https://vsleem.com/api",
|
|
4
|
-
obsType: "hs",
|
|
5
4
|
authorizeCode: ""
|
|
6
|
-
},
|
|
5
|
+
}, ot = {
|
|
7
6
|
isTransformResponse: !0,
|
|
8
7
|
joinBaseUrl: !0,
|
|
9
8
|
withAuthorize: !0
|
|
10
|
-
},
|
|
9
|
+
}, rt = {
|
|
11
10
|
url: "",
|
|
12
|
-
method:
|
|
11
|
+
method: x.GET,
|
|
13
12
|
headers: {}
|
|
14
13
|
};
|
|
15
|
-
class
|
|
14
|
+
class w extends Error {
|
|
16
15
|
constructor(t, e, i) {
|
|
17
|
-
super(e), this.code = t, this.message = e, this.details = i, this.name = "Apprror", Object.setPrototypeOf(this,
|
|
16
|
+
super(e), this.code = t, this.message = e, this.details = i, this.name = "Apprror", Object.setPrototypeOf(this, w.prototype);
|
|
18
17
|
}
|
|
19
18
|
// 可选的:转换成 JSON 格式,方便返回给调用方
|
|
20
19
|
toJSON() {
|
|
@@ -26,195 +25,196 @@ class y extends Error {
|
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
|
|
28
|
+
const G = { ...nt };
|
|
29
|
+
function at(s) {
|
|
30
|
+
const { baseUrl: t, authorizeCode: e } = s;
|
|
31
|
+
Object.assign(G, { baseUrl: t, authorizeCode: e });
|
|
32
32
|
}
|
|
33
|
-
async function
|
|
34
|
-
const e = { ...
|
|
33
|
+
async function P(s, t) {
|
|
34
|
+
const e = { ...ot, ...t }, i = { ...rt, ...s };
|
|
35
35
|
try {
|
|
36
|
-
const n =
|
|
37
|
-
return
|
|
36
|
+
const n = ht(i, e), { url: o, ...r } = n, c = await (await window.fetch(o, r)).json();
|
|
37
|
+
return ct(c, e);
|
|
38
38
|
} catch (n) {
|
|
39
|
-
return
|
|
39
|
+
return lt(n);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const { baseUrl: e, authorizeCode: i } =
|
|
44
|
-
let { url: r, method: a, headers:
|
|
42
|
+
function ht(s, t) {
|
|
43
|
+
const { baseUrl: e, authorizeCode: i } = G, { joinBaseUrl: n, withAuthorize: o } = t;
|
|
44
|
+
let { url: r, method: a, headers: c = {}, params: l, data: h } = s;
|
|
45
45
|
n && e && (r = `${e}${r}`), a = a?.toUpperCase();
|
|
46
|
-
const u = { ...
|
|
47
|
-
if (/^https?:\/\/.+$/i.test(e ?? "") ? u.PlatForm = new URL(e ?? "").host : u.PlatForm = new URL(window.location.href).host, o && i && (u.AuthorizationCode = i), a ===
|
|
48
|
-
const
|
|
49
|
-
r +=
|
|
46
|
+
const u = { ...c };
|
|
47
|
+
if (/^https?:\/\/.+$/i.test(e ?? "") ? u.PlatForm = new URL(e ?? "").host : u.PlatForm = new URL(window.location.href).host, o && i && (u.AuthorizationCode = i), a === x.POST && !u["Content-Type"] && (u["Content-Type"] = L.JSON), a === x.GET && l) {
|
|
48
|
+
const T = new URLSearchParams(l), v = r.includes("?") ? "&" : "?";
|
|
49
|
+
r += v + `${T.toString()}`;
|
|
50
50
|
}
|
|
51
51
|
let d;
|
|
52
|
-
return a ===
|
|
52
|
+
return a === x.POST && (d = u["Content-Type"] === L.JSON ? JSON.stringify(h || {}) : h), {
|
|
53
53
|
url: r,
|
|
54
54
|
method: a,
|
|
55
55
|
headers: u,
|
|
56
56
|
body: d
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function ct(s, t) {
|
|
60
60
|
if (!t.isTransformResponse)
|
|
61
61
|
return s;
|
|
62
62
|
if (!s)
|
|
63
|
-
throw new
|
|
63
|
+
throw new w(p.RequestResultError, "请求返回的结果错误");
|
|
64
64
|
const { code: e, data: i, msg: n } = s;
|
|
65
|
-
if (e ===
|
|
65
|
+
if (e === Y.SUCCESS)
|
|
66
66
|
return i;
|
|
67
|
-
throw new
|
|
67
|
+
throw new w(p.RequestCodeError, n || "请求返回的Code错误");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
throw s instanceof Error ? s : new
|
|
71
|
-
|
|
69
|
+
function lt(s) {
|
|
70
|
+
throw s instanceof Error ? s : new w(
|
|
71
|
+
p.RequestUnknownError,
|
|
72
72
|
typeof s == "string" ? s : "未知的请求错误"
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76
76
|
__proto__: null,
|
|
77
|
-
request:
|
|
78
|
-
setRequestGlobalConfig:
|
|
77
|
+
request: P,
|
|
78
|
+
setRequestGlobalConfig: at
|
|
79
79
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
80
|
-
function
|
|
81
|
-
return
|
|
80
|
+
function B(s, t) {
|
|
81
|
+
return P(
|
|
82
82
|
{
|
|
83
83
|
url: "/project/jssdk/cs/list",
|
|
84
|
-
method:
|
|
84
|
+
method: x.GET,
|
|
85
85
|
params: s
|
|
86
86
|
},
|
|
87
87
|
t
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
90
|
+
function $(s, t) {
|
|
91
|
+
return P(
|
|
92
92
|
{
|
|
93
93
|
url: "/project/jssdk/cs/bind",
|
|
94
|
-
method:
|
|
94
|
+
method: x.POST,
|
|
95
95
|
data: s
|
|
96
96
|
},
|
|
97
97
|
t
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function A(s, t) {
|
|
101
|
+
return P(
|
|
102
102
|
{
|
|
103
103
|
url: "/project/jssdk/cs/save",
|
|
104
|
-
method:
|
|
104
|
+
method: x.POST,
|
|
105
105
|
data: s
|
|
106
106
|
},
|
|
107
107
|
t
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
110
|
+
function _(s, t) {
|
|
111
|
+
return P(
|
|
112
112
|
{
|
|
113
113
|
url: "/project/jssdk/cs/delete",
|
|
114
|
-
method:
|
|
114
|
+
method: x.POST,
|
|
115
115
|
data: s
|
|
116
116
|
},
|
|
117
117
|
t
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
120
|
+
function Z(s, t) {
|
|
121
|
+
return P(
|
|
122
122
|
{
|
|
123
123
|
url: "/project/jssdk/cs/mapping",
|
|
124
|
-
method:
|
|
124
|
+
method: x.POST,
|
|
125
125
|
data: s
|
|
126
126
|
},
|
|
127
127
|
t
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return
|
|
130
|
+
function q(s, t) {
|
|
131
|
+
return P(
|
|
132
132
|
{
|
|
133
133
|
url: "/project/jssdk/cs/mapping/query",
|
|
134
|
-
method:
|
|
134
|
+
method: x.GET,
|
|
135
135
|
params: s
|
|
136
136
|
},
|
|
137
137
|
t
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function ut(s, t = {
|
|
141
141
|
isTransformResponse: !1,
|
|
142
142
|
joinBaseUrl: !1,
|
|
143
143
|
withAuthorize: !1
|
|
144
144
|
}) {
|
|
145
|
-
return
|
|
145
|
+
return P(
|
|
146
146
|
{
|
|
147
147
|
url: s,
|
|
148
|
-
method:
|
|
148
|
+
method: x.GET
|
|
149
149
|
},
|
|
150
150
|
t
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
154
154
|
__proto__: null,
|
|
155
|
-
bindCoordinate:
|
|
156
|
-
getCoordinateList:
|
|
157
|
-
getImageInfo:
|
|
158
|
-
getMappingRelation:
|
|
159
|
-
mapingCoordinate:
|
|
160
|
-
removeCoordinate:
|
|
161
|
-
saveCoordinate:
|
|
162
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
163
|
-
function
|
|
164
|
-
return
|
|
155
|
+
bindCoordinate: $,
|
|
156
|
+
getCoordinateList: B,
|
|
157
|
+
getImageInfo: ut,
|
|
158
|
+
getMappingRelation: q,
|
|
159
|
+
mapingCoordinate: Z,
|
|
160
|
+
removeCoordinate: _,
|
|
161
|
+
saveCoordinate: A
|
|
162
|
+
}, Symbol.toStringTag, { value: "Module" })), dt = typeof window < "u", ft = Object.prototype.toString;
|
|
163
|
+
function E(s, t) {
|
|
164
|
+
return ft.call(s) === `[object ${t}]`;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function J(s) {
|
|
167
167
|
return typeof s < "u";
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
return !
|
|
169
|
+
function H(s) {
|
|
170
|
+
return !J(s);
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
return s !== null &&
|
|
172
|
+
function S(s) {
|
|
173
|
+
return s !== null && E(s, "Object");
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function V(s) {
|
|
176
176
|
return s === null;
|
|
177
177
|
}
|
|
178
|
-
function ft(s) {
|
|
179
|
-
return T(s, "Date");
|
|
180
|
-
}
|
|
181
178
|
function mt(s) {
|
|
182
|
-
return
|
|
183
|
-
}
|
|
184
|
-
function k(s) {
|
|
185
|
-
return typeof s == "function";
|
|
179
|
+
return E(s, "Date");
|
|
186
180
|
}
|
|
187
181
|
function yt(s) {
|
|
188
|
-
return
|
|
182
|
+
return E(s, "String");
|
|
189
183
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
184
|
+
function j(s) {
|
|
185
|
+
return typeof s == "function";
|
|
192
186
|
}
|
|
193
|
-
function
|
|
194
|
-
return s
|
|
187
|
+
function wt(s) {
|
|
188
|
+
return E(s, "Boolean");
|
|
195
189
|
}
|
|
196
190
|
function pt(s) {
|
|
197
|
-
return
|
|
191
|
+
return E(s, "RegExp");
|
|
192
|
+
}
|
|
193
|
+
function g(s) {
|
|
194
|
+
return s && Array.isArray(s);
|
|
198
195
|
}
|
|
199
196
|
function gt(s) {
|
|
200
|
-
return
|
|
197
|
+
return typeof window < "u" && E(s, "Window");
|
|
198
|
+
}
|
|
199
|
+
function xt(s) {
|
|
200
|
+
return S(s) && !!s.tagName;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function I(s) {
|
|
203
203
|
return typeof s == "number" ? !0 : typeof s != "string" ? !1 : /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(s);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function Mt(s, t) {
|
|
206
206
|
return JSON.stringify(s) === JSON.stringify(t);
|
|
207
207
|
}
|
|
208
|
-
function Mt(s) {
|
|
209
|
-
return J(s) || H(s);
|
|
210
|
-
}
|
|
211
208
|
function vt(s) {
|
|
212
|
-
return
|
|
209
|
+
return H(s) || V(s);
|
|
213
210
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
211
|
+
function bt(s) {
|
|
212
|
+
return E(s, "Promise") && S(s) && j(s.then) && j(s.catch);
|
|
213
|
+
}
|
|
214
|
+
function W(s) {
|
|
215
|
+
return z(s, /* @__PURE__ */ new WeakMap());
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function z(s, t) {
|
|
218
218
|
if (typeof s != "object" || s === null)
|
|
219
219
|
return s;
|
|
220
220
|
if (t.has(s))
|
|
@@ -226,11 +226,11 @@ function P(s, t) {
|
|
|
226
226
|
return e = new RegExp(s), t.set(s, e), e;
|
|
227
227
|
if (s instanceof Map)
|
|
228
228
|
return e = /* @__PURE__ */ new Map(), t.set(s, e), s.forEach((n, o) => {
|
|
229
|
-
e.set(o,
|
|
229
|
+
e.set(o, z(n, t));
|
|
230
230
|
}), e;
|
|
231
231
|
if (s instanceof Set)
|
|
232
232
|
return e = /* @__PURE__ */ new Set(), t.set(s, e), s.forEach((n) => {
|
|
233
|
-
e.add(
|
|
233
|
+
e.add(z(n, t));
|
|
234
234
|
}), e;
|
|
235
235
|
if (ArrayBuffer.isView(s))
|
|
236
236
|
return e = new s.constructor(
|
|
@@ -243,18 +243,18 @@ function P(s, t) {
|
|
|
243
243
|
if (Array.isArray(s)) {
|
|
244
244
|
e = [], t.set(s, e);
|
|
245
245
|
for (let n = 0; n < s.length; n++)
|
|
246
|
-
n in s && (e[n] =
|
|
246
|
+
n in s && (e[n] = z(s[n], t));
|
|
247
247
|
return e;
|
|
248
248
|
}
|
|
249
249
|
e = Object.create(Object.getPrototypeOf(s)), t.set(s, e);
|
|
250
250
|
for (const n in s)
|
|
251
|
-
Object.prototype.hasOwnProperty.call(s, n) && (e[n] =
|
|
251
|
+
Object.prototype.hasOwnProperty.call(s, n) && (e[n] = z(s[n], t));
|
|
252
252
|
const i = Object.getOwnPropertySymbols(s);
|
|
253
253
|
for (const n of i)
|
|
254
|
-
Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] =
|
|
254
|
+
Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = z(s[n], t));
|
|
255
255
|
return e;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Tt(s, t, e = !1) {
|
|
258
258
|
let i;
|
|
259
259
|
const n = function(...o) {
|
|
260
260
|
const r = this, a = e && !i;
|
|
@@ -281,51 +281,51 @@ function St(s, t, e = !1) {
|
|
|
281
281
|
clearTimeout(i), i = void 0, n = void 0;
|
|
282
282
|
}, o;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function k(s, ...t) {
|
|
285
285
|
if (!t.length) return s;
|
|
286
286
|
const e = t.shift();
|
|
287
|
-
return e === void 0 ? s : (
|
|
287
|
+
return e === void 0 ? s : (C(s) && C(e) && Object.keys(e).forEach((i) => {
|
|
288
288
|
const n = s[i], o = e[i];
|
|
289
|
-
Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] :
|
|
290
|
-
}),
|
|
289
|
+
Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : C(n) && C(o) ? s[i] = k({ ...n }, o) : o !== void 0 && (s[i] = o);
|
|
290
|
+
}), k(s, ...t));
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function C(s) {
|
|
293
293
|
return s !== null && typeof s == "object" && !Array.isArray(s);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Q(s, ...t) {
|
|
296
296
|
if (!t.length) return s;
|
|
297
297
|
for (const e of t)
|
|
298
298
|
e != null && typeof e == "object" && Object.keys(e).forEach((i) => {
|
|
299
299
|
const n = e[i], o = s[i];
|
|
300
|
-
n !== null && typeof n == "object" && !Array.isArray(n) ? ((!o || typeof o != "object") && (s[i] = {}),
|
|
300
|
+
n !== null && typeof n == "object" && !Array.isArray(n) ? ((!o || typeof o != "object") && (s[i] = {}), Q(s[i], n)) : s[i] = n;
|
|
301
301
|
});
|
|
302
302
|
return s;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function K(s, t) {
|
|
305
305
|
const e = {};
|
|
306
|
-
if (
|
|
306
|
+
if (S(s) && !g(s)) {
|
|
307
307
|
for (const i in s)
|
|
308
308
|
if (Object.prototype.hasOwnProperty.call(s, i)) {
|
|
309
|
-
const n = s[i], o =
|
|
309
|
+
const n = s[i], o = S(t) && !g(t) ? t[i] : void 0;
|
|
310
310
|
if (!(i in (t || {})))
|
|
311
311
|
e[i] = n;
|
|
312
|
-
else if (
|
|
312
|
+
else if (g(n) && g(o))
|
|
313
313
|
JSON.stringify(n) !== JSON.stringify(o) && (e[i] = n);
|
|
314
|
-
else if (
|
|
315
|
-
const r =
|
|
314
|
+
else if (S(n) && S(o)) {
|
|
315
|
+
const r = K(n, o);
|
|
316
316
|
r && Object.keys(r).length > 0 && (e[i] = r);
|
|
317
317
|
} else n !== o && (e[i] = n);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
if (
|
|
320
|
+
if (S(t) && g(t))
|
|
321
321
|
for (const i in t)
|
|
322
322
|
Object.prototype.hasOwnProperty.call(t, i) && !(i in (s || {})) && (e[i] = void 0);
|
|
323
323
|
return e;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Pt(s, t = {}) {
|
|
326
326
|
return new Promise((e, i) => {
|
|
327
|
-
const n =
|
|
328
|
-
if (
|
|
327
|
+
const n = D(s);
|
|
328
|
+
if (Et(n)) {
|
|
329
329
|
e(!0);
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
@@ -339,14 +339,14 @@ function Tt(s, t = {}) {
|
|
|
339
339
|
}, document.head.appendChild(o);
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
function Pt(s) {
|
|
343
|
-
const t = z(s);
|
|
344
|
-
return Array.from(document.scripts).some((e) => z(e.src) === t);
|
|
345
|
-
}
|
|
346
342
|
function Et(s) {
|
|
343
|
+
const t = D(s);
|
|
344
|
+
return Array.from(document.scripts).some((e) => D(e.src) === t);
|
|
345
|
+
}
|
|
346
|
+
function zt(s) {
|
|
347
347
|
return new Promise((t, e) => {
|
|
348
|
-
const i =
|
|
349
|
-
if (
|
|
348
|
+
const i = D(s);
|
|
349
|
+
if (Dt(i)) {
|
|
350
350
|
t(!0);
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
@@ -358,13 +358,13 @@ function Et(s) {
|
|
|
358
358
|
}, document.head.appendChild(n);
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
const t =
|
|
361
|
+
function Dt(s) {
|
|
362
|
+
const t = D(s);
|
|
363
363
|
return Array.from(document.querySelectorAll('link[rel="stylesheet"]')).some(
|
|
364
|
-
(e) =>
|
|
364
|
+
(e) => D(e.href) === t
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function D(s) {
|
|
368
368
|
try {
|
|
369
369
|
const t = new URL(s, window.location.href);
|
|
370
370
|
return `${t.origin}${t.pathname}`;
|
|
@@ -372,7 +372,7 @@ function z(s) {
|
|
|
372
372
|
return s;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function Nt(s, t, e, i) {
|
|
376
376
|
const n = Math.min(s / e, t / i), o = e * n, r = i * n;
|
|
377
377
|
return {
|
|
378
378
|
scale: n,
|
|
@@ -384,59 +384,59 @@ function Dt(s, t, e, i) {
|
|
|
384
384
|
sh: r
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function Ct(s, t, e) {
|
|
388
388
|
return {
|
|
389
389
|
x: s * e.scale + e.x,
|
|
390
390
|
// 缩放后加上偏移量
|
|
391
391
|
y: t * e.scale + e.y
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function It(s, t, e) {
|
|
395
395
|
return {
|
|
396
396
|
x: (s - e.x) / e.scale,
|
|
397
397
|
// 减去偏移量后缩放到模型尺寸
|
|
398
398
|
y: (t - e.y) / e.scale
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Rt(s) {
|
|
402
402
|
console.warn(`[warn]:${s}`);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function Ot(s) {
|
|
405
405
|
throw new Error(`[error]:${s}`);
|
|
406
406
|
}
|
|
407
|
-
const
|
|
407
|
+
const jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
408
408
|
__proto__: null,
|
|
409
|
-
cloneDeep:
|
|
410
|
-
debounce:
|
|
411
|
-
deepMerge:
|
|
412
|
-
deepMergeProps:
|
|
413
|
-
error:
|
|
414
|
-
getDiffProps:
|
|
415
|
-
getImageTransform:
|
|
416
|
-
inBrowser:
|
|
417
|
-
is:
|
|
418
|
-
isArray:
|
|
419
|
-
isBoolean:
|
|
420
|
-
isDate:
|
|
421
|
-
isDef:
|
|
422
|
-
isElement:
|
|
423
|
-
isFunction:
|
|
424
|
-
isNull:
|
|
425
|
-
isNullOrUnDef:
|
|
426
|
-
isNumeric:
|
|
427
|
-
isObject:
|
|
428
|
-
isPromise:
|
|
429
|
-
isRegExp:
|
|
430
|
-
isSameValue:
|
|
431
|
-
isString:
|
|
432
|
-
isUnDef:
|
|
433
|
-
isWindow:
|
|
434
|
-
loadCss:
|
|
435
|
-
loadScript:
|
|
409
|
+
cloneDeep: W,
|
|
410
|
+
debounce: Tt,
|
|
411
|
+
deepMerge: k,
|
|
412
|
+
deepMergeProps: Q,
|
|
413
|
+
error: Ot,
|
|
414
|
+
getDiffProps: K,
|
|
415
|
+
getImageTransform: Nt,
|
|
416
|
+
inBrowser: dt,
|
|
417
|
+
is: E,
|
|
418
|
+
isArray: g,
|
|
419
|
+
isBoolean: wt,
|
|
420
|
+
isDate: mt,
|
|
421
|
+
isDef: J,
|
|
422
|
+
isElement: xt,
|
|
423
|
+
isFunction: j,
|
|
424
|
+
isNull: V,
|
|
425
|
+
isNullOrUnDef: vt,
|
|
426
|
+
isNumeric: I,
|
|
427
|
+
isObject: S,
|
|
428
|
+
isPromise: bt,
|
|
429
|
+
isRegExp: pt,
|
|
430
|
+
isSameValue: Mt,
|
|
431
|
+
isString: yt,
|
|
432
|
+
isUnDef: H,
|
|
433
|
+
isWindow: gt,
|
|
434
|
+
loadCss: zt,
|
|
435
|
+
loadScript: Pt,
|
|
436
436
|
throttle: St,
|
|
437
|
-
toCanvasCoord:
|
|
438
|
-
toModelCoord:
|
|
439
|
-
warn:
|
|
437
|
+
toCanvasCoord: Ct,
|
|
438
|
+
toModelCoord: It,
|
|
439
|
+
warn: Rt
|
|
440
440
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
441
441
|
class f {
|
|
442
442
|
/** 直角坐标系坐标 */
|
|
@@ -467,8 +467,8 @@ class f {
|
|
|
467
467
|
plane = "xy";
|
|
468
468
|
/** 默认平面 ('xy' 或 'xz') */
|
|
469
469
|
constructor(t) {
|
|
470
|
-
const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw:
|
|
471
|
-
this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, (this.x !== 0 || this.y !== 0 || this.z !== 0) && (this.plane = u, this.hasXYZ = !0), this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, (this.lat !== 0 || this.lon !== 0 || this.alt !== 0) && (this.hasGeo = !0), this.yaw = Number(
|
|
470
|
+
const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: c, pitch: l, roll: h, plane: u = "xy" } = t || {};
|
|
471
|
+
this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, (this.x !== 0 || this.y !== 0 || this.z !== 0) && (this.plane = u, this.hasXYZ = !0), this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, (this.lat !== 0 || this.lon !== 0 || this.alt !== 0) && (this.hasGeo = !0), this.yaw = Number(c) || 0, this.pitch = Number(l) || 0, this.roll = Number(h) || 0, (I(c) || I(l) || I(h)) && (this.hasAngle = !0);
|
|
472
472
|
}
|
|
473
473
|
/**
|
|
474
474
|
* 计算两点之间的三维距离
|
|
@@ -521,7 +521,7 @@ class f {
|
|
|
521
521
|
* @returns 夹角角度 (0-180度)
|
|
522
522
|
*/
|
|
523
523
|
static angleXZ(t, e, i) {
|
|
524
|
-
const n = { x: t.x - e.x, z: t.z - e.z }, o = { x: i.x - e.x, z: i.z - e.z }, r = n.x * o.x + n.z * o.z, a = Math.sqrt(n.x ** 2 + n.z ** 2),
|
|
524
|
+
const n = { x: t.x - e.x, z: t.z - e.z }, o = { x: i.x - e.x, z: i.z - e.z }, r = n.x * o.x + n.z * o.z, a = Math.sqrt(n.x ** 2 + n.z ** 2), c = Math.sqrt(o.x ** 2 + o.z ** 2), l = Math.max(-1, Math.min(1, r / (a * c))), u = Math.acos(l) * 180 / Math.PI;
|
|
525
525
|
return Math.min(u, 360 - u);
|
|
526
526
|
}
|
|
527
527
|
/**
|
|
@@ -555,26 +555,26 @@ class f {
|
|
|
555
555
|
try {
|
|
556
556
|
if (e?.id === i?.id)
|
|
557
557
|
return new f(this);
|
|
558
|
-
if (e?.modelType ===
|
|
558
|
+
if (e?.modelType === b.GeoModel) {
|
|
559
559
|
const { refPoint: n } = e?.relativeMap || {};
|
|
560
560
|
if (this?.hasXYZ)
|
|
561
561
|
return this.project(t);
|
|
562
562
|
if (this.hasGeo && n) {
|
|
563
|
-
const o =
|
|
563
|
+
const o = N.LLHToXYZ(this, n);
|
|
564
564
|
return this.x = o.x, this.y = o.y, this.z = o.z, this.hasXYZ = !0, this.project(t);
|
|
565
565
|
}
|
|
566
|
-
throw new
|
|
566
|
+
throw new w(p.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
|
|
567
567
|
}
|
|
568
|
-
if (i?.modelType ===
|
|
568
|
+
if (i?.modelType === b.GeoModel) {
|
|
569
569
|
const { refPoint: n } = i?.relativeMap || {};
|
|
570
570
|
if (this?.hasGeo)
|
|
571
571
|
return new f(this);
|
|
572
572
|
const o = this.project(t);
|
|
573
573
|
if (o?.hasXYZ && n) {
|
|
574
|
-
const r =
|
|
574
|
+
const r = N.XYZToLLH(o, n);
|
|
575
575
|
return o.lat = r.lat, o.lon = r.lon, o.alt = r.alt, o.hasGeo = !0, o;
|
|
576
576
|
}
|
|
577
|
-
throw new
|
|
577
|
+
throw new w(p.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
|
|
578
578
|
}
|
|
579
579
|
return this.project(t);
|
|
580
580
|
} catch (n) {
|
|
@@ -590,12 +590,12 @@ class f {
|
|
|
590
590
|
*/
|
|
591
591
|
project(t) {
|
|
592
592
|
if (!this.hasXYZ)
|
|
593
|
-
throw new
|
|
593
|
+
throw new w(p.PointNoXYZ, "点没有xxz坐标信息");
|
|
594
594
|
if (this.plane === "xz")
|
|
595
595
|
return this.projectXZ(t);
|
|
596
596
|
if (this.plane === "xy")
|
|
597
597
|
return this.projectXY(t);
|
|
598
|
-
throw new
|
|
598
|
+
throw new w(p.PointNoPlane, "点的plane应为xz或xy");
|
|
599
599
|
}
|
|
600
600
|
/**
|
|
601
601
|
* XZ平面投影转换
|
|
@@ -620,7 +620,7 @@ class f {
|
|
|
620
620
|
return e.x = i + t.x, e.y = n + t.y, e.z += t.z, e;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class N {
|
|
624
624
|
lat = 0;
|
|
625
625
|
/** 经度 */
|
|
626
626
|
lon = 0;
|
|
@@ -629,45 +629,45 @@ class D {
|
|
|
629
629
|
/** 高度 */
|
|
630
630
|
constructor(t) {
|
|
631
631
|
const { lat: e = 0, lon: i = 0, alt: n = 0 } = t || {};
|
|
632
|
-
this.lat = e, this.lon = i, this.alt = n;
|
|
632
|
+
this.lat = Number(e) || 0, this.lon = Number(i) || 0, this.alt = Number(n) || 0;
|
|
633
633
|
}
|
|
634
634
|
static XYZToLLH(t, e) {
|
|
635
635
|
const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt;
|
|
636
|
-
let
|
|
636
|
+
let c, l, h;
|
|
637
637
|
if (t.plane === "xz") {
|
|
638
638
|
const u = t.x / 1e3 / (a * Math.cos(r)), d = t.z / 1e3 / a;
|
|
639
|
-
|
|
639
|
+
c = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), h = e.alt + t.y / 1e3;
|
|
640
640
|
} else if (t.plane === "xy") {
|
|
641
641
|
const u = t.x / 1e3 / (a * Math.cos(r)), d = t.y / 1e3 / a;
|
|
642
|
-
|
|
642
|
+
c = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), h = e.alt + t.z / 1e3;
|
|
643
643
|
} else
|
|
644
|
-
throw new
|
|
645
|
-
return new
|
|
644
|
+
throw new w(p.GeoPointNoPlane, "点的plane应为xz或xy");
|
|
645
|
+
return new N({
|
|
646
646
|
lat: l,
|
|
647
|
-
lon:
|
|
648
|
-
alt:
|
|
647
|
+
lon: c,
|
|
648
|
+
alt: h
|
|
649
649
|
});
|
|
650
650
|
}
|
|
651
651
|
static LLHToXYZ(t, e) {
|
|
652
|
-
const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt,
|
|
652
|
+
const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt, c = f.toRadians(t.lon - e.lon), l = f.toRadians(e.lat - t.lat), h = a * c * Math.cos(r), u = a * l;
|
|
653
653
|
if (t.plane === "xz")
|
|
654
654
|
return new f({
|
|
655
|
-
x:
|
|
655
|
+
x: h * 1e3,
|
|
656
656
|
y: (t.alt - e.alt) * 1e3,
|
|
657
657
|
z: u * 1e3,
|
|
658
658
|
plane: "xz"
|
|
659
659
|
});
|
|
660
660
|
if (t.plane === "xy")
|
|
661
661
|
return new f({
|
|
662
|
-
x:
|
|
662
|
+
x: h * 1e3,
|
|
663
663
|
y: u * 1e3,
|
|
664
664
|
z: (t.alt - e.alt) * 1e3,
|
|
665
665
|
plane: "xy"
|
|
666
666
|
});
|
|
667
|
-
throw new
|
|
667
|
+
throw new w(p.GeoPointNoPlane, "点的plane应为xz或xy");
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
class
|
|
670
|
+
class y {
|
|
671
671
|
scale = 1;
|
|
672
672
|
yaw = 0;
|
|
673
673
|
x = 0;
|
|
@@ -680,7 +680,7 @@ class p {
|
|
|
680
680
|
/** 参考点 */
|
|
681
681
|
constructor(t) {
|
|
682
682
|
const { refPoint: e, ...i } = t || {};
|
|
683
|
-
e && (this.refPoint = new
|
|
683
|
+
e && (this.refPoint = new N(e)), Object.assign(this, i);
|
|
684
684
|
}
|
|
685
685
|
/**
|
|
686
686
|
* 合并两个相对坐标系的映射关系
|
|
@@ -690,22 +690,22 @@ class p {
|
|
|
690
690
|
*/
|
|
691
691
|
static addRelativeMap(t, e) {
|
|
692
692
|
if (t.plane !== e.plane)
|
|
693
|
-
throw new
|
|
693
|
+
throw new w(p.RelativePlaneUnmatch, "两个映射关系的plane应该相同");
|
|
694
694
|
const i = t.scale * e.scale, n = t.yaw + e.yaw, o = Math.cos(e.yaw), r = Math.sin(e.yaw);
|
|
695
|
-
let a = 0,
|
|
695
|
+
let a = 0, c = 0, l = 0;
|
|
696
696
|
if (t.plane === "xz") {
|
|
697
|
-
const
|
|
698
|
-
a = e.x +
|
|
697
|
+
const h = t.x * o - t.z * r, u = t.y, d = t.x * r + t.z * o;
|
|
698
|
+
a = e.x + h * e.scale, c = e.y + u * e.scale, l = e.z + d * e.scale;
|
|
699
699
|
} else if (t.plane === "xy") {
|
|
700
|
-
const
|
|
701
|
-
a = e.x +
|
|
700
|
+
const h = t.x * o - t.y * r, u = t.x * r + t.y * o, d = t.z;
|
|
701
|
+
a = e.x + h * e.scale, c = e.y + u * e.scale, l = e.z + d * e.scale;
|
|
702
702
|
} else
|
|
703
|
-
throw new
|
|
704
|
-
return new
|
|
703
|
+
throw new w(p.RelativeNoPlane, "映射关系的plane应为xz或xy");
|
|
704
|
+
return new y({
|
|
705
705
|
scale: i,
|
|
706
706
|
yaw: n,
|
|
707
707
|
x: a,
|
|
708
|
-
y:
|
|
708
|
+
y: c,
|
|
709
709
|
z: l,
|
|
710
710
|
start: t.start,
|
|
711
711
|
end: t.end,
|
|
@@ -719,19 +719,19 @@ class p {
|
|
|
719
719
|
*/
|
|
720
720
|
static inverseRelativeMap(t) {
|
|
721
721
|
const e = 1 / t.scale, i = -t.yaw, n = Math.cos(-i), o = Math.sin(-i);
|
|
722
|
-
let r = 0, a = 0,
|
|
722
|
+
let r = 0, a = 0, c = 0;
|
|
723
723
|
if (t.plane === "xz")
|
|
724
|
-
r = -(t.x * n + t.z * o) * e, a = -t.y * e,
|
|
724
|
+
r = -(t.x * n + t.z * o) * e, a = -t.y * e, c = -(t.z * n - t.x * o) * e;
|
|
725
725
|
else if (t.plane === "xy")
|
|
726
|
-
r = -(t.x * n + t.y * o) * e, a = -(t.y * n - t.x * o) * e,
|
|
726
|
+
r = -(t.x * n + t.y * o) * e, a = -(t.y * n - t.x * o) * e, c = -t.z * e;
|
|
727
727
|
else
|
|
728
|
-
throw new
|
|
729
|
-
return new
|
|
728
|
+
throw new w(p.RelativeNoPlane, "映射关系的plane应为xz或xy");
|
|
729
|
+
return new y({
|
|
730
730
|
scale: e,
|
|
731
731
|
yaw: i,
|
|
732
732
|
x: r,
|
|
733
733
|
y: a,
|
|
734
|
-
z:
|
|
734
|
+
z: c,
|
|
735
735
|
start: t.start,
|
|
736
736
|
end: t.end,
|
|
737
737
|
plane: t.plane
|
|
@@ -741,9 +741,9 @@ class p {
|
|
|
741
741
|
try {
|
|
742
742
|
let e = t ? JSON.parse(t) : void 0;
|
|
743
743
|
const { reference_point: i } = e || {};
|
|
744
|
-
return i && (e = { refPoint: i }), e ? new
|
|
744
|
+
return i && (e = { refPoint: i }), e ? new y(e) : void 0;
|
|
745
745
|
} catch {
|
|
746
|
-
throw new
|
|
746
|
+
throw new w(p.RelativeJsonError, "relativeMap格式化失败");
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
static toStringify(t) {
|
|
@@ -757,7 +757,7 @@ class m {
|
|
|
757
757
|
* @returns
|
|
758
758
|
*/
|
|
759
759
|
static async getCoordinateTree(t) {
|
|
760
|
-
const e = await
|
|
760
|
+
const e = await B({ projectId: t });
|
|
761
761
|
if (e.length) {
|
|
762
762
|
const i = m.handleCoordinateList(e);
|
|
763
763
|
return m.buildCoordinateTree(i, 0);
|
|
@@ -780,16 +780,16 @@ class m {
|
|
|
780
780
|
*/
|
|
781
781
|
static async addCoordinate(t, e) {
|
|
782
782
|
const { projectId: i, id: n } = t, o = e.map((a) => {
|
|
783
|
-
const { type:
|
|
783
|
+
const { type: c, modelType: l, relativeMap: h, level: u, ...d } = a, T = h ? JSON.stringify(h) : void 0;
|
|
784
784
|
return {
|
|
785
785
|
...d,
|
|
786
786
|
projectId: i,
|
|
787
787
|
parentId: n,
|
|
788
|
-
coordinateType:
|
|
788
|
+
coordinateType: c,
|
|
789
789
|
renderType: l,
|
|
790
|
-
relativePosition:
|
|
790
|
+
relativePosition: T
|
|
791
791
|
};
|
|
792
|
-
}), r = await
|
|
792
|
+
}), r = await A(o);
|
|
793
793
|
return m.handleCoordinateList(r);
|
|
794
794
|
}
|
|
795
795
|
/**
|
|
@@ -800,7 +800,7 @@ class m {
|
|
|
800
800
|
*/
|
|
801
801
|
static async removeCoordinate(t, e) {
|
|
802
802
|
const i = e.map((n) => n.id ?? -1);
|
|
803
|
-
return await
|
|
803
|
+
return await _(i);
|
|
804
804
|
}
|
|
805
805
|
/**
|
|
806
806
|
* 更新坐标系
|
|
@@ -810,9 +810,9 @@ class m {
|
|
|
810
810
|
*/
|
|
811
811
|
static async updateCoordinate(t, e) {
|
|
812
812
|
const { projectId: i, id: n } = t, o = e.map((a) => {
|
|
813
|
-
const { type:
|
|
813
|
+
const { type: c, relativeMap: l, level: h, ...u } = a, d = y.toStringify(l);
|
|
814
814
|
return { ...u, relativePosition: d, projectId: i, parentId: n };
|
|
815
|
-
}), r = await
|
|
815
|
+
}), r = await A(o);
|
|
816
816
|
return m.handleCoordinateList(r);
|
|
817
817
|
}
|
|
818
818
|
/**
|
|
@@ -823,9 +823,9 @@ class m {
|
|
|
823
823
|
*/
|
|
824
824
|
static async bindCoordinate(t, e) {
|
|
825
825
|
const { projectId: i, id: n } = t, o = e.map((a) => {
|
|
826
|
-
const { modelId:
|
|
827
|
-
return { modelId:
|
|
828
|
-
}), r = await
|
|
826
|
+
const { modelId: c } = a;
|
|
827
|
+
return { modelId: c, parentId: n, projectId: i };
|
|
828
|
+
}), r = await $(o);
|
|
829
829
|
return m.handleCoordinateList(r);
|
|
830
830
|
}
|
|
831
831
|
/**
|
|
@@ -841,13 +841,13 @@ class m {
|
|
|
841
841
|
renderType: o,
|
|
842
842
|
relativePosition: r,
|
|
843
843
|
...a
|
|
844
|
-
} = e,
|
|
845
|
-
return new
|
|
844
|
+
} = e, c = o === b.GeoModel ? new y(y.toParse(r)) : y.toParse(r);
|
|
845
|
+
return new R({
|
|
846
846
|
...a,
|
|
847
847
|
type: i,
|
|
848
848
|
modelType: o,
|
|
849
849
|
modelValue: n,
|
|
850
|
-
relativeMap:
|
|
850
|
+
relativeMap: c
|
|
851
851
|
});
|
|
852
852
|
});
|
|
853
853
|
}
|
|
@@ -860,9 +860,9 @@ class m {
|
|
|
860
860
|
const e = Array.isArray(t) ? t : [t], i = [];
|
|
861
861
|
function n(o) {
|
|
862
862
|
for (const r of o) {
|
|
863
|
-
const { level: a, parent:
|
|
864
|
-
...
|
|
865
|
-
relativeMap: new
|
|
863
|
+
const { level: a, parent: c, relativeMap: l, ...h } = r, u = new R({
|
|
864
|
+
...h,
|
|
865
|
+
relativeMap: new y(l)
|
|
866
866
|
});
|
|
867
867
|
i.push(u), r.children && r.children.length > 0 && n(r.children);
|
|
868
868
|
}
|
|
@@ -886,7 +886,7 @@ class m {
|
|
|
886
886
|
r.level = 0, n.push(r);
|
|
887
887
|
else {
|
|
888
888
|
const a = i.get(String(o.parentId ?? -1));
|
|
889
|
-
a && (r.type ===
|
|
889
|
+
a && (r.type === M.Space && (r.level = (Number(a.level) || 0) + 1), r.parent = a, a.children?.push(r));
|
|
890
890
|
}
|
|
891
891
|
}), n.forEach(m.sortCoordinateTree), n[0];
|
|
892
892
|
}
|
|
@@ -897,7 +897,7 @@ class m {
|
|
|
897
897
|
*/
|
|
898
898
|
static sortCoordinateTree(t) {
|
|
899
899
|
t.children && (t.children.sort((e, i) => {
|
|
900
|
-
if (e.type ===
|
|
900
|
+
if (e.type === M.Space) {
|
|
901
901
|
const n = Number(i?.relativeMap?.z) - Number(e?.relativeMap?.z);
|
|
902
902
|
return n !== 0 ? n : Number(i.createTime) - Number(e.createTime);
|
|
903
903
|
} else
|
|
@@ -911,14 +911,14 @@ class m {
|
|
|
911
911
|
static filterSpaceTree(t, e) {
|
|
912
912
|
const i = [];
|
|
913
913
|
return t.forEach((n) => {
|
|
914
|
-
const o = new
|
|
914
|
+
const o = new R(n);
|
|
915
915
|
e && (o.parent = e);
|
|
916
916
|
const r = m.filterSpaceTree(o.children, o);
|
|
917
|
-
o.children = r, o.disabled = o.disabled ?? !1, o.type !==
|
|
917
|
+
o.children = r, o.disabled = o.disabled ?? !1, o.type !== M.Model && i.push(o);
|
|
918
918
|
}), i;
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
class
|
|
921
|
+
class R {
|
|
922
922
|
id = 0;
|
|
923
923
|
/** id */
|
|
924
924
|
type = 0;
|
|
@@ -960,10 +960,10 @@ class C {
|
|
|
960
960
|
this.setOptions(t);
|
|
961
961
|
}
|
|
962
962
|
get spaceList() {
|
|
963
|
-
return this.children.filter((t) => t.type ===
|
|
963
|
+
return this.children.filter((t) => t.type === M.Space);
|
|
964
964
|
}
|
|
965
965
|
get modelList() {
|
|
966
|
-
return this.children.filter((t) => t.type ===
|
|
966
|
+
return this.children.filter((t) => t.type === M.Model);
|
|
967
967
|
}
|
|
968
968
|
get fullName() {
|
|
969
969
|
const t = this.name ? `(${this.name})` : "";
|
|
@@ -972,16 +972,16 @@ class C {
|
|
|
972
972
|
/** 设置参数 */
|
|
973
973
|
setOptions(t) {
|
|
974
974
|
const { relativeMap: e, parent: i, children: n, ...o } = t || {};
|
|
975
|
-
e && (this.relativeMap = new
|
|
975
|
+
e && (this.relativeMap = new y(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
|
|
976
976
|
}
|
|
977
977
|
/** 添加子节点 */
|
|
978
978
|
async addChild(t) {
|
|
979
|
-
const e =
|
|
979
|
+
const e = g(t) ? t : [t], i = await m.addCoordinate(this, e);
|
|
980
980
|
return this.mergeChild(i), i;
|
|
981
981
|
}
|
|
982
982
|
/** 删除子节点 */
|
|
983
983
|
async removeChild(t) {
|
|
984
|
-
const e =
|
|
984
|
+
const e = g(t) ? t : [t];
|
|
985
985
|
await m.removeCoordinate(this, e);
|
|
986
986
|
for (const i of e) {
|
|
987
987
|
const n = this.children.findIndex((o) => o.id === i.id);
|
|
@@ -990,12 +990,12 @@ class C {
|
|
|
990
990
|
}
|
|
991
991
|
/** 更新子节点 */
|
|
992
992
|
async updateChild(t) {
|
|
993
|
-
const e =
|
|
993
|
+
const e = g(t) ? t : [t], i = await m.updateCoordinate(this, e);
|
|
994
994
|
return this.mergeChild(i), i;
|
|
995
995
|
}
|
|
996
996
|
/** 绑定子节点,不建立映射关系 */
|
|
997
997
|
async bindChild(t) {
|
|
998
|
-
const e =
|
|
998
|
+
const e = g(t) ? t : [t], i = await m.bindCoordinate(this, e);
|
|
999
999
|
return this.mergeChild(i), i;
|
|
1000
1000
|
}
|
|
1001
1001
|
/** 合并子节点,没有查询到节点就插入 */
|
|
@@ -1003,26 +1003,26 @@ class C {
|
|
|
1003
1003
|
t?.length && t.forEach((e) => {
|
|
1004
1004
|
const i = this.children.find((n) => n.id === e.id);
|
|
1005
1005
|
if (i) {
|
|
1006
|
-
const { relativeMap: n, no: o, name: r, shortName: a, status:
|
|
1006
|
+
const { relativeMap: n, no: o, name: r, shortName: a, status: c, modelId: l, modelValue: h } = e;
|
|
1007
1007
|
Object.assign(i, {
|
|
1008
1008
|
relativeMap: n,
|
|
1009
1009
|
no: o,
|
|
1010
1010
|
name: r,
|
|
1011
1011
|
shortName: a,
|
|
1012
|
-
status:
|
|
1012
|
+
status: c,
|
|
1013
1013
|
modelId: l,
|
|
1014
|
-
modelValue:
|
|
1014
|
+
modelValue: h
|
|
1015
1015
|
});
|
|
1016
1016
|
} else this.id === e.parentId && (e.parent = this, this.children.unshift(e));
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
/** 映射到(模型映射到空间,空间映射到空间) */
|
|
1020
1020
|
async mappingTo(t) {
|
|
1021
|
-
await
|
|
1021
|
+
await Z(t);
|
|
1022
1022
|
}
|
|
1023
1023
|
/** 来自映射(被映射过的源坐标系关系) */
|
|
1024
|
-
async
|
|
1025
|
-
const t = await
|
|
1024
|
+
async getMapping() {
|
|
1025
|
+
const t = await q({ srcCsId: this.id });
|
|
1026
1026
|
return t[t.length - 1];
|
|
1027
1027
|
}
|
|
1028
1028
|
/**
|
|
@@ -1037,13 +1037,13 @@ class C {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
/**
|
|
1039
1039
|
*寻找到符合要求的子节点模型坐标系
|
|
1040
|
-
* @param type
|
|
1040
|
+
* @param type 允许的模型类型
|
|
1041
1041
|
* @param mapped 是否被映射
|
|
1042
1042
|
* @returns
|
|
1043
1043
|
*/
|
|
1044
|
-
findChildModel(t
|
|
1045
|
-
const i =
|
|
1046
|
-
return i.includes(this.modelType ?? -1) && this.status !==
|
|
1044
|
+
findChildModel(t, e = !0) {
|
|
1045
|
+
const i = g(t) ? t : [t];
|
|
1046
|
+
return i.includes(this.modelType ?? -1) && this.status !== O.Disabled ? this : ([M.Data, M.Model].includes(this.type) ? this.findParentSpace() : this)?.modelList?.filter((a) => i.includes(a.modelType ?? -1) ? e ? !!a.relativeMap : !0 : !1)?.sort((a, c) => Number(a.status) - Number(c.status))?.[0];
|
|
1047
1047
|
}
|
|
1048
1048
|
/**
|
|
1049
1049
|
* 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
|
|
@@ -1051,36 +1051,39 @@ class C {
|
|
|
1051
1051
|
* @param excludeNodes 排除的坐标系
|
|
1052
1052
|
* @returns
|
|
1053
1053
|
*/
|
|
1054
|
-
findClosestModel(t =
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1054
|
+
findClosestModel(t = [
|
|
1055
|
+
b.CADModel,
|
|
1056
|
+
b.BIMModel,
|
|
1057
|
+
b.ForgeModel,
|
|
1058
|
+
b.ThreeDModel,
|
|
1059
|
+
b.GeoModel
|
|
1060
|
+
], e) {
|
|
1061
|
+
const i = g(t) ? t : [t], n = /* @__PURE__ */ new Set();
|
|
1062
|
+
e?.forEach((h) => {
|
|
1063
|
+
n.add(String(h.id));
|
|
1064
|
+
});
|
|
1065
|
+
const o = [{ node: this, distance: 0 }], r = /* @__PURE__ */ new Set(), a = [];
|
|
1066
|
+
for (; o.length > 0; ) {
|
|
1067
|
+
const { node: h, distance: u } = o.shift();
|
|
1068
|
+
if (n.has(String(h.id)) || r.has(h))
|
|
1069
1069
|
continue;
|
|
1070
|
-
|
|
1071
|
-
r.add(
|
|
1072
|
-
const
|
|
1073
|
-
if (
|
|
1074
|
-
for (const
|
|
1075
|
-
r.has(
|
|
1076
|
-
if (
|
|
1077
|
-
for (const
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
for (const
|
|
1081
|
-
|
|
1070
|
+
const d = h.modelType ?? -1;
|
|
1071
|
+
i.includes(d) && a.push({ node: h, distance: u, modelType: d }), r.add(h);
|
|
1072
|
+
const T = [];
|
|
1073
|
+
if (h.children)
|
|
1074
|
+
for (const v of h.children)
|
|
1075
|
+
r.has(v) || T.push(v);
|
|
1076
|
+
if (h.parent?.children)
|
|
1077
|
+
for (const v of h.parent.children)
|
|
1078
|
+
v !== h && !r.has(v) && T.push(v);
|
|
1079
|
+
h.parent && !r.has(h.parent) && T.push(h.parent);
|
|
1080
|
+
for (const v of T)
|
|
1081
|
+
o.push({ node: v, distance: u + 1 });
|
|
1082
1082
|
}
|
|
1083
|
-
|
|
1083
|
+
if (a.length === 0)
|
|
1084
|
+
return;
|
|
1085
|
+
const c = Math.min(...a.map((h) => h.distance)), l = a.filter((h) => h.distance === c);
|
|
1086
|
+
return l.sort((h, u) => h.modelType - u.modelType), l[0]?.node;
|
|
1084
1087
|
}
|
|
1085
1088
|
/**
|
|
1086
1089
|
*向上寻找到子节点的空间坐标系
|
|
@@ -1088,7 +1091,7 @@ class C {
|
|
|
1088
1091
|
*/
|
|
1089
1092
|
findParentSpace() {
|
|
1090
1093
|
let t = this;
|
|
1091
|
-
for (; t && t.type !==
|
|
1094
|
+
for (; t && t.type !== M.Space; )
|
|
1092
1095
|
t = t.parent;
|
|
1093
1096
|
return t;
|
|
1094
1097
|
}
|
|
@@ -1101,13 +1104,13 @@ class C {
|
|
|
1101
1104
|
const e = [];
|
|
1102
1105
|
let i = this;
|
|
1103
1106
|
for (; i && t > 0; )
|
|
1104
|
-
i.type ===
|
|
1107
|
+
i.type === M.Space && (e.unshift(i.fullName), t--), i = i.parent;
|
|
1105
1108
|
return e;
|
|
1106
1109
|
}
|
|
1107
1110
|
/** 寻找坐标系组, 有groupUuid表示坐标系组 */
|
|
1108
1111
|
findCsGroup() {
|
|
1109
1112
|
const { groupUuid: t, parent: e } = this;
|
|
1110
|
-
return t ? e?.children?.filter((i) => i.groupUuid === t) || [] : [
|
|
1113
|
+
return t ? e?.children?.filter((i) => i.groupUuid === t) || [] : [];
|
|
1111
1114
|
}
|
|
1112
1115
|
/**
|
|
1113
1116
|
* 递归寻找到相应的层级
|
|
@@ -1156,9 +1159,9 @@ class C {
|
|
|
1156
1159
|
*/
|
|
1157
1160
|
getMappedCsTree() {
|
|
1158
1161
|
function t(n) {
|
|
1159
|
-
return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !==
|
|
1162
|
+
return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !== O.Disabled).map((o) => t(o))), n;
|
|
1160
1163
|
}
|
|
1161
|
-
const e =
|
|
1164
|
+
const e = W(this.findRoot(!0)), i = t(e);
|
|
1162
1165
|
return i.parentId = 0, i.parent = void 0, i;
|
|
1163
1166
|
}
|
|
1164
1167
|
/**
|
|
@@ -1168,13 +1171,13 @@ class C {
|
|
|
1168
1171
|
*/
|
|
1169
1172
|
getDestRelativeMap(t) {
|
|
1170
1173
|
if (this.id === t.id)
|
|
1171
|
-
return new
|
|
1174
|
+
return new y();
|
|
1172
1175
|
const e = this.getRelativeMaps(), i = t.getRelativeMaps();
|
|
1173
|
-
let n = new
|
|
1176
|
+
let n = new y();
|
|
1174
1177
|
return e?.forEach((o) => {
|
|
1175
|
-
n =
|
|
1178
|
+
n = y.addRelativeMap(n, o);
|
|
1176
1179
|
}), i?.reverse()?.forEach((o) => {
|
|
1177
|
-
n =
|
|
1180
|
+
n = y.addRelativeMap(n, y.inverseRelativeMap(o));
|
|
1178
1181
|
}), n;
|
|
1179
1182
|
}
|
|
1180
1183
|
/**
|
|
@@ -1208,7 +1211,7 @@ class C {
|
|
|
1208
1211
|
*/
|
|
1209
1212
|
static getCommonCoordinate(t) {
|
|
1210
1213
|
let e;
|
|
1211
|
-
const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type ===
|
|
1214
|
+
const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type === M.Space));
|
|
1212
1215
|
for (; this.checkSameCoordinate(i); ) {
|
|
1213
1216
|
const o = i.shift();
|
|
1214
1217
|
o?.length && (e = o[0]);
|
|
@@ -1236,7 +1239,7 @@ class C {
|
|
|
1236
1239
|
} else return !1;
|
|
1237
1240
|
}
|
|
1238
1241
|
}
|
|
1239
|
-
class
|
|
1242
|
+
class tt {
|
|
1240
1243
|
yaw = 0;
|
|
1241
1244
|
/** 偏航角 */
|
|
1242
1245
|
pitch = 0;
|
|
@@ -1250,14 +1253,14 @@ class K {
|
|
|
1250
1253
|
static toParse(t) {
|
|
1251
1254
|
if (t) {
|
|
1252
1255
|
const e = t?.split(",").map((i) => Number(i) || 0);
|
|
1253
|
-
return new
|
|
1256
|
+
return new tt({ yaw: e[0], pitch: e[1], roll: e[2] });
|
|
1254
1257
|
}
|
|
1255
1258
|
}
|
|
1256
1259
|
static toStringify(t) {
|
|
1257
1260
|
return t ? `${t.yaw},${t.pitch},${t.roll}` : "";
|
|
1258
1261
|
}
|
|
1259
1262
|
}
|
|
1260
|
-
class
|
|
1263
|
+
class et {
|
|
1261
1264
|
x = 0;
|
|
1262
1265
|
/** x轴 */
|
|
1263
1266
|
y = 0;
|
|
@@ -1271,14 +1274,14 @@ class tt {
|
|
|
1271
1274
|
static toParse(t) {
|
|
1272
1275
|
if (t) {
|
|
1273
1276
|
const e = t?.split(",").map((i) => Number(i) || 0);
|
|
1274
|
-
return new
|
|
1277
|
+
return new et({ x: e[0], y: e[1], z: e[2] });
|
|
1275
1278
|
}
|
|
1276
1279
|
}
|
|
1277
1280
|
static toStringify(t) {
|
|
1278
1281
|
return t ? `${t.x},${t.y},${t.z}` : "";
|
|
1279
1282
|
}
|
|
1280
1283
|
}
|
|
1281
|
-
class
|
|
1284
|
+
class kt {
|
|
1282
1285
|
/**
|
|
1283
1286
|
* 将源坐标系中的点转换到目标坐标系中
|
|
1284
1287
|
* @param points 需要转换的点数组
|
|
@@ -1297,7 +1300,7 @@ class At {
|
|
|
1297
1300
|
}), o;
|
|
1298
1301
|
}
|
|
1299
1302
|
}
|
|
1300
|
-
class
|
|
1303
|
+
class Xt {
|
|
1301
1304
|
canvas;
|
|
1302
1305
|
ctx;
|
|
1303
1306
|
options;
|
|
@@ -1349,11 +1352,11 @@ class jt {
|
|
|
1349
1352
|
isBindEvent: o = !0,
|
|
1350
1353
|
isDrawAssist: r = !1,
|
|
1351
1354
|
isMoveRedrawing: a,
|
|
1352
|
-
customDrawAssist:
|
|
1355
|
+
customDrawAssist: c,
|
|
1353
1356
|
afterDraw: l,
|
|
1354
|
-
...
|
|
1357
|
+
...h
|
|
1355
1358
|
} = t;
|
|
1356
|
-
this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.width = i, this.height = n, this.canvas.width = i, this.canvas.height = n, this.isBindEvent = o, this.isDrawAssist = r, this.customDrawAssist =
|
|
1359
|
+
this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.width = i, this.height = n, this.canvas.width = i, this.canvas.height = n, this.isBindEvent = o, this.isDrawAssist = r, this.customDrawAssist = c, this.isMoveRedrawing = a ?? r, this.options = h, this.onMousedown = this.onMousedown.bind(this), this.onMousemove = this.onMousemove.bind(this), this.onMousemoveTemp = this.onMousemoveTemp.bind(this), this.onMouseup = this.onMouseup.bind(this), this.onMousewheel = this.onMousewheel.bind(this), this.onDblclick = this.onDblclick.bind(this), this.onTouchstart = this.onTouchstart.bind(this), this.onTouchmove = this.onTouchmove.bind(this), this.onTouchend = this.onTouchend.bind(this), this.onMouseout = this.onMouseout.bind(this), this.afterDraw = this.afterDraw, o && (this.canvas.addEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.addEventListener("mousewheel", this.onMousewheel), this.canvas.addEventListener("mousedown", this.onMousedown), this.canvas.addEventListener("mousemove", this.onMousemove), this.canvas.addEventListener("mouseout", this.onMouseout), this.canvas.addEventListener("dblclick", this.onDblclick), this.canvas.addEventListener("touchstart", this.onTouchstart));
|
|
1357
1360
|
}
|
|
1358
1361
|
onClick(t) {
|
|
1359
1362
|
const { screenX: e, screenY: i } = t;
|
|
@@ -1482,8 +1485,8 @@ class jt {
|
|
|
1482
1485
|
this.isBindEvent && (this.canvas.removeEventListener("mousemove", this.onMousemove), this.canvas.removeEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.removeEventListener("mousewheel", this.onMousewheel), this.canvas.removeEventListener("mousedown", this.onMousedown), this.canvas.removeEventListener("mouseout", this.onMouseout), this.canvas.removeEventListener("dblclick", this.onDblclick));
|
|
1483
1486
|
}
|
|
1484
1487
|
}
|
|
1485
|
-
const
|
|
1486
|
-
class
|
|
1488
|
+
const X = {};
|
|
1489
|
+
class Ft {
|
|
1487
1490
|
type = "image";
|
|
1488
1491
|
// 修改为更通用的名称
|
|
1489
1492
|
x;
|
|
@@ -1497,7 +1500,7 @@ class Xt {
|
|
|
1497
1500
|
this.x = t.x || 0, this.y = t.y || 0, this.width = t.width || 0, this.height = t.height || 0, this.src = t.src, this.redraw = t.redraw, this.img = this.loadImage(t.onload);
|
|
1498
1501
|
}
|
|
1499
1502
|
loadImage(t) {
|
|
1500
|
-
const e =
|
|
1503
|
+
const e = X[this.src];
|
|
1501
1504
|
if (e)
|
|
1502
1505
|
return queueMicrotask(() => {
|
|
1503
1506
|
t?.(e), this.redraw?.();
|
|
@@ -1505,7 +1508,7 @@ class Xt {
|
|
|
1505
1508
|
{
|
|
1506
1509
|
const i = new Image();
|
|
1507
1510
|
return i.crossOrigin = "anonymous", i.src = this.src, i.onload = () => {
|
|
1508
|
-
|
|
1511
|
+
X[this.src] = i, t?.(i), this.redraw?.();
|
|
1509
1512
|
}, i;
|
|
1510
1513
|
}
|
|
1511
1514
|
}
|
|
@@ -1518,7 +1521,7 @@ class Xt {
|
|
|
1518
1521
|
}
|
|
1519
1522
|
}
|
|
1520
1523
|
}
|
|
1521
|
-
class
|
|
1524
|
+
class Ut {
|
|
1522
1525
|
id = "";
|
|
1523
1526
|
type = "point";
|
|
1524
1527
|
x;
|
|
@@ -1538,8 +1541,8 @@ class Ft {
|
|
|
1538
1541
|
t.beginPath(), t.arc(this.x, this.y, this.r * i, 0, 2 * Math.PI), t.fillStyle = this.backgroundColor, t.fill(), t.font = `${this.r * i}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.text, this.x, this.y + this.r * i / 3), t.restore();
|
|
1539
1542
|
}
|
|
1540
1543
|
}
|
|
1541
|
-
const
|
|
1542
|
-
class
|
|
1544
|
+
const F = {};
|
|
1545
|
+
class Yt {
|
|
1543
1546
|
id = "";
|
|
1544
1547
|
type = "issue";
|
|
1545
1548
|
//轨迹点上的事件
|
|
@@ -1559,7 +1562,7 @@ class Ut {
|
|
|
1559
1562
|
this.id = t.id, this.x = t.x, this.y = t.y, this.width = t.width || 0, this.height = t.height || 0, this.index = t.index, this.pIndex = t.pIndex, this.parentId = t.parentId, this.count = t.count || 0, this.badgeR = 3, this.src = t.src, this.redraw = t.redraw, this.img = this.loadImage(t.onload);
|
|
1560
1563
|
}
|
|
1561
1564
|
loadImage(t) {
|
|
1562
|
-
const e =
|
|
1565
|
+
const e = F[this.src];
|
|
1563
1566
|
if (e)
|
|
1564
1567
|
return queueMicrotask(() => {
|
|
1565
1568
|
t?.(e), this.redraw?.();
|
|
@@ -1567,18 +1570,18 @@ class Ut {
|
|
|
1567
1570
|
{
|
|
1568
1571
|
const i = new Image();
|
|
1569
1572
|
return i.src = this.src, i.crossOrigin = "anonymous", i.onload = () => {
|
|
1570
|
-
|
|
1573
|
+
F[this.src] = i, t?.(i), this.redraw?.();
|
|
1571
1574
|
}, i;
|
|
1572
1575
|
}
|
|
1573
1576
|
}
|
|
1574
1577
|
draw(t, e) {
|
|
1575
1578
|
if (!this.img.complete) return;
|
|
1576
|
-
const i = 1 / e.scale, n = this.width * i, o = this.height * i, r = this.x - n / 2, a = this.y - o,
|
|
1577
|
-
t.save(), t.drawImage(this.img, r, a, n, o), t.beginPath(), this.count > 1 && (t.arc(this.x + n * 0.3, this.y - o * 0.8,
|
|
1579
|
+
const i = 1 / e.scale, n = this.width * i, o = this.height * i, r = this.x - n / 2, a = this.y - o, c = this.badgeR * i, l = c * 1.5;
|
|
1580
|
+
t.save(), t.drawImage(this.img, r, a, n, o), t.beginPath(), this.count > 1 && (t.arc(this.x + n * 0.3, this.y - o * 0.8, c, 0, 2 * Math.PI), t.fillStyle = "red", t.fill(), t.font = `${l}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.count.toString(), this.x + n * 0.3, this.y - o * 0.8 + c / 2)), t.restore();
|
|
1578
1581
|
}
|
|
1579
1582
|
}
|
|
1580
|
-
const
|
|
1581
|
-
class
|
|
1583
|
+
const U = {};
|
|
1584
|
+
class Gt {
|
|
1582
1585
|
type = "marker";
|
|
1583
1586
|
x;
|
|
1584
1587
|
y;
|
|
@@ -1594,7 +1597,7 @@ class Yt {
|
|
|
1594
1597
|
this.x = t.x, this.y = t.y, this.url = t.url, this.width = t.width ?? 0, this.height = t.height ?? 0, this.anchor = t.anchor, this.scale = t.scale ?? 1, t.redraw && (this.redraw = t.redraw), t.beforeDraw && (this.beforeDraw = t.beforeDraw), this.img = this.loadImage(t.onload);
|
|
1595
1598
|
}
|
|
1596
1599
|
loadImage(t) {
|
|
1597
|
-
const e =
|
|
1600
|
+
const e = U[this.url];
|
|
1598
1601
|
if (e)
|
|
1599
1602
|
return queueMicrotask(() => {
|
|
1600
1603
|
t?.(e), this.redraw?.();
|
|
@@ -1602,7 +1605,7 @@ class Yt {
|
|
|
1602
1605
|
{
|
|
1603
1606
|
const i = new Image();
|
|
1604
1607
|
return i.src = this.url, i.crossOrigin = "anonymous", i.onload = () => {
|
|
1605
|
-
|
|
1608
|
+
U[this.url] = i, t?.(i), this.redraw?.();
|
|
1606
1609
|
}, i;
|
|
1607
1610
|
}
|
|
1608
1611
|
}
|
|
@@ -1632,7 +1635,7 @@ class Yt {
|
|
|
1632
1635
|
}
|
|
1633
1636
|
}
|
|
1634
1637
|
}
|
|
1635
|
-
class
|
|
1638
|
+
class Bt {
|
|
1636
1639
|
type = "radar";
|
|
1637
1640
|
x;
|
|
1638
1641
|
y;
|
|
@@ -1662,7 +1665,7 @@ class Gt {
|
|
|
1662
1665
|
r.addColorStop(0, "rgba(180, 42, 42, 1)"), r.addColorStop(1, "rgba(180, 42, 42, 0.5)"), t.beginPath(), t.moveTo(this.x, this.y), t.arc(this.x, this.y, this.r * i, n, o), t.closePath(), t.fillStyle = r, t.fill(), t.restore();
|
|
1663
1666
|
}
|
|
1664
1667
|
}
|
|
1665
|
-
class
|
|
1668
|
+
class $t {
|
|
1666
1669
|
type = "region";
|
|
1667
1670
|
x;
|
|
1668
1671
|
y;
|
|
@@ -1683,8 +1686,8 @@ class Bt {
|
|
|
1683
1686
|
}
|
|
1684
1687
|
draw(t, e) {
|
|
1685
1688
|
if (t.save(), t.beginPath(), t.globalAlpha = 0.3, t.fillStyle = this.backgroundColor, this.shape === "circle") {
|
|
1686
|
-
const [{ x: i, y: n }, {}, { x: o, y: r }] = this.areaPoints, a = Math.abs(o - i) / 2,
|
|
1687
|
-
t.arc(
|
|
1689
|
+
const [{ x: i, y: n }, {}, { x: o, y: r }] = this.areaPoints, a = Math.abs(o - i) / 2, c = i + (o - i) / 2, l = n + (r - n) / 2;
|
|
1690
|
+
t.arc(c, l, a, 0, 2 * Math.PI);
|
|
1688
1691
|
} else
|
|
1689
1692
|
this.areaPoints.forEach((i, n) => {
|
|
1690
1693
|
const { x: o, y: r } = i;
|
|
@@ -1694,33 +1697,35 @@ class Bt {
|
|
|
1694
1697
|
}
|
|
1695
1698
|
}
|
|
1696
1699
|
export {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1700
|
+
nt as APP_SETTING,
|
|
1701
|
+
w as AppError,
|
|
1702
|
+
p as AppErrorCode,
|
|
1703
|
+
it as AppObsType,
|
|
1704
|
+
Xt as CanvasElement,
|
|
1705
|
+
Ft as CanvasImageElement,
|
|
1706
|
+
Yt as CanvasIssueElement,
|
|
1707
|
+
Gt as CanvasMarkerElement,
|
|
1708
|
+
Ut as CanvasPointElement,
|
|
1709
|
+
Bt as CanvasRadarElement,
|
|
1710
|
+
$t as CanvasRegionElement,
|
|
1711
|
+
R as Coordinate,
|
|
1712
|
+
st as CoordinateLevel,
|
|
1713
|
+
b as CoordinateModelType,
|
|
1714
|
+
O as CoordinateStatus,
|
|
1715
|
+
M as CoordinateType,
|
|
1716
|
+
kt as DataHelper,
|
|
1714
1717
|
m as DataSource,
|
|
1715
|
-
|
|
1718
|
+
N as GeoPoint,
|
|
1716
1719
|
f as Point,
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1720
|
+
tt as Position,
|
|
1721
|
+
rt as REQUEST_CONFIG,
|
|
1722
|
+
ot as REQUEST_OPTIONS,
|
|
1723
|
+
y as RelativeMap,
|
|
1724
|
+
L as RequestContentType,
|
|
1725
|
+
x as RequestMethod,
|
|
1726
|
+
Y as RequestResultCode,
|
|
1727
|
+
et as Vector3,
|
|
1728
|
+
At as api,
|
|
1729
|
+
Lt as http,
|
|
1730
|
+
jt as utils
|
|
1726
1731
|
};
|