@vsleem-realsee-viewer/shared 2.0.6 → 2.0.8

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/index.mjs CHANGED
@@ -12,49 +12,50 @@ class m extends Error {
12
12
  };
13
13
  }
14
14
  }
15
- var P = /* @__PURE__ */ ((s) => (s[s.CADModel = 5] = "CADModel", s[s.BIMModel = 6] = "BIMModel", s[s.ForgeModel = 7] = "ForgeModel", s[s.ThreeDModel = 8] = "ThreeDModel", s[s.SkyMapModel = 9] = "SkyMapModel", s[s.ScaleModel = 10] = "ScaleModel", s))(P || {}), K = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(K || {}), M = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(M || {}), D = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(D || {}), F = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))(F || {}), x = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(x || {}), I = /* @__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))(I || {}), tt = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(tt || {}), y = /* @__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))(y || {});
16
- const et = {
15
+ var D = /* @__PURE__ */ ((s) => (s[s.CADModel = 5] = "CADModel", s[s.BIMModel = 6] = "BIMModel", s[s.ForgeModel = 7] = "ForgeModel", s[s.ThreeDModel = 8] = "ThreeDModel", s[s.SkyMapModel = 9] = "SkyMapModel", s[s.ScaleModel = 10] = "ScaleModel", s))(D || {}), tt = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(tt || {}), v = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(v || {}), C = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(C || {}), F = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))(F || {}), M = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(M || {}), R = /* @__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))(R || {}), et = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(et || {}), y = /* @__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))(y || {});
16
+ const st = {
17
17
  baseUrl: "https://vsleem.com/api",
18
- obsType: "hs"
19
- }, st = {
18
+ obsType: "hs",
19
+ authorizeCode: ""
20
+ }, it = {
20
21
  isTransformResponse: !0,
21
22
  joinBaseUrl: !0,
22
23
  withAuthorize: !0
23
- }, it = {
24
+ }, nt = {
24
25
  url: "",
25
- method: x.GET,
26
+ method: M.GET,
26
27
  headers: {}
27
- }, U = { ...et };
28
- function nt(s) {
28
+ }, U = { ...st };
29
+ function ot(s) {
29
30
  Object.assign(U, s);
30
31
  }
31
- async function b(s, t) {
32
- const e = { ...st, ...t }, i = { ...it, ...s };
32
+ async function T(s, t) {
33
+ const e = { ...it, ...t }, i = { ...nt, ...s };
33
34
  try {
34
- const n = ot(i, e), { url: o, ...r } = n, h = await (await window.fetch(o, r)).json();
35
- return rt(h, e);
35
+ const n = rt(i, e), { url: o, ...r } = n, h = await (await window.fetch(o, r)).json();
36
+ return at(h, e);
36
37
  } catch (n) {
37
- return at(n);
38
+ return ht(n);
38
39
  }
39
40
  }
40
- function ot(s, t) {
41
+ function rt(s, t) {
41
42
  const { baseUrl: e, authorizeCode: i } = U, { joinBaseUrl: n, withAuthorize: o } = t;
42
43
  let { url: r, method: a, headers: h = {}, params: l, data: c } = s;
43
44
  n && e && (r = `${e}${r}`), a = a?.toUpperCase();
44
45
  const u = { ...h };
45
- 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"] = I.JSON), a === x.GET && l) {
46
+ 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 === M.POST && !u["Content-Type"] && (u["Content-Type"] = R.JSON), a === M.GET && l) {
46
47
  const p = new URLSearchParams(l);
47
48
  r += `?${p.toString()}`;
48
49
  }
49
50
  let d;
50
- return a === x.POST && (d = u["Content-Type"] === I.JSON ? JSON.stringify(c || {}) : c), {
51
+ return a === M.POST && (d = u["Content-Type"] === R.JSON ? JSON.stringify(c || {}) : c), {
51
52
  url: r,
52
53
  method: a,
53
54
  headers: u,
54
55
  body: d
55
56
  };
56
57
  }
57
- function rt(s, t) {
58
+ function at(s, t) {
58
59
  if (!t.isTransformResponse)
59
60
  return s;
60
61
  if (!s)
@@ -64,102 +65,102 @@ function rt(s, t) {
64
65
  return i;
65
66
  throw new m(y.RequestCodeError, n || "请求返回的Code错误");
66
67
  }
67
- function at(s) {
68
+ function ht(s) {
68
69
  throw s instanceof Error ? s : new m(
69
70
  y.RequestUnknownError,
70
71
  typeof s == "string" ? s : "未知的请求错误"
71
72
  );
72
73
  }
73
- const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74
+ const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74
75
  __proto__: null,
75
- request: b,
76
- setRequestGlobalConfig: nt
76
+ request: T,
77
+ setRequestGlobalConfig: ot
77
78
  }, Symbol.toStringTag, { value: "Module" }));
78
79
  function Y(s, t) {
79
- return b(
80
+ return T(
80
81
  {
81
82
  url: "/project/jssdk/cs/list",
82
- method: x.GET,
83
+ method: M.GET,
83
84
  params: s
84
85
  },
85
86
  t
86
87
  );
87
88
  }
88
- function B(s, t) {
89
- return b(
89
+ function G(s, t) {
90
+ return T(
90
91
  {
91
92
  url: "/project/jssdk/cs/bind",
92
- method: x.POST,
93
+ method: M.POST,
93
94
  data: s
94
95
  },
95
96
  t
96
97
  );
97
98
  }
98
- function C(s, t) {
99
- return b(
99
+ function O(s, t) {
100
+ return T(
100
101
  {
101
102
  url: "/project/jssdk/cs/save",
102
- method: x.POST,
103
+ method: M.POST,
103
104
  data: s
104
105
  },
105
106
  t
106
107
  );
107
108
  }
108
- function G(s, t) {
109
- return b(
109
+ function B(s, t) {
110
+ return T(
110
111
  {
111
112
  url: "/project/jssdk/cs/delete",
112
- method: x.POST,
113
+ method: M.POST,
113
114
  data: s
114
115
  },
115
116
  t
116
117
  );
117
118
  }
118
119
  function $(s, t) {
119
- return b(
120
+ return T(
120
121
  {
121
122
  url: "/project/jssdk/cs/mapping",
122
- method: x.POST,
123
+ method: M.POST,
123
124
  data: s
124
125
  },
125
126
  t
126
127
  );
127
128
  }
128
129
  function _(s, t) {
129
- return b(
130
+ return T(
130
131
  {
131
132
  url: "/project/jssdk/cs/mapping/query",
132
- method: x.GET,
133
+ method: M.GET,
133
134
  params: s
134
135
  },
135
136
  t
136
137
  );
137
138
  }
138
- function ht(s, t = {
139
+ function ct(s, t = {
139
140
  isTransformResponse: !1,
140
141
  joinBaseUrl: !1,
141
142
  withAuthorize: !1
142
143
  }) {
143
- return b(
144
+ return T(
144
145
  {
145
146
  url: s,
146
- method: x.GET
147
+ method: M.GET
147
148
  },
148
149
  t
149
150
  );
150
151
  }
151
- const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152
153
  __proto__: null,
153
- bindCoordinate: B,
154
+ bindCoordinate: G,
154
155
  getCoordinateList: Y,
155
- getImageInfo: ht,
156
+ getImageInfo: ct,
156
157
  getMappingRelation: _,
157
158
  mapingCoordinate: $,
158
- removeCoordinate: G,
159
- saveCoordinate: C
160
- }, Symbol.toStringTag, { value: "Module" })), ct = typeof window < "u", lt = Object.prototype.toString;
161
- function v(s, t) {
162
- return lt.call(s) === `[object ${t}]`;
159
+ removeCoordinate: B,
160
+ saveCoordinate: O
161
+ }, Symbol.toStringTag, { value: "Module" })), lt = typeof window < "u", ut = Object.prototype.toString;
162
+ function P(s, t) {
163
+ return ut.call(s) === `[object ${t}]`;
163
164
  }
164
165
  function Z(s) {
165
166
  return typeof s < "u";
@@ -167,41 +168,38 @@ function Z(s) {
167
168
  function q(s) {
168
169
  return !Z(s);
169
170
  }
170
- function j(s) {
171
- return s !== null && v(s, "Object");
171
+ function S(s) {
172
+ return s !== null && P(s, "Object");
172
173
  }
173
174
  function J(s) {
174
175
  return s === null;
175
176
  }
176
- function ut(s) {
177
- return v(s, "Date");
178
- }
179
177
  function dt(s) {
180
- return v(s, "String");
181
- }
182
- function O(s) {
183
- return typeof s == "function";
178
+ return P(s, "Date");
184
179
  }
185
180
  function ft(s) {
186
- return v(s, "Boolean");
181
+ return P(s, "String");
187
182
  }
188
- function mt(s) {
189
- return v(s, "RegExp");
183
+ function L(s) {
184
+ return typeof s == "function";
190
185
  }
191
- function S(s) {
192
- return s && Array.isArray(s);
186
+ function mt(s) {
187
+ return P(s, "Boolean");
193
188
  }
194
189
  function yt(s) {
195
- return typeof window < "u" && v(s, "Window");
190
+ return P(s, "RegExp");
191
+ }
192
+ function g(s) {
193
+ return s && Array.isArray(s);
196
194
  }
197
195
  function wt(s) {
198
- return j(s) && !!s.tagName;
196
+ return typeof window < "u" && P(s, "Window");
199
197
  }
200
198
  function pt(s) {
201
- return typeof s == "number" || /^\d+(\.\d+)?$/.test(s);
199
+ return S(s) && !!s.tagName;
202
200
  }
203
- function E(s) {
204
- return v(Number(s), "Number");
201
+ function b(s) {
202
+ return typeof s == "number" || /^\d+(\.\d+)?$/.test(String(s ?? ""));
205
203
  }
206
204
  function gt(s, t) {
207
205
  return JSON.stringify(s) === JSON.stringify(t);
@@ -210,12 +208,12 @@ function xt(s) {
210
208
  return q(s) || J(s);
211
209
  }
212
210
  function Mt(s) {
213
- return v(s, "Promise") && j(s) && O(s.then) && O(s.catch);
211
+ return P(s, "Promise") && S(s) && L(s.then) && L(s.catch);
214
212
  }
215
213
  function H(s) {
216
- return T(s, /* @__PURE__ */ new WeakMap());
214
+ return E(s, /* @__PURE__ */ new WeakMap());
217
215
  }
