@vsleem-realsee-viewer/shared 2.1.2 → 2.1.4
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 +556 -27
- package/dist/index.d.ts +20 -3
- package/dist/index.mjs +147 -132
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ct = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(ct || {}), _ = /* @__PURE__ */ ((s) => (s.en_US = "en-US", s.zh_CN = "zh-CN", s.ja_JP = "ja-JP", s))(_ || {}), g = /* @__PURE__ */ ((s) => (s.WGS84 = "WGS84", s.WGS1984 = "WGS84", s.EPSG4326 = "WGS84", s.GCJ02 = "GCJ02", s.AMap = "GCJ02", s.BD09 = "BD09", s.BD09LL = "BD09", s.Baidu = "BD09", s.BMap = "BD09", s.BD09MC = "BD09MC", s.BD09Meter = "BD09MC", s.EPSG3857 = "EPSG3857", s.EPSG900913 = "EPSG3857", s.EPSG102100 = "EPSG3857", s.WebMercator = "EPSG3857", s.WM = "EPSG3857", s))(g || {}), 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.SoonspaceModel = 10] = "SoonspaceModel", s[s.ScaleModel = 101] = "ScaleModel", s))(b || {}), ht = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(ht || {}), v = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(v || {}), A = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(A || {}), 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 || {}), $ = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))($ || {}), M = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(M || {}), G = /* @__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))(G || {});
|
|
2
2
|
const lt = {
|
|
3
3
|
baseUrl: "https://vsleem.com/api",
|
|
4
4
|
authorizeCode: ""
|
|
@@ -41,6 +41,20 @@ const lt = {
|
|
|
41
41
|
patterns: ["openstreetmap", "openstreetmap.org"],
|
|
42
42
|
CRSTypes: [g.WGS84, g.WGS84]
|
|
43
43
|
}
|
|
44
|
+
], Jt = [
|
|
45
|
+
{
|
|
46
|
+
url: "https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",
|
|
47
|
+
options: {
|
|
48
|
+
subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
|
|
49
|
+
attribution: "© 天地图 GS(2022)3124号"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
url: "https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",
|
|
54
|
+
options: {
|
|
55
|
+
subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
];
|
|
45
59
|
class w extends Error {
|
|
46
60
|
constructor(t, e, i) {
|
|
@@ -61,7 +75,7 @@ function mt(s) {
|
|
|
61
75
|
const { baseUrl: t, authorizeCode: e, locale: i } = s;
|
|
62
76
|
Object.assign(J, { baseUrl: t, authorizeCode: e, locale: i });
|
|
63
77
|
}
|
|
64
|
-
async function
|
|
78
|
+
async function E(s, t) {
|
|
65
79
|
const e = { ...ut, ...t }, i = { ...dt, ...s };
|
|
66
80
|
try {
|
|
67
81
|
const n = yt(i, e), { url: o, ...r } = n, c = await (await window.fetch(o, r)).json();
|
|
@@ -75,16 +89,16 @@ function yt(s, t) {
|
|
|
75
89
|
let { url: a, method: c, headers: l = {}, params: h, data: u } = s;
|
|
76
90
|
o && e && (a = `${e}${a}`), c = c?.toUpperCase();
|
|
77
91
|
const d = { ...l };
|
|
78
|
-
if (/^https?:\/\/.+$/i.test(e ?? "") ? d.PlatForm = new URL(e ?? "").host : d.PlatForm = new URL(window.location.href).host, r && i && (d.AuthorizationCode = i), c === M.POST && !d["Content-Type"] && (d["Content-Type"] =
|
|
92
|
+
if (/^https?:\/\/.+$/i.test(e ?? "") ? d.PlatForm = new URL(e ?? "").host : d.PlatForm = new URL(window.location.href).host, r && i && (d.AuthorizationCode = i), c === M.POST && !d["Content-Type"] && (d["Content-Type"] = G.JSON), n && (d["Accept-Language"] = n), c === M.GET && h) {
|
|
79
93
|
const S = new URLSearchParams(h), at = a.includes("?") ? "&" : "?";
|
|
80
94
|
a += at + `${S.toString()}`;
|
|
81
95
|
}
|
|
82
|
-
let
|
|
83
|
-
return c === M.POST && (
|
|
96
|
+
let T;
|
|
97
|
+
return c === M.POST && (T = d["Content-Type"] === G.JSON ? JSON.stringify(u || {}) : u), {
|
|
84
98
|
url: a,
|
|
85
99
|
method: c,
|
|
86
100
|
headers: d,
|
|
87
|
-
body:
|
|
101
|
+
body: T
|
|
88
102
|
};
|
|
89
103
|
}
|
|
90
104
|
function wt(s, t) {
|
|
@@ -103,13 +117,13 @@ function pt(s) {
|
|
|
103
117
|
typeof s == "string" ? s : "未知的请求错误"
|
|
104
118
|
);
|
|
105
119
|
}
|
|
106
|
-
const
|
|
120
|
+
const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
107
121
|
__proto__: null,
|
|
108
|
-
request:
|
|
122
|
+
request: E,
|
|
109
123
|
setRequestGlobalConfig: mt
|
|
110
124
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
111
|
-
function
|
|
112
|
-
return
|
|
125
|
+
function W(s, t) {
|
|
126
|
+
return E(
|
|
113
127
|
{
|
|
114
128
|
url: "/project/jssdk/cs/list",
|
|
115
129
|
method: M.GET,
|
|
@@ -118,8 +132,8 @@ function q(s, t) {
|
|
|
118
132
|
t
|
|
119
133
|
);
|
|
120
134
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
135
|
+
function q(s, t) {
|
|
136
|
+
return E(
|
|
123
137
|
{
|
|
124
138
|
url: "/project/jssdk/cs/bind",
|
|
125
139
|
method: M.POST,
|
|
@@ -129,7 +143,7 @@ function W(s, t) {
|
|
|
129
143
|
);
|
|
130
144
|
}
|
|
131
145
|
function j(s, t) {
|
|
132
|
-
return
|
|
146
|
+
return E(
|
|
133
147
|
{
|
|
134
148
|
url: "/project/jssdk/cs/save",
|
|
135
149
|
method: M.POST,
|
|
@@ -138,8 +152,8 @@ function j(s, t) {
|
|
|
138
152
|
t
|
|
139
153
|
);
|
|
140
154
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
155
|
+
function V(s, t) {
|
|
156
|
+
return E(
|
|
143
157
|
{
|
|
144
158
|
url: "/project/jssdk/cs/delete",
|
|
145
159
|
method: M.POST,
|
|
@@ -148,8 +162,8 @@ function Z(s, t) {
|
|
|
148
162
|
t
|
|
149
163
|
);
|
|
150
164
|
}
|
|
151
|
-
function
|
|
152
|
-
return
|
|
165
|
+
function Z(s, t) {
|
|
166
|
+
return E(
|
|
153
167
|
{
|
|
154
168
|
url: "/project/jssdk/cs/mapping",
|
|
155
169
|
method: M.POST,
|
|
@@ -159,7 +173,7 @@ function V(s, t) {
|
|
|
159
173
|
);
|
|
160
174
|
}
|
|
161
175
|
function H(s, t) {
|
|
162
|
-
return
|
|
176
|
+
return E(
|
|
163
177
|
{
|
|
164
178
|
url: "/project/jssdk/cs/mapping/query",
|
|
165
179
|
method: M.GET,
|
|
@@ -169,7 +183,7 @@ function H(s, t) {
|
|
|
169
183
|
);
|
|
170
184
|
}
|
|
171
185
|
function Q(s, t) {
|
|
172
|
-
return
|
|
186
|
+
return E(
|
|
173
187
|
{
|
|
174
188
|
url: "/project/jssdk/project/detail",
|
|
175
189
|
method: M.GET,
|
|
@@ -183,7 +197,7 @@ function gt(s, t = {
|
|
|
183
197
|
joinBaseUrl: !1,
|
|
184
198
|
withAuthorize: !1
|
|
185
199
|
}) {
|
|
186
|
-
return
|
|
200
|
+
return E(
|
|
187
201
|
{
|
|
188
202
|
url: s,
|
|
189
203
|
method: M.GET
|
|
@@ -193,13 +207,13 @@ function gt(s, t = {
|
|
|
193
207
|
}
|
|
194
208
|
const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
195
209
|
__proto__: null,
|
|
196
|
-
bindCoordinate:
|
|
197
|
-
getCoordinateList:
|
|
210
|
+
bindCoordinate: q,
|
|
211
|
+
getCoordinateList: W,
|
|
198
212
|
getImageInfo: gt,
|
|
199
213
|
getMappingRelation: H,
|
|
200
214
|
getProjectDetail: Q,
|
|
201
|
-
mapingCoordinate:
|
|
202
|
-
removeCoordinate:
|
|
215
|
+
mapingCoordinate: Z,
|
|
216
|
+
removeCoordinate: V,
|
|
203
217
|
saveCoordinate: j
|
|
204
218
|
}, Symbol.toStringTag, { value: "Module" })), Mt = typeof window < "u", xt = Object.prototype.toString;
|
|
205
219
|
function D(s, t) {
|
|
@@ -211,7 +225,7 @@ function K(s) {
|
|
|
211
225
|
function tt(s) {
|
|
212
226
|
return !K(s);
|
|
213
227
|
}
|
|
214
|
-
function
|
|
228
|
+
function P(s) {
|
|
215
229
|
return s !== null && D(s, "Object");
|
|
216
230
|
}
|
|
217
231
|
function et(s) {
|
|
@@ -226,37 +240,37 @@ function St(s) {
|
|
|
226
240
|
function k(s) {
|
|
227
241
|
return typeof s == "function";
|
|
228
242
|
}
|
|
229
|
-
function
|
|
243
|
+
function Tt(s) {
|
|
230
244
|
return D(s, "Boolean");
|
|
231
245
|
}
|
|
232
|
-
function
|
|
246
|
+
function bt(s) {
|
|
233
247
|
return D(s, "RegExp");
|
|
234
248
|
}
|
|
235
249
|
function x(s) {
|
|
236
250
|
return s && Array.isArray(s);
|
|
237
251
|
}
|
|
238
|
-
function
|
|
252
|
+
function Et(s) {
|
|
239
253
|
return typeof window < "u" && D(s, "Window");
|
|
240
254
|
}
|
|
241
|
-
function
|
|
242
|
-
return
|
|
255
|
+
function Pt(s) {
|
|
256
|
+
return P(s) && !!s.tagName;
|
|
243
257
|
}
|
|
244
|
-
function
|
|
258
|
+
function R(s) {
|
|
245
259
|
return typeof s == "number" ? !0 : typeof s != "string" ? !1 : /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(s);
|
|
246
260
|
}
|
|
247
261
|
function Dt(s, t) {
|
|
248
262
|
return JSON.stringify(s) === JSON.stringify(t);
|
|
249
263
|
}
|
|
250
|
-
function
|
|
264
|
+
function It(s) {
|
|
251
265
|
return tt(s) || et(s);
|
|
252
266
|
}
|
|
253
|
-
function
|
|
254
|
-
return D(s, "Promise") &&
|
|
267
|
+
function zt(s) {
|
|
268
|
+
return D(s, "Promise") && P(s) && k(s.then) && k(s.catch);
|
|
255
269
|
}
|
|
256
|
-
function
|
|
270
|
+
function Nt(s, t = {}) {
|
|
257
271
|
return new Promise((e, i) => {
|
|
258
|
-
const n =
|
|
259
|
-
if (
|
|
272
|
+
const n = z(s);
|
|
273
|
+
if (Ct(n)) {
|
|
260
274
|
e(!0);
|
|
261
275
|
return;
|
|
262
276
|
}
|
|
@@ -270,14 +284,14 @@ function Ct(s, t = {}) {
|
|
|
270
284
|
}, document.head.appendChild(o);
|
|
271
285
|
});
|
|
272
286
|
}
|
|
273
|
-
function
|
|
274
|
-
const t =
|
|
275
|
-
return Array.from(document.scripts).some((e) =>
|
|
287
|
+
function Ct(s) {
|
|
288
|
+
const t = z(s);
|
|
289
|
+
return Array.from(document.scripts).some((e) => z(e.src) === t);
|
|
276
290
|
}
|
|
277
|
-
function
|
|
291
|
+
function Rt(s) {
|
|
278
292
|
return new Promise((t, e) => {
|
|
279
|
-
const i =
|
|
280
|
-
if (
|
|
293
|
+
const i = z(s);
|
|
294
|
+
if (Ot(i)) {
|
|
281
295
|
t(!0);
|
|
282
296
|
return;
|
|
283
297
|
}
|
|
@@ -289,13 +303,13 @@ function Ot(s) {
|
|
|
289
303
|
}, document.head.appendChild(n);
|
|
290
304
|
});
|
|
291
305
|
}
|
|
292
|
-
function
|
|
293
|
-
const t =
|
|
306
|
+
function Ot(s) {
|
|
307
|
+
const t = z(s);
|
|
294
308
|
return Array.from(document.querySelectorAll('link[rel="stylesheet"]')).some(
|
|
295
|
-
(e) =>
|
|
309
|
+
(e) => z(e.href) === t
|
|
296
310
|
);
|
|
297
311
|
}
|
|
298
|
-
function
|
|
312
|
+
function z(s) {
|
|
299
313
|
try {
|
|
300
314
|
const t = new URL(s, window.location.href);
|
|
301
315
|
return `${t.origin}${t.pathname}`;
|
|
@@ -304,9 +318,9 @@ function N(s) {
|
|
|
304
318
|
}
|
|
305
319
|
}
|
|
306
320
|
function st(s) {
|
|
307
|
-
return
|
|
321
|
+
return I(s, /* @__PURE__ */ new WeakMap());
|
|
308
322
|
}
|
|
309
|
-
function
|
|
323
|
+
function I(s, t) {
|
|
310
324
|
if (typeof s != "object" || s === null)
|
|
311
325
|
return s;
|
|
312
326
|
if (t.has(s))
|
|
@@ -318,11 +332,11 @@ function z(s, t) {
|
|
|
318
332
|
return e = new RegExp(s), t.set(s, e), e;
|
|
319
333
|
if (s instanceof Map)
|
|
320
334
|
return e = /* @__PURE__ */ new Map(), t.set(s, e), s.forEach((n, o) => {
|
|
321
|
-
e.set(o,
|
|
335
|
+
e.set(o, I(n, t));
|
|
322
336
|
}), e;
|
|
323
337
|
if (s instanceof Set)
|
|
324
338
|
return e = /* @__PURE__ */ new Set(), t.set(s, e), s.forEach((n) => {
|
|
325
|
-
e.add(
|
|
339
|
+
e.add(I(n, t));
|
|
326
340
|
}), e;
|
|
327
341
|
if (ArrayBuffer.isView(s))
|
|
328
342
|
return e = new s.constructor(
|
|
@@ -335,18 +349,18 @@ function z(s, t) {
|
|
|
335
349
|
if (Array.isArray(s)) {
|
|
336
350
|
e = [], t.set(s, e);
|
|
337
351
|
for (let n = 0; n < s.length; n++)
|
|
338
|
-
n in s && (e[n] =
|
|
352
|
+
n in s && (e[n] = I(s[n], t));
|
|
339
353
|
return e;
|
|
340
354
|
}
|
|
341
355
|
e = Object.create(Object.getPrototypeOf(s)), t.set(s, e);
|
|
342
356
|
for (const n in s)
|
|
343
|
-
Object.prototype.hasOwnProperty.call(s, n) && (e[n] =
|
|
357
|
+
Object.prototype.hasOwnProperty.call(s, n) && (e[n] = I(s[n], t));
|
|
344
358
|
const i = Object.getOwnPropertySymbols(s);
|
|
345
359
|
for (const n of i)
|
|
346
|
-
Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] =
|
|
360
|
+
Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = I(s[n], t));
|
|
347
361
|
return e;
|
|
348
362
|
}
|
|
349
|
-
function
|
|
363
|
+
function Lt(s, t, e = !1) {
|
|
350
364
|
let i;
|
|
351
365
|
const n = function(...o) {
|
|
352
366
|
const r = this, a = e && !i;
|
|
@@ -376,12 +390,12 @@ function At(s, t, e = !1) {
|
|
|
376
390
|
function U(s, ...t) {
|
|
377
391
|
if (!t.length) return s;
|
|
378
392
|
const e = t.shift();
|
|
379
|
-
return e === void 0 ? s : (
|
|
393
|
+
return e === void 0 ? s : (C(s) && C(e) && Object.keys(e).forEach((i) => {
|
|
380
394
|
const n = s[i], o = e[i];
|
|
381
|
-
Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] :
|
|
395
|
+
Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : C(n) && C(o) ? s[i] = U({ ...n }, o) : o !== void 0 && (s[i] = o);
|
|
382
396
|
}), U(s, ...t));
|
|
383
397
|
}
|
|
384
|
-
function
|
|
398
|
+
function C(s) {
|
|
385
399
|
return s !== null && typeof s == "object" && !Array.isArray(s);
|
|
386
400
|
}
|
|
387
401
|
function it(s, ...t) {
|
|
@@ -395,26 +409,26 @@ function it(s, ...t) {
|
|
|
395
409
|
}
|
|
396
410
|
function nt(s, t) {
|
|
397
411
|
const e = {};
|
|
398
|
-
if (
|
|
412
|
+
if (P(s) && !x(s)) {
|
|
399
413
|
for (const i in s)
|
|
400
414
|
if (Object.prototype.hasOwnProperty.call(s, i)) {
|
|
401
|
-
const n = s[i], o =
|
|
415
|
+
const n = s[i], o = P(t) && !x(t) ? t[i] : void 0;
|
|
402
416
|
if (!(i in (t || {})))
|
|
403
417
|
e[i] = n;
|
|
404
418
|
else if (x(n) && x(o))
|
|
405
419
|
JSON.stringify(n) !== JSON.stringify(o) && (e[i] = n);
|
|
406
|
-
else if (
|
|
420
|
+
else if (P(n) && P(o)) {
|
|
407
421
|
const r = nt(n, o);
|
|
408
422
|
r && Object.keys(r).length > 0 && (e[i] = r);
|
|
409
423
|
} else n !== o && (e[i] = n);
|
|
410
424
|
}
|
|
411
425
|
}
|
|
412
|
-
if (
|
|
426
|
+
if (P(t) && x(t))
|
|
413
427
|
for (const i in t)
|
|
414
428
|
Object.prototype.hasOwnProperty.call(t, i) && !(i in (s || {})) && (e[i] = void 0);
|
|
415
429
|
return e;
|
|
416
430
|
}
|
|
417
|
-
function
|
|
431
|
+
function Gt(s = 0) {
|
|
418
432
|
return new Promise((t) => setTimeout(t, s));
|
|
419
433
|
}
|
|
420
434
|
function jt(s) {
|
|
@@ -469,21 +483,21 @@ function Yt() {
|
|
|
469
483
|
(e === 4 || e === 6 || e === 8 || e === 10) && (s += "-"), s += X[t[e] >>> 4], s += X[t[e] & 15];
|
|
470
484
|
return s;
|
|
471
485
|
}
|
|
472
|
-
let
|
|
473
|
-
const
|
|
474
|
-
function
|
|
486
|
+
let O = 0;
|
|
487
|
+
const _t = 9999;
|
|
488
|
+
function $t(s = "") {
|
|
475
489
|
const t = Date.now(), e = Math.floor(Math.random() * 1e6);
|
|
476
|
-
return
|
|
490
|
+
return O = (O + 1) % _t, `${s}${s ? "_" : ""}${t}_${O.toString().padStart(4, "0")}_${e.toString().padStart(6, "0")}`;
|
|
477
491
|
}
|
|
478
|
-
const
|
|
492
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
479
493
|
__proto__: null,
|
|
480
|
-
buildShortUUID:
|
|
494
|
+
buildShortUUID: $t,
|
|
481
495
|
buildUUID: Yt,
|
|
482
496
|
cloneDeep: st,
|
|
483
|
-
debounce:
|
|
497
|
+
debounce: Lt,
|
|
484
498
|
deepMerge: U,
|
|
485
499
|
deepMergeProps: it,
|
|
486
|
-
delay:
|
|
500
|
+
delay: Gt,
|
|
487
501
|
error: kt,
|
|
488
502
|
getDiffProps: nt,
|
|
489
503
|
getImageTransform: Xt,
|
|
@@ -491,23 +505,23 @@ const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
491
505
|
inBrowser: Mt,
|
|
492
506
|
is: D,
|
|
493
507
|
isArray: x,
|
|
494
|
-
isBoolean:
|
|
508
|
+
isBoolean: Tt,
|
|
495
509
|
isDate: vt,
|
|
496
510
|
isDef: K,
|
|
497
|
-
isElement:
|
|
511
|
+
isElement: Pt,
|
|
498
512
|
isFunction: k,
|
|
499
513
|
isNull: et,
|
|
500
|
-
isNullOrUnDef:
|
|
501
|
-
isNumeric:
|
|
502
|
-
isObject:
|
|
503
|
-
isPromise:
|
|
504
|
-
isRegExp:
|
|
514
|
+
isNullOrUnDef: It,
|
|
515
|
+
isNumeric: R,
|
|
516
|
+
isObject: P,
|
|
517
|
+
isPromise: zt,
|
|
518
|
+
isRegExp: bt,
|
|
505
519
|
isSameValue: Dt,
|
|
506
520
|
isString: St,
|
|
507
521
|
isUnDef: tt,
|
|
508
|
-
isWindow:
|
|
509
|
-
loadCss:
|
|
510
|
-
loadScript:
|
|
522
|
+
isWindow: Et,
|
|
523
|
+
loadCss: Rt,
|
|
524
|
+
loadScript: Nt,
|
|
511
525
|
throttle: At,
|
|
512
526
|
toCanvasCoord: Bt,
|
|
513
527
|
toModelCoord: Ft,
|
|
@@ -543,7 +557,7 @@ class f {
|
|
|
543
557
|
/** 默认平面 ('xy' 或 'xz') */
|
|
544
558
|
constructor(t) {
|
|
545
559
|
const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: c, pitch: l, roll: h, plane: u = "xy" } = t || {};
|
|
546
|
-
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, (
|
|
560
|
+
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, (R(c) || R(l) || R(h)) && (this.hasAngle = !0);
|
|
547
561
|
}
|
|
548
562
|
/**
|
|
549
563
|
* 计算两点之间的三维距离
|
|
@@ -630,18 +644,18 @@ class f {
|
|
|
630
644
|
try {
|
|
631
645
|
if (e?.id === i?.id)
|
|
632
646
|
return new f(this);
|
|
633
|
-
if (e?.modelType ===
|
|
647
|
+
if (e?.modelType === b.GeoModel) {
|
|
634
648
|
const { refPoint: n } = e?.relativeMap || {};
|
|
635
649
|
if (this.hasGeo && n) {
|
|
636
|
-
const o =
|
|
650
|
+
const o = N.LLHToXYZ(this, n);
|
|
637
651
|
return this.x = o.x, this.y = o.y, this.z = o.z, this.hasXYZ = !0, this.project(t);
|
|
638
652
|
}
|
|
639
653
|
throw new w(p.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
|
|
640
654
|
}
|
|
641
|
-
if (i?.modelType ===
|
|
655
|
+
if (i?.modelType === b.GeoModel) {
|
|
642
656
|
const { refPoint: n } = i?.relativeMap || {}, o = this.project(t);
|
|
643
657
|
if (o?.hasXYZ && n) {
|
|
644
|
-
const r =
|
|
658
|
+
const r = N.XYZToLLH(o, n);
|
|
645
659
|
return o.lat = r.lat, o.lon = r.lon, o.alt = r.alt, o.hasGeo = !0, o;
|
|
646
660
|
}
|
|
647
661
|
throw new w(p.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
|
|
@@ -690,7 +704,7 @@ class f {
|
|
|
690
704
|
return e.x = i + t.x, e.y = n + t.y, e.z += t.z, e;
|
|
691
705
|
}
|
|
692
706
|
}
|
|
693
|
-
class
|
|
707
|
+
class N {
|
|
694
708
|
lat = 0;
|
|
695
709
|
/** 经度 */
|
|
696
710
|
lon = 0;
|
|
@@ -712,7 +726,7 @@ class C {
|
|
|
712
726
|
c = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), h = e.alt + t.z / 1e3;
|
|
713
727
|
} else
|
|
714
728
|
throw new w(p.GeoPointNoPlane, "点的plane应为xz或xy");
|
|
715
|
-
return new
|
|
729
|
+
return new N({
|
|
716
730
|
lat: l,
|
|
717
731
|
lon: c,
|
|
718
732
|
alt: h
|
|
@@ -750,7 +764,7 @@ class y {
|
|
|
750
764
|
/** 参考点 */
|
|
751
765
|
constructor(t) {
|
|
752
766
|
const { refPoint: e, ...i } = t || {};
|
|
753
|
-
e && (this.refPoint = new
|
|
767
|
+
e && (this.refPoint = new N(e)), Object.assign(this, i);
|
|
754
768
|
}
|
|
755
769
|
/**
|
|
756
770
|
* 合并两个相对坐标系的映射关系
|
|
@@ -837,7 +851,7 @@ class m {
|
|
|
837
851
|
* @returns
|
|
838
852
|
*/
|
|
839
853
|
static async getCoordinateTree(t) {
|
|
840
|
-
const e = await
|
|
854
|
+
const e = await W({ projectId: t });
|
|
841
855
|
if (e.length) {
|
|
842
856
|
const i = m.handleCoordinateList(e);
|
|
843
857
|
return m.buildCoordinateTree(i, 0);
|
|
@@ -860,14 +874,14 @@ class m {
|
|
|
860
874
|
*/
|
|
861
875
|
static async addCoordinate(t, e) {
|
|
862
876
|
const { projectId: i, id: n } = t, o = e.map((a) => {
|
|
863
|
-
const { type: c, modelType: l, relativeMap: h, level: u, ...d } = a,
|
|
877
|
+
const { type: c, modelType: l, relativeMap: h, level: u, ...d } = a, T = h ? JSON.stringify(h) : void 0;
|
|
864
878
|
return {
|
|
865
879
|
...d,
|
|
866
880
|
projectId: i,
|
|
867
881
|
parentId: n,
|
|
868
882
|
coordinateType: c,
|
|
869
883
|
renderType: l,
|
|
870
|
-
relativePosition:
|
|
884
|
+
relativePosition: T
|
|
871
885
|
};
|
|
872
886
|
}), r = await j(o);
|
|
873
887
|
return m.handleCoordinateList(r);
|
|
@@ -880,7 +894,7 @@ class m {
|
|
|
880
894
|
*/
|
|
881
895
|
static async removeCoordinate(t, e) {
|
|
882
896
|
const i = e.map((n) => n.id ?? -1);
|
|
883
|
-
return await
|
|
897
|
+
return await V(i);
|
|
884
898
|
}
|
|
885
899
|
/**
|
|
886
900
|
* 更新坐标系
|
|
@@ -905,7 +919,7 @@ class m {
|
|
|
905
919
|
const { projectId: i, id: n } = t, o = e.map((a) => {
|
|
906
920
|
const { modelId: c } = a;
|
|
907
921
|
return { modelId: c, parentId: n, projectId: i };
|
|
908
|
-
}), r = await
|
|
922
|
+
}), r = await q(o);
|
|
909
923
|
return m.handleCoordinateList(r);
|
|
910
924
|
}
|
|
911
925
|
/**
|
|
@@ -921,8 +935,8 @@ class m {
|
|
|
921
935
|
renderType: o,
|
|
922
936
|
relativePosition: r,
|
|
923
937
|
...a
|
|
924
|
-
} = e, c = o ===
|
|
925
|
-
return new
|
|
938
|
+
} = e, c = o === b.GeoModel ? new y(y.toParse(r)) : y.toParse(r);
|
|
939
|
+
return new L({
|
|
926
940
|
...a,
|
|
927
941
|
type: i,
|
|
928
942
|
modelType: o,
|
|
@@ -940,7 +954,7 @@ class m {
|
|
|
940
954
|
const e = Array.isArray(t) ? t : [t], i = [];
|
|
941
955
|
function n(o) {
|
|
942
956
|
for (const r of o) {
|
|
943
|
-
const { level: a, parent: c, relativeMap: l, ...h } = r, u = new
|
|
957
|
+
const { level: a, parent: c, relativeMap: l, ...h } = r, u = new L({
|
|
944
958
|
...h,
|
|
945
959
|
relativeMap: new y(l)
|
|
946
960
|
});
|
|
@@ -991,14 +1005,14 @@ class m {
|
|
|
991
1005
|
static filterSpaceTree(t, e) {
|
|
992
1006
|
const i = [];
|
|
993
1007
|
return t.forEach((n) => {
|
|
994
|
-
const o = new
|
|
1008
|
+
const o = new L(n);
|
|
995
1009
|
e && (o.parent = e);
|
|
996
1010
|
const r = m.filterSpaceTree(o.children, o);
|
|
997
1011
|
o.children = r, o.disabled = o.disabled ?? !1, o.type !== v.Model && i.push(o);
|
|
998
1012
|
}), i;
|
|
999
1013
|
}
|
|
1000
1014
|
}
|
|
1001
|
-
class
|
|
1015
|
+
class L {
|
|
1002
1016
|
id = 0;
|
|
1003
1017
|
/** id */
|
|
1004
1018
|
type = 0;
|
|
@@ -1098,7 +1112,7 @@ class G {
|
|
|
1098
1112
|
}
|
|
1099
1113
|
/** 映射到(模型映射到空间,空间映射到空间) */
|
|
1100
1114
|
async mappingTo(t) {
|
|
1101
|
-
await
|
|
1115
|
+
await Z(t);
|
|
1102
1116
|
}
|
|
1103
1117
|
/** 来自映射(被映射过的源坐标系关系) */
|
|
1104
1118
|
async getMapping() {
|
|
@@ -1131,11 +1145,11 @@ class G {
|
|
|
1131
1145
|
* @returns
|
|
1132
1146
|
*/
|
|
1133
1147
|
findClosestModel(t = [
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1148
|
+
b.CADModel,
|
|
1149
|
+
b.BIMModel,
|
|
1150
|
+
b.ForgeModel,
|
|
1151
|
+
b.ThreeDModel,
|
|
1152
|
+
b.GeoModel
|
|
1139
1153
|
], e) {
|
|
1140
1154
|
const i = x(t) ? t : [t], n = /* @__PURE__ */ new Set();
|
|
1141
1155
|
e?.forEach((h) => {
|
|
@@ -1148,15 +1162,15 @@ class G {
|
|
|
1148
1162
|
continue;
|
|
1149
1163
|
const d = h.modelType ?? -1;
|
|
1150
1164
|
i.includes(d) && a.push({ node: h, distance: u, modelType: d }), r.add(h);
|
|
1151
|
-
const
|
|
1165
|
+
const T = [];
|
|
1152
1166
|
if (h.children)
|
|
1153
1167
|
for (const S of h.children)
|
|
1154
|
-
r.has(S) ||
|
|
1168
|
+
r.has(S) || T.push(S);
|
|
1155
1169
|
if (h.parent?.children)
|
|
1156
1170
|
for (const S of h.parent.children)
|
|
1157
|
-
S !== h && !r.has(S) &&
|
|
1158
|
-
h.parent && !r.has(h.parent) &&
|
|
1159
|
-
for (const S of
|
|
1171
|
+
S !== h && !r.has(S) && T.push(S);
|
|
1172
|
+
h.parent && !r.has(h.parent) && T.push(h.parent);
|
|
1173
|
+
for (const S of T)
|
|
1160
1174
|
o.push({ node: S, distance: u + 1 });
|
|
1161
1175
|
}
|
|
1162
1176
|
if (a.length === 0)
|
|
@@ -1379,7 +1393,7 @@ class Zt {
|
|
|
1379
1393
|
}), o;
|
|
1380
1394
|
}
|
|
1381
1395
|
}
|
|
1382
|
-
class
|
|
1396
|
+
class Ht {
|
|
1383
1397
|
canvas;
|
|
1384
1398
|
ctx;
|
|
1385
1399
|
options;
|
|
@@ -1565,7 +1579,7 @@ class Vt {
|
|
|
1565
1579
|
}
|
|
1566
1580
|
}
|
|
1567
1581
|
const B = {};
|
|
1568
|
-
class
|
|
1582
|
+
class Qt {
|
|
1569
1583
|
type = "image";
|
|
1570
1584
|
// 修改为更通用的名称
|
|
1571
1585
|
x;
|
|
@@ -1600,7 +1614,7 @@ class Ht {
|
|
|
1600
1614
|
}
|
|
1601
1615
|
}
|
|
1602
1616
|
}
|
|
1603
|
-
class
|
|
1617
|
+
class Kt {
|
|
1604
1618
|
id = "";
|
|
1605
1619
|
type = "point";
|
|
1606
1620
|
x;
|
|
@@ -1621,7 +1635,7 @@ class Qt {
|
|
|
1621
1635
|
}
|
|
1622
1636
|
}
|
|
1623
1637
|
const F = {};
|
|
1624
|
-
class
|
|
1638
|
+
class te {
|
|
1625
1639
|
id = "";
|
|
1626
1640
|
type = "issue";
|
|
1627
1641
|
//轨迹点上的事件
|
|
@@ -1660,7 +1674,7 @@ class Kt {
|
|
|
1660
1674
|
}
|
|
1661
1675
|
}
|
|
1662
1676
|
const Y = {};
|
|
1663
|
-
class
|
|
1677
|
+
class ee {
|
|
1664
1678
|
type = "marker";
|
|
1665
1679
|
x;
|
|
1666
1680
|
y;
|
|
@@ -1714,7 +1728,7 @@ class te {
|
|
|
1714
1728
|
}
|
|
1715
1729
|
}
|
|
1716
1730
|
}
|
|
1717
|
-
class
|
|
1731
|
+
class se {
|
|
1718
1732
|
type = "radar";
|
|
1719
1733
|
x;
|
|
1720
1734
|
y;
|
|
@@ -1744,7 +1758,7 @@ class ee {
|
|
|
1744
1758
|
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();
|
|
1745
1759
|
}
|
|
1746
1760
|
}
|
|
1747
|
-
class
|
|
1761
|
+
class ie {
|
|
1748
1762
|
type = "region";
|
|
1749
1763
|
x;
|
|
1750
1764
|
y;
|
|
@@ -1779,35 +1793,36 @@ export {
|
|
|
1779
1793
|
lt as APP_SETTING,
|
|
1780
1794
|
w as AppError,
|
|
1781
1795
|
p as AppErrorCode,
|
|
1782
|
-
|
|
1796
|
+
ct as AppObsType,
|
|
1783
1797
|
g as CRSTypes,
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1798
|
+
Ht as CanvasElement,
|
|
1799
|
+
Qt as CanvasImageElement,
|
|
1800
|
+
te as CanvasIssueElement,
|
|
1801
|
+
ee as CanvasMarkerElement,
|
|
1802
|
+
Kt as CanvasPointElement,
|
|
1803
|
+
se as CanvasRadarElement,
|
|
1804
|
+
ie as CanvasRegionElement,
|
|
1805
|
+
L as Coordinate,
|
|
1806
|
+
ht as CoordinateLevel,
|
|
1807
|
+
b as CoordinateModelType,
|
|
1794
1808
|
A as CoordinateStatus,
|
|
1795
1809
|
v as CoordinateType,
|
|
1796
1810
|
Zt as DataHelper,
|
|
1797
1811
|
m as DataSource,
|
|
1798
|
-
|
|
1812
|
+
N as GeoPoint,
|
|
1799
1813
|
_ as LocaleType,
|
|
1800
1814
|
ft as MAP_PROVIDERS,
|
|
1815
|
+
Jt as MAP_TILE_LAYERS,
|
|
1801
1816
|
f as Point,
|
|
1802
1817
|
ot as Position,
|
|
1803
1818
|
dt as REQUEST_CONFIG,
|
|
1804
1819
|
ut as REQUEST_OPTIONS,
|
|
1805
1820
|
y as RelativeMap,
|
|
1806
|
-
|
|
1821
|
+
G as RequestContentType,
|
|
1807
1822
|
M as RequestMethod,
|
|
1808
1823
|
$ as RequestResultCode,
|
|
1809
1824
|
rt as Vector3,
|
|
1810
1825
|
qt as api,
|
|
1811
|
-
|
|
1812
|
-
|
|
1826
|
+
Wt as http,
|
|
1827
|
+
Vt as utils
|
|
1813
1828
|
};
|