218
- function T(s, t) {
216
+ function E(s, t) {
219
217
  if (typeof s != "object" || s === null)
220
218
  return s;
221
219
  if (t.has(s))
@@ -227,11 +225,11 @@ function T(s, t) {
227
225
  return e = new RegExp(s), t.set(s, e), e;
228
226
  if (s instanceof Map)
229
227
  return e = /* @__PURE__ */ new Map(), t.set(s, e), s.forEach((n, o) => {
230
- e.set(o, T(n, t));
228
+ e.set(o, E(n, t));
231
229
  }), e;
232
230
  if (s instanceof Set)
233
231
  return e = /* @__PURE__ */ new Set(), t.set(s, e), s.forEach((n) => {
234
- e.add(T(n, t));
232
+ e.add(E(n, t));
235
233
  }), e;
236
234
  if (ArrayBuffer.isView(s))
237
235
  return e = new s.constructor(
@@ -244,15 +242,15 @@ function T(s, t) {
244
242
  if (Array.isArray(s)) {
245
243
  e = [], t.set(s, e);
246
244
  for (let n = 0; n < s.length; n++)
247
- n in s && (e[n] = T(s[n], t));
245
+ n in s && (e[n] = E(s[n], t));
248
246
  return e;
249
247
  }
250
248
  e = Object.create(Object.getPrototypeOf(s)), t.set(s, e);
251
249
  for (const n in s)
252
- Object.prototype.hasOwnProperty.call(s, n) && (e[n] = T(s[n], t));
250
+ Object.prototype.hasOwnProperty.call(s, n) && (e[n] = E(s[n], t));
253
251
  const i = Object.getOwnPropertySymbols(s);
254
252
  for (const n of i)
255
- Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = T(s[n], t));
253
+ Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = E(s[n], t));
256
254
  return e;
257
255
  }
258
256
  function vt(s, t, e = !1) {
@@ -282,15 +280,15 @@ function bt(s, t, e = !1) {
282
280
  clearTimeout(i), i = void 0, n = void 0;
283
281
  }, o;
284
282
  }
285
- function R(s, ...t) {
283
+ function k(s, ...t) {
286
284
  if (!t.length) return s;
287
285
  const e = t.shift();
288
- return e === void 0 ? s : (z(s) && z(e) && Object.keys(e).forEach((i) => {
286
+ return e === void 0 ? s : (I(s) && I(e) && Object.keys(e).forEach((i) => {
289
287
  const n = s[i], o = e[i];
290
- Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : z(n) && z(o) ? s[i] = R({ ...n }, o) : o !== void 0 && (s[i] = o);
291
- }), R(s, ...t));
288
+ Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : I(n) && I(o) ? s[i] = k({ ...n }, o) : o !== void 0 && (s[i] = o);
289
+ }), k(s, ...t));
292
290
  }
293
- function z(s) {
291
+ function I(s) {
294
292
  return s !== null && typeof s == "object" && !Array.isArray(s);
295
293
  }
296
294
  function V(s, ...t) {
@@ -302,9 +300,30 @@ function V(s, ...t) {
302
300
  });
303
301
  return s;
304
302
  }
303
+ function W(s, t) {
304
+ const e = {};
305
+ if (S(s) && !g(s)) {
306
+ for (const i in s)
307
+ if (Object.prototype.hasOwnProperty.call(s, i)) {
308
+ const n = s[i], o = S(t) && !g(t) ? t[i] : void 0;
309
+ if (!(i in (t || {})))
310
+ e[i] = n;
311
+ else if (g(n) && g(o))
312
+ JSON.stringify(n) !== JSON.stringify(o) && (e[i] = n);
313
+ else if (S(n) && S(o)) {
314
+ const r = W(n, o);
315
+ r && Object.keys(r).length > 0 && (e[i] = r);
316
+ } else n !== o && (e[i] = n);
317
+ }
318
+ }
319
+ if (S(t) && g(t))
320
+ for (const i in t)
321
+ Object.prototype.hasOwnProperty.call(t, i) && !(i in (s || {})) && (e[i] = void 0);
322
+ return e;
323
+ }
305
324
  function St(s, t = {}) {
306
325
  return new Promise((e, i) => {
307
- const n = L(s);
326
+ const n = z(s);
308
327
  if (Tt(n)) {
309
328
  e(!0);
310
329
  return;
@@ -320,10 +339,29 @@ function St(s, t = {}) {
320
339
  });
321
340
  }
322
341
  function Tt(s) {
323
- const t = L(s);
324
- return Array.from(document.scripts).some((e) => L(e.src) === t);
342
+ const t = z(s);
343
+ return Array.from(document.scripts).some((e) => z(e.src) === t);
325
344
  }
326
- function L(s) {
345
+ function Pt(s) {
346
+ return new Promise((t, e) => {
347
+ const i = z(s);
348
+ if (Et(i)) {
349
+ t(!0);
350
+ return;
351
+ }
352
+ const n = document.createElement("link");
353
+ n.rel = "stylesheet", n.type = "text/css", n.href = s, n.onload = () => {
354
+ t(!0);
355
+ }, n.onerror = () => {
356
+ document.head.removeChild(n), e(new Error(`Failed to load link: ${s}`));
357
+ }, document.head.appendChild(n);
358
+ });
359
+ }
360
+ function Et(s) {
361
+ const t = z(s);
362
+ return Array.from(document.links).some((e) => z(e.href) === t);
363
+ }
364
+ function z(s) {
327
365
  try {
328
366
  const t = new URL(s, window.location.href);
329
367
  return `${t.origin}${t.pathname}`;
@@ -331,7 +369,7 @@ function L(s) {
331
369
  return s;
332
370
  }
333
371
  }
334
- function Pt(s, t, e, i) {
372
+ function Dt(s, t, e, i) {
335
373
  const n = Math.min(s / e, t / i), o = e * n, r = i * n;
336
374
  return {
337
375
  scale: n,
@@ -343,7 +381,7 @@ function Pt(s, t, e, i) {
343
381
  sh: r
344
382
  };
345
383
  }
346
- function Et(s, t, e) {
384
+ function zt(s, t, e) {
347
385
  return {
348
386
  x: s * e.scale + e.x,
349
387
  // 缩放后加上偏移量
@@ -357,44 +395,45 @@ function Nt(s, t, e) {
357
395
  y: (t - e.y) / e.scale
358
396
  };
359
397
  }
360
- function zt(s) {
398
+ function It(s) {
361
399
  console.warn(`[warn]:${s}`);
362
400
  }
363
- function Dt(s) {
401
+ function Ct(s) {
364
402
  throw new Error(`[error]:${s}`);
365
403
  }
366
- const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
404
+ const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
367
405
  __proto__: null,
368
406
  cloneDeep: H,
369
407
  debounce: vt,
370
- deepMerge: R,
408
+ deepMerge: k,
371
409
  deepMergeProps: V,
372
- error: Dt,
373
- getImageTransform: Pt,
374
- inBrowser: ct,
375
- is: v,
376
- isArray: S,
377
- isBoolean: ft,
378
- isDate: ut,
410
+ error: Ct,
411
+ getDiffProps: W,
412
+ getImageTransform: Dt,
413
+ inBrowser: lt,
414
+ is: P,
415
+ isArray: g,
416
+ isBoolean: mt,
417
+ isDate: dt,
379
418
  isDef: Z,
380
- isElement: wt,
381
- isFunction: O,
419
+ isElement: pt,
420
+ isFunction: L,
382
421
  isNull: J,
383
422
  isNullOrUnDef: xt,
384
- isNumber: E,
385
- isNumeric: pt,
386
- isObject: j,
423
+ isNumber: b,
424
+ isObject: S,
387
425
  isPromise: Mt,
388
- isRegExp: mt,
426
+ isRegExp: yt,
389
427
  isSameValue: gt,
390
- isString: dt,
428
+ isString: ft,
391
429
  isUnDef: q,
392
- isWindow: yt,
430
+ isWindow: wt,
431
+ loadCss: Pt,
393
432
  loadScript: St,
394
433
  throttle: bt,
395
- toCanvasCoord: Et,
434
+ toCanvasCoord: zt,
396
435
  toModelCoord: Nt,
397
- warn: zt
436
+ warn: It
398
437
  }, Symbol.toStringTag, { value: "Module" }));
399
438
  class f {
400
439
  // 直角坐标系坐标
@@ -426,7 +465,7 @@ class f {
426
465
  // 默认平面 ('xy' 或 'xz')
427
466
  constructor(t) {
428
467
  const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: h, pitch: l, roll: c, plane: u = "xy" } = t || {};
429
- E(e) && E(i) && (this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, this.plane = u, this.hasXYZ = !0), E(o) && E(r) && Number(o) !== 0 && Number(r) !== 0 && (this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, this.hasGeo = !0), (h !== void 0 || l !== void 0 || c !== void 0) && (this.yaw = Number(h) || 0, this.pitch = Number(l) || 0, this.roll = Number(c) || 0, this.hasAngle = !0);
468
+ b(e) && b(i) && Number(e) !== 0 && Number(i) !== 0 && (this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, this.plane = u, this.hasXYZ = !0), b(o) && b(r) && Number(o) !== 0 && Number(r) !== 0 && (this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, this.hasGeo = !0), (b(h) || b(l) || b(c)) && (this.yaw = Number(h) || 0, this.pitch = Number(l) || 0, this.roll = Number(c) || 0, this.hasAngle = !0);
430
469
  }
431
470
  /**
432
471
  * 计算两点之间的三维距离
@@ -513,16 +552,21 @@ class f {
513
552
  try {
514
553
  if (e?.id === i?.id)
515
554
  return new f(this);
516
- if (e?.modelType === P.SkyMapModel) {
555
+ if (e?.modelType === D.SkyMapModel) {
517
556
  const { refPoint: n } = e?.relativeMap || {};
557
+ if (this?.hasXYZ)
558
+ return this.project(t);
518
559
  if (this.hasGeo && n) {
519
560
  const o = N.LLHToXYZ(this, n);
520
561
  return this.x = o.x, this.y = o.y, this.z = o.z, this.hasXYZ = !0, this.project(t);
521
562
  }
522
563
  throw new m(y.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
523
564
  }
524
- if (i?.modelType === P.SkyMapModel) {
525
- const { refPoint: n } = i?.relativeMap || {}, o = this.project(t);
565
+ if (i?.modelType === D.SkyMapModel) {
566
+ const { refPoint: n } = i?.relativeMap || {};
567
+ if (this?.hasGeo)
568
+ return new f(this);
569
+ const o = this.project(t);
526
570
  if (o?.hasXYZ && n) {
527
571
  const r = N.XYZToLLH(o, n);
528
572
  return o.lat = r.lat, o.lon = r.lon, o.alt = r.alt, o.hasGeo = !0, o;
@@ -619,7 +663,7 @@ class N {
619
663
  throw new m(y.GeoPointNoPlane, "点的plane应为xz或xy");
620
664
  }
621
665
  }
622
- class g {
666
+ class x {
623
667
  scale = 1;
624
668
  yaw = 0;
625
669
  x = 0;
@@ -653,7 +697,7 @@ class g {
653
697
  a = e.x + c * e.scale, h = e.y + u * e.scale, l = e.z + d * e.scale;
654
698
  } else
655
699
  throw new m(y.RelativeNoPlane, "映射关系的plane应为xz或xy");
656
- return new g({
700
+ return new x({
657
701
  scale: i,
658
702
  yaw: n,
659
703
  x: a,
@@ -678,7 +722,7 @@ class g {
678
722
  r = -(t.x * n + t.y * o) * e, a = -(t.y * n - t.x * o) * e, h = -t.z * e;
679
723
  else
680
724
  throw new m(y.RelativeNoPlane, "映射关系的plane应为xz或xy");
681
- return new g({
725
+ return new x({
682
726
  scale: e,
683
727
  yaw: i,
684
728
  x: r,
@@ -693,7 +737,7 @@ class g {
693
737
  try {
694
738
  let e = t ? JSON.parse(t) : void 0;
695
739
  const { reference_point: i } = e || {};
696
- return i && (e = { refPoint: i }), e ? new g(e) : void 0;
740
+ return i && (e = { refPoint: i }), e ? new x(e) : void 0;
697
741
  } catch {
698
742
  throw new m(y.RelativeJsonError, "relativeMap格式化失败");
699
743
  }
@@ -732,7 +776,7 @@ class w {
732
776
  renderType: l,
733
777
  relativePosition: p
734
778
  };
735
- }), r = await C(o);
779
+ }), r = await O(o);
736
780
  return w.handleCoordinateList(r);
737
781
  }
738
782
  /**
@@ -743,7 +787,7 @@ class w {
743
787
  */
744
788
  static async removeCoordinate(t, e) {
745
789
  const i = e.map((n) => n.id ?? -1);
746
- return await G(i);
790
+ return await B(i);
747
791
  }
748
792
  /**
749
793
  * 更新坐标系
@@ -753,9 +797,9 @@ class w {
753
797
  */
754
798
  static async updateCoordinate(t, e) {
755
799
  const { projectId: i, id: n } = t, o = e.map((a) => {
756
- const { type: h, relativeMap: l, level: c, ...u } = a, d = g.toStringify(l);
800
+ const { type: h, relativeMap: l, level: c, ...u } = a, d = x.toStringify(l);
757
801
  return { ...u, relativePosition: d, projectId: i, parentId: n };
758
- }), r = await C(o);
802
+ }), r = await O(o);
759
803
  return w.handleCoordinateList(r);
760
804
  }
761
805
  /**
@@ -768,7 +812,7 @@ class w {
768
812
  const { projectId: i, id: n } = t, o = e.map((a) => {
769
813
  const { modelId: h } = a;
770
814
  return { modelId: h, parentId: n, projectId: i };
771
- }), r = await B(o);
815
+ }), r = await G(o);
772
816
  return w.handleCoordinateList(r);
773
817
  }
774
818
  /**
@@ -784,8 +828,8 @@ class w {
784
828
  renderType: o,
785
829
  relativePosition: r,
786
830
  ...a
787
- } = e, h = g.toParse(r);
788
- return new It({
831
+ } = e, h = x.toParse(r);
832
+ return new Rt({
789
833
  ...a,
790
834
  type: i,
791
835
  modelType: o,
@@ -822,7 +866,7 @@ class w {
822
866
  */
823
867
  static sortCoordinateTree(t) {
824
868
  t.children && (t.children.sort((e, i) => {
825
- if (e.type === M.Space) {
869
+ if (e.type === v.Space) {
826
870
  const n = Number(i?.relativeMap?.z) - Number(e?.relativeMap?.z);
827
871
  return n !== 0 ? n : Number(i.createTime) - Number(e.createTime);
828
872
  } else
@@ -837,11 +881,11 @@ class w {
837
881
  const e = [];
838
882
  return t.forEach((i) => {
839
883
  const n = w.filterSpaceTree(i.children);
840
- i.children = n, i.disabled = i.disabled ?? !1, i.type !== M.Model && e.push(i);
884
+ i.children = n, i.disabled = i.disabled ?? !1, i.type !== v.Model && e.push(i);
841
885
  }), e;
842
886
  }
843
887
  }
844
- class It {
888
+ class Rt {
845
889
  id = 0;
846
890
  //id
847
891
  type = 0;
@@ -883,10 +927,10 @@ class It {
883
927
  this.setOptions(t);
884
928
  }
885
929
  get spaceList() {
886
- return this.children.filter((t) => t.type === M.Space);
930
+ return this.children.filter((t) => t.type === v.Space);
887
931
  }
888
932
  get modelList() {
889
- return this.children.filter((t) => t.type === M.Model);
933
+ return this.children.filter((t) => t.type === v.Model);
890
934
  }
891
935
  get fullName() {
892
936
  const t = this.name ? `(${this.name})` : "";
@@ -895,16 +939,16 @@ class It {
895
939
  //设置参数
896
940
  setOptions(t) {
897
941
  const { relativeMap: e, parent: i, children: n, ...o } = t || {};
898
- e && (this.relativeMap = new g(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
942
+ e && (this.relativeMap = new x(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
899
943
  }
900
944
  //添加子节点
901
945
  async addChild(t) {
902
- const e = S(t) ? t : [t], i = await w.addCoordinate(this, e);
946
+ const e = g(t) ? t : [t], i = await w.addCoordinate(this, e);
903
947
  this.mergeChild(i);
904
948
  }
905
949
  //删除子节点
906
950
  async removeChild(t) {
907
- const e = S(t) ? t : [t];
951
+ const e = g(t) ? t : [t];
908
952
  await w.removeCoordinate(this, e);
909
953
  for (const i of e) {
910
954
  const n = this.children.findIndex((o) => o.id === i.id);
@@ -913,12 +957,12 @@ class It {
913
957
  }
914
958
  //更新子节点
915
959
  async updateChild(t) {
916
- const e = S(t) ? t : [t], i = await w.updateCoordinate(this, e);
960
+ const e = g(t) ? t : [t], i = await w.updateCoordinate(this, e);
917
961
  this.mergeChild(i);
918
962
  }
919
963
  //绑定子节点,不建立映射关系
920
964
  async bindChild(t) {
921
- const e = S(t) ? t : [t], i = await w.bindCoordinate(this, e);
965
+ const e = g(t) ? t : [t], i = await w.bindCoordinate(this, e);
922
966
  this.mergeChild(i);
923
967
  }
924
968
  // 合并子节点,没有查询到节点就插入
@@ -964,9 +1008,9 @@ class It {
964
1008
  * @param mapped 是否被映射
965
1009
  * @returns
966
1010
  */
967
- findChildModel(t = [P.CADModel, P.SkyMapModel], e = !0) {
968
- const i = S(t) ? t : [t];
969
- return i.includes(this.modelType ?? -1) && this.status !== D.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, h) => Number(a.status) - Number(h.status))?.[0];
1011
+ findChildModel(t = [D.CADModel, D.SkyMapModel], e = !0) {
1012
+ const i = g(t) ? t : [t];
1013
+ return i.includes(this.modelType ?? -1) && this.status !== C.Disabled ? this : ([v.Data, v.Model].includes(this.type) ? this.findParentSpace() : this)?.modelList?.filter((a) => i.includes(a.modelType ?? -1) ? e ? !!a.relativeMap : !0 : !1)?.sort((a, h) => Number(a.status) - Number(h.status))?.[0];
970
1014
  }
971
1015
  /**
972
1016
  * 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
@@ -974,11 +1018,11 @@ class It {
974
1018
  * @param excludeNodes //排除的坐标系
975
1019
  * @returns
976
1020
  */
977
- findClosestModel(t = P.CADModel, e) {
1021
+ findClosestModel(t = D.CADModel, e) {
978
1022
  const i = /* @__PURE__ */ new Set();
979
1023
  for (const l of e ?? [])
980
1024
  i.add(String(l.id));
981
- const n = [{ node: this, distance: 0 }], o = S(t) ? t : [t], r = /* @__PURE__ */ new Set();
1025
+ const n = [{ node: this, distance: 0 }], o = g(t) ? t : [t], r = /* @__PURE__ */ new Set();
982
1026
  let a, h = 1 / 0;
983
1027
  for (; n.length > 0; ) {
984
1028
  const l = n.shift();
@@ -1011,7 +1055,7 @@ class It {
1011
1055
  */
1012
1056
  findParentSpace() {
1013
1057
  let t = this;
1014
- for (; t && t.type !== M.Space; )
1058
+ for (; t && t.type !== v.Space; )
1015
1059
  t = t.parent;
1016
1060
  return t;
1017
1061
  }
@@ -1024,7 +1068,7 @@ class It {
1024
1068
  const e = [];
1025
1069
  let i = this;
1026
1070
  for (; i && t > 0; )
1027
- i.type === M.Space && (e.unshift(i.fullName), t--), i = i.parent;
1071
+ i.type === v.Space && (e.unshift(i.fullName), t--), i = i.parent;
1028
1072
  return e;
1029
1073
  }
1030
1074
  // 寻找坐标系组, 有groupUuid表示坐标系组
@@ -1079,7 +1123,7 @@ class It {
1079
1123
  */
1080
1124
  getMappedCsTree() {
1081
1125
  function t(n) {
1082
- return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !== D.Disabled).map((o) => t(o))), n;
1126
+ return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !== C.Disabled).map((o) => t(o))), n;
1083
1127
  }
1084
1128
  const e = H(this.findRoot(!0)), i = t(e);
1085
1129
  return i.parentId = 0, i.parent = void 0, i;
@@ -1091,13 +1135,13 @@ class It {
1091
1135
  */
1092
1136
  getDestRelativeMap(t) {
1093
1137
  if (this.id === t.id)
1094
- return new g();
1138
+ return new x();
1095
1139
  const e = this.getRelativeMaps(), i = t.getRelativeMaps();
1096
- let n = new g();
1140
+ let n = new x();
1097
1141
  return e?.forEach((o) => {
1098
- n = g.addRelativeMap(n, o);
1142
+ n = x.addRelativeMap(n, o);
1099
1143
  }), i?.reverse()?.forEach((o) => {
1100
- n = g.addRelativeMap(n, g.inverseRelativeMap(o));
1144
+ n = x.addRelativeMap(n, x.inverseRelativeMap(o));
1101
1145
  }), n;
1102
1146
  }
1103
1147
  /**
@@ -1131,7 +1175,7 @@ class It {
1131
1175
  */
1132
1176
  static getCommonCoordinate(t) {
1133
1177
  let e;
1134
- const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type === M.Space));
1178
+ const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type === v.Space));
1135
1179
  for (; this.checkSameCoordinate(i); ) {
1136
1180
  const o = i.shift();
1137
1181
  o?.length && (e = o[0]);
@@ -1159,7 +1203,7 @@ class It {
1159
1203
  } else return !1;
1160
1204
  }
1161
1205
  }
1162
- class W {
1206
+ class Q {
1163
1207
  yaw = 0;
1164
1208
  //偏航角
1165
1209
  pitch = 0;
@@ -1173,14 +1217,14 @@ class W {
1173
1217
  static toParse(t) {
1174
1218
  if (t) {
1175
1219
  const e = t?.split(",").map((i) => Number(i) || 0);
1176
- return new W({ yaw: e[0], pitch: e[1], roll: e[2] });
1220
+ return new Q({ yaw: e[0], pitch: e[1], roll: e[2] });
1177
1221
  }
1178
1222
  }
1179
1223
  static toStringify(t) {
1180
1224
  return t ? `${t.yaw},${t.pitch},${t.roll}` : "";
1181
1225
  }
1182
1226
  }
1183
- class Q {
1227
+ class K {
1184
1228
  x = 0;
1185
1229
  //x轴
1186
1230
  y = 0;
@@ -1194,14 +1238,33 @@ class Q {
1194
1238
  static toParse(t) {
1195
1239
  if (t) {
1196
1240
  const e = t?.split(",").map((i) => Number(i) || 0);
1197
- return new Q({ x: e[0], y: e[1], z: e[2] });
1241
+ return new K({ x: e[0], y: e[1], z: e[2] });
1198
1242
  }
1199
1243
  }
1200
1244
  static toStringify(t) {
1201
1245
  return t ? `${t.x},${t.y},${t.z}` : "";
1202
1246
  }
1203
1247
  }
1204
- class Lt {
1248
+ class At {
1249
+ /**
1250
+ * 将源坐标系中的点转换到目标坐标系中
1251
+ * @param points 需要转换的点数组
1252
+ * @param srcCoordinate 源坐标系
1253
+ * @param dstCoordinate 目标坐标系
1254
+ * @returns 转换后的点数组
1255
+ */
1256
+ static srcPointToDstPoint(t, e, i) {
1257
+ if (!e || !i || !t?.length) return [];
1258
+ const n = e?.getDestRelativeMap(i);
1259
+ if (!n) return [];
1260
+ const o = [];
1261
+ return t.forEach((r) => {
1262
+ const a = r.projection(n, e, i);
1263
+ a && o.push(a);
1264
+ }), o;
1265
+ }
1266
+ }
1267
+ class jt {
1205
1268
  canvas;
1206
1269
  ctx;
1207
1270
  options;
@@ -1386,8 +1449,8 @@ class Lt {
1386
1449
  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));
1387
1450
  }
1388
1451
  }
1389
- const k = {};
1390
- class jt {
1452
+ const A = {};
1453
+ class Xt {
1391
1454
  type = "image";
1392
1455
  // 修改为更通用的名称
1393
1456
  x;
@@ -1401,7 +1464,7 @@ class jt {
1401
1464
  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);
1402
1465
  }
1403
1466
  loadImage(t) {
1404
- const e = k[this.src];
1467
+ const e = A[this.src];
1405
1468
  if (e)
1406
1469
  return queueMicrotask(() => {
1407
1470
  t?.(e), this.redraw?.();
@@ -1409,7 +1472,7 @@ class jt {
1409
1472
  {
1410
1473
  const i = new Image();
1411
1474
  return i.crossOrigin = "anonymous", i.src = this.src, i.onload = () => {
1412
- k[this.src] = i, t?.(i), this.redraw?.();
1475
+ A[this.src] = i, t?.(i), this.redraw?.();
1413
1476
  }, i;
1414
1477
  }
1415
1478
  }
@@ -1422,7 +1485,7 @@ class jt {
1422
1485
  }
1423
1486
  }
1424
1487
  }
1425
- class kt {
1488
+ class Ft {
1426
1489
  id = "";
1427
1490
  type = "point";
1428
1491
  x;
@@ -1442,8 +1505,8 @@ class kt {
1442
1505
  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();
1443
1506
  }
1444
1507
  }
1445
- const A = {};
1446
- class At {
1508
+ const j = {};
1509
+ class Ut {
1447
1510
  id = "";
1448
1511
  type = "issue";
1449
1512
  //轨迹点上的事件
@@ -1463,7 +1526,7 @@ class At {
1463
1526
  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);
1464
1527
  }
1465
1528
  loadImage(t) {
1466
- const e = A[this.src];
1529
+ const e = j[this.src];
1467
1530
  if (e)
1468
1531
  return queueMicrotask(() => {
1469
1532
  t?.(e), this.redraw?.();
@@ -1471,7 +1534,7 @@ class At {
1471
1534
  {
1472
1535
  const i = new Image();
1473
1536
  return i.src = this.src, i.crossOrigin = "anonymous", i.onload = () => {
1474
- A[this.src] = i, t?.(i), this.redraw?.();
1537
+ j[this.src] = i, t?.(i), this.redraw?.();
1475
1538
  }, i;
1476
1539
  }
1477
1540
  }
@@ -1482,7 +1545,7 @@ class At {
1482
1545
  }
1483
1546
  }
1484
1547
  const X = {};
1485
- class Xt {
1548
+ class Yt {
1486
1549
  type = "marker";
1487
1550
  x;
1488
1551
  y;
@@ -1536,7 +1599,7 @@ class Xt {
1536
1599
  }
1537
1600
  }
1538
1601
  }
1539
- class Ft {
1602
+ class Gt {
1540
1603
  type = "radar";
1541
1604
  x;
1542
1605
  y;
@@ -1566,7 +1629,7 @@ class Ft {
1566
1629
  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();
1567
1630
  }
1568
1631
  }
1569
- class Ut {
1632
+ class Bt {
1570
1633
  type = "region";
1571
1634
  x;
1572
1635
  y;
@@ -1598,32 +1661,33 @@ class Ut {
1598
1661
  }
1599
1662
  }
1600
1663
  export {
1601
- et as APP_SETTING,
1664
+ st as APP_SETTING,
1602
1665
  m as AppError,
1603
1666
  y as AppErrorCode,
1604
- tt as AppObsType,
1605
- Lt as CanvasElement,
1606
- jt as CanvasImageElement,
1607
- At as CanvasIssueElement,
1608
- Xt as CanvasMarkerElement,
1609
- kt as CanvasPointElement,
1610
- Ft as CanvasRadarElement,
1611
- Ut as CanvasRegionElement,
1612
- It as Coordinate,
1613
- K as CoordinateLevel,
1614
- P as CoordinateModelType,
1615
- D as CoordinateStatus,
1616
- M as CoordinateType,
1667
+ et as AppObsType,
1668
+ jt as CanvasElement,
1669
+ Xt as CanvasImageElement,
1670
+ Ut as CanvasIssueElement,
1671
+ Yt as CanvasMarkerElement,
1672
+ Ft as CanvasPointElement,
1673
+ Gt as CanvasRadarElement,
1674
+ Bt as CanvasRegionElement,
1675
+ Rt as Coordinate,
1676
+ tt as CoordinateLevel,
1677
+ D as CoordinateModelType,
1678
+ C as CoordinateStatus,
1679
+ v as CoordinateType,
1680
+ At as DataHelper,
1617
1681
  w as DataSource,
1618
1682
  N as GeoPoint,
1619
1683
  f as Point,
1620
- W as Position,
1621
- g as RelativeMap,
1622
- I as RequestContentType,
1623
- x as RequestMethod,
1684
+ Q as Position,
1685
+ x as RelativeMap,
1686
+ R as RequestContentType,
1687
+ M as RequestMethod,
1624
1688
  F as RequestResultCode,
1625
- Q as Vector3,
1626
- Ot as api,
1627
- Ct as http,
1628
- Rt as utils
1689
+ K as Vector3,
1690
+ Lt as api,
1691
+ Ot as http,
1692
+ kt as utils
1629
1693
  };