leiting-bim 2.2.66 → 2.2.68

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.
@@ -1,7 +1,7 @@
1
- var Nt = Object.defineProperty;
2
- var Gt = (h, t, e) => t in h ? Nt(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
1
+ var zt = Object.defineProperty;
2
+ var Gt = (h, t, e) => t in h ? zt(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
3
  var c = (h, t, e) => Gt(h, typeof t != "symbol" ? t + "" : t, e);
4
- class Io {
4
+ class _o {
5
5
  constructor(t, e, i) {
6
6
  c(this, "Cesium");
7
7
  c(this, "viewer");
@@ -10,6 +10,7 @@ class Io {
10
10
  c(this, "displayLimit");
11
11
  c(this, "maxLevel");
12
12
  c(this, "debugCurrentGrids");
13
+ c(this, "debugHeightBounds");
13
14
  c(this, "levels");
14
15
  c(this, "points", []);
15
16
  c(this, "gridLayers", /* @__PURE__ */ new Map());
@@ -22,6 +23,13 @@ class Io {
22
23
  c(this, "groupByTheme");
23
24
  c(this, "tilingScheme");
24
25
  c(this, "terrainLevelOffset");
26
+ c(this, "heightCandidateNeighborRing");
27
+ c(this, "heightBoxRetentionEnabled");
28
+ /**
29
+ * 地表瓦片已离开、但高度 OBB 曾进入视野的格网。每次刷新都会重新做 OBB
30
+ * 可见性判断,不能仅依赖“当前地表瓦片外围一圈”的首次发现。
31
+ */
32
+ c(this, "heightRetainedCells", /* @__PURE__ */ new Map());
25
33
  c(this, "debugTileCoordLayer", null);
26
34
  c(this, "levelIndexByTileLevel", /* @__PURE__ */ new Map());
27
35
  c(this, "_lastTileProvider", null);
@@ -37,13 +45,20 @@ class Io {
37
45
  c(this, "defaultMaxLevel", 28);
38
46
  // 单次从视图层级向下细分到聚合层级时,最多细分的层级数
39
47
  c(this, "maxRefineLevels", 2);
40
- this.Cesium = t, this.viewer = e, this.labelPool = i.labelPool, this.threshold = i.threshold ?? 10, this.displayLimit = i.displayLimit ?? 100, this.maxLevel = i.maxLevel ?? 5, this.debugCurrentGrids = i.debugCurrentGrids ?? !1, this.clusterTheme = i.clusterTheme ?? "cluster-label", this.pointTheme = i.pointTheme ?? "point-label", this.centralPointMode = i.centralPointMode ?? "central", this.minGlobalPointCount = i.minGlobalPointCount ?? 0, this.groupByTheme = i.groupByTheme ?? !1, this.terrainLevelOffset = i.terrainLevelOffset ?? 2;
48
+ this.Cesium = t, this.viewer = e, this.labelPool = i.labelPool, this.threshold = i.threshold ?? 10, this.displayLimit = i.displayLimit ?? 100, this.maxLevel = i.maxLevel ?? 5, this.debugHeightBounds = i.debugHeightBounds ?? !1, this.debugCurrentGrids = i.debugCurrentGrids ?? this.debugHeightBounds, this.clusterTheme = i.clusterTheme ?? "cluster-label", this.pointTheme = i.pointTheme ?? "point-label", this.centralPointMode = i.centralPointMode ?? "central", this.minGlobalPointCount = i.minGlobalPointCount ?? 0, this.groupByTheme = i.groupByTheme ?? !1, this.terrainLevelOffset = i.terrainLevelOffset ?? 2, this.heightCandidateNeighborRing = Math.max(
49
+ 0,
50
+ Math.floor(i.heightCandidateNeighborRing ?? 1)
51
+ ), this.heightBoxRetentionEnabled = i.heightBoxRetentionEnabled ?? !0;
41
52
  const n = this.viewer.scene && this.viewer.scene.globe, s = n && n._surface, o = s && s._tileProvider, r = (o == null ? void 0 : o.tilingScheme) || new this.Cesium.GeographicTilingScheme();
42
53
  this._lastTileProvider = o, this.tilingScheme = r, this.levels = this._createLevels(), this._buildLevels(), this._updateFn = this._update.bind(this), this.debugCurrentGrids && this._ensureDebugImageryLayer(), n && (this._tileLoadListener = (a) => {
43
54
  a === 0 && this._cameraDirty && (this._cameraDirty = !1, this._scheduleUpdate());
44
55
  }, n.tileLoadProgressEvent.addEventListener(this._tileLoadListener)), this._cameraChangedHandler = () => {
45
56
  this._update();
46
- }, this.viewer.camera.changed.addEventListener(this._cameraChangedHandler);
57
+ }, this.viewer.camera.changed.addEventListener(this._cameraChangedHandler), this._exposeDebugInstance();
58
+ }
59
+ /** 临时调试入口:供浏览器控制台直接查看和操纵当前聚合器实例。 */
60
+ _exposeDebugInstance() {
61
+ typeof window > "u" || (window.__cesiumBufferedHierarchicalAggregator = this);
47
62
  }
48
63
  setGroupByTheme(t, e = !0, i = !0) {
49
64
  if (this.groupByTheme === t) {
@@ -59,7 +74,21 @@ class Io {
59
74
  this.threshold = t, e && this._update();
60
75
  }
61
76
  setDebugCurrentGrids(t, e = !0) {
62
- this.debugCurrentGrids = t, t ? this._ensureDebugImageryLayer() : (this._clearDebugGrids(), this._removeDebugImageryLayer()), e && this._update();
77
+ this.debugCurrentGrids = t, t ? this._ensureDebugImageryLayer() : (this._clearDebugGrids(), this._removeDebugImageryLayer(), this.debugHeightBounds = !1), e && this._update();
78
+ }
79
+ /** 开关高度 OBB 调试绘制;开启时会自动保留二维格网作为参照。 */
80
+ setDebugHeightBounds(t, e = !0) {
81
+ this.debugHeightBounds = t, t && !this.debugCurrentGrids && (this.debugCurrentGrids = !0, this._ensureDebugImageryLayer()), e && this._update();
82
+ }
83
+ /** 调整高程包围盒的候选格网扩展圈数;0 表示只保留已渲染格网。 */
84
+ setHeightCandidateNeighborRing(t, e = !0) {
85
+ const i = Number.isFinite(t) ? Math.max(0, Math.floor(t)) : 0;
86
+ i !== this.heightCandidateNeighborRing && (this.heightCandidateNeighborRing = i, e && this._update());
87
+ }
88
+ /** 开关高程格网的三维可见性兜底,便于业务按需验证或降级。 */
89
+ setHeightBoxRetentionEnabled(t, e = !0) {
90
+ const i = !!t;
91
+ i !== this.heightBoxRetentionEnabled && (this.heightBoxRetentionEnabled = i, i || this.heightRetainedCells.clear(), e && this._update());
63
92
  }
64
93
  _syncTilingSchemeAndLevels() {
65
94
  const t = this.viewer.scene && this.viewer.scene.globe, e = t && t._surface, i = e && e._tileProvider, n = (i == null ? void 0 : i.tilingScheme) || new this.Cesium.GeographicTilingScheme(), s = i !== this._lastTileProvider, o = this.tilingScheme !== n;
@@ -122,17 +151,18 @@ class Io {
122
151
  if (!l) continue;
123
152
  const d = `${l.x}_${l.y}`, u = r.get(d);
124
153
  if (u) {
125
- const p = u.allPoints.findIndex((g) => g.id === t.id);
126
- if (p !== -1 && u.allPoints.splice(p, 1), this._shouldSkipAggregation(i.data)) {
127
- const g = u.skipPoints.findIndex((m) => m.id === t.id);
128
- g !== -1 && u.skipPoints.splice(g, 1);
154
+ const g = u.allPoints.findIndex((p) => p.id === t.id);
155
+ if (g !== -1 && u.allPoints.splice(g, 1), this._shouldSkipAggregation(i.data)) {
156
+ const p = u.skipPoints.findIndex((m) => m.id === t.id);
157
+ p !== -1 && u.skipPoints.splice(p, 1);
129
158
  } else {
130
- const g = this.groupByTheme ? this._getBillboardTheme(i.data) : this.clusterTheme, m = u.groups.get(g);
159
+ const p = this.groupByTheme ? this._getBillboardTheme(i.data) : this.clusterTheme, m = u.groups.get(p);
131
160
  if (m) {
132
161
  const f = m.findIndex((y) => y.id === t.id);
133
- f !== -1 && m.splice(f, 1), m.length === 0 && u.groups.delete(g);
162
+ f !== -1 && m.splice(f, 1), m.length === 0 && u.groups.delete(p);
134
163
  }
135
164
  }
165
+ u.heightRangeDirty = !0;
136
166
  }
137
167
  }
138
168
  const n = { ...i, ...t };
@@ -150,7 +180,7 @@ class Io {
150
180
  const l = a.filter((d) => !e.has(d.id));
151
181
  l.length === 0 ? o.groups.delete(r) : o.groups.set(r, l);
152
182
  }
153
- o.allPoints.length === 0 && n.delete(s);
183
+ o.allPoints.length === 0 ? n.delete(s) : o.heightRangeDirty = !0;
154
184
  }
155
185
  }
156
186
  this._update();
@@ -177,8 +207,15 @@ class Io {
177
207
  if (a || (a = {
178
208
  allPoints: [],
179
209
  groups: /* @__PURE__ */ new Map(),
180
- skipPoints: []
181
- }, n.set(r, a)), a.allPoints.push(t), this._shouldSkipAggregation(t.data))
210
+ skipPoints: [],
211
+ minHeight: 0,
212
+ maxHeight: 0,
213
+ heightRangeDirty: !1
214
+ }, n.set(r, a)), a.allPoints.push(t), !a.heightRangeDirty) {
215
+ const l = this._getPointHeight(t);
216
+ a.minHeight = Math.min(a.minHeight, l), a.maxHeight = Math.max(a.maxHeight, l);
217
+ }
218
+ if (this._shouldSkipAggregation(t.data))
182
219
  a.skipPoints.push(t);
183
220
  else {
184
221
  const l = this.groupByTheme ? this._getBillboardTheme(t.data) : this.clusterTheme;
@@ -203,26 +240,31 @@ class Io {
203
240
  }
204
241
  _update() {
205
242
  if (!this.labelPool) return;
206
- this._syncTilingSchemeAndLevels(), this.labelPool.reset(), this.debugCurrentGrids && this._clearDebugGrids();
243
+ this._syncTilingSchemeAndLevels(), this.labelPool.beginUpdate(), this.debugCurrentGrids && this._clearDebugGrids();
207
244
  const t = this.points.length < this.minGlobalPointCount ? 1 / 0 : this.threshold;
208
245
  let e = 0;
209
- const i = (n, s, o, r) => {
210
- e = this._processCell(
211
- n,
212
- s,
213
- o,
214
- r,
215
- t,
216
- e
217
- );
246
+ const i = /* @__PURE__ */ new Map(), n = (s, o, r, a) => {
247
+ const l = this.levels[s];
248
+ if (!l) return;
249
+ const d = `${l.level}_${o}_${r}`;
250
+ i.has(d) || i.set(d, { levelIdx: s, lonIdx: o, latIdx: r, viewTileLevel: a });
218
251
  };
219
252
  try {
220
- const n = this._getSurfaceTiles();
221
- if (!n || n.length === 0) {
222
- this._handleNoSurfaceTiles(e);
253
+ const s = this._getSurfaceTiles();
254
+ if (!s || s.length === 0) {
255
+ this._handleNoSurfaceTiles(e), this.labelPool.cleanup();
223
256
  return;
224
257
  }
225
- this._tilesRetryCount = 0, this._processTiles(n, i);
258
+ this._tilesRetryCount = 0, this._processTiles(s, n), this._appendHeightVisibleCells(i);
259
+ for (const o of i.values())
260
+ if (e = this._processCell(
261
+ o.levelIdx,
262
+ o.lonIdx,
263
+ o.latIdx,
264
+ o.viewTileLevel,
265
+ t,
266
+ e
267
+ ), e >= this.displayLimit) break;
226
268
  } catch {
227
269
  this.labelPool.cleanup();
228
270
  return;
@@ -277,42 +319,194 @@ class Io {
277
319
  }
278
320
  return e;
279
321
  }
322
+ _getPointHeight(t) {
323
+ const e = Number(t == null ? void 0 : t.height);
324
+ return Number.isFinite(e) ? e : 0;
325
+ }
326
+ _getCellHeightRange(t) {
327
+ if (!t.heightRangeDirty)
328
+ return { minHeight: t.minHeight, maxHeight: t.maxHeight };
329
+ let e = 0, i = 0;
330
+ for (const n of t.allPoints) {
331
+ const s = this._getPointHeight(n);
332
+ e = Math.min(e, s), i = Math.max(i, s);
333
+ }
334
+ return t.minHeight = e, t.maxHeight = i, t.heightRangeDirty = !1, { minHeight: e, maxHeight: i };
335
+ }
336
+ _createCameraCullingVolume() {
337
+ var t, e, i;
338
+ try {
339
+ const n = (t = this.viewer) == null ? void 0 : t.camera;
340
+ return (i = (e = n == null ? void 0 : n.frustum) == null ? void 0 : e.computeCullingVolume) == null ? void 0 : i.call(
341
+ e,
342
+ n.positionWC,
343
+ n.directionWC,
344
+ n.upWC
345
+ );
346
+ } catch {
347
+ return;
348
+ }
349
+ }
350
+ _createGlobeOccluder() {
351
+ var t, e, i, n, s, o;
352
+ try {
353
+ const r = (e = (t = this.viewer) == null ? void 0 : t.camera) == null ? void 0 : e.positionWC, a = ((s = (n = (i = this.viewer) == null ? void 0 : i.scene) == null ? void 0 : n.globe) == null ? void 0 : s.ellipsoid) || ((o = this.Cesium.Ellipsoid) == null ? void 0 : o.WGS84);
354
+ return !r || !a || !this.Cesium.EllipsoidalOccluder ? void 0 : new this.Cesium.EllipsoidalOccluder(a, r);
355
+ } catch {
356
+ return;
357
+ }
358
+ }
359
+ /**
360
+ * 地表瓦片离开渲染集合时,高空/地下点仍可能落在视锥内。使用格网 Rectangle 与
361
+ * [minHeight, maxHeight] 构造 OBB,再同时进行视锥和椭球遮挡判断。
362
+ */
363
+ _isHeightBoxVisible(t, e, i, n, s) {
364
+ var d, u, g, p, m, f, y, w, v;
365
+ const o = this.levels[t], r = o && ((d = this.gridLayers.get(o.level)) == null ? void 0 : d.get(`${e}_${i}`));
366
+ if (!o || !r || r.allPoints.length === 0) return !1;
367
+ const { minHeight: a, maxHeight: l } = this._getCellHeightRange(r);
368
+ if (a === 0 && l === 0) return !1;
369
+ try {
370
+ const P = this.tilingScheme.tileXYToRectangle(e, i, o.level), b = (y = (u = this.Cesium.OrientedBoundingBox) == null ? void 0 : u.fromRectangle) == null ? void 0 : y.call(
371
+ u,
372
+ P,
373
+ a,
374
+ l,
375
+ ((m = (p = (g = this.viewer) == null ? void 0 : g.scene) == null ? void 0 : p.globe) == null ? void 0 : m.ellipsoid) || ((f = this.Cesium.Ellipsoid) == null ? void 0 : f.WGS84)
376
+ );
377
+ if (!b) return !0;
378
+ const C = n || this._createCameraCullingVolume();
379
+ if (C && C.computeVisibility(b) === this.Cesium.Intersect.OUTSIDE)
380
+ return !1;
381
+ const L = s || this._createGlobeOccluder(), E = (v = (w = this.Cesium.BoundingSphere) == null ? void 0 : w.fromOrientedBoundingBox) == null ? void 0 : v.call(w, b);
382
+ return !(L && E && !L.isBoundingSphereVisible(E));
383
+ } catch {
384
+ return !0;
385
+ }
386
+ }
387
+ _doCellsOverlap(t, e) {
388
+ var r;
389
+ if (t.levelIdx === e.levelIdx)
390
+ return t.lonIdx === e.lonIdx && t.latIdx === e.latIdx;
391
+ const i = this.levels[t.levelIdx], n = this.levels[e.levelIdx];
392
+ if (!i || !n) return !1;
393
+ const s = this.tilingScheme.tileXYToRectangle(t.lonIdx, t.latIdx, i.level), o = this.tilingScheme.tileXYToRectangle(
394
+ e.lonIdx,
395
+ e.latIdx,
396
+ n.level
397
+ );
398
+ return !s || !o ? !1 : (r = this.Cesium.Rectangle) != null && r.intersection ? !!this.Cesium.Rectangle.intersection(s, o) : !(s.east <= o.west || s.west >= o.east || s.north <= o.south || s.south >= o.north);
399
+ }
400
+ /**
401
+ * 从当前地表可见格网的外围扩展少量候选格网。候选最终仍须通过 OBB 视锥测试,
402
+ * 因此不会因简单邻域扩展而显示真实离屏的点。
403
+ */
404
+ _appendHeightVisibleCells(t) {
405
+ var l, d, u, g;
406
+ if (!this.heightBoxRetentionEnabled) {
407
+ this.heightRetainedCells.clear();
408
+ return;
409
+ }
410
+ const e = this._createCameraCullingVolume(), i = this._createGlobeOccluder(), n = [], s = /* @__PURE__ */ new Set(), o = Array.from(t.values());
411
+ for (const [p, m] of Array.from(this.heightRetainedCells.entries())) {
412
+ if (t.has(p)) {
413
+ this.heightRetainedCells.delete(p);
414
+ continue;
415
+ }
416
+ if (o.some(
417
+ (y) => y.levelIdx !== m.levelIdx && this._doCellsOverlap(m, y)
418
+ ) || !this._isHeightBoxVisible(
419
+ m.levelIdx,
420
+ m.lonIdx,
421
+ m.latIdx,
422
+ e,
423
+ i
424
+ )) {
425
+ this.heightRetainedCells.delete(p);
426
+ continue;
427
+ }
428
+ t.set(p, m);
429
+ }
430
+ if (this.heightCandidateNeighborRing <= 0) return;
431
+ const r = /* @__PURE__ */ new Map();
432
+ for (const p of o) {
433
+ const m = r.get(p.levelIdx) || [];
434
+ m.push(p), r.set(p.levelIdx, m);
435
+ }
436
+ for (const [p, m] of r) {
437
+ const f = this.levels[p], y = f && this.gridLayers.get(f.level), w = f && ((d = (l = this.tilingScheme).getNumberOfXTilesAtLevel) == null ? void 0 : d.call(l, f.level)), v = f && ((g = (u = this.tilingScheme).getNumberOfYTilesAtLevel) == null ? void 0 : g.call(u, f.level));
438
+ if (!y || !Number.isFinite(w) || !Number.isFinite(v)) continue;
439
+ const P = new Set(m.map((C) => `${C.lonIdx}_${C.latIdx}`));
440
+ let b = m.map((C) => ({ ...C }));
441
+ for (let C = 1; C <= this.heightCandidateNeighborRing; C++) {
442
+ const L = /* @__PURE__ */ new Map();
443
+ for (const E of b)
444
+ for (let M = -1; M <= 1; M++)
445
+ for (let x = -1; x <= 1; x++) {
446
+ if (M === 0 && x === 0) continue;
447
+ const I = E.latIdx + x;
448
+ if (I < 0 || I >= v) continue;
449
+ const D = ((E.lonIdx + M) % w + w) % w, T = `${D}_${I}`;
450
+ if (P.has(T)) continue;
451
+ P.add(T);
452
+ const S = { ...E, lonIdx: D, latIdx: I };
453
+ L.set(T, S);
454
+ const _ = `${f.level}_${D}_${I}`;
455
+ t.has(_) || s.has(_) || y.get(T) && this._isHeightBoxVisible(p, D, I, e, i) && (n.push(S), s.add(_));
456
+ }
457
+ b = Array.from(L.values());
458
+ }
459
+ }
460
+ n.sort((p, m) => m.levelIdx - p.levelIdx);
461
+ const a = [];
462
+ for (const p of n) {
463
+ const m = Array.from(t.values()).some(
464
+ (v) => v.levelIdx !== p.levelIdx && this._doCellsOverlap(p, v)
465
+ ), f = a.some(
466
+ (v) => v.levelIdx !== p.levelIdx && this._doCellsOverlap(p, v)
467
+ );
468
+ if (m || f) continue;
469
+ a.push(p);
470
+ const w = `${this.levels[p.levelIdx].level}_${p.lonIdx}_${p.latIdx}`;
471
+ t.set(w, p), this.heightRetainedCells.set(w, p);
472
+ }
473
+ }
280
474
  _processTiles(t, e) {
281
- const i = /* @__PURE__ */ new Set(), n = !this._isTerrainEnabled(), s = this.viewer.scene, o = s && s.globe, r = o && o.ellipsoid, a = r && s.camera.computeViewRectangle(r), l = (d, u, p) => {
475
+ const i = /* @__PURE__ */ new Set(), n = !this._isTerrainEnabled(), s = this.viewer.scene, o = s && s.globe, r = o && o.ellipsoid, a = r && s.camera.computeViewRectangle(r), l = (d, u, g) => {
282
476
  if (!n || !a) return !0;
283
- const g = this.tilingScheme.tileXYToRectangle(d, u, p);
284
- return !(!g || g.east <= a.west || g.west >= a.east || g.north <= a.south || g.south >= a.north);
477
+ const p = this.tilingScheme.tileXYToRectangle(d, u, g);
478
+ return !(!p || p.east <= a.west || p.west >= a.east || p.north <= a.south || p.south >= a.north);
285
479
  };
286
480
  for (const d of t) {
287
- const u = d.rectangle, p = d._level ?? d.level;
288
- if (!u || typeof p != "number") continue;
289
- const g = this._getGridRefLevel(p), m = this._resolveLevelIndex(g);
481
+ const u = d.rectangle, g = d._level ?? d.level;
482
+ if (!u || typeof g != "number") continue;
483
+ const p = this._getGridRefLevel(g), m = this._resolveLevelIndex(p);
290
484
  if (m === void 0) continue;
291
- const f = this.levels[m].level, y = d._x ?? d.x, v = d._y ?? d.y;
292
- if (typeof y == "number" && typeof v == "number") {
293
- const T = p - f;
485
+ const f = this.levels[m].level, y = d._x ?? d.x, w = d._y ?? d.y;
486
+ if (typeof y == "number" && typeof w == "number") {
487
+ const T = g - f;
294
488
  if (T >= 0) {
295
- const S = 1 << T, _ = Math.floor(y / S), k = Math.floor(v / S), A = `${f}_${_}_${k}`;
489
+ const S = 1 << T, _ = Math.floor(y / S), k = Math.floor(w / S), A = `${f}_${_}_${k}`;
296
490
  if (i.has(A)) continue;
297
- i.add(A), e(m, _, k, p);
491
+ i.add(A), e(m, _, k, g);
298
492
  } else {
299
- const _ = 1 << Math.min(-T, this.maxRefineLevels), k = y * _, A = v * _;
300
- for (let $ = 0; $ < _; $++)
301
- for (let O = 0; O < _; O++) {
302
- const G = k + $, B = A + O;
303
- if (!l(G, B, f)) continue;
304
- const N = `${f}_${G}_${B}`;
305
- i.has(N) || (i.add(N), e(m, G, B, p));
493
+ const _ = 1 << Math.min(-T, this.maxRefineLevels), k = y * _, A = w * _;
494
+ for (let R = 0; R < _; R++)
495
+ for (let H = 0; H < _; H++) {
496
+ const B = k + R, Y = A + H;
497
+ if (!l(B, Y, f)) continue;
498
+ const N = `${f}_${B}_${Y}`;
499
+ i.has(N) || (i.add(N), e(m, B, Y, g));
306
500
  }
307
501
  }
308
502
  continue;
309
503
  }
310
- const P = this.levels[m].size, b = this.Cesium.Math.toDegrees(u.west), C = this.Cesium.Math.toDegrees(u.east), E = this.Cesium.Math.toDegrees(u.south), L = this.Cesium.Math.toDegrees(u.north), M = Math.floor((b - -180) / P), x = Math.floor((C - -180) / P), I = Math.floor((E - -90) / P), D = Math.floor((L - -90) / P);
504
+ const P = this.levels[m].size, b = this.Cesium.Math.toDegrees(u.west), C = this.Cesium.Math.toDegrees(u.east), L = this.Cesium.Math.toDegrees(u.south), E = this.Cesium.Math.toDegrees(u.north), M = Math.floor((b - -180) / P), x = Math.floor((C - -180) / P), I = Math.floor((L - -90) / P), D = Math.floor((E - -90) / P);
311
505
  for (let T = M; T <= x; T++)
312
506
  for (let S = I; S <= D; S++) {
313
507
  if (!l(T, S, f)) continue;
314
508
  const _ = `${f}_${T}_${S}`;
315
- i.has(_) || (i.add(_), e(m, T, S, p));
509
+ i.has(_) || (i.add(_), e(m, T, S, g));
316
510
  }
317
511
  }
318
512
  }
@@ -327,7 +521,7 @@ class Io {
327
521
  if (!r) return null;
328
522
  const a = `${e}_${i}`, l = r.get(a);
329
523
  if (!l) return null;
330
- const d = this.tilingScheme.tileXYToRectangle(e, i, o), u = this.Cesium.Math.toDegrees(d.west), p = this.Cesium.Math.toDegrees(d.south), g = this.Cesium.Math.toDegrees(d.east), m = this.Cesium.Math.toDegrees(d.north), f = (u + g) / 2, y = (p + m) / 2;
524
+ const d = this.tilingScheme.tileXYToRectangle(e, i, o), u = this.Cesium.Math.toDegrees(d.west), g = this.Cesium.Math.toDegrees(d.south), p = this.Cesium.Math.toDegrees(d.east), m = this.Cesium.Math.toDegrees(d.north), f = (u + p) / 2, y = (g + m) / 2;
331
525
  return {
332
526
  levelIdx: t,
333
527
  tileLevel: o,
@@ -337,8 +531,8 @@ class Io {
337
531
  cell: l,
338
532
  rect: d,
339
533
  west: u,
340
- south: p,
341
- east: g,
534
+ south: g,
535
+ east: p,
342
536
  north: m,
343
537
  centerLon: f,
344
538
  centerLat: y,
@@ -363,7 +557,7 @@ class Io {
363
557
  return e;
364
558
  }
365
559
  _processCellGroups(t, e, i) {
366
- var p, g, m, f, y, v, w;
560
+ var g, p, m, f, y, w, v;
367
561
  const {
368
562
  levelIdx: n,
369
563
  lonIdx: s,
@@ -379,8 +573,8 @@ class Io {
379
573
  return ((D = I.data) == null ? void 0 : D.show) !== !1;
380
574
  });
381
575
  if (C.length === 0) continue;
382
- let E = a, L = l, M = ((p = C[0]) == null ? void 0 : p.height) || 0;
383
- if (this.centralPointMode == "firstPoint" && (E = ((g = C[0]) == null ? void 0 : g.lon) || 0, L = ((m = C[0]) == null ? void 0 : m.lat) || 0, M = ((f = C[0]) == null ? void 0 : f.height) || 0), n === this.levels.length - 1 || C.length < e)
576
+ let L = a, E = l, M = ((g = C[0]) == null ? void 0 : g.height) || 0;
577
+ if (this.centralPointMode == "firstPoint" && (L = ((p = C[0]) == null ? void 0 : p.lon) || 0, E = ((m = C[0]) == null ? void 0 : m.lat) || 0, M = ((f = C[0]) == null ? void 0 : f.height) || 0), n === this.levels.length - 1 || C.length < e)
384
578
  for (const I of C) {
385
579
  if (i >= this.displayLimit) break;
386
580
  this._isVisibleAtLevel(I, u) && (this.labelPool.add(I.data, {
@@ -401,7 +595,7 @@ class Io {
401
595
  this.labelPool.add(
402
596
  {
403
597
  id: S,
404
- billboard: ((w = (v = I[0]) == null ? void 0 : v.data) == null ? void 0 : w.billboard) || [],
598
+ billboard: ((v = (w = I[0]) == null ? void 0 : w.data) == null ? void 0 : v.billboard) || [],
405
599
  count: I.length,
406
600
  gridKey: `${s}_${o}`,
407
601
  points: I,
@@ -409,8 +603,8 @@ class Io {
409
603
  },
410
604
  {
411
605
  id: S,
412
- lon: E,
413
- lat: L,
606
+ lon: L,
607
+ lat: E,
414
608
  height: M,
415
609
  theme: T
416
610
  }
@@ -421,20 +615,24 @@ class Io {
421
615
  }
422
616
  _debugDrawCell(t) {
423
617
  if (!this.debugCurrentGrids) return;
424
- const { levelIdx: e, west: i, south: n, east: s, north: o, lonIdx: r, latIdx: a } = t, l = this.levels[e].level;
618
+ const { levelIdx: e, west: i, south: n, east: s, north: o, lonIdx: r, latIdx: a, cell: l } = t, d = this.levels[e].level, u = this.heightRetainedCells.has(
619
+ `${d}_${r}_${a}`
620
+ );
425
621
  this._drawDebugGrid(
426
622
  i,
427
623
  n,
428
624
  s,
429
625
  o,
430
- `L:${l} X:${r} Y:${a}`
626
+ `L:${d} X:${r} Y:${a}`,
627
+ l,
628
+ u
431
629
  );
432
630
  }
433
631
  refresh() {
434
632
  this._update();
435
633
  }
436
- _drawDebugGrid(t, e, i, n, s) {
437
- const o = this.Cesium.Rectangle.fromDegrees(t, e, i, n), r = this.Cesium.Cartesian3.fromDegreesArray([
634
+ _drawDebugGrid(t, e, i, n, s, o, r = !1) {
635
+ const a = this.Cesium.Rectangle.fromDegrees(t, e, i, n), l = this.Cesium.Cartesian3.fromDegreesArray([
438
636
  t,
439
637
  e,
440
638
  i,
@@ -445,9 +643,9 @@ class Io {
445
643
  n,
446
644
  t,
447
645
  e
448
- ]), a = this.viewer.entities.add({
646
+ ]), d = this.viewer.entities.add({
449
647
  rectangle: {
450
- coordinates: o,
648
+ coordinates: a,
451
649
  material: this.Cesium.Color.YELLOW.withAlpha(0.2),
452
650
  outline: !0,
453
651
  outlineColor: this.Cesium.Color.RED,
@@ -457,7 +655,7 @@ class Io {
457
655
  },
458
656
  // 额外一圈贴地边框线,避免依赖 rectangle.outline
459
657
  polyline: {
460
- positions: r,
658
+ positions: l,
461
659
  width: 2,
462
660
  material: this.Cesium.Color.RED,
463
661
  clampToGround: !0
@@ -473,7 +671,83 @@ class Io {
473
671
  horizontalOrigin: this.Cesium.HorizontalOrigin.CENTER
474
672
  }
475
673
  });
476
- this.debugGrids.push(a);
674
+ this.debugGrids.push(d), this.debugHeightBounds && o && this._drawDebugHeightBounds(t, e, i, n, s, o, r);
675
+ }
676
+ /**
677
+ * 用和可见性判断相同的 Rectangle + [minHeight, maxHeight] 绘制 OBB 线框,
678
+ * 便于确认“地表离屏但高程标记仍可见”的候选格网是否被正确选中。
679
+ */
680
+ _drawDebugHeightBounds(t, e, i, n, s, o, r) {
681
+ var p, m, f, y, w, v;
682
+ const { minHeight: a, maxHeight: l } = this._getCellHeightRange(o), d = this.Cesium.Rectangle.fromDegrees(t, e, i, n), u = ((f = (m = (p = this.viewer) == null ? void 0 : p.scene) == null ? void 0 : m.globe) == null ? void 0 : f.ellipsoid) || ((y = this.Cesium.Ellipsoid) == null ? void 0 : y.WGS84), g = (v = (w = this.Cesium.OrientedBoundingBox) == null ? void 0 : w.fromRectangle) == null ? void 0 : v.call(
683
+ w,
684
+ d,
685
+ a,
686
+ l,
687
+ u
688
+ );
689
+ if (g)
690
+ try {
691
+ const P = this.Cesium.Matrix3.getColumn(
692
+ g.halfAxes,
693
+ 0,
694
+ new this.Cesium.Cartesian3()
695
+ ), b = this.Cesium.Matrix3.getColumn(
696
+ g.halfAxes,
697
+ 1,
698
+ new this.Cesium.Cartesian3()
699
+ ), C = this.Cesium.Matrix3.getColumn(
700
+ g.halfAxes,
701
+ 2,
702
+ new this.Cesium.Cartesian3()
703
+ ), L = (B, Y, N) => {
704
+ const z = this.Cesium.Cartesian3.clone(g.center, new this.Cesium.Cartesian3()), V = new this.Cesium.Cartesian3();
705
+ return this.Cesium.Cartesian3.add(
706
+ z,
707
+ this.Cesium.Cartesian3.multiplyByScalar(P, B, V),
708
+ z
709
+ ), this.Cesium.Cartesian3.add(
710
+ z,
711
+ this.Cesium.Cartesian3.multiplyByScalar(b, Y, V),
712
+ z
713
+ ), this.Cesium.Cartesian3.add(
714
+ z,
715
+ this.Cesium.Cartesian3.multiplyByScalar(C, N, V),
716
+ z
717
+ ), z;
718
+ }, E = L(-1, -1, -1), M = L(1, -1, -1), x = L(1, 1, -1), I = L(-1, 1, -1), D = L(-1, -1, 1), T = L(1, -1, 1), S = L(1, 1, 1), _ = L(-1, 1, 1), k = r ? this.Cesium.Color.ORANGE.withAlpha(1) : this.Cesium.Color.CYAN.withAlpha(0.9), A = this.viewer.entities.add({
719
+ polyline: {
720
+ // 连续路径覆盖 12 条盒子边;个别边重复仅用于将独立边串为一个 Polyline。
721
+ positions: [E, M, x, I, E, D, T, S, _, D, T, M, x, S, _, I],
722
+ width: 3,
723
+ material: k
724
+ }
725
+ });
726
+ this.debugGrids.push(A);
727
+ const R = this.Cesium.Cartesian3.add(
728
+ g.center,
729
+ C,
730
+ new this.Cesium.Cartesian3()
731
+ ), H = this.viewer.entities.add({
732
+ position: R,
733
+ label: {
734
+ text: `${s}
735
+ ${r ? "状态: 高度 Box 保留" : "状态: 地表格网可见"}
736
+ H: ${a.toFixed(1)} ~ ${l.toFixed(1)}m`,
737
+ font: "13px sans-serif",
738
+ fillColor: k,
739
+ outlineColor: this.Cesium.Color.BLACK,
740
+ outlineWidth: 2,
741
+ style: this.Cesium.LabelStyle.FILL_AND_OUTLINE,
742
+ verticalOrigin: this.Cesium.VerticalOrigin.BOTTOM,
743
+ horizontalOrigin: this.Cesium.HorizontalOrigin.CENTER,
744
+ pixelOffset: new this.Cesium.Cartesian2(0, -8),
745
+ disableDepthTestDistance: Number.POSITIVE_INFINITY
746
+ }
747
+ });
748
+ this.debugGrids.push(H);
749
+ } catch {
750
+ }
477
751
  }
478
752
  _clearDebugGrids() {
479
753
  for (const t of this.debugGrids)
@@ -501,7 +775,7 @@ class Io {
501
775
  destroy() {
502
776
  this._cameraChangedHandler && (this.viewer.camera.changed.removeEventListener(this._cameraChangedHandler), this._cameraChangedHandler = null);
503
777
  const t = this.viewer.scene, e = t && t.globe;
504
- e && this._tileLoadListener && (e.tileLoadProgressEvent.removeEventListener(this._tileLoadListener), this._tileLoadListener = null), this._updateTimer !== null && (clearTimeout(this._updateTimer), this._updateTimer = null), this.labelPool.reset(), this._clearDebugGrids(), this._removeDebugImageryLayer();
778
+ e && this._tileLoadListener && (e.tileLoadProgressEvent.removeEventListener(this._tileLoadListener), this._tileLoadListener = null), this._updateTimer !== null && (clearTimeout(this._updateTimer), this._updateTimer = null), this.labelPool.reset(), this.heightRetainedCells.clear(), this._clearDebugGrids(), this._removeDebugImageryLayer(), typeof window < "u" && window.__cesiumBufferedHierarchicalAggregator === this && delete window.__cesiumBufferedHierarchicalAggregator;
505
779
  }
506
780
  }
507
781
  var te = /* @__PURE__ */ ((h) => (h.Click = "marker:click", h.DoubleClick = "marker:dblclick", h.RightClick = "marker:rightclick", h.MouseEnter = "marker:mouseenter", h.MouseLeave = "marker:mouseleave", h.MouseDown = "marker:mousedown", h.MouseUp = "marker:mouseup", h))(te || {});
@@ -563,7 +837,19 @@ const Yt = {
563
837
  [te.MouseDown]: "mousedown",
564
838
  [te.MouseUp]: "mouseup"
565
839
  };
566
- class z {
840
+ function Vt() {
841
+ var h;
842
+ if (typeof window > "u") return !1;
843
+ try {
844
+ return window.__DEVICE_ALARM_DEBUG__ === !0 || ((h = window.localStorage) == null ? void 0 : h.getItem("deviceAlarmDebug")) === "1";
845
+ } catch {
846
+ return !1;
847
+ }
848
+ }
849
+ function jt(h, t = {}) {
850
+ Vt() && console.log("[DeviceAlarm][OverlayPool]", h, t);
851
+ }
852
+ class G {
567
853
  /**
568
854
  * 构造函数
569
855
  * @param Cesium Cesium 命名空间
@@ -644,57 +930,60 @@ class z {
644
930
  theme: r,
645
931
  show: a = !0,
646
932
  notCreateElement: l = !1,
647
- style: d
648
- } = e, u = this.themes[r];
649
- if (!u) {
933
+ persistent: d = !1,
934
+ style: u
935
+ } = e, g = this.themes[r];
936
+ if (!g) {
650
937
  console.warn(`Theme "${r}" not registered`);
651
938
  return;
652
939
  }
653
940
  let p = this.labels.get(i);
654
941
  if (p) {
655
- p.theme = r, p.data = t, p.notCreateElement = l;
656
- try {
657
- p.unload = u.createElement(p.el, { id: i, theme: r, data: t }, u), (!l || a) && this.container.appendChild(p.el);
658
- } catch (g) {
659
- console.error(`Error updating label element for id "${i}":`, g);
660
- }
942
+ const m = p.theme !== r || p.data !== t || p.notCreateElement !== l || !p.el.parentNode;
943
+ if (p.theme = r, p.data = t, p.notCreateElement = l, p.persistent = d, m)
944
+ try {
945
+ typeof p.unload == "function" && p.unload(), p.el.replaceChildren(), p.unload = g.createElement(p.el, { id: i, theme: r, data: t }, g) || {};
946
+ } catch (f) {
947
+ console.error(`Error updating label element for id "${i}":`, f);
948
+ }
949
+ (!l || a) && p.el.parentNode !== this.container && this.container.appendChild(p.el);
661
950
  } else {
662
- const g = document.createElement("div");
663
- Object.assign(g.style, {
951
+ const m = document.createElement("div");
952
+ Object.assign(m.style, {
664
953
  position: "absolute",
665
954
  transform: "translate(0, 0)",
666
955
  pointerEvents: "auto",
667
956
  ...e.style || {}
668
957
  });
669
- for (const [f, y] of Object.entries(Yt)) {
670
- g.addEventListener(y, (w) => {
671
- w.stopPropagation();
672
- const P = this.labels.get(i);
673
- this.eventBus.runListener(f, P, w);
958
+ for (const [y, w] of Object.entries(Yt)) {
959
+ m.addEventListener(w, (P) => {
960
+ P.stopPropagation();
961
+ const b = this.labels.get(i);
962
+ this.eventBus.runListener(y, b, P);
674
963
  });
675
964
  let v = 0;
676
- g.addEventListener("wheel", (w) => {
965
+ m.addEventListener("wheel", (P) => {
677
966
  if (!this.openWheel) return;
678
- const P = w.currentTarget;
967
+ const b = P.currentTarget;
679
968
  v = Date.now();
680
- const b = v;
681
- P.style.pointerEvents = "none", setTimeout(() => {
682
- v === b && (P.style.pointerEvents = "auto");
969
+ const C = v;
970
+ b.style.pointerEvents = "none", setTimeout(() => {
971
+ v === C && (b.style.pointerEvents = "auto");
683
972
  }, 2e3);
684
973
  });
685
974
  }
686
- let m = null;
975
+ let f = null;
687
976
  if (!l || a) {
688
977
  try {
689
- m = u.createElement(g, { id: i, theme: r, data: t }, u) || {};
690
- } catch (f) {
691
- console.error(`Error updating label element for id "${i}":`, f);
978
+ f = g.createElement(m, { id: i, theme: r, data: t }, g) || {};
979
+ } catch (y) {
980
+ console.error(`Error updating label element for id "${i}":`, y);
692
981
  }
693
- this.container.appendChild(g);
982
+ this.container.appendChild(m);
694
983
  }
695
- p = { id: i, el: g, theme: r, data: t, notCreateElement: l, unload: m }, this.labels.set(i, p);
984
+ p = { id: i, el: m, theme: r, data: t, notCreateElement: l, persistent: d, unload: f }, this.labels.set(i, p);
696
985
  }
697
- p.el.dataset.lon = String(n), p.el.dataset.lat = String(s), p.el.dataset.height = String(o), p.offset = e.offset, p.anchor = e.anchor || "top-left", p.el.style.zIndex = (d == null ? void 0 : d.zIndex) || "1", p.el.style.display = a ? "block" : "none", a && this.activeIds.add(i), a ? this._scheduleOcclusionCheck() : (this.activeIds.delete(i), this.occludedIds.delete(i));
986
+ p.el.dataset.lon = String(n), p.el.dataset.lat = String(s), p.el.dataset.height = String(o), p.offset = e.offset, p.anchor = e.anchor || "top-left", Object.assign(p.el.style, e.style || {}), p.el.style.zIndex = (u == null ? void 0 : u.zIndex) || "1", p.el.style.display = a ? "block" : "none", a && this.activeIds.add(i), a ? this._scheduleOcclusionCheck() : (this.activeIds.delete(i), this.occludedIds.delete(i));
698
987
  }
699
988
  /**
700
989
  * 批量添加标签
@@ -738,7 +1027,7 @@ class z {
738
1027
  return;
739
1028
  }
740
1029
  try {
741
- i.data = e, n.createElement(i.el, { id: t, theme: i.theme, data: e }, n);
1030
+ typeof i.unload == "function" && i.unload(), i.el.replaceChildren(), i.data = e, i.unload = n.createElement(i.el, { id: t, theme: i.theme, data: e }, n) || {};
742
1031
  } catch (s) {
743
1032
  console.error(`Failed to update label "${t}":`, s);
744
1033
  }
@@ -801,7 +1090,19 @@ class z {
801
1090
  return this.labels.has(t);
802
1091
  }
803
1092
  /**
804
- * 清空活跃 ID 列表(不影响 DOM)
1093
+ * 开始一次设备聚合的差异化可见性更新。
1094
+ * 独立覆盖层不参与聚合计算,必须保留在活跃集合中以继续跟随相机。
1095
+ */
1096
+ beginUpdate() {
1097
+ this.activeIds = new Set(
1098
+ [...this.activeIds].filter((t) => {
1099
+ var e;
1100
+ return ((e = this.labels.get(t)) == null ? void 0 : e.persistent) === !0;
1101
+ })
1102
+ );
1103
+ }
1104
+ /**
1105
+ * 强制卸载所有当前活跃标签;仅供销毁等需要释放 DOM 的场景使用。
805
1106
  */
806
1107
  reset() {
807
1108
  for (const t of this.activeIds.values()) {
@@ -815,7 +1116,13 @@ class z {
815
1116
  */
816
1117
  cleanup() {
817
1118
  for (const [t, e] of this.labels.entries())
818
- this.activeIds.has(t) || (e.el.style.display = "none", this.occludedIds.delete(t));
1119
+ if (!this.activeIds.has(t)) {
1120
+ if (e.persistent) {
1121
+ jt("skip-persistent-cleanup", { id: t, display: e.el.style.display });
1122
+ continue;
1123
+ }
1124
+ e.el.style.display = "none", this.occludedIds.delete(t);
1125
+ }
819
1126
  }
820
1127
  /**
821
1128
  * 经纬度 -> 自动地形高度修正 -> Cartesian3 -> 屏幕坐标
@@ -868,10 +1175,10 @@ class z {
868
1175
  }
869
1176
  const r = this.Cesium.Cartesian3.fromDegrees(n, s, o), a = this.toWindowCoordinates(r);
870
1177
  if (this.Cesium.defined(a)) {
871
- const l = this.themes[i.theme], d = i.offset || ((t = l.options) == null ? void 0 : t.offset) || {}, u = d.x || 0, p = d.y || 0, g = this.occludedIds.has(e);
1178
+ const l = this.themes[i.theme], d = i.offset || ((t = l.options) == null ? void 0 : t.offset) || {}, u = d.x || 0, g = d.y || 0, p = this.occludedIds.has(e);
872
1179
  i.el.style.left = `${a.x}px`, i.el.style.top = `${a.y}px`;
873
1180
  const m = this.getAnchorTransform(i.anchor);
874
- i.el.style.transform = `${m}${m ? " " : ""}translate(${u}px, ${p}px)`, i.el.style.display = g ? "none" : "block";
1181
+ i.el.style.transform = `${m}${m ? " " : ""}translate(${u}px, ${g}px)`, i.el.style.display = p ? "none" : "block";
875
1182
  } else
876
1183
  i.el.style.display = "none";
877
1184
  }
@@ -914,8 +1221,8 @@ class z {
914
1221
  reason: "pick-unsupported"
915
1222
  }), !0;
916
1223
  try {
917
- const p = r.pickPosition(i);
918
- if (!p || !a.positionWC)
1224
+ const g = r.pickPosition(i);
1225
+ if (!g || !a.positionWC)
919
1226
  return this._pushOcclusionLog({
920
1227
  timestamp: Date.now(),
921
1228
  id: t,
@@ -925,7 +1232,7 @@ class z {
925
1232
  occluded: !0,
926
1233
  reason: "pick-empty"
927
1234
  }), !0;
928
- const g = Number(this.occlusionOptions.distanceEpsilon) || 0, m = l.Cartesian3.distance(a.positionWC, e), f = l.Cartesian3.distance(a.positionWC, p), y = f + g < m;
1235
+ const p = Number(this.occlusionOptions.distanceEpsilon) || 0, m = l.Cartesian3.distance(a.positionWC, e), f = l.Cartesian3.distance(a.positionWC, g), y = f + p < m;
929
1236
  return this._pushOcclusionLog({
930
1237
  timestamp: Date.now(),
931
1238
  id: t,
@@ -934,7 +1241,7 @@ class z {
934
1241
  height: o,
935
1242
  occluded: y,
936
1243
  reason: "distance-compare",
937
- epsilon: g,
1244
+ epsilon: p,
938
1245
  labelDistance: m,
939
1246
  pickedDistance: f
940
1247
  }), y;
@@ -1048,7 +1355,7 @@ class ce {
1048
1355
  this.onMouseMove && (window.removeEventListener("mousemove", this.onMouseMove), this.onMouseMove = null), this.tooltipEl.parentElement && this.tooltipEl.parentElement.removeChild(this.tooltipEl);
1049
1356
  }
1050
1357
  }
1051
- class jt {
1358
+ class Wt {
1052
1359
  constructor(t, e) {
1053
1360
  c(this, "Cesium");
1054
1361
  c(this, "viewer");
@@ -1060,7 +1367,7 @@ class jt {
1060
1367
  startDrawing(t) {
1061
1368
  const { Cesium: e, viewer: i } = this;
1062
1369
  this.tooltip = new ce(), this.tooltip.show("左键添加点"), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
1063
- var p, g;
1370
+ var g, p;
1064
1371
  const s = i.scene.pickPosition(n.position);
1065
1372
  if (!s) return;
1066
1373
  const o = e.Cartographic.fromCartesian(s), r = e.Math.toDegrees(o.longitude), a = e.Math.toDegrees(o.latitude), l = o.height, d = i.entities.add({
@@ -1080,7 +1387,7 @@ class jt {
1080
1387
  this.clear();
1081
1388
  }
1082
1389
  };
1083
- (p = t.onComplete) == null || p.call(t, u), this.stopDrawing(), (g = this.tooltip) == null || g.hide(), this.tooltip = null;
1390
+ (g = t.onComplete) == null || g.call(t, u), this.stopDrawing(), (p = this.tooltip) == null || p.hide(), this.tooltip = null;
1084
1391
  }, e.ScreenSpaceEventType.LEFT_CLICK);
1085
1392
  }
1086
1393
  stopDrawing() {
@@ -1092,7 +1399,7 @@ class jt {
1092
1399
  (t = this.tooltip) == null || t.hide(), this.tooltip = null, this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.stopDrawing();
1093
1400
  }
1094
1401
  }
1095
- class Wt {
1402
+ class Ut {
1096
1403
  constructor(t, e) {
1097
1404
  c(this, "Cesium");
1098
1405
  c(this, "viewer");
@@ -1209,7 +1516,7 @@ class Wt {
1209
1516
  this.entity && (t.entities.remove(this.entity), this.entity = null), this.tempPoints.forEach((i) => t.entities.remove(i)), this.tempPoints = [], (e = this.tooltip) == null || e.hide(), this.tooltip = null, this.positions = [], this.options = null, this.stopDrawing();
1210
1517
  }
1211
1518
  }
1212
- class Vt {
1519
+ class Kt {
1213
1520
  constructor(t, e) {
1214
1521
  c(this, "Cesium");
1215
1522
  c(this, "viewer");
@@ -1231,8 +1538,8 @@ class Vt {
1231
1538
  coordinates: new e.CallbackProperty(() => {
1232
1539
  if (!(!this.startPoint || !this.endPoint))
1233
1540
  try {
1234
- const r = e.Cartographic.fromCartesian(this.startPoint), a = e.Cartographic.fromCartesian(this.endPoint), l = Math.min(r.longitude, a.longitude), d = Math.max(r.longitude, a.longitude), u = Math.min(r.latitude, a.latitude), p = Math.max(r.latitude, a.latitude);
1235
- return new e.Rectangle(l, u, d, p);
1541
+ const r = e.Cartographic.fromCartesian(this.startPoint), a = e.Cartographic.fromCartesian(this.endPoint), l = Math.min(r.longitude, a.longitude), d = Math.max(r.longitude, a.longitude), u = Math.min(r.latitude, a.latitude), g = Math.max(r.latitude, a.latitude);
1542
+ return new e.Rectangle(l, u, d, g);
1236
1543
  } catch (r) {
1237
1544
  console.warn("Rectangle calculation error:", r);
1238
1545
  return;
@@ -1284,7 +1591,7 @@ class Vt {
1284
1591
  this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.startPoint = null, this.endPoint = null, this.stopDrawing();
1285
1592
  }
1286
1593
  }
1287
- class Ut {
1594
+ class Xt {
1288
1595
  constructor(t, e) {
1289
1596
  c(this, "viewer");
1290
1597
  c(this, "Cesium");
@@ -1333,31 +1640,31 @@ class Ut {
1333
1640
  lat: this.Cesium.Math.toDegrees(s.latitude),
1334
1641
  height: s.height
1335
1642
  }, r = (t == null ? void 0 : t.step) || 1, a = [], l = [];
1336
- for (let p = 0; p < 360; p += r) {
1337
- const g = this.Cesium.Math.toRadians(p), m = new this.Cesium.EllipsoidGeodesic();
1643
+ for (let g = 0; g < 360; g += r) {
1644
+ const p = this.Cesium.Math.toRadians(g), m = new this.Cesium.EllipsoidGeodesic();
1338
1645
  m.setEndPoints(
1339
1646
  s,
1340
1647
  new this.Cesium.Cartographic(
1341
- s.longitude + 1e-4 * Math.cos(g),
1342
- s.latitude + 1e-4 * Math.sin(g)
1648
+ s.longitude + 1e-4 * Math.cos(p),
1649
+ s.latitude + 1e-4 * Math.sin(p)
1343
1650
  )
1344
1651
  );
1345
1652
  const f = m.interpolateUsingSurfaceDistance(n), y = this.Cesium.Ellipsoid.WGS84.cartographicToCartesian(f);
1346
1653
  a.push(y);
1347
- const v = this.Cesium.Cartographic.fromCartesian(y);
1654
+ const w = this.Cesium.Cartographic.fromCartesian(y);
1348
1655
  l.push({
1349
- lng: this.Cesium.Math.toDegrees(v.longitude),
1350
- lat: this.Cesium.Math.toDegrees(v.latitude),
1351
- height: v.height
1656
+ lng: this.Cesium.Math.toDegrees(w.longitude),
1657
+ lat: this.Cesium.Math.toDegrees(w.latitude),
1658
+ height: w.height
1352
1659
  });
1353
1660
  }
1354
1661
  l.push(l[0]);
1355
- const d = this.positions.map((p) => {
1356
- const g = this.Cesium.Cartographic.fromCartesian(p);
1662
+ const d = this.positions.map((g) => {
1663
+ const p = this.Cesium.Cartographic.fromCartesian(g);
1357
1664
  return {
1358
- lng: this.Cesium.Math.toDegrees(g.longitude),
1359
- lat: this.Cesium.Math.toDegrees(g.latitude),
1360
- height: g.height
1665
+ lng: this.Cesium.Math.toDegrees(p.longitude),
1666
+ lat: this.Cesium.Math.toDegrees(p.latitude),
1667
+ height: p.height
1361
1668
  };
1362
1669
  });
1363
1670
  (u = t.onComplete) == null || u.call(t, {
@@ -1380,7 +1687,7 @@ class Ut {
1380
1687
  this.stopDrawing(), this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.positions = [], this.currentRadius = 0;
1381
1688
  }
1382
1689
  }
1383
- class Kt {
1690
+ class qt {
1384
1691
  constructor(t, e) {
1385
1692
  c(this, "Cesium");
1386
1693
  c(this, "viewer");
@@ -1510,7 +1817,7 @@ class Kt {
1510
1817
  this.entity && (t.entities.remove(this.entity), this.entity = null), this.tempPoints.forEach((i) => t.entities.remove(i)), this.tempPoints = [], (e = this.tooltip) == null || e.hide(), this.tooltip = null, this.positions = [], this.lnglats = [], this.options = null, this.stopDrawing();
1511
1818
  }
1512
1819
  }
1513
- class To {
1820
+ class Do {
1514
1821
  constructor(t, e) {
1515
1822
  c(this, "viewer");
1516
1823
  c(this, "Cesium");
@@ -1521,19 +1828,19 @@ class To {
1521
1828
  var i;
1522
1829
  switch (this.clear(), t) {
1523
1830
  case "point":
1524
- this.activeDrawer = new jt(this.Cesium, this.viewer);
1831
+ this.activeDrawer = new Wt(this.Cesium, this.viewer);
1525
1832
  break;
1526
1833
  case "line":
1527
- this.activeDrawer = new Wt(this.Cesium, this.viewer);
1834
+ this.activeDrawer = new Ut(this.Cesium, this.viewer);
1528
1835
  break;
1529
1836
  case "rectangle":
1530
- this.activeDrawer = new Vt(this.Cesium, this.viewer);
1837
+ this.activeDrawer = new Kt(this.Cesium, this.viewer);
1531
1838
  break;
1532
1839
  case "circle":
1533
- this.activeDrawer = new Ut(this.Cesium, this.viewer);
1840
+ this.activeDrawer = new Xt(this.Cesium, this.viewer);
1534
1841
  break;
1535
1842
  case "polygon":
1536
- this.activeDrawer = new Kt(this.Cesium, this.viewer);
1843
+ this.activeDrawer = new qt(this.Cesium, this.viewer);
1537
1844
  break;
1538
1845
  default:
1539
1846
  throw new Error(`Unsupported draw type: ${t}`);
@@ -1547,52 +1854,52 @@ class To {
1547
1854
  this.clear();
1548
1855
  }
1549
1856
  }
1550
- var Lt = typeof global == "object" && global && global.Object === Object && global, Xt = typeof self == "object" && self && self.Object === Object && self, ie = Lt || Xt || Function("return this")(), fe = ie.Symbol, Et = Object.prototype, qt = Et.hasOwnProperty, Zt = Et.toString, be = fe ? fe.toStringTag : void 0;
1551
- function Jt(h) {
1552
- var t = qt.call(h, be), e = h[be];
1857
+ var Lt = typeof global == "object" && global && global.Object === Object && global, Zt = typeof self == "object" && self && self.Object === Object && self, ie = Lt || Zt || Function("return this")(), fe = ie.Symbol, Et = Object.prototype, Jt = Et.hasOwnProperty, Qt = Et.toString, be = fe ? fe.toStringTag : void 0;
1858
+ function ei(h) {
1859
+ var t = Jt.call(h, be), e = h[be];
1553
1860
  try {
1554
1861
  h[be] = void 0;
1555
1862
  var i = !0;
1556
1863
  } catch {
1557
1864
  }
1558
- var n = Zt.call(h);
1865
+ var n = Qt.call(h);
1559
1866
  return i && (t ? h[be] = e : delete h[be]), n;
1560
1867
  }
1561
- var Qt = Object.prototype, ei = Qt.toString;
1562
- function ti(h) {
1563
- return ei.call(h);
1868
+ var ti = Object.prototype, ii = ti.toString;
1869
+ function si(h) {
1870
+ return ii.call(h);
1564
1871
  }
1565
- var ii = "[object Null]", si = "[object Undefined]", Ke = fe ? fe.toStringTag : void 0;
1872
+ var ni = "[object Null]", oi = "[object Undefined]", Ke = fe ? fe.toStringTag : void 0;
1566
1873
  function xe(h) {
1567
- return h == null ? h === void 0 ? si : ii : Ke && Ke in Object(h) ? Jt(h) : ti(h);
1874
+ return h == null ? h === void 0 ? oi : ni : Ke && Ke in Object(h) ? ei(h) : si(h);
1568
1875
  }
1569
1876
  function Ie(h) {
1570
1877
  return h != null && typeof h == "object";
1571
1878
  }
1572
1879
  var Le = Array.isArray;
1573
- function He(h) {
1880
+ function Oe(h) {
1574
1881
  var t = typeof h;
1575
1882
  return h != null && (t == "object" || t == "function");
1576
1883
  }
1577
- var ni = "[object AsyncFunction]", oi = "[object Function]", ri = "[object GeneratorFunction]", ai = "[object Proxy]";
1884
+ var ri = "[object AsyncFunction]", ai = "[object Function]", li = "[object GeneratorFunction]", hi = "[object Proxy]";
1578
1885
  function Mt(h) {
1579
- if (!He(h))
1886
+ if (!Oe(h))
1580
1887
  return !1;
1581
1888
  var t = xe(h);
1582
- return t == oi || t == ri || t == ni || t == ai;
1889
+ return t == ai || t == li || t == ri || t == hi;
1583
1890
  }
1584
- var Ne = ie["__core-js_shared__"], Xe = (function() {
1585
- var h = /[^.]+$/.exec(Ne && Ne.keys && Ne.keys.IE_PROTO || "");
1891
+ var ze = ie["__core-js_shared__"], Xe = (function() {
1892
+ var h = /[^.]+$/.exec(ze && ze.keys && ze.keys.IE_PROTO || "");
1586
1893
  return h ? "Symbol(src)_1." + h : "";
1587
1894
  })();
1588
- function li(h) {
1895
+ function ci(h) {
1589
1896
  return !!Xe && Xe in h;
1590
1897
  }
1591
- var hi = Function.prototype, ci = hi.toString;
1898
+ var di = Function.prototype, ui = di.toString;
1592
1899
  function de(h) {
1593
1900
  if (h != null) {
1594
1901
  try {
1595
- return ci.call(h);
1902
+ return ui.call(h);
1596
1903
  } catch {
1597
1904
  }
1598
1905
  try {
@@ -1602,27 +1909,27 @@ function de(h) {
1602
1909
  }
1603
1910
  return "";
1604
1911
  }
1605
- var di = /[\\^$.*+?()[\]{}|]/g, ui = /^\[object .+?Constructor\]$/, pi = Function.prototype, mi = Object.prototype, gi = pi.toString, fi = mi.hasOwnProperty, yi = RegExp(
1606
- "^" + gi.call(fi).replace(di, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1912
+ var pi = /[\\^$.*+?()[\]{}|]/g, mi = /^\[object .+?Constructor\]$/, gi = Function.prototype, fi = Object.prototype, yi = gi.toString, wi = fi.hasOwnProperty, vi = RegExp(
1913
+ "^" + yi.call(wi).replace(pi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1607
1914
  );
1608
- function wi(h) {
1609
- if (!He(h) || li(h))
1915
+ function Ci(h) {
1916
+ if (!Oe(h) || ci(h))
1610
1917
  return !1;
1611
- var t = Mt(h) ? yi : ui;
1918
+ var t = Mt(h) ? vi : mi;
1612
1919
  return t.test(de(h));
1613
1920
  }
1614
- function vi(h, t) {
1921
+ function bi(h, t) {
1615
1922
  return h == null ? void 0 : h[t];
1616
1923
  }
1617
1924
  function ue(h, t) {
1618
- var e = vi(h, t);
1619
- return wi(e) ? e : void 0;
1925
+ var e = bi(h, t);
1926
+ return Ci(e) ? e : void 0;
1620
1927
  }
1621
- var Be = ue(ie, "WeakMap"), qe = Object.create, Ci = /* @__PURE__ */ (function() {
1928
+ var Be = ue(ie, "WeakMap"), qe = Object.create, Pi = /* @__PURE__ */ (function() {
1622
1929
  function h() {
1623
1930
  }
1624
1931
  return function(t) {
1625
- if (!He(t))
1932
+ if (!Oe(t))
1626
1933
  return {};
1627
1934
  if (qe)
1628
1935
  return qe(t);
@@ -1637,17 +1944,17 @@ var Be = ue(ie, "WeakMap"), qe = Object.create, Ci = /* @__PURE__ */ (function()
1637
1944
  } catch {
1638
1945
  }
1639
1946
  })();
1640
- function bi(h, t) {
1947
+ function Li(h, t) {
1641
1948
  for (var e = -1, i = h == null ? 0 : h.length; ++e < i && t(h[e], e, h) !== !1; )
1642
1949
  ;
1643
1950
  return h;
1644
1951
  }
1645
- var Pi = 9007199254740991, Li = /^(?:0|[1-9]\d*)$/;
1646
- function Ei(h, t) {
1952
+ var Ei = 9007199254740991, Mi = /^(?:0|[1-9]\d*)$/;
1953
+ function xi(h, t) {
1647
1954
  var e = typeof h;
1648
- return t = t ?? Pi, !!t && (e == "number" || e != "symbol" && Li.test(h)) && h > -1 && h % 1 == 0 && h < t;
1955
+ return t = t ?? Ei, !!t && (e == "number" || e != "symbol" && Mi.test(h)) && h > -1 && h % 1 == 0 && h < t;
1649
1956
  }
1650
- function Mi(h, t, e) {
1957
+ function Ii(h, t, e) {
1651
1958
  t == "__proto__" && Ze ? Ze(h, t, {
1652
1959
  configurable: !0,
1653
1960
  enumerable: !0,
@@ -1658,66 +1965,66 @@ function Mi(h, t, e) {
1658
1965
  function xt(h, t) {
1659
1966
  return h === t || h !== h && t !== t;
1660
1967
  }
1661
- var xi = Object.prototype, Ii = xi.hasOwnProperty;
1662
- function Ti(h, t, e) {
1968
+ var Ti = Object.prototype, _i = Ti.hasOwnProperty;
1969
+ function Di(h, t, e) {
1663
1970
  var i = h[t];
1664
- (!(Ii.call(h, t) && xt(i, e)) || e === void 0 && !(t in h)) && Mi(h, t, e);
1971
+ (!(_i.call(h, t) && xt(i, e)) || e === void 0 && !(t in h)) && Ii(h, t, e);
1665
1972
  }
1666
- var _i = 9007199254740991;
1973
+ var Si = 9007199254740991;
1667
1974
  function It(h) {
1668
- return typeof h == "number" && h > -1 && h % 1 == 0 && h <= _i;
1975
+ return typeof h == "number" && h > -1 && h % 1 == 0 && h <= Si;
1669
1976
  }
1670
- function Di(h) {
1977
+ function Ai(h) {
1671
1978
  return h != null && It(h.length) && !Mt(h);
1672
1979
  }
1673
- var Si = Object.prototype;
1980
+ var ki = Object.prototype;
1674
1981
  function Tt(h) {
1675
- var t = h && h.constructor, e = typeof t == "function" && t.prototype || Si;
1982
+ var t = h && h.constructor, e = typeof t == "function" && t.prototype || ki;
1676
1983
  return h === e;
1677
1984
  }
1678
- function Ai(h, t) {
1985
+ function Ri(h, t) {
1679
1986
  for (var e = -1, i = Array(h); ++e < h; )
1680
1987
  i[e] = t(e);
1681
1988
  return i;
1682
1989
  }
1683
- var ki = "[object Arguments]";
1990
+ var $i = "[object Arguments]";
1684
1991
  function Je(h) {
1685
- return Ie(h) && xe(h) == ki;
1992
+ return Ie(h) && xe(h) == $i;
1686
1993
  }
1687
- var _t = Object.prototype, $i = _t.hasOwnProperty, Ri = _t.propertyIsEnumerable, Oi = Je(/* @__PURE__ */ (function() {
1994
+ var _t = Object.prototype, Hi = _t.hasOwnProperty, Oi = _t.propertyIsEnumerable, Fi = Je(/* @__PURE__ */ (function() {
1688
1995
  return arguments;
1689
1996
  })()) ? Je : function(h) {
1690
- return Ie(h) && $i.call(h, "callee") && !Ri.call(h, "callee");
1997
+ return Ie(h) && Hi.call(h, "callee") && !Oi.call(h, "callee");
1691
1998
  };
1692
- function Hi() {
1999
+ function Ni() {
1693
2000
  return !1;
1694
2001
  }
1695
- var Dt = typeof exports == "object" && exports && !exports.nodeType && exports, Qe = Dt && typeof module == "object" && module && !module.nodeType && module, Fi = Qe && Qe.exports === Dt, et = Fi ? ie.Buffer : void 0, zi = et ? et.isBuffer : void 0, St = zi || Hi, Ni = "[object Arguments]", Gi = "[object Array]", Bi = "[object Boolean]", Yi = "[object Date]", ji = "[object Error]", Wi = "[object Function]", Vi = "[object Map]", Ui = "[object Number]", Ki = "[object Object]", Xi = "[object RegExp]", qi = "[object Set]", Zi = "[object String]", Ji = "[object WeakMap]", Qi = "[object ArrayBuffer]", es = "[object DataView]", ts = "[object Float32Array]", is = "[object Float64Array]", ss = "[object Int8Array]", ns = "[object Int16Array]", os = "[object Int32Array]", rs = "[object Uint8Array]", as = "[object Uint8ClampedArray]", ls = "[object Uint16Array]", hs = "[object Uint32Array]", F = {};
1696
- F[ts] = F[is] = F[ss] = F[ns] = F[os] = F[rs] = F[as] = F[ls] = F[hs] = !0;
1697
- F[Ni] = F[Gi] = F[Qi] = F[Bi] = F[es] = F[Yi] = F[ji] = F[Wi] = F[Vi] = F[Ui] = F[Ki] = F[Xi] = F[qi] = F[Zi] = F[Ji] = !1;
1698
- function cs(h) {
2002
+ var Dt = typeof exports == "object" && exports && !exports.nodeType && exports, Qe = Dt && typeof module == "object" && module && !module.nodeType && module, zi = Qe && Qe.exports === Dt, et = zi ? ie.Buffer : void 0, Gi = et ? et.isBuffer : void 0, St = Gi || Ni, Bi = "[object Arguments]", Yi = "[object Array]", Vi = "[object Boolean]", ji = "[object Date]", Wi = "[object Error]", Ui = "[object Function]", Ki = "[object Map]", Xi = "[object Number]", qi = "[object Object]", Zi = "[object RegExp]", Ji = "[object Set]", Qi = "[object String]", es = "[object WeakMap]", ts = "[object ArrayBuffer]", is = "[object DataView]", ss = "[object Float32Array]", ns = "[object Float64Array]", os = "[object Int8Array]", rs = "[object Int16Array]", as = "[object Int32Array]", ls = "[object Uint8Array]", hs = "[object Uint8ClampedArray]", cs = "[object Uint16Array]", ds = "[object Uint32Array]", F = {};
2003
+ F[ss] = F[ns] = F[os] = F[rs] = F[as] = F[ls] = F[hs] = F[cs] = F[ds] = !0;
2004
+ F[Bi] = F[Yi] = F[ts] = F[Vi] = F[is] = F[ji] = F[Wi] = F[Ui] = F[Ki] = F[Xi] = F[qi] = F[Zi] = F[Ji] = F[Qi] = F[es] = !1;
2005
+ function us(h) {
1699
2006
  return Ie(h) && It(h.length) && !!F[xe(h)];
1700
2007
  }
1701
- function Ve(h) {
2008
+ function We(h) {
1702
2009
  return function(t) {
1703
2010
  return h(t);
1704
2011
  };
1705
2012
  }
1706
- var At = typeof exports == "object" && exports && !exports.nodeType && exports, Pe = At && typeof module == "object" && module && !module.nodeType && module, ds = Pe && Pe.exports === At, Ge = ds && Lt.process, ye = (function() {
2013
+ var At = typeof exports == "object" && exports && !exports.nodeType && exports, Pe = At && typeof module == "object" && module && !module.nodeType && module, ps = Pe && Pe.exports === At, Ge = ps && Lt.process, ye = (function() {
1707
2014
  try {
1708
2015
  var h = Pe && Pe.require && Pe.require("util").types;
1709
2016
  return h || Ge && Ge.binding && Ge.binding("util");
1710
2017
  } catch {
1711
2018
  }
1712
- })(), tt = ye && ye.isTypedArray, us = tt ? Ve(tt) : cs, ps = Object.prototype, ms = ps.hasOwnProperty;
1713
- function gs(h, t) {
1714
- var e = Le(h), i = !e && Oi(h), n = !e && !i && St(h), s = !e && !i && !n && us(h), o = e || i || n || s, r = o ? Ai(h.length, String) : [], a = r.length;
2019
+ })(), tt = ye && ye.isTypedArray, ms = tt ? We(tt) : us, gs = Object.prototype, fs = gs.hasOwnProperty;
2020
+ function ys(h, t) {
2021
+ var e = Le(h), i = !e && Fi(h), n = !e && !i && St(h), s = !e && !i && !n && ms(h), o = e || i || n || s, r = o ? Ri(h.length, String) : [], a = r.length;
1715
2022
  for (var l in h)
1716
- ms.call(h, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
2023
+ fs.call(h, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
1717
2024
  (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1718
2025
  n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1719
2026
  s && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
1720
- Ei(l, a))) && r.push(l);
2027
+ xi(l, a))) && r.push(l);
1721
2028
  return r;
1722
2029
  }
1723
2030
  function kt(h, t) {
@@ -1725,44 +2032,44 @@ function kt(h, t) {
1725
2032
  return h(t(e));
1726
2033
  };
1727
2034
  }
1728
- var fs = kt(Object.keys, Object), ys = Object.prototype, ws = ys.hasOwnProperty;
1729
- function vs(h) {
2035
+ var ws = kt(Object.keys, Object), vs = Object.prototype, Cs = vs.hasOwnProperty;
2036
+ function bs(h) {
1730
2037
  if (!Tt(h))
1731
- return fs(h);
2038
+ return ws(h);
1732
2039
  var t = [];
1733
2040
  for (var e in Object(h))
1734
- ws.call(h, e) && e != "constructor" && t.push(e);
2041
+ Cs.call(h, e) && e != "constructor" && t.push(e);
1735
2042
  return t;
1736
2043
  }
1737
- function Cs(h) {
1738
- return Di(h) ? gs(h) : vs(h);
2044
+ function Ps(h) {
2045
+ return Ai(h) ? ys(h) : bs(h);
1739
2046
  }
1740
2047
  var Ee = ue(Object, "create");
1741
- function bs() {
2048
+ function Ls() {
1742
2049
  this.__data__ = Ee ? Ee(null) : {}, this.size = 0;
1743
2050
  }
1744
- function Ps(h) {
2051
+ function Es(h) {
1745
2052
  var t = this.has(h) && delete this.__data__[h];
1746
2053
  return this.size -= t ? 1 : 0, t;
1747
2054
  }
1748
- var Ls = "__lodash_hash_undefined__", Es = Object.prototype, Ms = Es.hasOwnProperty;
1749
- function xs(h) {
2055
+ var Ms = "__lodash_hash_undefined__", xs = Object.prototype, Is = xs.hasOwnProperty;
2056
+ function Ts(h) {
1750
2057
  var t = this.__data__;
1751
2058
  if (Ee) {
1752
2059
  var e = t[h];
1753
- return e === Ls ? void 0 : e;
2060
+ return e === Ms ? void 0 : e;
1754
2061
  }
1755
- return Ms.call(t, h) ? t[h] : void 0;
2062
+ return Is.call(t, h) ? t[h] : void 0;
1756
2063
  }
1757
- var Is = Object.prototype, Ts = Is.hasOwnProperty;
1758
- function _s(h) {
2064
+ var _s = Object.prototype, Ds = _s.hasOwnProperty;
2065
+ function Ss(h) {
1759
2066
  var t = this.__data__;
1760
- return Ee ? t[h] !== void 0 : Ts.call(t, h);
2067
+ return Ee ? t[h] !== void 0 : Ds.call(t, h);
1761
2068
  }
1762
- var Ds = "__lodash_hash_undefined__";
1763
- function Ss(h, t) {
2069
+ var As = "__lodash_hash_undefined__";
2070
+ function ks(h, t) {
1764
2071
  var e = this.__data__;
1765
- return this.size += this.has(h) ? 0 : 1, e[h] = Ee && t === void 0 ? Ds : t, this;
2072
+ return this.size += this.has(h) ? 0 : 1, e[h] = Ee && t === void 0 ? As : t, this;
1766
2073
  }
1767
2074
  function he(h) {
1768
2075
  var t = -1, e = h == null ? 0 : h.length;
@@ -1771,12 +2078,12 @@ function he(h) {
1771
2078
  this.set(i[0], i[1]);
1772
2079
  }
1773
2080
  }
1774
- he.prototype.clear = bs;
1775
- he.prototype.delete = Ps;
1776
- he.prototype.get = xs;
1777
- he.prototype.has = _s;
1778
- he.prototype.set = Ss;
1779
- function As() {
2081
+ he.prototype.clear = Ls;
2082
+ he.prototype.delete = Es;
2083
+ he.prototype.get = Ts;
2084
+ he.prototype.has = Ss;
2085
+ he.prototype.set = ks;
2086
+ function Rs() {
1780
2087
  this.__data__ = [], this.size = 0;
1781
2088
  }
1782
2089
  function Fe(h, t) {
@@ -1785,22 +2092,22 @@ function Fe(h, t) {
1785
2092
  return e;
1786
2093
  return -1;
1787
2094
  }
1788
- var ks = Array.prototype, $s = ks.splice;
1789
- function Rs(h) {
2095
+ var $s = Array.prototype, Hs = $s.splice;
2096
+ function Os(h) {
1790
2097
  var t = this.__data__, e = Fe(t, h);
1791
2098
  if (e < 0)
1792
2099
  return !1;
1793
2100
  var i = t.length - 1;
1794
- return e == i ? t.pop() : $s.call(t, e, 1), --this.size, !0;
2101
+ return e == i ? t.pop() : Hs.call(t, e, 1), --this.size, !0;
1795
2102
  }
1796
- function Os(h) {
2103
+ function Fs(h) {
1797
2104
  var t = this.__data__, e = Fe(t, h);
1798
2105
  return e < 0 ? void 0 : t[e][1];
1799
2106
  }
1800
- function Hs(h) {
2107
+ function Ns(h) {
1801
2108
  return Fe(this.__data__, h) > -1;
1802
2109
  }
1803
- function Fs(h, t) {
2110
+ function zs(h, t) {
1804
2111
  var e = this.__data__, i = Fe(e, h);
1805
2112
  return i < 0 ? (++this.size, e.push([h, t])) : e[i][1] = t, this;
1806
2113
  }
@@ -1811,39 +2118,39 @@ function ae(h) {
1811
2118
  this.set(i[0], i[1]);
1812
2119
  }
1813
2120
  }
1814
- ae.prototype.clear = As;
1815
- ae.prototype.delete = Rs;
1816
- ae.prototype.get = Os;
1817
- ae.prototype.has = Hs;
1818
- ae.prototype.set = Fs;
2121
+ ae.prototype.clear = Rs;
2122
+ ae.prototype.delete = Os;
2123
+ ae.prototype.get = Fs;
2124
+ ae.prototype.has = Ns;
2125
+ ae.prototype.set = zs;
1819
2126
  var Me = ue(ie, "Map");
1820
- function zs() {
2127
+ function Gs() {
1821
2128
  this.size = 0, this.__data__ = {
1822
2129
  hash: new he(),
1823
2130
  map: new (Me || ae)(),
1824
2131
  string: new he()
1825
2132
  };
1826
2133
  }
1827
- function Ns(h) {
2134
+ function Bs(h) {
1828
2135
  var t = typeof h;
1829
2136
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? h !== "__proto__" : h === null;
1830
2137
  }
1831
- function ze(h, t) {
2138
+ function Ne(h, t) {
1832
2139
  var e = h.__data__;
1833
- return Ns(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
2140
+ return Bs(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
1834
2141
  }
1835
- function Gs(h) {
1836
- var t = ze(this, h).delete(h);
2142
+ function Ys(h) {
2143
+ var t = Ne(this, h).delete(h);
1837
2144
  return this.size -= t ? 1 : 0, t;
1838
2145
  }
1839
- function Bs(h) {
1840
- return ze(this, h).get(h);
2146
+ function Vs(h) {
2147
+ return Ne(this, h).get(h);
1841
2148
  }
1842
- function Ys(h) {
1843
- return ze(this, h).has(h);
2149
+ function js(h) {
2150
+ return Ne(this, h).has(h);
1844
2151
  }
1845
- function js(h, t) {
1846
- var e = ze(this, h), i = e.size;
2152
+ function Ws(h, t) {
2153
+ var e = Ne(this, h), i = e.size;
1847
2154
  return e.set(h, t), this.size += e.size == i ? 0 : 1, this;
1848
2155
  }
1849
2156
  function we(h) {
@@ -1853,36 +2160,36 @@ function we(h) {
1853
2160
  this.set(i[0], i[1]);
1854
2161
  }
1855
2162
  }
1856
- we.prototype.clear = zs;
1857
- we.prototype.delete = Gs;
1858
- we.prototype.get = Bs;
1859
- we.prototype.has = Ys;
1860
- we.prototype.set = js;
1861
- function Ws(h, t) {
2163
+ we.prototype.clear = Gs;
2164
+ we.prototype.delete = Ys;
2165
+ we.prototype.get = Vs;
2166
+ we.prototype.has = js;
2167
+ we.prototype.set = Ws;
2168
+ function Us(h, t) {
1862
2169
  for (var e = -1, i = t.length, n = h.length; ++e < i; )
1863
2170
  h[n + e] = t[e];
1864
2171
  return h;
1865
2172
  }
1866
- var Vs = kt(Object.getPrototypeOf, Object);
1867
- function Us() {
2173
+ var Ks = kt(Object.getPrototypeOf, Object);
2174
+ function Xs() {
1868
2175
  this.__data__ = new ae(), this.size = 0;
1869
2176
  }
1870
- function Ks(h) {
2177
+ function qs(h) {
1871
2178
  var t = this.__data__, e = t.delete(h);
1872
2179
  return this.size = t.size, e;
1873
2180
  }
1874
- function Xs(h) {
2181
+ function Zs(h) {
1875
2182
  return this.__data__.get(h);
1876
2183
  }
1877
- function qs(h) {
2184
+ function Js(h) {
1878
2185
  return this.__data__.has(h);
1879
2186
  }
1880
- var Zs = 200;
1881
- function Js(h, t) {
2187
+ var Qs = 200;
2188
+ function en(h, t) {
1882
2189
  var e = this.__data__;
1883
2190
  if (e instanceof ae) {
1884
2191
  var i = e.__data__;
1885
- if (!Me || i.length < Zs - 1)
2192
+ if (!Me || i.length < Qs - 1)
1886
2193
  return i.push([h, t]), this.size = ++e.size, this;
1887
2194
  e = this.__data__ = new we(i);
1888
2195
  }
@@ -1892,172 +2199,172 @@ function ve(h) {
1892
2199
  var t = this.__data__ = new ae(h);
1893
2200
  this.size = t.size;
1894
2201
  }
1895
- ve.prototype.clear = Us;
1896
- ve.prototype.delete = Ks;
1897
- ve.prototype.get = Xs;
1898
- ve.prototype.has = qs;
1899
- ve.prototype.set = Js;
1900
- var $t = typeof exports == "object" && exports && !exports.nodeType && exports, it = $t && typeof module == "object" && module && !module.nodeType && module, Qs = it && it.exports === $t, st = Qs ? ie.Buffer : void 0;
2202
+ ve.prototype.clear = Xs;
2203
+ ve.prototype.delete = qs;
2204
+ ve.prototype.get = Zs;
2205
+ ve.prototype.has = Js;
2206
+ ve.prototype.set = en;
2207
+ var Rt = typeof exports == "object" && exports && !exports.nodeType && exports, it = Rt && typeof module == "object" && module && !module.nodeType && module, tn = it && it.exports === Rt, st = tn ? ie.Buffer : void 0;
1901
2208
  st && st.allocUnsafe;
1902
- function en(h, t) {
2209
+ function sn(h, t) {
1903
2210
  return h.slice();
1904
2211
  }
1905
- function tn(h, t) {
2212
+ function nn(h, t) {
1906
2213
  for (var e = -1, i = h == null ? 0 : h.length, n = 0, s = []; ++e < i; ) {
1907
2214
  var o = h[e];
1908
2215
  t(o, e, h) && (s[n++] = o);
1909
2216
  }
1910
2217
  return s;
1911
2218
  }
1912
- function sn() {
2219
+ function on() {
1913
2220
  return [];
1914
2221
  }
1915
- var nn = Object.prototype, on = nn.propertyIsEnumerable, nt = Object.getOwnPropertySymbols, rn = nt ? function(h) {
1916
- return h == null ? [] : (h = Object(h), tn(nt(h), function(t) {
1917
- return on.call(h, t);
2222
+ var rn = Object.prototype, an = rn.propertyIsEnumerable, nt = Object.getOwnPropertySymbols, ln = nt ? function(h) {
2223
+ return h == null ? [] : (h = Object(h), nn(nt(h), function(t) {
2224
+ return an.call(h, t);
1918
2225
  }));
1919
- } : sn;
1920
- function an(h, t, e) {
2226
+ } : on;
2227
+ function hn(h, t, e) {
1921
2228
  var i = t(h);
1922
- return Le(h) ? i : Ws(i, e(h));
2229
+ return Le(h) ? i : Us(i, e(h));
1923
2230
  }
1924
- function ln(h) {
1925
- return an(h, Cs, rn);
2231
+ function cn(h) {
2232
+ return hn(h, Ps, ln);
1926
2233
  }
1927
- var Ye = ue(ie, "DataView"), je = ue(ie, "Promise"), We = ue(ie, "Set"), ot = "[object Map]", hn = "[object Object]", rt = "[object Promise]", at = "[object Set]", lt = "[object WeakMap]", ht = "[object DataView]", cn = de(Ye), dn = de(Me), un = de(je), pn = de(We), mn = de(Be), re = xe;
1928
- (Ye && re(new Ye(new ArrayBuffer(1))) != ht || Me && re(new Me()) != ot || je && re(je.resolve()) != rt || We && re(new We()) != at || Be && re(new Be()) != lt) && (re = function(h) {
1929
- var t = xe(h), e = t == hn ? h.constructor : void 0, i = e ? de(e) : "";
2234
+ var Ye = ue(ie, "DataView"), Ve = ue(ie, "Promise"), je = ue(ie, "Set"), ot = "[object Map]", dn = "[object Object]", rt = "[object Promise]", at = "[object Set]", lt = "[object WeakMap]", ht = "[object DataView]", un = de(Ye), pn = de(Me), mn = de(Ve), gn = de(je), fn = de(Be), re = xe;
2235
+ (Ye && re(new Ye(new ArrayBuffer(1))) != ht || Me && re(new Me()) != ot || Ve && re(Ve.resolve()) != rt || je && re(new je()) != at || Be && re(new Be()) != lt) && (re = function(h) {
2236
+ var t = xe(h), e = t == dn ? h.constructor : void 0, i = e ? de(e) : "";
1930
2237
  if (i)
1931
2238
  switch (i) {
1932
- case cn:
2239
+ case un:
1933
2240
  return ht;
1934
- case dn:
2241
+ case pn:
1935
2242
  return ot;
1936
- case un:
2243
+ case mn:
1937
2244
  return rt;
1938
- case pn:
2245
+ case gn:
1939
2246
  return at;
1940
- case mn:
2247
+ case fn:
1941
2248
  return lt;
1942
2249
  }
1943
2250
  return t;
1944
2251
  });
1945
- var gn = Object.prototype, fn = gn.hasOwnProperty;
1946
- function yn(h) {
2252
+ var yn = Object.prototype, wn = yn.hasOwnProperty;
2253
+ function vn(h) {
1947
2254
  var t = h.length, e = new h.constructor(t);
1948
- return t && typeof h[0] == "string" && fn.call(h, "index") && (e.index = h.index, e.input = h.input), e;
2255
+ return t && typeof h[0] == "string" && wn.call(h, "index") && (e.index = h.index, e.input = h.input), e;
1949
2256
  }
1950
2257
  var ct = ie.Uint8Array;
1951
2258
  function Ue(h) {
1952
2259
  var t = new h.constructor(h.byteLength);
1953
2260
  return new ct(t).set(new ct(h)), t;
1954
2261
  }
1955
- function wn(h, t) {
2262
+ function Cn(h, t) {
1956
2263
  var e = Ue(h.buffer);
1957
2264
  return new h.constructor(e, h.byteOffset, h.byteLength);
1958
2265
  }
1959
- var vn = /\w*$/;
1960
- function Cn(h) {
1961
- var t = new h.constructor(h.source, vn.exec(h));
2266
+ var bn = /\w*$/;
2267
+ function Pn(h) {
2268
+ var t = new h.constructor(h.source, bn.exec(h));
1962
2269
  return t.lastIndex = h.lastIndex, t;
1963
2270
  }
1964
2271
  var dt = fe ? fe.prototype : void 0, ut = dt ? dt.valueOf : void 0;
1965
- function bn(h) {
2272
+ function Ln(h) {
1966
2273
  return ut ? Object(ut.call(h)) : {};
1967
2274
  }
1968
- function Pn(h, t) {
2275
+ function En(h, t) {
1969
2276
  var e = Ue(h.buffer);
1970
2277
  return new h.constructor(e, h.byteOffset, h.length);
1971
2278
  }
1972
- var Ln = "[object Boolean]", En = "[object Date]", Mn = "[object Map]", xn = "[object Number]", In = "[object RegExp]", Tn = "[object Set]", _n = "[object String]", Dn = "[object Symbol]", Sn = "[object ArrayBuffer]", An = "[object DataView]", kn = "[object Float32Array]", $n = "[object Float64Array]", Rn = "[object Int8Array]", On = "[object Int16Array]", Hn = "[object Int32Array]", Fn = "[object Uint8Array]", zn = "[object Uint8ClampedArray]", Nn = "[object Uint16Array]", Gn = "[object Uint32Array]";
1973
- function Bn(h, t, e) {
2279
+ var Mn = "[object Boolean]", xn = "[object Date]", In = "[object Map]", Tn = "[object Number]", _n = "[object RegExp]", Dn = "[object Set]", Sn = "[object String]", An = "[object Symbol]", kn = "[object ArrayBuffer]", Rn = "[object DataView]", $n = "[object Float32Array]", Hn = "[object Float64Array]", On = "[object Int8Array]", Fn = "[object Int16Array]", Nn = "[object Int32Array]", zn = "[object Uint8Array]", Gn = "[object Uint8ClampedArray]", Bn = "[object Uint16Array]", Yn = "[object Uint32Array]";
2280
+ function Vn(h, t, e) {
1974
2281
  var i = h.constructor;
1975
2282
  switch (t) {
1976
- case Sn:
2283
+ case kn:
1977
2284
  return Ue(h);
1978
- case Ln:
1979
- case En:
2285
+ case Mn:
2286
+ case xn:
1980
2287
  return new i(+h);
1981
- case An:
1982
- return wn(h);
1983
- case kn:
1984
- case $n:
1985
2288
  case Rn:
1986
- case On:
2289
+ return Cn(h);
2290
+ case $n:
1987
2291
  case Hn:
2292
+ case On:
1988
2293
  case Fn:
1989
- case zn:
1990
2294
  case Nn:
2295
+ case zn:
1991
2296
  case Gn:
1992
- return Pn(h);
1993
- case Mn:
1994
- return new i();
1995
- case xn:
1996
- case _n:
1997
- return new i(h);
2297
+ case Bn:
2298
+ case Yn:
2299
+ return En(h);
1998
2300
  case In:
1999
- return Cn(h);
2000
- case Tn:
2001
2301
  return new i();
2302
+ case Tn:
2303
+ case Sn:
2304
+ return new i(h);
2305
+ case _n:
2306
+ return Pn(h);
2002
2307
  case Dn:
2003
- return bn(h);
2308
+ return new i();
2309
+ case An:
2310
+ return Ln(h);
2004
2311
  }
2005
2312
  }
2006
- function Yn(h) {
2007
- return typeof h.constructor == "function" && !Tt(h) ? Ci(Vs(h)) : {};
2313
+ function jn(h) {
2314
+ return typeof h.constructor == "function" && !Tt(h) ? Pi(Ks(h)) : {};
2008
2315
  }
2009
- var jn = "[object Map]";
2010
- function Wn(h) {
2011
- return Ie(h) && re(h) == jn;
2316
+ var Wn = "[object Map]";
2317
+ function Un(h) {
2318
+ return Ie(h) && re(h) == Wn;
2012
2319
  }
2013
- var pt = ye && ye.isMap, Vn = pt ? Ve(pt) : Wn, Un = "[object Set]";
2014
- function Kn(h) {
2015
- return Ie(h) && re(h) == Un;
2320
+ var pt = ye && ye.isMap, Kn = pt ? We(pt) : Un, Xn = "[object Set]";
2321
+ function qn(h) {
2322
+ return Ie(h) && re(h) == Xn;
2016
2323
  }
2017
- var mt = ye && ye.isSet, Xn = mt ? Ve(mt) : Kn, Rt = "[object Arguments]", qn = "[object Array]", Zn = "[object Boolean]", Jn = "[object Date]", Qn = "[object Error]", Ot = "[object Function]", eo = "[object GeneratorFunction]", to = "[object Map]", io = "[object Number]", Ht = "[object Object]", so = "[object RegExp]", no = "[object Set]", oo = "[object String]", ro = "[object Symbol]", ao = "[object WeakMap]", lo = "[object ArrayBuffer]", ho = "[object DataView]", co = "[object Float32Array]", uo = "[object Float64Array]", po = "[object Int8Array]", mo = "[object Int16Array]", go = "[object Int32Array]", fo = "[object Uint8Array]", yo = "[object Uint8ClampedArray]", wo = "[object Uint16Array]", vo = "[object Uint32Array]", H = {};
2018
- H[Rt] = H[qn] = H[lo] = H[ho] = H[Zn] = H[Jn] = H[co] = H[uo] = H[po] = H[mo] = H[go] = H[to] = H[io] = H[Ht] = H[so] = H[no] = H[oo] = H[ro] = H[fo] = H[yo] = H[wo] = H[vo] = !0;
2019
- H[Qn] = H[Ot] = H[ao] = !1;
2324
+ var mt = ye && ye.isSet, Zn = mt ? We(mt) : qn, $t = "[object Arguments]", Jn = "[object Array]", Qn = "[object Boolean]", eo = "[object Date]", to = "[object Error]", Ht = "[object Function]", io = "[object GeneratorFunction]", so = "[object Map]", no = "[object Number]", Ot = "[object Object]", oo = "[object RegExp]", ro = "[object Set]", ao = "[object String]", lo = "[object Symbol]", ho = "[object WeakMap]", co = "[object ArrayBuffer]", uo = "[object DataView]", po = "[object Float32Array]", mo = "[object Float64Array]", go = "[object Int8Array]", fo = "[object Int16Array]", yo = "[object Int32Array]", wo = "[object Uint8Array]", vo = "[object Uint8ClampedArray]", Co = "[object Uint16Array]", bo = "[object Uint32Array]", O = {};
2325
+ O[$t] = O[Jn] = O[co] = O[uo] = O[Qn] = O[eo] = O[po] = O[mo] = O[go] = O[fo] = O[yo] = O[so] = O[no] = O[Ot] = O[oo] = O[ro] = O[ao] = O[lo] = O[wo] = O[vo] = O[Co] = O[bo] = !0;
2326
+ O[to] = O[Ht] = O[ho] = !1;
2020
2327
  function De(h, t, e, i, n, s) {
2021
2328
  var o;
2022
2329
  if (o !== void 0)
2023
2330
  return o;
2024
- if (!He(h))
2331
+ if (!Oe(h))
2025
2332
  return h;
2026
2333
  var r = Le(h);
2027
2334
  if (r)
2028
- o = yn(h);
2335
+ o = vn(h);
2029
2336
  else {
2030
- var a = re(h), l = a == Ot || a == eo;
2337
+ var a = re(h), l = a == Ht || a == io;
2031
2338
  if (St(h))
2032
- return en(h);
2033
- if (a == Ht || a == Rt || l && !n)
2034
- o = l ? {} : Yn(h);
2339
+ return sn(h);
2340
+ if (a == Ot || a == $t || l && !n)
2341
+ o = l ? {} : jn(h);
2035
2342
  else {
2036
- if (!H[a])
2343
+ if (!O[a])
2037
2344
  return n ? h : {};
2038
- o = Bn(h, a);
2345
+ o = Vn(h, a);
2039
2346
  }
2040
2347
  }
2041
2348
  s || (s = new ve());
2042
2349
  var d = s.get(h);
2043
2350
  if (d)
2044
2351
  return d;
2045
- s.set(h, o), Xn(h) ? h.forEach(function(g) {
2046
- o.add(De(g, t, e, g, h, s));
2047
- }) : Vn(h) && h.forEach(function(g, m) {
2048
- o.set(m, De(g, t, e, m, h, s));
2352
+ s.set(h, o), Zn(h) ? h.forEach(function(p) {
2353
+ o.add(De(p, t, e, p, h, s));
2354
+ }) : Kn(h) && h.forEach(function(p, m) {
2355
+ o.set(m, De(p, t, e, m, h, s));
2049
2356
  });
2050
- var u = ln, p = r ? void 0 : u(h);
2051
- return bi(p || h, function(g, m) {
2052
- p && (m = g, g = h[m]), Ti(o, m, De(g, t, e, m, h, s));
2357
+ var u = cn, g = r ? void 0 : u(h);
2358
+ return Li(g || h, function(p, m) {
2359
+ g && (m = p, p = h[m]), Di(o, m, De(p, t, e, m, h, s));
2053
2360
  }), o;
2054
2361
  }
2055
- var Co = 1, bo = 4;
2362
+ var Po = 1, Lo = 4;
2056
2363
  function _e(h) {
2057
- return De(h, Co | bo);
2364
+ return De(h, Po | Lo);
2058
2365
  }
2059
- var Po = /* @__PURE__ */ ((h) => (h.Rotate = "rotate", h.Move = "move", h.Scale = "scale", h.MoveHeight = "moveHeight", h.Empty = "", h))(Po || {}), Lo = /* @__PURE__ */ ((h) => (h.Scale = "addScale", h.Rotate = "rotate", h.Translation = "translation", h.Remove = "removeById", h.Add = "add", h))(Lo || {});
2060
- class _o {
2366
+ var Eo = /* @__PURE__ */ ((h) => (h.Rotate = "rotate", h.Move = "move", h.Scale = "scale", h.MoveHeight = "moveHeight", h.Empty = "", h))(Eo || {}), Mo = /* @__PURE__ */ ((h) => (h.Scale = "addScale", h.Rotate = "rotate", h.Translation = "translation", h.Remove = "removeById", h.Add = "add", h))(Mo || {});
2367
+ class So {
2061
2368
  constructor(t) {
2062
2369
  c(this, "primitives", /* @__PURE__ */ new Map());
2063
2370
  c(this, "eventListener", /* @__PURE__ */ new Map());
@@ -2159,8 +2466,8 @@ class _o {
2159
2466
  * @return {*}
2160
2467
  */
2161
2468
  async add(t, e = !0) {
2162
- var g, m, f, y, v;
2163
- const i = this.viewer, n = this.Cesium, s = n.Math.toRadians(((g = t.headingPitchRoll) == null ? void 0 : g.heading) || 0), o = n.Math.toRadians(((m = t.headingPitchRoll) == null ? void 0 : m.pitch) || 0), r = n.Math.toRadians(((f = t.headingPitchRoll) == null ? void 0 : f.roll) || 0), a = new n.HeadingPitchRoll(s, o, r);
2469
+ var p, m, f, y, w;
2470
+ const i = this.viewer, n = this.Cesium, s = n.Math.toRadians(((p = t.headingPitchRoll) == null ? void 0 : p.heading) || 0), o = n.Math.toRadians(((m = t.headingPitchRoll) == null ? void 0 : m.pitch) || 0), r = n.Math.toRadians(((f = t.headingPitchRoll) == null ? void 0 : f.roll) || 0), a = new n.HeadingPitchRoll(s, o, r);
2164
2471
  let l = t.position;
2165
2472
  if (Le(l) ? l = n.Cartesian3.fromDegrees(l[0], l[1], l[2] || 0) : l && typeof l == "object" && typeof l.lng < "u" && typeof l.lat < "u" && (l = n.Cartesian3.fromDegrees(l.lng, l.lat, l.height || 0)), !l)
2166
2473
  throw new Error("GLTFManage.add 缺少有效 position");
@@ -2169,15 +2476,15 @@ class _o {
2169
2476
  ...t.model,
2170
2477
  modelMatrix: d
2171
2478
  };
2172
- let p;
2479
+ let g;
2173
2480
  if (typeof ((y = n == null ? void 0 : n.Model) == null ? void 0 : y.fromGltf) == "function")
2174
- p = i.scene.primitives.add(n.Model.fromGltf(u));
2175
- else if (typeof ((v = n == null ? void 0 : n.Model) == null ? void 0 : v.fromGltfAsync) == "function") {
2176
- const w = await n.Model.fromGltfAsync(u);
2177
- p = i.scene.primitives.add(w);
2481
+ g = i.scene.primitives.add(n.Model.fromGltf(u));
2482
+ else if (typeof ((w = n == null ? void 0 : n.Model) == null ? void 0 : w.fromGltfAsync) == "function") {
2483
+ const v = await n.Model.fromGltfAsync(u);
2484
+ g = i.scene.primitives.add(v);
2178
2485
  } else
2179
2486
  throw new Error("Cesium.Model.fromGltf / fromGltfAsync 均不可用");
2180
- p.scale = 1, p.__sceneGadgetScale = this.getPrimitiveScale({ modelMatrix: d }), this.initializePrimitiveRuntimeState(p), this.primitives.set(t.id, p), p.show = e, this.runEventListener("add", { info: t, gltf: p });
2487
+ g.scale = 1, g.__sceneGadgetScale = this.getPrimitiveScale({ modelMatrix: d }), this.initializePrimitiveRuntimeState(g), this.primitives.set(t.id, g), g.show = e, this.runEventListener("add", { info: t, gltf: g });
2181
2488
  }
2182
2489
  flyTo(t) {
2183
2490
  const e = this.viewer;
@@ -2403,7 +2710,7 @@ class _o {
2403
2710
  n.Matrix4.fromScale(l),
2404
2711
  new n.Matrix4()
2405
2712
  );
2406
- const u = this.getPrimitiveScale(t), p = this.getPrimitiveRuntimeRadius(t), g = this.getPrimitiveEffectiveRadius(t);
2713
+ const u = this.getPrimitiveScale(t), g = this.getPrimitiveRuntimeRadius(t), p = this.getPrimitiveEffectiveRadius(t);
2407
2714
  return this.debugLog("applyScaleToPrimitive", {
2408
2715
  id: t == null ? void 0 : t.id,
2409
2716
  inputScale: e,
@@ -2411,9 +2718,9 @@ class _o {
2411
2718
  beforeScale: s,
2412
2719
  afterScale: u,
2413
2720
  beforeRadius: o,
2414
- afterRadius: p,
2721
+ afterRadius: g,
2415
2722
  beforeEffectiveRadius: r,
2416
- afterEffectiveRadius: g
2723
+ afterEffectiveRadius: p
2417
2724
  }), t.modelMatrix;
2418
2725
  }
2419
2726
  getGizmoModelMatrix(t) {
@@ -2497,9 +2804,9 @@ class _o {
2497
2804
  */
2498
2805
  initEditBox(t) {
2499
2806
  const e = this.Cesium, i = this.viewer, n = i.scene;
2500
- let s = null, o = null, r = null, a = null, l = "", d = "", u = null, p = null, g = null, m = null;
2807
+ let s = null, o = null, r = null, a = null, l = "", d = "", u = null, g = null, p = null, m = null;
2501
2808
  const f = () => {
2502
- s = null, o = null, r = null, a = null, l = "", d = "", u = null, p = null, g = null, m = null, this.hideFeedback(), this.unlockCamera();
2809
+ s = null, o = null, r = null, a = null, l = "", d = "", u = null, g = null, p = null, m = null, this.hideFeedback(), this.unlockCamera();
2503
2810
  }, y = (P) => {
2504
2811
  const b = (C) => (P.split(C)[1] || "").split("_");
2505
2812
  if (P.includes("moveAxis_")) {
@@ -2527,37 +2834,37 @@ class _o {
2527
2834
  return { modelId: C[0], mode: "scale", axis: String(C[1] || "").toUpperCase() };
2528
2835
  }
2529
2836
  return P.includes("scaleCenter_") ? { modelId: b("scaleCenter_")[0], mode: "scale", axis: "CENTER" } : P.includes("scaleCenterHit_") ? { modelId: b("scaleCenterHit_")[0], mode: "scale", axis: "CENTER" } : null;
2530
- }, v = (P) => {
2837
+ }, w = (P) => {
2531
2838
  if (this.editMode !== "scale" || !this.activeModelId || !P || !(n != null && n.drillPick))
2532
2839
  return !1;
2533
2840
  try {
2534
2841
  return (n.drillPick(P, 12) || []).some((C) => {
2535
- const E = this.getPickDebugId(C);
2536
- if (typeof E != "string") return !1;
2537
- const L = y(E);
2538
- return (L == null ? void 0 : L.mode) === "scale" && (L == null ? void 0 : L.axis) === "CENTER" && (L == null ? void 0 : L.modelId) === this.activeModelId;
2842
+ const L = this.getPickDebugId(C);
2843
+ if (typeof L != "string") return !1;
2844
+ const E = y(L);
2845
+ return (E == null ? void 0 : E.mode) === "scale" && (E == null ? void 0 : E.axis) === "CENTER" && (E == null ? void 0 : E.modelId) === this.activeModelId;
2539
2846
  });
2540
2847
  } catch {
2541
2848
  return !1;
2542
2849
  }
2543
- }, w = (P, b, C, E) => {
2850
+ }, v = (P, b, C, L) => {
2544
2851
  if (s = this.primitives.get(P), s) {
2545
- l = C, d = E, o = e.Matrix4.clone(s.modelMatrix), a = this.normalizeScaleVector(this.getPrimitiveScale(s));
2546
- const L = e.Matrix4.getTranslation(
2852
+ l = C, d = L, o = e.Matrix4.clone(s.modelMatrix), a = this.normalizeScaleVector(this.getPrimitiveScale(s));
2853
+ const E = e.Matrix4.getTranslation(
2547
2854
  o,
2548
2855
  new e.Cartesian3()
2549
2856
  );
2550
- g = e.Cartesian3.clone(L), r = e.Cartesian2.clone(
2857
+ p = e.Cartesian3.clone(E), r = e.Cartesian2.clone(
2551
2858
  b.position || b.endPosition,
2552
2859
  new e.Cartesian2()
2553
2860
  );
2554
- const M = e.Transforms.eastNorthUpToFixedFrame(g);
2861
+ const M = e.Transforms.eastNorthUpToFixedFrame(p);
2555
2862
  let x = new e.Cartesian3();
2556
- C === "move" ? E === "XY" ? e.Matrix4.getColumn(M, 2, x) : E === "YZ" ? e.Matrix4.getColumn(M, 0, x) : E === "ZX" ? e.Matrix4.getColumn(M, 1, x) : x = e.Cartesian3.clone(i.scene.camera.direction) : C === "rotate" ? (E === "X" && e.Matrix4.getColumn(M, 0, x), E === "Y" && e.Matrix4.getColumn(M, 1, x), E === "Z" && e.Matrix4.getColumn(M, 2, x)) : x = e.Cartesian3.clone(i.scene.camera.direction), e.Cartesian3.normalize(x, x), u = e.Plane.fromPointNormal(g, x);
2863
+ C === "move" ? L === "XY" ? e.Matrix4.getColumn(M, 2, x) : L === "YZ" ? e.Matrix4.getColumn(M, 0, x) : L === "ZX" ? e.Matrix4.getColumn(M, 1, x) : x = e.Cartesian3.clone(i.scene.camera.direction) : C === "rotate" ? (L === "X" && e.Matrix4.getColumn(M, 0, x), L === "Y" && e.Matrix4.getColumn(M, 1, x), L === "Z" && e.Matrix4.getColumn(M, 2, x)) : x = e.Cartesian3.clone(i.scene.camera.direction), e.Cartesian3.normalize(x, x), u = e.Plane.fromPointNormal(p, x);
2557
2864
  const I = i.camera.getPickRay(b.position || b.endPosition);
2558
- p = I && u ? e.IntersectionTests.rayPlane(I, u) : null, p && (m = e.Cartesian3.subtract(
2559
- p,
2865
+ g = I && u ? e.IntersectionTests.rayPlane(I, u) : null, g && (m = e.Cartesian3.subtract(
2560
2866
  g,
2867
+ p,
2561
2868
  new e.Cartesian3()
2562
2869
  ), e.Cartesian3.magnitudeSquared(m) > 0 && e.Cartesian3.normalize(m, m)), this.lockCamera();
2563
2870
  }
@@ -2566,8 +2873,8 @@ class _o {
2566
2873
  var M, x;
2567
2874
  if (!t()) return;
2568
2875
  (this.editMode === "scale" || this.editMode === "move") && this.debugPickStack(P.position, this.editMode);
2569
- const C = n.pick(P.position), E = (C == null ? void 0 : C.id) || ((M = C == null ? void 0 : C.primitive) == null ? void 0 : M.id);
2570
- if (typeof E != "string") {
2876
+ const C = n.pick(P.position), L = (C == null ? void 0 : C.id) || ((M = C == null ? void 0 : C.primitive) == null ? void 0 : M.id);
2877
+ if (typeof L != "string") {
2571
2878
  this.editMode === "scale" && this.debugLog("scale:leftDown:miss", {
2572
2879
  activeModelId: this.activeModelId,
2573
2880
  pickedPrimitiveId: (x = C == null ? void 0 : C.primitive) == null ? void 0 : x.id,
@@ -2575,29 +2882,29 @@ class _o {
2575
2882
  });
2576
2883
  return;
2577
2884
  }
2578
- let L = y(E);
2885
+ let E = y(L);
2579
2886
  this.editMode === "scale" && this.debugLog("scale:leftDown:hit", {
2580
2887
  activeModelId: this.activeModelId,
2581
- hitId: E,
2582
- hitInfo: L
2583
- }), L != null && L.modelId && (this.setEditMode(L.mode), w(L.modelId, P, L.mode, L.axis), L.mode === "scale" && L.axis === "CENTER" && this.debugLog("scale:center:drag-start", {
2584
- modelId: L.modelId,
2888
+ hitId: L,
2889
+ hitInfo: E
2890
+ }), E != null && E.modelId && (this.setEditMode(E.mode), v(E.modelId, P, E.mode, E.axis), E.mode === "scale" && E.axis === "CENTER" && this.debugLog("scale:center:drag-start", {
2891
+ modelId: E.modelId,
2585
2892
  startMousePosition: P.position
2586
2893
  }));
2587
2894
  }, e.ScreenSpaceEventType.LEFT_DOWN), this.handler.setInputAction((P) => {
2588
- if (t() && (l === "" ? v(P.endPosition) ? this.showHoverModeHint("向上拖放大,向下拖缩小") : this.scaleCenterHintVisible && this.hideModeHint() : this.scaleCenterHintVisible && this.hideModeHint(), l != "" && s && u && g && p)) {
2589
- const C = i.camera.getPickRay(P.endPosition), E = C ? e.IntersectionTests.rayPlane(C, u) : null;
2590
- if (!E) return;
2591
- l === "rotate" ? this.rotateModel(s, o, d, g, m, E) : l === "move" ? this.moveModel(s, o, d, g, p, E) : l === "scale" && this.moveModelScale(
2895
+ if (t() && (l === "" ? w(P.endPosition) ? this.showHoverModeHint("向上拖放大,向下拖缩小") : this.scaleCenterHintVisible && this.hideModeHint() : this.scaleCenterHintVisible && this.hideModeHint(), l != "" && s && u && p && g)) {
2896
+ const C = i.camera.getPickRay(P.endPosition), L = C ? e.IntersectionTests.rayPlane(C, u) : null;
2897
+ if (!L) return;
2898
+ l === "rotate" ? this.rotateModel(s, o, d, p, m, L) : l === "move" ? this.moveModel(s, o, d, p, g, L) : l === "scale" && this.moveModelScale(
2592
2899
  s,
2593
2900
  o,
2594
2901
  d,
2595
- g,
2596
- r,
2597
2902
  p,
2903
+ r,
2904
+ g,
2598
2905
  a,
2599
2906
  P.endPosition,
2600
- E
2907
+ L
2601
2908
  );
2602
2909
  }
2603
2910
  }, e.ScreenSpaceEventType.MOUSE_MOVE), this.handler.setInputAction(() => {
@@ -2786,15 +3093,15 @@ class _o {
2786
3093
  }
2787
3094
  const o = s.center, r = (e = (t = this.viewer) == null ? void 0 : t.scene) == null ? void 0 : e.canvas, a = Number((r == null ? void 0 : r.clientWidth) || (r == null ? void 0 : r.width) || 0), l = Number((r == null ? void 0 : r.clientHeight) || (r == null ? void 0 : r.height) || 0);
2788
3095
  if (this.modeToolbarEl && this.modeToolbarEl.style.display !== "none") {
2789
- const d = Number(this.modeToolbarEl.offsetWidth || 58), u = Number(this.modeToolbarEl.offsetHeight || 176), p = 18;
2790
- let g = s.maxX + p;
2791
- g + d > a - 12 && (g = s.minX - d - p), g = n.Math.clamp(g, 12, Math.max(12, a - d - 12));
3096
+ const d = Number(this.modeToolbarEl.offsetWidth || 58), u = Number(this.modeToolbarEl.offsetHeight || 176), g = 18;
3097
+ let p = s.maxX + g;
3098
+ p + d > a - 12 && (p = s.minX - d - g), p = n.Math.clamp(p, 12, Math.max(12, a - d - 12));
2792
3099
  const m = (s.minY + s.maxY) / 2, f = n.Math.clamp(
2793
3100
  m - u / 2,
2794
3101
  12,
2795
3102
  Math.max(12, l - u - 12)
2796
3103
  );
2797
- this.modeToolbarEl.style.left = `${g}px`, this.modeToolbarEl.style.top = `${f + u / 2}px`;
3104
+ this.modeToolbarEl.style.left = `${p}px`, this.modeToolbarEl.style.top = `${f + u / 2}px`;
2798
3105
  }
2799
3106
  if (this.feedbackLabelEl && this.feedbackLabelEl.style.display !== "none") {
2800
3107
  const d = this.feedbackAnchor || o, u = this.toWindowCoordinates(d);
@@ -2843,7 +3150,7 @@ class _o {
2843
3150
  });
2844
3151
  }
2845
3152
  getGizmoMetrics(t) {
2846
- const e = Math.max(this.getPrimitiveEffectiveRadius(t), 8), i = Math.max(e * 0.08, 2.2), n = Math.max(e * 1.25, 20), s = Math.max(e * 0.28, 6), o = Math.max(e * 0.065, 1.8), r = Math.max(e * 0.028, 1.1), a = Math.max(i * 2.2, e * 0.18), l = Math.max(e * 0.62, a + 6), d = Math.max(e * 0.018, 0.8), u = Math.max(e * 1.02, 18), p = Math.max(e * 0.024, 1.15), g = Math.max(e * 1.06, 18), m = Math.max(e * 0.075, 2.4);
3153
+ const e = Math.max(this.getPrimitiveEffectiveRadius(t), 8), i = Math.max(e * 0.08, 2.2), n = Math.max(e * 1.25, 20), s = Math.max(e * 0.28, 6), o = Math.max(e * 0.065, 1.8), r = Math.max(e * 0.028, 1.1), a = Math.max(i * 2.2, e * 0.18), l = Math.max(e * 0.62, a + 6), d = Math.max(e * 0.018, 0.8), u = Math.max(e * 1.02, 18), g = Math.max(e * 0.024, 1.15), p = Math.max(e * 1.06, 18), m = Math.max(e * 0.075, 2.4);
2847
3154
  return {
2848
3155
  centerRadius: i,
2849
3156
  axisLength: n,
@@ -2854,17 +3161,17 @@ class _o {
2854
3161
  planeEnd: l,
2855
3162
  planeThickness: d,
2856
3163
  rotationRadius: u,
2857
- rotationThickness: p,
2858
- scaleOffset: g,
3164
+ rotationThickness: g,
3165
+ scaleOffset: p,
2859
3166
  scaleHandleRadius: m
2860
3167
  };
2861
3168
  }
2862
3169
  createSegmentInstance(t, e, i, n, s) {
2863
3170
  const o = this.Cesium, r = o.Cartesian3.subtract(i, e, new o.Cartesian3()), a = o.Cartesian3.magnitude(r);
2864
3171
  if (!Number.isFinite(a) || a <= 0) return null;
2865
- const l = o.Cartesian3.normalize(r, new o.Cartesian3()), d = o.Cartesian3.midpoint(e, i, new o.Cartesian3()), u = o.Cartesian3.UNIT_X, p = o.Cartesian3.cross(u, l, new o.Cartesian3()), g = o.Cartesian3.magnitude(p), m = o.Math.clamp(o.Cartesian3.dot(u, l), -1, 1);
3172
+ const l = o.Cartesian3.normalize(r, new o.Cartesian3()), d = o.Cartesian3.midpoint(e, i, new o.Cartesian3()), u = o.Cartesian3.UNIT_X, g = o.Cartesian3.cross(u, l, new o.Cartesian3()), p = o.Cartesian3.magnitude(g), m = o.Math.clamp(o.Cartesian3.dot(u, l), -1, 1);
2866
3173
  let f = o.Quaternion.clone(o.Quaternion.IDENTITY);
2867
- return g > 1e-6 ? (o.Cartesian3.normalize(p, p), f = o.Quaternion.fromAxisAngle(p, Math.acos(m))) : m < 0 && (f = o.Quaternion.fromAxisAngle(o.Cartesian3.UNIT_Z, Math.PI)), new o.GeometryInstance({
3174
+ return p > 1e-6 ? (o.Cartesian3.normalize(g, g), f = o.Quaternion.fromAxisAngle(g, Math.acos(m))) : m < 0 && (f = o.Quaternion.fromAxisAngle(o.Cartesian3.UNIT_Z, Math.PI)), new o.GeometryInstance({
2868
3175
  id: t,
2869
3176
  geometry: this.createUnitBoxGeometry(),
2870
3177
  modelMatrix: o.Matrix4.fromTranslationQuaternionRotationScale(
@@ -3070,32 +3377,32 @@ class _o {
3070
3377
  color: e.Color.YELLOW.withAlpha(0.92)
3071
3378
  }
3072
3379
  ].flatMap((u) => {
3073
- const p = [];
3074
- for (let g = 0; g < 90; g += s) {
3075
- const m = e.Math.toRadians(g), f = e.Math.toRadians(g + s), y = this.getRotationPlanePoint(
3380
+ const g = [];
3381
+ for (let p = 0; p < 90; p += s) {
3382
+ const m = e.Math.toRadians(p), f = e.Math.toRadians(p + s), y = this.getRotationPlanePoint(
3076
3383
  u.plane,
3077
3384
  n.rotationRadius,
3078
3385
  m
3079
- ), v = this.getRotationPlanePoint(u.plane, n.rotationRadius, f), w = this.createSegmentInstance(
3080
- `rotationArc_${t.id}_${u.axis}_${g}`,
3386
+ ), w = this.getRotationPlanePoint(u.plane, n.rotationRadius, f), v = this.createSegmentInstance(
3387
+ `rotationArc_${t.id}_${u.axis}_${p}`,
3081
3388
  y,
3082
- v,
3389
+ w,
3083
3390
  n.rotationThickness,
3084
3391
  u.color
3085
3392
  );
3086
- w && p.push(w);
3393
+ v && g.push(v);
3087
3394
  for (let P = 0; P < o; P += 1) {
3088
- const b = r + l * (P + 0.5), C = this.getRotationPlanePoint(u.plane, b, m), E = this.getRotationPlanePoint(u.plane, b, f), L = this.createSegmentInstance(
3089
- `rotationSector_${t.id}_${u.axis}_${P}_${g}`,
3395
+ const b = r + l * (P + 0.5), C = this.getRotationPlanePoint(u.plane, b, m), L = this.getRotationPlanePoint(u.plane, b, f), E = this.createSegmentInstance(
3396
+ `rotationSector_${t.id}_${u.axis}_${P}_${p}`,
3090
3397
  C,
3091
- E,
3398
+ L,
3092
3399
  Math.max(l * 0.92, n.rotationThickness * 1.4),
3093
3400
  u.color.withAlpha(0.04)
3094
3401
  );
3095
- L && p.push(L);
3402
+ E && g.push(E);
3096
3403
  }
3097
3404
  }
3098
- return p;
3405
+ return g;
3099
3406
  });
3100
3407
  this.rotationRing = new e.Primitive({
3101
3408
  geometryInstances: d,
@@ -3181,15 +3488,15 @@ class _o {
3181
3488
  topRadius: o,
3182
3489
  bottomRadius: o
3183
3490
  })
3184
- ), p = e.CylinderGeometry.createGeometry(
3491
+ ), g = e.CylinderGeometry.createGeometry(
3185
3492
  new e.CylinderGeometry({
3186
3493
  length: l,
3187
3494
  topRadius: 0,
3188
3495
  bottomRadius: r
3189
3496
  })
3190
3497
  );
3191
- let g = a + d, m = (a + d) / 2;
3192
- this.translate(u, [0, 0, m]), this.translate(p, [0, 0, g]), this.heightArrow = new e.Primitive({
3498
+ let p = a + d, m = (a + d) / 2;
3499
+ this.translate(u, [0, 0, m]), this.translate(g, [0, 0, p]), this.heightArrow = new e.Primitive({
3193
3500
  modelMatrix: t.modelMatrix,
3194
3501
  geometryInstances: [
3195
3502
  new e.GeometryInstance({
@@ -3201,7 +3508,7 @@ class _o {
3201
3508
  }),
3202
3509
  new e.GeometryInstance({
3203
3510
  id: `heightArrow-arrow_${t.id}`,
3204
- geometry: p,
3511
+ geometry: g,
3205
3512
  attributes: {
3206
3513
  color: e.ColorGeometryInstanceAttribute.fromColor(s.withAlpha(0.9))
3207
3514
  }
@@ -3337,10 +3644,10 @@ class _o {
3337
3644
  new r.Matrix4()
3338
3645
  );
3339
3646
  t.modelMatrix = u, this.updatedTool(u);
3340
- const p = r.Matrix4.getTranslation(u, new r.Cartesian3()), g = r.Cartesian3.magnitude(d), m = ["XY", "YZ", "ZX"].includes(i) ? i : `${i}轴`;
3341
- this.showFeedback(`${m} ${g.toFixed(2)} m`, p), this.writeDragEndPayload(t.id, "translation", {
3647
+ const g = r.Matrix4.getTranslation(u, new r.Cartesian3()), p = r.Cartesian3.magnitude(d), m = ["XY", "YZ", "ZX"].includes(i) ? i : `${i}轴`;
3648
+ this.showFeedback(`${m} ${p.toFixed(2)} m`, g), this.writeDragEndPayload(t.id, "translation", {
3342
3649
  id: t.id,
3343
- position: p
3650
+ position: g
3344
3651
  });
3345
3652
  }
3346
3653
  /**
@@ -3361,15 +3668,15 @@ class _o {
3361
3668
  o.longitude,
3362
3669
  o.latitude,
3363
3670
  (l == null ? void 0 : l.height) || o.height || 0
3364
- ), u = r.Cartographic.toCartesian(d), p = r.Matrix4.getRotation(e, new r.Matrix3()), g = r.Matrix4.fromRotationTranslation(p, u);
3365
- t.modelMatrix = g, this.updatedTool(g), this.showFeedback(
3671
+ ), u = r.Cartographic.toCartesian(d), g = r.Matrix4.getRotation(e, new r.Matrix3()), p = r.Matrix4.fromRotationTranslation(g, u);
3672
+ t.modelMatrix = p, this.updatedTool(p), this.showFeedback(
3366
3673
  `${(((l == null ? void 0 : l.height) || 0) - (o.height || 0)).toFixed(2)} m`,
3367
3674
  u
3368
3675
  );
3369
3676
  let m = new r.Cartesian3(
3370
- g[12],
3371
- g[13],
3372
- g[14]
3677
+ p[12],
3678
+ p[13],
3679
+ p[14]
3373
3680
  ), f = this.dragEndCallbackMap.get(t.id);
3374
3681
  f || (f = /* @__PURE__ */ new Map(), this.dragEndCallbackMap.set(t.id, f)), f.set("translation", {
3375
3682
  id: t.id,
@@ -3382,12 +3689,12 @@ class _o {
3382
3689
  if (!t || !e || !i) return null;
3383
3690
  const o = s.camera.getPickRay(t);
3384
3691
  if (!o) return null;
3385
- const r = o.origin, a = n.Cartesian3.normalize(o.direction, new n.Cartesian3()), l = e, d = i, u = n.Cartesian3.subtract(r, l, new n.Cartesian3()), p = n.Cartesian3.dot(a, a), g = -n.Cartesian3.dot(a, d), m = n.Cartesian3.dot(d, d), f = -n.Cartesian3.dot(a, u), y = n.Cartesian3.dot(d, u), v = p * m - g * g;
3386
- if (Math.abs(v) < 1e-6) return null;
3387
- const w = (p * y - g * f) / v;
3692
+ const r = o.origin, a = n.Cartesian3.normalize(o.direction, new n.Cartesian3()), l = e, d = i, u = n.Cartesian3.subtract(r, l, new n.Cartesian3()), g = n.Cartesian3.dot(a, a), p = -n.Cartesian3.dot(a, d), m = n.Cartesian3.dot(d, d), f = -n.Cartesian3.dot(a, u), y = n.Cartesian3.dot(d, u), w = g * m - p * p;
3693
+ if (Math.abs(w) < 1e-6) return null;
3694
+ const v = (g * y - p * f) / w;
3388
3695
  return n.Cartesian3.add(
3389
3696
  l,
3390
- n.Cartesian3.multiplyByScalar(d, w, new n.Cartesian3()),
3697
+ n.Cartesian3.multiplyByScalar(d, v, new n.Cartesian3()),
3391
3698
  new n.Cartesian3()
3392
3699
  );
3393
3700
  }
@@ -3408,24 +3715,24 @@ class _o {
3408
3715
  );
3409
3716
  if (r.Cartesian3.magnitudeSquared(a) <= 1e-6) return;
3410
3717
  r.Cartesian3.normalize(a, a);
3411
- const l = r.Transforms.eastNorthUpToFixedFrame(n), d = this.getAxisVector(l, i), u = r.Math.clamp(r.Cartesian3.dot(s, a), -1, 1), p = Math.acos(u);
3412
- if (!Number.isFinite(p) || p <= 1e-6) return;
3413
- const g = r.Cartesian3.cross(
3718
+ const l = r.Transforms.eastNorthUpToFixedFrame(n), d = this.getAxisVector(l, i), u = r.Math.clamp(r.Cartesian3.dot(s, a), -1, 1), g = Math.acos(u);
3719
+ if (!Number.isFinite(g) || g <= 1e-6) return;
3720
+ const p = r.Cartesian3.cross(
3414
3721
  s,
3415
3722
  a,
3416
3723
  new r.Cartesian3()
3417
- ), m = r.Cartesian3.dot(g, d) >= 0 ? 1 : -1, f = p * m, y = r.Quaternion.fromAxisAngle(d, f), v = r.Matrix4.fromRotationTranslation(
3724
+ ), m = r.Cartesian3.dot(p, d) >= 0 ? 1 : -1, f = g * m, y = r.Quaternion.fromAxisAngle(d, f), w = r.Matrix4.fromRotationTranslation(
3418
3725
  r.Matrix3.fromQuaternion(y)
3419
- ), w = this.applyTransformAroundCenter(
3726
+ ), v = this.applyTransformAroundCenter(
3420
3727
  e,
3421
3728
  n,
3422
- v
3729
+ w
3423
3730
  );
3424
- t.modelMatrix = w, this.updatedTool(w);
3425
- const P = r.Matrix4.getTranslation(w, new r.Cartesian3());
3731
+ t.modelMatrix = v, this.updatedTool(v);
3732
+ const P = r.Matrix4.getTranslation(v, new r.Cartesian3());
3426
3733
  this.showFeedback(`${i}轴 ${r.Math.toDegrees(f).toFixed(1)}°`, P);
3427
3734
  const b = this.getModelHeadingPitchRoll(
3428
- this.extractModelBaseMatrix(w)
3735
+ this.extractModelBaseMatrix(v)
3429
3736
  );
3430
3737
  this.writeDragEndPayload(t.id, "rotate", {
3431
3738
  id: t.id,
@@ -3439,7 +3746,7 @@ class _o {
3439
3746
  moveModelScale(t, e, i, n, s, o, r, a, l) {
3440
3747
  const d = this.Cesium;
3441
3748
  if (!r) return;
3442
- const u = this.getGizmoMetrics(t), p = d.Transforms.eastNorthUpToFixedFrame(n), g = Math.max(u.scaleOffset * 0.7, 8);
3749
+ const u = this.getGizmoMetrics(t), g = d.Transforms.eastNorthUpToFixedFrame(n), p = Math.max(u.scaleOffset * 0.7, 8);
3443
3750
  let m = 0;
3444
3751
  if (i === "CENTER") {
3445
3752
  if (!s || !a) return;
@@ -3451,8 +3758,8 @@ class _o {
3451
3758
  l,
3452
3759
  o,
3453
3760
  new d.Cartesian3()
3454
- ), C = this.getAxisVector(p, i);
3455
- m = d.Cartesian3.dot(b, C) / g;
3761
+ ), C = this.getAxisVector(g, i);
3762
+ m = d.Cartesian3.dot(b, C) / p;
3456
3763
  }
3457
3764
  const f = Math.max(0.05, 1 + m), y = {
3458
3765
  x: r.x,
@@ -3468,9 +3775,9 @@ class _o {
3468
3775
  );
3469
3776
  y[i.toLowerCase()] = b;
3470
3777
  }
3471
- const v = this.extractModelBaseMatrix(e);
3472
- this.applyScaleToPrimitive(t, y, v), this.activeModelId === t.id ? this.refreshActiveToolGeometry() : this.updatedTool(t.modelMatrix);
3473
- const w = d.Matrix4.getTranslation(t.modelMatrix, new d.Cartesian3()), P = i === "CENTER" ? `${Math.max(y.x, y.y, y.z).toFixed(2)}x` : `${i}轴 ${y[i.toLowerCase()].toFixed(2)}x`;
3778
+ const w = this.extractModelBaseMatrix(e);
3779
+ this.applyScaleToPrimitive(t, y, w), this.activeModelId === t.id ? this.refreshActiveToolGeometry() : this.updatedTool(t.modelMatrix);
3780
+ const v = d.Matrix4.getTranslation(t.modelMatrix, new d.Cartesian3()), P = i === "CENTER" ? `${Math.max(y.x, y.y, y.z).toFixed(2)}x` : `${i}轴 ${y[i.toLowerCase()].toFixed(2)}x`;
3474
3781
  this.debugLog("moveModelScale", {
3475
3782
  id: t == null ? void 0 : t.id,
3476
3783
  axis: i,
@@ -3483,7 +3790,7 @@ class _o {
3483
3790
  deltaFactor: m,
3484
3791
  factor: f,
3485
3792
  runtimeRadius: this.getPrimitiveRuntimeRadius(t)
3486
- }), this.showFeedback(P, w), this.writeDragEndPayload(t.id, "addScale", {
3793
+ }), this.showFeedback(P, v), this.writeDragEndPayload(t.id, "addScale", {
3487
3794
  id: t.id,
3488
3795
  scale: y
3489
3796
  });
@@ -3493,7 +3800,7 @@ class _o {
3493
3800
  this.deactivateEdit(), this.hideModeHint(), (t = this.tooltipManager) == null || t.destroy(), this.tooltipManager = null, this.overlayUpdateFn && (this.viewer.scene.postRender.removeEventListener(this.overlayUpdateFn), this.overlayUpdateFn = null), (e = this.overlayContainer) == null || e.remove(), this.overlayContainer = null, this.modeToolbarEl = null, this.feedbackLabelEl = null, this.handler && (this.handler.destroy(), this.handler = null);
3494
3801
  }
3495
3802
  }
3496
- function Do(h, t) {
3803
+ function Ao(h, t) {
3497
3804
  const e = t.materialType || "DynamicImgMaterial" + Date.now() + Math.floor(Math.random() * 1e3);
3498
3805
  function i(s) {
3499
3806
  this._definitionChanged = new h.Event(), this._color = s.color, this._colorSubscription = void 0, this.color = s.color, this.duration = s.duration, this._time = Date.now();
@@ -3556,7 +3863,7 @@ function Do(h, t) {
3556
3863
  }
3557
3864
  }), new i(t);
3558
3865
  }
3559
- function So(h, t) {
3866
+ function ko(h, t) {
3560
3867
  const e = t.MaterialType || "wallType" + (/* @__PURE__ */ new Date()).getTime() + parseInt(Math.random() * 1e3 + "");
3561
3868
  function i(s) {
3562
3869
  this._definitionChanged = new h.Event(), this._color = void 0, this._colorSubscription = void 0, this.color = s.color, this.duration = s.duration, this._time = (/* @__PURE__ */ new Date()).getTime();
@@ -3619,8 +3926,8 @@ function So(h, t) {
3619
3926
  }
3620
3927
  }), new i(t);
3621
3928
  }
3622
- function Ao(h, t) {
3623
- const e = h.Color, i = Object.defineProperties, n = h.Event, s = h.createPropertyDescriptor, o = h.Property, r = (u, p) => u === void 0 ? p : u, a = {};
3929
+ function Ro(h, t) {
3930
+ const e = h.Color, i = Object.defineProperties, n = h.Event, s = h.createPropertyDescriptor, o = h.Property, r = (u, g) => u === void 0 ? g : u, a = {};
3624
3931
  let l = t.materialType || "PolylineFlow" + Date.now() + Math.floor(Math.random() * 1e3);
3625
3932
  function d(u) {
3626
3933
  u = r(u, a), this._definitionChanged = new n(), this._color = void 0, this._colorSubscription = void 0, this.color = u.color || e.fromBytes(0, 255, 255, 255), this._duration = void 0, this._durationSubscription = void 0, this.duration = r(u.duration, 45);
@@ -3638,13 +3945,13 @@ function Ao(h, t) {
3638
3945
  }
3639
3946
  }), d.prototype.getType = function(u) {
3640
3947
  return l;
3641
- }, d.prototype.getValue = function(u, p) {
3642
- return p || (p = {}), p.color = o.getValueOrClonedDefault(
3948
+ }, d.prototype.getValue = function(u, g) {
3949
+ return g || (g = {}), g.color = o.getValueOrClonedDefault(
3643
3950
  this._color,
3644
3951
  u,
3645
3952
  h.Color.WHITE,
3646
- p.color
3647
- ), p.duration = this._duration, p;
3953
+ g.color
3954
+ ), g.duration = this._duration, g;
3648
3955
  }, d.prototype.equals = function(u) {
3649
3956
  return this === u || u instanceof d && o.equals(this._color, u._color);
3650
3957
  }, i(d.prototype, {
@@ -3682,7 +3989,7 @@ function Ao(h, t) {
3682
3989
  }
3683
3990
  }), new d(t);
3684
3991
  }
3685
- class ko {
3992
+ class $o {
3686
3993
  constructor() {
3687
3994
  c(this, "categoryMap", /* @__PURE__ */ new Map());
3688
3995
  c(this, "CategoryGet", {});
@@ -3779,7 +4086,7 @@ class ko {
3779
4086
  return [...this.categoryMap.keys()];
3780
4087
  }
3781
4088
  }
3782
- class Eo {
4089
+ class xo {
3783
4090
  constructor(t) {
3784
4091
  c(this, "id");
3785
4092
  c(this, "entities", []);
@@ -3835,7 +4142,7 @@ class Eo {
3835
4142
  };
3836
4143
  }
3837
4144
  }
3838
- class Mo {
4145
+ class Io {
3839
4146
  constructor(t, e, i, n, s, o) {
3840
4147
  c(this, "id");
3841
4148
  c(this, "groupMap", /* @__PURE__ */ new Map());
@@ -3888,20 +4195,20 @@ class Mo {
3888
4195
  themeKey: t.theme,
3889
4196
  category: "wall",
3890
4197
  options: t
3891
- }), n = (w, P = 0) => {
3892
- const b = Number(w);
4198
+ }), n = (v, P = 0) => {
4199
+ const b = Number(v);
3893
4200
  return Number.isFinite(b) ? b : P;
3894
- }, s = t.positions.map((w) => n(w == null ? void 0 : w[2], 0)), o = n(t.minHeight, 0), r = n(t.maxHeight, 0), a = (w) => Array.isArray(w) && w.length === t.positions.length && w.every((P) => Math.abs(n(P, 0)) < 1e-6), l = s.some((w) => Math.abs(w) > 1e-6), p = (Array.isArray(t.minimumHeights) && t.minimumHeights.length === t.positions.length && !(a(t.minimumHeights) && l) ? t.minimumHeights.map((w) => n(w, 0)) : s).map((w) => w - o), f = (Array.isArray(t.maximumHeights) && t.maximumHeights.length === t.positions.length && !(a(t.maximumHeights) && l) ? t.maximumHeights.map((w) => n(w, 0)) : s).map((w) => w + r), y = t.positions.map(
3895
- (w) => this.Cesium.Cartesian3.fromDegrees(w[0], w[1], w[2] || 0)
4201
+ }, s = t.positions.map((v) => n(v == null ? void 0 : v[2], 0)), o = n(t.minHeight, 0), r = n(t.maxHeight, 0), a = (v) => Array.isArray(v) && v.length === t.positions.length && v.every((P) => Math.abs(n(P, 0)) < 1e-6), l = s.some((v) => Math.abs(v) > 1e-6), g = (Array.isArray(t.minimumHeights) && t.minimumHeights.length === t.positions.length && !(a(t.minimumHeights) && l) ? t.minimumHeights.map((v) => n(v, 0)) : s).map((v) => v - o), f = (Array.isArray(t.maximumHeights) && t.maximumHeights.length === t.positions.length && !(a(t.maximumHeights) && l) ? t.maximumHeights.map((v) => n(v, 0)) : s).map((v) => v + r), y = t.positions.map(
4202
+ (v) => this.Cesium.Cartesian3.fromDegrees(v[0], v[1], v[2] || 0)
3896
4203
  );
3897
- let v = {
4204
+ let w = {
3898
4205
  ...t
3899
4206
  };
3900
- return i && (v.material = i), this.viewer.entities.add({
4207
+ return i && (w.material = i), this.viewer.entities.add({
3901
4208
  wall: {
3902
- ...v,
4209
+ ...w,
3903
4210
  positions: y,
3904
- minimumHeights: p,
4211
+ minimumHeights: g,
3905
4212
  maximumHeights: f
3906
4213
  },
3907
4214
  show: (t.show ?? !0) && e
@@ -3981,7 +4288,7 @@ class Mo {
3981
4288
  });
3982
4289
  const r = this.createBillboardPoints(n);
3983
4290
  r.length && e && this.aggregator.appendPoints(r, !1), this.createCard(n);
3984
- const a = new Eo({
4291
+ const a = new xo({
3985
4292
  id: i,
3986
4293
  entities: s,
3987
4294
  primitives: [],
@@ -4038,7 +4345,7 @@ class Mo {
4038
4345
  this.groupMap.forEach((t) => t.removeAll(this.viewer)), this.groupMap.clear();
4039
4346
  }
4040
4347
  }
4041
- class $o {
4348
+ class Ho {
4042
4349
  constructor(t, e, i, n, s) {
4043
4350
  c(this, "Cesium");
4044
4351
  c(this, "viewer");
@@ -4051,7 +4358,7 @@ class $o {
4051
4358
  addLayer(t) {
4052
4359
  this.layerMap.has(t) || this.layerMap.set(
4053
4360
  t,
4054
- new Mo(
4361
+ new Io(
4055
4362
  t,
4056
4363
  this.Cesium,
4057
4364
  this.viewer,
@@ -4089,7 +4396,7 @@ class $o {
4089
4396
  (i = this.layerMap.get(t)) == null || i.removeGroups(e);
4090
4397
  }
4091
4398
  }
4092
- function Ro(h) {
4399
+ function Oo(h) {
4093
4400
  const t = [];
4094
4401
  return h.features.forEach((e, i) => {
4095
4402
  if (e.geometry && e.properties) {
@@ -4166,7 +4473,7 @@ function Ro(h) {
4166
4473
  }
4167
4474
  }), t;
4168
4475
  }
4169
- class Oo {
4476
+ class Fo {
4170
4477
  constructor(t) {
4171
4478
  c(this, "Cesium");
4172
4479
  c(this, "viewer");
@@ -4202,16 +4509,16 @@ class Oo {
4202
4509
  }
4203
4510
  //注册主题
4204
4511
  initTheme(t) {
4205
- var n, s, o, r, a, l, d, u, p, g, m, f;
4512
+ var n, s, o, r, a, l, d, u, g, p, m, f;
4206
4513
  let e = this.materialManager, i = this.Cesium;
4207
4514
  if (t.category == "polyline") {
4208
4515
  const y = ((s = (n = t.properties) == null ? void 0 : n.lineType) == null ? void 0 : s.pattern) && ((r = (o = t.properties) == null ? void 0 : o.lineType) == null ? void 0 : r.patternLength);
4209
- let v = "";
4516
+ let w = "";
4210
4517
  if (y) {
4211
- const w = ((l = (a = t.properties) == null ? void 0 : a.lineType) == null ? void 0 : l.pattern) || [0.25, -0.125], P = ((u = (d = t.properties) == null ? void 0 : d.lineType) == null ? void 0 : u.patternLength) || 0.375;
4212
- let b = this.convertCadPatternToCesiumDash(w, P);
4213
- v = `DashedLineMaterial_pattern_${b.dashPattern}_dashLength_${b.dashLength}_color_${(p = t.properties) == null ? void 0 : p.color}`, e.has(v) || e.register({
4214
- themeKey: v,
4518
+ const v = ((l = (a = t.properties) == null ? void 0 : a.lineType) == null ? void 0 : l.pattern) || [0.25, -0.125], P = ((u = (d = t.properties) == null ? void 0 : d.lineType) == null ? void 0 : u.patternLength) || 0.375;
4519
+ let b = this.convertCadPatternToCesiumDash(v, P);
4520
+ w = `DashedLineMaterial_pattern_${b.dashPattern}_dashLength_${b.dashLength}_color_${(g = t.properties) == null ? void 0 : g.color}`, e.has(w) || e.register({
4521
+ themeKey: w,
4215
4522
  material: i.Material.fromType("PolylineDash", {
4216
4523
  color: i.Color.fromCssColorString(t.properties.color || "#FFFFFF").withAlpha(
4217
4524
  0.8
@@ -4223,8 +4530,8 @@ class Oo {
4223
4530
  })
4224
4531
  });
4225
4532
  } else
4226
- v = `LineMaterial_color_${(g = t.properties) == null ? void 0 : g.color}`, e.has(v) || e.register({
4227
- themeKey: v,
4533
+ w = `LineMaterial_color_${(p = t.properties) == null ? void 0 : p.color}`, e.has(w) || e.register({
4534
+ themeKey: w,
4228
4535
  material: i.Material.fromType("Color", {
4229
4536
  color: i.Color.fromCssColorString(t.properties.color || "#FFFFFF").withAlpha(
4230
4537
  0.8
@@ -4488,15 +4795,15 @@ class Oo {
4488
4795
  }
4489
4796
  const r = o.geometry, a = r._positions || r._polygonHierarchy.positions;
4490
4797
  if (a && a.length > 0) {
4491
- let l = a[0].x, d = a[0].y, u = a[0].z, p = a[0].x, g = a[0].y, m = a[0].z;
4798
+ let l = a[0].x, d = a[0].y, u = a[0].z, g = a[0].x, p = a[0].y, m = a[0].z;
4492
4799
  a.forEach((P) => {
4493
- l = Math.min(l, P.x), d = Math.min(d, P.y), u = Math.min(u, P.z), p = Math.max(p, P.x), g = Math.max(g, P.y), m = Math.max(m, P.z);
4800
+ l = Math.min(l, P.x), d = Math.min(d, P.y), u = Math.min(u, P.z), g = Math.max(g, P.x), p = Math.max(p, P.y), m = Math.max(m, P.z);
4494
4801
  });
4495
4802
  const f = new this.Cesium.Cartesian3(
4496
- (l + p) / 2,
4497
- (d + g) / 2,
4803
+ (l + g) / 2,
4804
+ (d + p) / 2,
4498
4805
  (u + m) / 2
4499
- ), v = new this.Cesium.Cartesian3(p - l, g - d, m - u).z, w = Math.abs(v || 1) * 1.5;
4806
+ ), w = new this.Cesium.Cartesian3(g - l, p - d, m - u).z, v = Math.abs(w || 1) * 1.5;
4500
4807
  this.viewer.camera.flyTo({
4501
4808
  destination: f,
4502
4809
  duration: 2,
@@ -4504,14 +4811,14 @@ class Oo {
4504
4811
  complete: () => {
4505
4812
  console.log(`已定位到图元 ${e}`);
4506
4813
  },
4507
- offset: new this.Cesium.Cartesian3(0, 0, w)
4814
+ offset: new this.Cesium.Cartesian3(0, 0, v)
4508
4815
  // 使用动态计算的偏移高度
4509
4816
  });
4510
4817
  } else
4511
4818
  console.warn(`无法获取图元 ${e} 的顶点信息`);
4512
4819
  }
4513
4820
  }
4514
- const $e = class $e {
4821
+ const Re = class Re {
4515
4822
  constructor(t, e) {
4516
4823
  c(this, "Cesium");
4517
4824
  c(this, "viewer");
@@ -4544,7 +4851,7 @@ const $e = class $e {
4544
4851
  const e = this.Cesium, i = this.viewer;
4545
4852
  if (!this.htmlLabelPool) {
4546
4853
  const n = t.overlayContainerId || "html-label-container";
4547
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-horizontal-total", {
4854
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-horizontal-total", {
4548
4855
  createElement: (s, o) => {
4549
4856
  var r;
4550
4857
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -4558,8 +4865,8 @@ const $e = class $e {
4558
4865
  options: { offset: { x: 0, y: -10 } }
4559
4866
  });
4560
4867
  }
4561
- this.tooltip = new ce(), this.tooltip.show($e.TIP_TEXT), this._bindGlobalEvents(t, e, i), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
4562
- var m, f, y, v;
4868
+ this.tooltip = new ce(), this.tooltip.show(Re.TIP_TEXT), this._bindGlobalEvents(t, e, i), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
4869
+ var m, f, y, w;
4563
4870
  const s = i.scene.pickPosition(n.position);
4564
4871
  if (!s) return;
4565
4872
  const o = e.Cartographic.fromCartesian(s), r = e.Math.toDegrees(o.longitude), a = e.Math.toDegrees(o.latitude);
@@ -4575,35 +4882,35 @@ const $e = class $e {
4575
4882
  }
4576
4883
  });
4577
4884
  this.tempPoints.push(d);
4578
- const u = s, p = ((f = (m = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || e.Color.RED, g = i.entities.add({
4885
+ const u = s, g = ((f = (m = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || e.Color.RED, p = i.entities.add({
4579
4886
  polyline: {
4580
4887
  positions: [u, l],
4581
4888
  width: t.width || 3,
4582
4889
  material: new e.PolylineDashMaterialProperty({
4583
- color: p,
4890
+ color: g,
4584
4891
  dashLength: 12,
4585
4892
  dashPattern: 255
4586
4893
  })
4587
4894
  }
4588
4895
  });
4589
- if (this.groundLineEntities.push(g), this.positions.length >= 2) {
4590
- const w = this.positions[this.positions.length - 2], P = this.positions[this.positions.length - 1], b = e.Cartographic.fromCartesian(w), C = e.Cartographic.fromCartesian(P), E = i.entities.add({
4896
+ if (this.groundLineEntities.push(p), this.positions.length >= 2) {
4897
+ const v = this.positions[this.positions.length - 2], P = this.positions[this.positions.length - 1], b = e.Cartographic.fromCartesian(v), C = e.Cartographic.fromCartesian(P), L = i.entities.add({
4591
4898
  polyline: {
4592
- positions: [w, P],
4899
+ positions: [v, P],
4593
4900
  width: t.width || 3,
4594
4901
  material: t.lineColor || t.color || e.Color.YELLOW,
4595
4902
  depthFailMaterial: new e.PolylineDashMaterialProperty({
4596
- color: ((v = (y = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : v.call(y, 0.9)) || e.Color.RED,
4903
+ color: ((w = (y = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : w.call(y, 0.9)) || e.Color.RED,
4597
4904
  dashLength: 12,
4598
4905
  dashPattern: 255
4599
4906
  })
4600
4907
  }
4601
4908
  });
4602
- this.segmentEntities.push(E);
4909
+ this.segmentEntities.push(L);
4603
4910
  const M = new e.EllipsoidGeodesic(b, C).surfaceDistance, x = new e.Cartesian3(
4604
- (w.x + P.x) / 2,
4605
- (w.y + P.y) / 2,
4606
- (w.z + P.z) / 2
4911
+ (v.x + P.x) / 2,
4912
+ (v.y + P.y) / 2,
4913
+ (v.z + P.z) / 2
4607
4914
  ), I = e.Cartographic.fromCartesian(x), D = `measure_horizontal_seg_${this.segmentLabelIds.length}_${Date.now()}`;
4608
4915
  this.segmentLabelIds.push(D), this.htmlLabelPool.add(
4609
4916
  { text: `${M.toFixed(2)} m` },
@@ -4638,22 +4945,22 @@ const $e = class $e {
4638
4945
  }, e.ScreenSpaceEventType.MOUSE_MOVE);
4639
4946
  }
4640
4947
  _handlePreviewMove(t, e, i, n) {
4641
- var P, b, C, E;
4948
+ var P, b, C, L;
4642
4949
  if (this.positions.length === 0) return;
4643
4950
  const s = n.scene.pickPosition(t.endPosition);
4644
4951
  if (!s) return;
4645
4952
  this.hoverPos = s;
4646
4953
  const o = i.Cartographic.fromCartesian(s), r = i.Math.toDegrees(o.longitude), a = i.Math.toDegrees(o.latitude), l = i.Cartesian3.fromDegrees(r, a, this.firstHeight || 0);
4647
4954
  this.previewPos = l, this.previewGroundPos = s;
4648
- const d = this.positions[this.positions.length - 1], u = i.Cartographic.fromCartesian(d), p = i.Cartographic.fromCartesian(l), m = new i.EllipsoidGeodesic(u, p).surfaceDistance, f = new i.Cartesian3(
4955
+ const d = this.positions[this.positions.length - 1], u = i.Cartographic.fromCartesian(d), g = i.Cartographic.fromCartesian(l), m = new i.EllipsoidGeodesic(u, g).surfaceDistance, f = new i.Cartesian3(
4649
4956
  (d.x + l.x) / 2,
4650
4957
  (d.y + l.y) / 2,
4651
4958
  (d.z + l.z) / 2
4652
- ), y = i.Cartographic.fromCartesian(f), v = this.previewLabelId || "measure_horizontal_preview";
4653
- this.previewLabelId = v, this.htmlLabelPool.add(
4959
+ ), y = i.Cartographic.fromCartesian(f), w = this.previewLabelId || "measure_horizontal_preview";
4960
+ this.previewLabelId = w, this.htmlLabelPool.add(
4654
4961
  { text: `${m.toFixed(2)} m` },
4655
4962
  {
4656
- id: v,
4963
+ id: w,
4657
4964
  lon: i.Math.toDegrees(y.longitude),
4658
4965
  lat: i.Math.toDegrees(y.latitude),
4659
4966
  height: y.height || this.firstHeight || 0,
@@ -4661,13 +4968,13 @@ const $e = class $e {
4661
4968
  show: !0
4662
4969
  }
4663
4970
  );
4664
- const w = ((b = (P = e.dashLineColor || e.lineColor || e.color || i.Color.RED).withAlpha) == null ? void 0 : b.call(P, 0.9)) || i.Color.RED;
4971
+ const v = ((b = (P = e.dashLineColor || e.lineColor || e.color || i.Color.RED).withAlpha) == null ? void 0 : b.call(P, 0.9)) || i.Color.RED;
4665
4972
  this.previewGroundEntity || (this.previewGroundEntity = n.entities.add({
4666
4973
  polyline: {
4667
4974
  positions: new i.CallbackProperty(() => !this.previewPos || !this.previewGroundPos ? [] : [this.previewGroundPos, this.previewPos], !1),
4668
4975
  width: e.width || 3,
4669
4976
  material: new i.PolylineDashMaterialProperty({
4670
- color: w,
4977
+ color: v,
4671
4978
  dashLength: 12,
4672
4979
  dashPattern: 255
4673
4980
  })
@@ -4678,7 +4985,7 @@ const $e = class $e {
4678
4985
  width: e.width || 3,
4679
4986
  material: e.lineColor || e.color || i.Color.YELLOW,
4680
4987
  depthFailMaterial: new i.PolylineDashMaterialProperty({
4681
- color: ((E = (C = e.dashLineColor || e.lineColor || e.color || i.Color.RED).withAlpha) == null ? void 0 : E.call(C, 0.9)) || i.Color.RED,
4988
+ color: ((L = (C = e.dashLineColor || e.lineColor || e.color || i.Color.RED).withAlpha) == null ? void 0 : L.call(C, 0.9)) || i.Color.RED,
4682
4989
  dashLength: 12,
4683
4990
  dashPattern: 255
4684
4991
  })
@@ -4717,7 +5024,7 @@ const $e = class $e {
4717
5024
  this.stop(), this._clearPreviewState();
4718
5025
  let i = 0;
4719
5026
  for (let l = 1; l < this.positions.length; l++) {
4720
- const d = this.positions[l - 1], u = this.positions[l], p = e.Cartographic.fromCartesian(d), g = e.Cartographic.fromCartesian(u), m = new e.EllipsoidGeodesic(p, g);
5027
+ const d = this.positions[l - 1], u = this.positions[l], g = e.Cartographic.fromCartesian(d), p = e.Cartographic.fromCartesian(u), m = new e.EllipsoidGeodesic(g, p);
4721
5028
  i += m.surfaceDistance;
4722
5029
  }
4723
5030
  const n = this.positions[this.positions.length - 1], s = e.Cartographic.fromCartesian(n), o = this.totalLabelId || `measure_horizontal_total_${Date.now()}`;
@@ -4761,44 +5068,44 @@ const $e = class $e {
4761
5068
  if (!l.length) return;
4762
5069
  if (!this.htmlLabelPool) {
4763
5070
  const y = s.overlayContainerId || "html-label-container";
4764
- this.htmlLabelPool = e || new z(i, n, y), this.htmlLabelPool.registerTheme("measure-horizontal-total", {
4765
- createElement: (v, w) => {
5071
+ this.htmlLabelPool = e || new G(i, n, y), this.htmlLabelPool.registerTheme("measure-horizontal-total", {
5072
+ createElement: (w, v) => {
4766
5073
  var P;
4767
- v.innerHTML = String(((P = w == null ? void 0 : w.data) == null ? void 0 : P.text) || ""), v.style.background = "rgba(0,0,0,0.6)", v.style.color = "#fff", v.style.font = "14px sans-serif", v.style.padding = "4px 6px", v.style.borderRadius = "4px", v.style.whiteSpace = "pre";
5074
+ w.innerHTML = String(((P = v == null ? void 0 : v.data) == null ? void 0 : P.text) || ""), w.style.background = "rgba(0,0,0,0.6)", w.style.color = "#fff", w.style.font = "14px sans-serif", w.style.padding = "4px 6px", w.style.borderRadius = "4px", w.style.whiteSpace = "pre";
4768
5075
  },
4769
5076
  options: { offset: { x: 0, y: -10 } }
4770
5077
  }), this.htmlLabelPool.registerTheme("measure-horizontal-seg", {
4771
- createElement: (v, w) => {
5078
+ createElement: (w, v) => {
4772
5079
  var P;
4773
- v.innerHTML = String(((P = w == null ? void 0 : w.data) == null ? void 0 : P.text) || ""), v.style.background = "rgba(0,0,0,0.6)", v.style.color = "#fff", v.style.font = "14px sans-serif", v.style.padding = "4px 6px", v.style.borderRadius = "4px", v.style.whiteSpace = "pre";
5080
+ w.innerHTML = String(((P = v == null ? void 0 : v.data) == null ? void 0 : P.text) || ""), w.style.background = "rgba(0,0,0,0.6)", w.style.color = "#fff", w.style.font = "14px sans-serif", w.style.padding = "4px 6px", w.style.borderRadius = "4px", w.style.whiteSpace = "pre";
4774
5081
  },
4775
5082
  options: { offset: { x: 0, y: -10 } }
4776
5083
  });
4777
5084
  }
4778
5085
  for (const y of l) {
4779
- const v = n.entities.add({ position: y, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
4780
- this.tempPoints.push(v);
4781
- const w = i.Cartographic.fromCartesian(y), P = i.Math.toDegrees(w.longitude), b = i.Math.toDegrees(w.latitude), C = n.scene.globe.getHeight(new i.Cartographic(w.longitude, w.latitude, 0)) || 0, E = i.Cartesian3.fromDegrees(P, b, C), L = n.entities.add({
5086
+ const w = n.entities.add({ position: y, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5087
+ this.tempPoints.push(w);
5088
+ const v = i.Cartographic.fromCartesian(y), P = i.Math.toDegrees(v.longitude), b = i.Math.toDegrees(v.latitude), C = n.scene.globe.getHeight(new i.Cartographic(v.longitude, v.latitude, 0)) || 0, L = i.Cartesian3.fromDegrees(P, b, C), E = n.entities.add({
4782
5089
  polyline: {
4783
- positions: [E, y],
5090
+ positions: [L, y],
4784
5091
  width: a,
4785
5092
  material: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 })
4786
5093
  }
4787
5094
  });
4788
- this.groundLineEntities.push(L);
5095
+ this.groundLineEntities.push(E);
4789
5096
  }
4790
5097
  for (let y = 1; y < l.length; y++) {
4791
- const v = l[y - 1], w = l[y], P = n.entities.add({
5098
+ const w = l[y - 1], v = l[y], P = n.entities.add({
4792
5099
  polyline: {
4793
- positions: [v, w],
5100
+ positions: [w, v],
4794
5101
  width: a,
4795
5102
  material: o,
4796
5103
  depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 })
4797
5104
  }
4798
5105
  });
4799
5106
  this.segmentEntities.push(P);
4800
- const b = i.Cartographic.fromCartesian(v), C = i.Cartographic.fromCartesian(w), L = new i.EllipsoidGeodesic(b, C).surfaceDistance, M = new i.Cartesian3((v.x + w.x) / 2, (v.y + w.y) / 2, (v.z + w.z) / 2), x = i.Cartographic.fromCartesian(M), I = t.id + `_seg_${y - 1}`;
4801
- this.segmentLabelIds.push(I), this.htmlLabelPool.add({ text: `${L.toFixed(2)} m` }, {
5107
+ const b = i.Cartographic.fromCartesian(w), C = i.Cartographic.fromCartesian(v), E = new i.EllipsoidGeodesic(b, C).surfaceDistance, M = new i.Cartesian3((w.x + v.x) / 2, (w.y + v.y) / 2, (w.z + v.z) / 2), x = i.Cartographic.fromCartesian(M), I = t.id + `_seg_${y - 1}`;
5108
+ this.segmentLabelIds.push(I), this.htmlLabelPool.add({ text: `${E.toFixed(2)} m` }, {
4802
5109
  id: I,
4803
5110
  lon: i.Math.toDegrees(x.longitude),
4804
5111
  lat: i.Math.toDegrees(x.latitude),
@@ -4810,23 +5117,23 @@ const $e = class $e {
4810
5117
  }
4811
5118
  let d = 0;
4812
5119
  for (let y = 1; y < l.length; y++) {
4813
- const v = i.Cartographic.fromCartesian(l[y - 1]), w = i.Cartographic.fromCartesian(l[y]), P = new i.EllipsoidGeodesic(v, w);
5120
+ const w = i.Cartographic.fromCartesian(l[y - 1]), v = i.Cartographic.fromCartesian(l[y]), P = new i.EllipsoidGeodesic(w, v);
4814
5121
  d += P.surfaceDistance;
4815
5122
  }
4816
- const u = l[l.length - 1], p = i.Cartographic.fromCartesian(u), g = t.id + "_total";
4817
- this.totalLabelId = g, this.htmlLabelPool.add({ text: `${d.toFixed(2)} m` }, {
4818
- id: g,
4819
- lon: i.Math.toDegrees(p.longitude),
4820
- lat: i.Math.toDegrees(p.latitude),
4821
- height: p.height || 0,
5123
+ const u = l[l.length - 1], g = i.Cartographic.fromCartesian(u), p = t.id + "_total";
5124
+ this.totalLabelId = p, this.htmlLabelPool.add({ text: `${d.toFixed(2)} m` }, {
5125
+ id: p,
5126
+ lon: i.Math.toDegrees(g.longitude),
5127
+ lat: i.Math.toDegrees(g.latitude),
5128
+ height: g.height || 0,
4822
5129
  theme: "measure-horizontal-total",
4823
5130
  show: !0,
4824
5131
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
4825
5132
  });
4826
5133
  }
4827
5134
  };
4828
- c($e, "TIP_TEXT", "单击左键添加点,右键撤销,双击左键或Esc结束");
4829
- let Se = $e;
5135
+ c(Re, "TIP_TEXT", "单击左键添加点,右键撤销,双击左键或Esc结束");
5136
+ let Se = Re;
4830
5137
  class gt {
4831
5138
  constructor(t, e) {
4832
5139
  c(this, "Cesium");
@@ -4850,7 +5157,7 @@ class gt {
4850
5157
  const e = this.Cesium, i = this.viewer;
4851
5158
  if (!this.htmlLabelPool) {
4852
5159
  const n = t.overlayContainerId || "html-label-container";
4853
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-vertical", {
5160
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-vertical", {
4854
5161
  createElement: (s, o) => {
4855
5162
  var r;
4856
5163
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -4864,12 +5171,12 @@ class gt {
4864
5171
  let o = s ? i.scene.globe.pick(s, i.scene) : null;
4865
5172
  if (o || (o = i.camera.pickEllipsoid(n.position, e.Ellipsoid.WGS84)), o || (o = i.scene.pickPosition(n.position)), !!o)
4866
5173
  if (this.positions.length === 0) {
4867
- const p = e.Cartographic.fromCartesian(o);
4868
- this.baseCarto = new e.Cartographic(p.longitude, p.latitude, 0);
4869
- const g = e.Ellipsoid.WGS84.cartographicToCartesian(this.baseCarto);
4870
- this.baseUp = e.Ellipsoid.WGS84.geodeticSurfaceNormalCartographic(this.baseCarto), this.positions.push(g);
5174
+ const g = e.Cartographic.fromCartesian(o);
5175
+ this.baseCarto = new e.Cartographic(g.longitude, g.latitude, 0);
5176
+ const p = e.Ellipsoid.WGS84.cartographicToCartesian(this.baseCarto);
5177
+ this.baseUp = e.Ellipsoid.WGS84.geodeticSurfaceNormalCartographic(this.baseCarto), this.positions.push(p);
4871
5178
  const m = i.entities.add({
4872
- position: g,
5179
+ position: p,
4873
5180
  point: {
4874
5181
  pixelSize: 8,
4875
5182
  color: t.pointColor || t.color || e.Color.YELLOW,
@@ -4880,7 +5187,7 @@ class gt {
4880
5187
  const f = t.lineColor || t.color || e.Color.CYAN, y = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED;
4881
5188
  this.previewEntity = i.entities.add({
4882
5189
  polyline: {
4883
- positions: [g, g],
5190
+ positions: [p, p],
4884
5191
  width: t.width || 3,
4885
5192
  material: f,
4886
5193
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -4892,20 +5199,20 @@ class gt {
4892
5199
  });
4893
5200
  } else {
4894
5201
  if (!this.baseCarto || !this.baseUp) return;
4895
- const p = this.positions[0], g = i.camera.getPickRay(n.position);
4896
- if (!g) return;
4897
- const m = g.origin, f = e.Cartesian3.normalize(g.direction, new e.Cartesian3()), y = p, v = this.baseUp, w = e.Cartesian3.subtract(m, y, new e.Cartesian3()), P = e.Cartesian3.dot(f, f), b = -e.Cartesian3.dot(f, v), C = e.Cartesian3.dot(v, v), E = -e.Cartesian3.dot(f, w), L = e.Cartesian3.dot(v, w), M = P * C - b * b;
5202
+ const g = this.positions[0], p = i.camera.getPickRay(n.position);
5203
+ if (!p) return;
5204
+ const m = p.origin, f = e.Cartesian3.normalize(p.direction, new e.Cartesian3()), y = g, w = this.baseUp, v = e.Cartesian3.subtract(m, y, new e.Cartesian3()), P = e.Cartesian3.dot(f, f), b = -e.Cartesian3.dot(f, w), C = e.Cartesian3.dot(w, w), L = -e.Cartesian3.dot(f, v), E = e.Cartesian3.dot(w, v), M = P * C - b * b;
4898
5205
  if (Math.abs(M) < 1e-6) return;
4899
- const x = (P * L - b * E) / M, I = e.Cartesian3.add(
5206
+ const x = (P * E - b * L) / M, I = e.Cartesian3.add(
4900
5207
  y,
4901
- e.Cartesian3.multiplyByScalar(v, x, new e.Cartesian3()),
5208
+ e.Cartesian3.multiplyByScalar(w, x, new e.Cartesian3()),
4902
5209
  new e.Cartesian3()
4903
5210
  );
4904
5211
  this.positions[1] = I, this.stop(), this.previewEntity && (this.viewer.entities.remove(this.previewEntity), this.previewEntity = null), this.previewPointEntity && (this.viewer.entities.remove(this.previewPointEntity), this.previewPointEntity = null);
4905
5212
  const D = t.lineColor || t.color || e.Color.CYAN, T = ((d = (l = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : d.call(l, 0.9)) || e.Color.RED;
4906
5213
  this.entity = i.entities.add({
4907
5214
  polyline: {
4908
- positions: [p, I],
5215
+ positions: [g, I],
4909
5216
  width: t.width || 3,
4910
5217
  material: D,
4911
5218
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -4924,33 +5231,33 @@ class gt {
4924
5231
  }
4925
5232
  });
4926
5233
  this.tempPoints.push(S);
4927
- const _ = this.baseCarto, k = e.Cartographic.fromCartesian(I), A = Math.abs((k.height || 0) - (_.height || 0)), $ = new e.Cartesian3(
5234
+ const _ = this.baseCarto, k = e.Cartographic.fromCartesian(I), A = Math.abs((k.height || 0) - (_.height || 0)), R = new e.Cartesian3(
4928
5235
  (this.positions[0].x + this.positions[1].x) / 2,
4929
5236
  (this.positions[0].y + this.positions[1].y) / 2,
4930
5237
  (this.positions[0].z + this.positions[1].z) / 2
4931
- ), O = e.Cartographic.fromCartesian($);
5238
+ ), H = e.Cartographic.fromCartesian(R);
4932
5239
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
4933
- const G = this.htmlLabelId || `measure_vertical_${Date.now()}`;
4934
- this.htmlLabelId = G, this.htmlLabelPool.add(
5240
+ const B = this.htmlLabelId || `measure_vertical_${Date.now()}`;
5241
+ this.htmlLabelId = B, this.htmlLabelPool.add(
4935
5242
  { text: `${A.toFixed(2)} m` },
4936
5243
  {
4937
- id: G,
4938
- lon: e.Math.toDegrees(O.longitude),
4939
- lat: e.Math.toDegrees(O.latitude),
4940
- height: O.height || 0,
5244
+ id: B,
5245
+ lon: e.Math.toDegrees(H.longitude),
5246
+ lat: e.Math.toDegrees(H.latitude),
5247
+ height: H.height || 0,
4941
5248
  theme: "measure-vertical",
4942
5249
  show: !0,
4943
5250
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
4944
5251
  }
4945
5252
  );
4946
- const B = {
5253
+ const Y = {
4947
5254
  entity: this.entity,
4948
5255
  label: this.labelEntity,
4949
5256
  positions: this.positions,
4950
5257
  vertical: A,
4951
5258
  clear: () => this.clear()
4952
5259
  };
4953
- (u = t.onComplete) == null || u.call(t, B);
5260
+ (u = t.onComplete) == null || u.call(t, Y);
4954
5261
  }
4955
5262
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
4956
5263
  var I, D;
@@ -4961,11 +5268,11 @@ class gt {
4961
5268
  }
4962
5269
  const s = this.positions[0], o = i.camera.getPickRay(n.endPosition);
4963
5270
  if (!o) return;
4964
- const r = o.origin, a = e.Cartesian3.normalize(o.direction, new e.Cartesian3()), l = s, d = this.baseUp, u = e.Cartesian3.subtract(r, l, new e.Cartesian3()), p = e.Cartesian3.dot(a, a), g = -e.Cartesian3.dot(a, d), m = e.Cartesian3.dot(d, d), f = -e.Cartesian3.dot(a, u), y = e.Cartesian3.dot(d, u), v = p * m - g * g;
4965
- if (Math.abs(v) < 1e-6) return;
4966
- const w = (p * y - g * f) / v, P = e.Cartesian3.add(
5271
+ const r = o.origin, a = e.Cartesian3.normalize(o.direction, new e.Cartesian3()), l = s, d = this.baseUp, u = e.Cartesian3.subtract(r, l, new e.Cartesian3()), g = e.Cartesian3.dot(a, a), p = -e.Cartesian3.dot(a, d), m = e.Cartesian3.dot(d, d), f = -e.Cartesian3.dot(a, u), y = e.Cartesian3.dot(d, u), w = g * m - p * p;
5272
+ if (Math.abs(w) < 1e-6) return;
5273
+ const v = (g * y - p * f) / w, P = e.Cartesian3.add(
4967
5274
  l,
4968
- e.Cartesian3.multiplyByScalar(d, w, new e.Cartesian3()),
5275
+ e.Cartesian3.multiplyByScalar(d, v, new e.Cartesian3()),
4969
5276
  new e.Cartesian3()
4970
5277
  );
4971
5278
  if (this.positions[1] = P, !this.previewEntity) {
@@ -4991,13 +5298,13 @@ class gt {
4991
5298
  disableDepthTestDistance: Number.POSITIVE_INFINITY
4992
5299
  }
4993
5300
  });
4994
- const b = this.baseCarto, C = e.Cartographic.fromCartesian(P), E = Math.abs((C.height || 0) - (b.height || 0)), L = new e.Cartesian3(
5301
+ const b = this.baseCarto, C = e.Cartographic.fromCartesian(P), L = Math.abs((C.height || 0) - (b.height || 0)), E = new e.Cartesian3(
4995
5302
  (this.positions[0].x + P.x) / 2,
4996
5303
  (this.positions[0].y + P.y) / 2,
4997
5304
  (this.positions[0].z + P.z) / 2
4998
- ), M = e.Cartographic.fromCartesian(L), x = this.previewLabelId || "measure_vertical_preview";
5305
+ ), M = e.Cartographic.fromCartesian(E), x = this.previewLabelId || "measure_vertical_preview";
4999
5306
  this.previewLabelId = x, this.htmlLabelPool.add(
5000
- { text: `${E.toFixed(2)} m` },
5307
+ { text: `${L.toFixed(2)} m` },
5001
5308
  {
5002
5309
  id: x,
5003
5310
  lon: e.Math.toDegrees(M.longitude),
@@ -5018,26 +5325,26 @@ class gt {
5018
5325
  }
5019
5326
  rehydrate(t, e) {
5020
5327
  var b, C;
5021
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.CYAN, r = ((C = (b = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : C.call(b, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((E) => new i.Cartesian3(E[0], E[1], E[2]));
5328
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.CYAN, r = ((C = (b = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : C.call(b, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((L) => new i.Cartesian3(L[0], L[1], L[2]));
5022
5329
  if (l.length < 2) return;
5023
5330
  if (!this.htmlLabelPool) {
5024
- const E = s.overlayContainerId || "html-label-container";
5025
- this.htmlLabelPool = e || new z(i, n, E), this.htmlLabelPool.registerTheme("measure-vertical", {
5026
- createElement: (L, M) => {
5331
+ const L = s.overlayContainerId || "html-label-container";
5332
+ this.htmlLabelPool = e || new G(i, n, L), this.htmlLabelPool.registerTheme("measure-vertical", {
5333
+ createElement: (E, M) => {
5027
5334
  var x;
5028
- L.innerHTML = String(((x = M == null ? void 0 : M.data) == null ? void 0 : x.text) || ""), L.style.background = "rgba(0,0,0,0.6)", L.style.color = "#fff", L.style.font = "14px sans-serif", L.style.padding = "4px 6px", L.style.borderRadius = "4px", L.style.whiteSpace = "pre";
5335
+ E.innerHTML = String(((x = M == null ? void 0 : M.data) == null ? void 0 : x.text) || ""), E.style.background = "rgba(0,0,0,0.6)", E.style.color = "#fff", E.style.font = "14px sans-serif", E.style.padding = "4px 6px", E.style.borderRadius = "4px", E.style.whiteSpace = "pre";
5029
5336
  },
5030
5337
  options: { offset: { x: 0, y: -10 } }
5031
5338
  });
5032
5339
  }
5033
- const d = l[0], u = l[1], p = n.entities.add({ position: d, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), g = n.entities.add({ position: u, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5034
- this.tempPoints.push(p), this.tempPoints.push(g), this.entity = n.entities.add({ polyline: { positions: [d, u], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } });
5035
- const m = i.Cartographic.fromCartesian(d), f = i.Cartographic.fromCartesian(u), y = Math.abs((f.height || 0) - (m.height || 0)), v = new i.Cartesian3((d.x + u.x) / 2, (d.y + u.y) / 2, (d.z + u.z) / 2), w = i.Cartographic.fromCartesian(v), P = t.id + "_label";
5340
+ const d = l[0], u = l[1], g = n.entities.add({ position: d, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), p = n.entities.add({ position: u, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5341
+ this.tempPoints.push(g), this.tempPoints.push(p), this.entity = n.entities.add({ polyline: { positions: [d, u], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } });
5342
+ const m = i.Cartographic.fromCartesian(d), f = i.Cartographic.fromCartesian(u), y = Math.abs((f.height || 0) - (m.height || 0)), w = new i.Cartesian3((d.x + u.x) / 2, (d.y + u.y) / 2, (d.z + u.z) / 2), v = i.Cartographic.fromCartesian(w), P = t.id + "_label";
5036
5343
  this.htmlLabelId = P, this.htmlLabelPool.add({ text: `${y.toFixed(2)} m` }, {
5037
5344
  id: P,
5038
- lon: i.Math.toDegrees(w.longitude),
5039
- lat: i.Math.toDegrees(w.latitude),
5040
- height: w.height || 0,
5345
+ lon: i.Math.toDegrees(v.longitude),
5346
+ lat: i.Math.toDegrees(v.latitude),
5347
+ height: v.height || 0,
5041
5348
  theme: "measure-vertical",
5042
5349
  show: !0,
5043
5350
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
@@ -5074,7 +5381,7 @@ class ft {
5074
5381
  const e = this.Cesium, i = this.viewer;
5075
5382
  if (!this.htmlLabelPool) {
5076
5383
  const n = t.overlayContainerId || "html-label-container";
5077
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-triangle", {
5384
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-triangle", {
5078
5385
  createElement: (s, o) => {
5079
5386
  var r;
5080
5387
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -5108,28 +5415,28 @@ class ft {
5108
5415
  }
5109
5416
  });
5110
5417
  if (this.pointEntities.push(o), this.positions.length === 2) {
5111
- this.stop(), this.previewSegmentEntities.forEach((X) => i.entities.remove(X)), this.previewSegmentEntities = [], this.previewAngleMarkerEntities.forEach((X) => i.entities.remove(X)), this.previewAngleMarkerEntities = [], this.previewPointEntity && (i.entities.remove(this.previewPointEntity), this.previewPointEntity = null);
5112
- const d = e.Cartographic.fromCartesian(this.positions[0]), u = e.Cartographic.fromCartesian(this.positions[1]), p = d.height || 0, g = u.height || 0, m = p <= g ? this.positions[0] : this.positions[1], f = p > g ? this.positions[0] : this.positions[1], y = e.Cartographic.fromCartesian(m);
5418
+ this.stop(), this.previewSegmentEntities.forEach((q) => i.entities.remove(q)), this.previewSegmentEntities = [], this.previewAngleMarkerEntities.forEach((q) => i.entities.remove(q)), this.previewAngleMarkerEntities = [], this.previewPointEntity && (i.entities.remove(this.previewPointEntity), this.previewPointEntity = null);
5419
+ const d = e.Cartographic.fromCartesian(this.positions[0]), u = e.Cartographic.fromCartesian(this.positions[1]), g = d.height || 0, p = u.height || 0, m = g <= p ? this.positions[0] : this.positions[1], f = g > p ? this.positions[0] : this.positions[1], y = e.Cartographic.fromCartesian(m);
5113
5420
  e.Cartographic.fromCartesian(f);
5114
- const v = Math.max(p, g), w = e.Cartesian3.fromDegrees(
5421
+ const w = Math.max(g, p), v = e.Cartesian3.fromDegrees(
5115
5422
  e.Math.toDegrees(y.longitude),
5116
5423
  e.Math.toDegrees(y.latitude),
5117
- v
5424
+ w
5118
5425
  ), P = t.lineColor || t.color || e.Color.YELLOW, b = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED, C = i.entities.add({
5119
5426
  polyline: {
5120
- positions: [m, w],
5427
+ positions: [m, v],
5121
5428
  width: t.width || 3,
5122
5429
  material: P,
5123
5430
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
5124
5431
  }
5125
- }), E = i.entities.add({
5432
+ }), L = i.entities.add({
5126
5433
  polyline: {
5127
- positions: [w, f],
5434
+ positions: [v, f],
5128
5435
  width: t.width || 3,
5129
5436
  material: P,
5130
5437
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
5131
5438
  }
5132
- }), L = i.entities.add({
5439
+ }), E = i.entities.add({
5133
5440
  polyline: {
5134
5441
  positions: [m, f],
5135
5442
  width: t.width || 3,
@@ -5137,41 +5444,41 @@ class ft {
5137
5444
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
5138
5445
  }
5139
5446
  });
5140
- this.segmentEntities.push(C, E, L);
5141
- const M = e.Cartesian3.distance(m, w), x = e.Cartesian3.distance(w, f), I = e.Cartesian3.distance(m, f), D = new e.Cartesian3((m.x + w.x) / 2, (m.y + w.y) / 2, (m.z + w.z) / 2), T = new e.Cartesian3((w.x + f.x) / 2, (w.y + f.y) / 2, (w.z + f.z) / 2), S = new e.Cartesian3((m.x + f.x) / 2, (m.y + f.y) / 2, (m.z + f.z) / 2), _ = e.Cartographic.fromCartesian(D), k = e.Cartographic.fromCartesian(T), A = e.Cartographic.fromCartesian(S), $ = "measure_triangle_seg_v", O = "measure_triangle_seg_h", G = "measure_triangle_seg_hyp";
5142
- this.segmentLabelIds = [$, O, G], this.htmlLabelPool.add({ text: `${M.toFixed(2)} m` }, { id: $, lon: e.Math.toDegrees(_.longitude), lat: e.Math.toDegrees(_.latitude), height: _.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${x.toFixed(2)} m` }, { id: O, lon: e.Math.toDegrees(k.longitude), lat: e.Math.toDegrees(k.latitude), height: k.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${I.toFixed(2)} m` }, { id: G, lon: e.Math.toDegrees(A.longitude), lat: e.Math.toDegrees(A.latitude), height: A.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5143
- const B = e.Cartesian3.subtract(f, m, new e.Cartesian3()), N = e.Cartesian3.subtract(w, m, new e.Cartesian3()), K = e.Cartesian3.subtract(w, f, new e.Cartesian3()), q = e.Cartesian3.subtract(m, f, new e.Cartesian3()), se = e.Cartesian3.dot(B, N), pe = Math.sqrt(e.Cartesian3.dot(B, B)) * Math.sqrt(e.Cartesian3.dot(N, N)), me = e.Cartesian3.dot(K, q), Ce = Math.sqrt(e.Cartesian3.dot(K, K)) * Math.sqrt(e.Cartesian3.dot(q, q)), Y = Math.acos(Math.min(Math.max(se / (pe || 1), -1), 1)), le = Math.acos(Math.min(Math.max(me / (Ce || 1), -1), 1)), ee = e.Cartographic.fromCartesian(m), j = e.Cartographic.fromCartesian(f), Z = "measure_triangle_angle_a", ne = "measure_triangle_angle_b";
5144
- this.angleLabelIds = [Z, ne], this.htmlLabelPool.add({ text: `${(Y * 180 / Math.PI).toFixed(2)}°` }, { id: Z, lon: e.Math.toDegrees(ee.longitude), lat: e.Math.toDegrees(ee.latitude), height: ee.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${(le * 180 / Math.PI).toFixed(2)}°` }, { id: ne, lon: e.Math.toDegrees(j.longitude), lat: e.Math.toDegrees(j.latitude), height: j.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5145
- const ge = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), W = Math.min(M, x) * ge;
5447
+ this.segmentEntities.push(C, L, E);
5448
+ const M = e.Cartesian3.distance(m, v), x = e.Cartesian3.distance(v, f), I = e.Cartesian3.distance(m, f), D = new e.Cartesian3((m.x + v.x) / 2, (m.y + v.y) / 2, (m.z + v.z) / 2), T = new e.Cartesian3((v.x + f.x) / 2, (v.y + f.y) / 2, (v.z + f.z) / 2), S = new e.Cartesian3((m.x + f.x) / 2, (m.y + f.y) / 2, (m.z + f.z) / 2), _ = e.Cartographic.fromCartesian(D), k = e.Cartographic.fromCartesian(T), A = e.Cartographic.fromCartesian(S), R = "measure_triangle_seg_v", H = "measure_triangle_seg_h", B = "measure_triangle_seg_hyp";
5449
+ this.segmentLabelIds = [R, H, B], this.htmlLabelPool.add({ text: `${M.toFixed(2)} m` }, { id: R, lon: e.Math.toDegrees(_.longitude), lat: e.Math.toDegrees(_.latitude), height: _.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${x.toFixed(2)} m` }, { id: H, lon: e.Math.toDegrees(k.longitude), lat: e.Math.toDegrees(k.latitude), height: k.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${I.toFixed(2)} m` }, { id: B, lon: e.Math.toDegrees(A.longitude), lat: e.Math.toDegrees(A.latitude), height: A.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5450
+ const Y = e.Cartesian3.subtract(f, m, new e.Cartesian3()), N = e.Cartesian3.subtract(v, m, new e.Cartesian3()), z = e.Cartesian3.subtract(v, f, new e.Cartesian3()), V = e.Cartesian3.subtract(m, f, new e.Cartesian3()), se = e.Cartesian3.dot(Y, N), pe = Math.sqrt(e.Cartesian3.dot(Y, Y)) * Math.sqrt(e.Cartesian3.dot(N, N)), me = e.Cartesian3.dot(z, V), Ce = Math.sqrt(e.Cartesian3.dot(z, z)) * Math.sqrt(e.Cartesian3.dot(V, V)), j = Math.acos(Math.min(Math.max(se / (pe || 1), -1), 1)), le = Math.acos(Math.min(Math.max(me / (Ce || 1), -1), 1)), ee = e.Cartographic.fromCartesian(m), W = e.Cartographic.fromCartesian(f), Z = "measure_triangle_angle_a", ne = "measure_triangle_angle_b";
5451
+ this.angleLabelIds = [Z, ne], this.htmlLabelPool.add({ text: `${(j * 180 / Math.PI).toFixed(2)}°` }, { id: Z, lon: e.Math.toDegrees(ee.longitude), lat: e.Math.toDegrees(ee.latitude), height: ee.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${(le * 180 / Math.PI).toFixed(2)}°` }, { id: ne, lon: e.Math.toDegrees(W.longitude), lat: e.Math.toDegrees(W.latitude), height: W.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5452
+ const ge = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), U = Math.min(M, x) * ge;
5146
5453
  if (M > 1e-3 && x > 1e-3) {
5147
- const X = e.Cartesian3.normalize(
5148
- e.Cartesian3.subtract(m, w, new e.Cartesian3()),
5454
+ const q = e.Cartesian3.normalize(
5455
+ e.Cartesian3.subtract(m, v, new e.Cartesian3()),
5149
5456
  new e.Cartesian3()
5150
5457
  ), oe = e.Cartesian3.normalize(
5151
- e.Cartesian3.subtract(f, w, new e.Cartesian3()),
5458
+ e.Cartesian3.subtract(f, v, new e.Cartesian3()),
5152
5459
  new e.Cartesian3()
5153
5460
  ), J = new e.Cartesian3(
5154
- w.x + X.x * W,
5155
- w.y + X.y * W,
5156
- w.z + X.z * W
5157
- ), R = new e.Cartesian3(
5158
- w.x + oe.x * W,
5159
- w.y + oe.y * W,
5160
- w.z + oe.z * W
5161
- ), U = new e.Cartesian3(
5162
- w.x + X.x * W + oe.x * W,
5163
- w.y + X.y * W + oe.y * W,
5164
- w.z + X.z * W + oe.z * W
5461
+ v.x + q.x * U,
5462
+ v.y + q.y * U,
5463
+ v.z + q.z * U
5464
+ ), $ = new e.Cartesian3(
5465
+ v.x + oe.x * U,
5466
+ v.y + oe.y * U,
5467
+ v.z + oe.z * U
5468
+ ), X = new e.Cartesian3(
5469
+ v.x + q.x * U + oe.x * U,
5470
+ v.y + q.y * U + oe.y * U,
5471
+ v.z + q.z * U + oe.z * U
5165
5472
  ), Q = i.entities.add({
5166
5473
  polyline: {
5167
- positions: [J, U],
5474
+ positions: [J, X],
5168
5475
  width: t.width || 3,
5169
5476
  material: P,
5170
5477
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
5171
5478
  }
5172
5479
  }), Te = i.entities.add({
5173
5480
  polyline: {
5174
- positions: [R, U],
5481
+ positions: [$, X],
5175
5482
  width: t.width || 3,
5176
5483
  material: P,
5177
5484
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
@@ -5180,24 +5487,24 @@ class ft {
5180
5487
  this.angleMarkerEntities.push(Q, Te);
5181
5488
  }
5182
5489
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
5183
- const V = {
5490
+ const K = {
5184
5491
  entity: this.segmentEntities,
5185
- positions: [m, f, w],
5492
+ positions: [m, f, v],
5186
5493
  lengths: { vertical: M, horizontal: x, hypotenuse: I },
5187
- angles: { acuteA: Y, acuteB: le },
5494
+ angles: { acuteA: j, acuteB: le },
5188
5495
  clear: () => this.clear()
5189
5496
  };
5190
- (l = t.onComplete) == null || l.call(t, V);
5497
+ (l = t.onComplete) == null || l.call(t, K);
5191
5498
  }
5192
5499
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
5193
5500
  var le, ee;
5194
5501
  if (this.positions.length !== 1) return;
5195
5502
  const s = i.scene.pickPosition(n.endPosition);
5196
5503
  if (!s) return;
5197
- const o = e.Cartographic.fromCartesian(this.positions[0]), r = e.Cartographic.fromCartesian(s), a = o.height || 0, l = r.height || 0, d = a <= l ? this.positions[0] : s, u = a > l ? this.positions[0] : s, p = e.Cartographic.fromCartesian(d), g = Math.max(a, l), m = e.Cartesian3.fromDegrees(
5198
- this.Cesium.Math.toDegrees(p.longitude),
5199
- this.Cesium.Math.toDegrees(p.latitude),
5200
- g
5504
+ const o = e.Cartographic.fromCartesian(this.positions[0]), r = e.Cartographic.fromCartesian(s), a = o.height || 0, l = r.height || 0, d = a <= l ? this.positions[0] : s, u = a > l ? this.positions[0] : s, g = e.Cartographic.fromCartesian(d), p = Math.max(a, l), m = e.Cartesian3.fromDegrees(
5505
+ this.Cesium.Math.toDegrees(g.longitude),
5506
+ this.Cesium.Math.toDegrees(g.latitude),
5507
+ p
5201
5508
  );
5202
5509
  this.previewLow = d, this.previewHigh = u, this.previewThird = m;
5203
5510
  const f = t.lineColor || t.color || e.Color.YELLOW, y = ((ee = (le = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : ee.call(le, 0.9)) || e.Color.RED;
@@ -5209,7 +5516,7 @@ class ft {
5209
5516
  disableDepthTestDistance: Number.POSITIVE_INFINITY
5210
5517
  }
5211
5518
  }), !this.previewSegmentEntities.length) {
5212
- const j = i.entities.add({
5519
+ const W = i.entities.add({
5213
5520
  polyline: {
5214
5521
  positions: new e.CallbackProperty(() => !this.previewLow || !this.previewThird ? [] : [this.previewLow, this.previewThird], !1),
5215
5522
  width: t.width || 3,
@@ -5231,40 +5538,40 @@ class ft {
5231
5538
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: y, dashLength: 12, dashPattern: 255 })
5232
5539
  }
5233
5540
  });
5234
- this.previewSegmentEntities.push(j, Z, ne);
5541
+ this.previewSegmentEntities.push(W, Z, ne);
5235
5542
  }
5236
- const v = e.Cartesian3.distance(d, m), w = e.Cartesian3.distance(m, u), P = e.Cartesian3.distance(d, u), b = e.Cartesian3.subtract(u, d, new e.Cartesian3()), C = e.Cartesian3.subtract(m, d, new e.Cartesian3()), E = e.Cartesian3.subtract(m, u, new e.Cartesian3()), L = e.Cartesian3.subtract(d, u, new e.Cartesian3()), M = e.Cartesian3.dot(b, C), x = Math.sqrt(e.Cartesian3.dot(b, b)) * Math.sqrt(e.Cartesian3.dot(C, C)), I = e.Cartesian3.dot(E, L), D = Math.sqrt(e.Cartesian3.dot(E, E)) * Math.sqrt(e.Cartesian3.dot(L, L)), T = Math.acos(Math.min(Math.max(M / (x || 1), -1), 1)), S = Math.acos(Math.min(Math.max(I / (D || 1), -1), 1)), _ = new e.Cartesian3((d.x + m.x) / 2, (d.y + m.y) / 2, (d.z + m.z) / 2), k = new e.Cartesian3((m.x + u.x) / 2, (m.y + u.y) / 2, (m.z + u.z) / 2), A = new e.Cartesian3((d.x + u.x) / 2, (d.y + u.y) / 2, (d.z + u.z) / 2), $ = e.Cartographic.fromCartesian(_), O = e.Cartographic.fromCartesian(k), G = e.Cartographic.fromCartesian(A), B = e.Cartographic.fromCartesian(d), N = e.Cartographic.fromCartesian(u), K = "measure_triangle_seg_v", q = "measure_triangle_seg_h", se = "measure_triangle_seg_hyp", pe = "measure_triangle_angle_a", me = "measure_triangle_angle_b";
5237
- this.segmentLabelIds.length === 0 && (this.segmentLabelIds = [K, q, se]), this.angleLabelIds.length === 0 && (this.angleLabelIds = [pe, me]), this.htmlLabelPool.add({ text: `${v.toFixed(2)} m` }, { id: K, lon: e.Math.toDegrees($.longitude), lat: e.Math.toDegrees($.latitude), height: $.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${w.toFixed(2)} m` }, { id: q, lon: e.Math.toDegrees(O.longitude), lat: e.Math.toDegrees(O.latitude), height: O.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${P.toFixed(2)} m` }, { id: se, lon: e.Math.toDegrees(G.longitude), lat: e.Math.toDegrees(G.latitude), height: G.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${(T * 180 / Math.PI).toFixed(2)}°` }, { id: pe, lon: e.Math.toDegrees(B.longitude), lat: e.Math.toDegrees(B.latitude), height: B.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${(S * 180 / Math.PI).toFixed(2)}°` }, { id: me, lon: e.Math.toDegrees(N.longitude), lat: e.Math.toDegrees(N.latitude), height: N.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5238
- const Ce = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), Y = Math.min(v, w) * Ce;
5239
- if (v > 1e-3 && w > 1e-3) {
5240
- const j = e.Cartesian3.normalize(
5543
+ const w = e.Cartesian3.distance(d, m), v = e.Cartesian3.distance(m, u), P = e.Cartesian3.distance(d, u), b = e.Cartesian3.subtract(u, d, new e.Cartesian3()), C = e.Cartesian3.subtract(m, d, new e.Cartesian3()), L = e.Cartesian3.subtract(m, u, new e.Cartesian3()), E = e.Cartesian3.subtract(d, u, new e.Cartesian3()), M = e.Cartesian3.dot(b, C), x = Math.sqrt(e.Cartesian3.dot(b, b)) * Math.sqrt(e.Cartesian3.dot(C, C)), I = e.Cartesian3.dot(L, E), D = Math.sqrt(e.Cartesian3.dot(L, L)) * Math.sqrt(e.Cartesian3.dot(E, E)), T = Math.acos(Math.min(Math.max(M / (x || 1), -1), 1)), S = Math.acos(Math.min(Math.max(I / (D || 1), -1), 1)), _ = new e.Cartesian3((d.x + m.x) / 2, (d.y + m.y) / 2, (d.z + m.z) / 2), k = new e.Cartesian3((m.x + u.x) / 2, (m.y + u.y) / 2, (m.z + u.z) / 2), A = new e.Cartesian3((d.x + u.x) / 2, (d.y + u.y) / 2, (d.z + u.z) / 2), R = e.Cartographic.fromCartesian(_), H = e.Cartographic.fromCartesian(k), B = e.Cartographic.fromCartesian(A), Y = e.Cartographic.fromCartesian(d), N = e.Cartographic.fromCartesian(u), z = "measure_triangle_seg_v", V = "measure_triangle_seg_h", se = "measure_triangle_seg_hyp", pe = "measure_triangle_angle_a", me = "measure_triangle_angle_b";
5544
+ this.segmentLabelIds.length === 0 && (this.segmentLabelIds = [z, V, se]), this.angleLabelIds.length === 0 && (this.angleLabelIds = [pe, me]), this.htmlLabelPool.add({ text: `${w.toFixed(2)} m` }, { id: z, lon: e.Math.toDegrees(R.longitude), lat: e.Math.toDegrees(R.latitude), height: R.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${v.toFixed(2)} m` }, { id: V, lon: e.Math.toDegrees(H.longitude), lat: e.Math.toDegrees(H.latitude), height: H.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${P.toFixed(2)} m` }, { id: se, lon: e.Math.toDegrees(B.longitude), lat: e.Math.toDegrees(B.latitude), height: B.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${(T * 180 / Math.PI).toFixed(2)}°` }, { id: pe, lon: e.Math.toDegrees(Y.longitude), lat: e.Math.toDegrees(Y.latitude), height: Y.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${(S * 180 / Math.PI).toFixed(2)}°` }, { id: me, lon: e.Math.toDegrees(N.longitude), lat: e.Math.toDegrees(N.latitude), height: N.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5545
+ const Ce = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), j = Math.min(w, v) * Ce;
5546
+ if (w > 1e-3 && v > 1e-3) {
5547
+ const W = e.Cartesian3.normalize(
5241
5548
  e.Cartesian3.subtract(d, m, new e.Cartesian3()),
5242
5549
  new e.Cartesian3()
5243
5550
  ), Z = e.Cartesian3.normalize(
5244
5551
  e.Cartesian3.subtract(u, m, new e.Cartesian3()),
5245
5552
  new e.Cartesian3()
5246
5553
  ), ne = new e.Cartesian3(
5247
- m.x + j.x * Y,
5248
- m.y + j.y * Y,
5249
- m.z + j.z * Y
5554
+ m.x + W.x * j,
5555
+ m.y + W.y * j,
5556
+ m.z + W.z * j
5250
5557
  ), ge = new e.Cartesian3(
5251
- m.x + Z.x * Y,
5252
- m.y + Z.y * Y,
5253
- m.z + Z.z * Y
5254
- ), W = new e.Cartesian3(
5255
- m.x + j.x * Y + Z.x * Y,
5256
- m.y + j.y * Y + Z.y * Y,
5257
- m.z + j.z * Y + Z.z * Y
5558
+ m.x + Z.x * j,
5559
+ m.y + Z.y * j,
5560
+ m.z + Z.z * j
5561
+ ), U = new e.Cartesian3(
5562
+ m.x + W.x * j + Z.x * j,
5563
+ m.y + W.y * j + Z.y * j,
5564
+ m.z + W.z * j + Z.z * j
5258
5565
  );
5259
- if (this.previewMarkerP1 = ne, this.previewMarkerP2 = ge, this.previewMarkerCorner = W, !this.previewAngleMarkerEntities.length) {
5260
- const V = i.entities.add({
5566
+ if (this.previewMarkerP1 = ne, this.previewMarkerP2 = ge, this.previewMarkerCorner = U, !this.previewAngleMarkerEntities.length) {
5567
+ const K = i.entities.add({
5261
5568
  polyline: {
5262
5569
  positions: new e.CallbackProperty(() => !this.previewMarkerP1 || !this.previewMarkerCorner ? [] : [this.previewMarkerP1, this.previewMarkerCorner], !1),
5263
5570
  width: t.width || 3,
5264
5571
  material: f,
5265
5572
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: y, dashLength: 12, dashPattern: 255 })
5266
5573
  }
5267
- }), X = i.entities.add({
5574
+ }), q = i.entities.add({
5268
5575
  polyline: {
5269
5576
  positions: new e.CallbackProperty(() => !this.previewMarkerP2 || !this.previewMarkerCorner ? [] : [this.previewMarkerP2, this.previewMarkerCorner], !1),
5270
5577
  width: t.width || 3,
@@ -5272,7 +5579,7 @@ class ft {
5272
5579
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: y, dashLength: 12, dashPattern: 255 })
5273
5580
  }
5274
5581
  });
5275
- this.previewAngleMarkerEntities.push(V, X);
5582
+ this.previewAngleMarkerEntities.push(K, q);
5276
5583
  }
5277
5584
  }
5278
5585
  }, e.ScreenSpaceEventType.MOUSE_MOVE);
@@ -5284,53 +5591,53 @@ class ft {
5284
5591
  this.stop(), this.segmentEntities.forEach((t) => this.viewer.entities.remove(t)), this.segmentEntities = [], this.angleMarkerEntities.forEach((t) => this.viewer.entities.remove(t)), this.angleMarkerEntities = [], this.pointEntities.forEach((t) => this.viewer.entities.remove(t)), this.pointEntities = [], this.previewSegmentEntities.forEach((t) => this.viewer.entities.remove(t)), this.previewSegmentEntities = [], this.previewAngleMarkerEntities.forEach((t) => this.viewer.entities.remove(t)), this.previewAngleMarkerEntities = [], this.previewPointEntity && (this.viewer.entities.remove(this.previewPointEntity), this.previewPointEntity = null), this.htmlLabelPool && this.htmlLabelId && (this.htmlLabelPool.removeByIds([this.htmlLabelId]), this.htmlLabelId = null), this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null), this.segmentLabelIds.length && this.htmlLabelPool && this.htmlLabelPool.removeByIds(this.segmentLabelIds.slice()), this.angleLabelIds.length && this.htmlLabelPool && this.htmlLabelPool.removeByIds(this.angleLabelIds.slice()), this.segmentLabelIds = [], this.angleLabelIds = [], this.positions = [];
5285
5592
  }
5286
5593
  rehydrate(t, e) {
5287
- var X, oe;
5288
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((oe = (X = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : oe.call(X, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((J) => new i.Cartesian3(J[0], J[1], J[2]));
5594
+ var q, oe;
5595
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((oe = (q = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : oe.call(q, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((J) => new i.Cartesian3(J[0], J[1], J[2]));
5289
5596
  if (l.length < 2) return;
5290
5597
  if (!this.htmlLabelPool) {
5291
5598
  const J = s.overlayContainerId || "html-label-container";
5292
- this.htmlLabelPool = e || new z(i, n, J), this.htmlLabelPool.registerTheme("measure-triangle", {
5293
- createElement: (R, U) => {
5599
+ this.htmlLabelPool = e || new G(i, n, J), this.htmlLabelPool.registerTheme("measure-triangle", {
5600
+ createElement: ($, X) => {
5294
5601
  var Q;
5295
- R.innerHTML = String(((Q = U == null ? void 0 : U.data) == null ? void 0 : Q.text) || ""), R.style.background = "rgba(0,0,0,0.6)", R.style.color = "#fff", R.style.font = "14px sans-serif", R.style.padding = "4px 6px", R.style.borderRadius = "4px", R.style.whiteSpace = "pre";
5602
+ $.innerHTML = String(((Q = X == null ? void 0 : X.data) == null ? void 0 : Q.text) || ""), $.style.background = "rgba(0,0,0,0.6)", $.style.color = "#fff", $.style.font = "14px sans-serif", $.style.padding = "4px 6px", $.style.borderRadius = "4px", $.style.whiteSpace = "pre";
5296
5603
  },
5297
5604
  options: { offset: { x: 0, y: -10 } }
5298
5605
  }), this.htmlLabelPool.registerTheme("measure-triangle-seg", {
5299
- createElement: (R, U) => {
5606
+ createElement: ($, X) => {
5300
5607
  var Q;
5301
- R.innerHTML = String(((Q = U == null ? void 0 : U.data) == null ? void 0 : Q.text) || ""), R.style.background = "rgba(0,0,0,0.6)", R.style.color = "#fff", R.style.font = "14px sans-serif", R.style.padding = "4px 6px", R.style.borderRadius = "4px", R.style.whiteSpace = "pre";
5608
+ $.innerHTML = String(((Q = X == null ? void 0 : X.data) == null ? void 0 : Q.text) || ""), $.style.background = "rgba(0,0,0,0.6)", $.style.color = "#fff", $.style.font = "14px sans-serif", $.style.padding = "4px 6px", $.style.borderRadius = "4px", $.style.whiteSpace = "pre";
5302
5609
  },
5303
5610
  options: { offset: { x: 0, y: -10 } }
5304
5611
  }), this.htmlLabelPool.registerTheme("measure-triangle-angle", {
5305
- createElement: (R, U) => {
5612
+ createElement: ($, X) => {
5306
5613
  var Q;
5307
- R.innerHTML = String(((Q = U == null ? void 0 : U.data) == null ? void 0 : Q.text) || ""), R.style.background = "rgba(0,0,0,0.6)", R.style.color = "#fff", R.style.font = "14px sans-serif", R.style.padding = "4px 6px", R.style.borderRadius = "4px", R.style.whiteSpace = "pre";
5614
+ $.innerHTML = String(((Q = X == null ? void 0 : X.data) == null ? void 0 : Q.text) || ""), $.style.background = "rgba(0,0,0,0.6)", $.style.color = "#fff", $.style.font = "14px sans-serif", $.style.padding = "4px 6px", $.style.borderRadius = "4px", $.style.whiteSpace = "pre";
5308
5615
  },
5309
5616
  options: { offset: { x: 0, y: -10 } }
5310
5617
  });
5311
5618
  }
5312
- const d = i.Cartographic.fromCartesian(l[0]), u = i.Cartographic.fromCartesian(l[1]), p = d.height || 0, g = u.height || 0, m = p <= g ? l[0] : l[1], f = p > g ? l[0] : l[1], y = n.entities.add({ position: m, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), v = n.entities.add({ position: f, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5313
- this.pointEntities.push(y, v);
5314
- const w = i.Cartographic.fromCartesian(m), P = Math.max(p, g), b = i.Cartesian3.fromDegrees(
5315
- i.Math.toDegrees(w.longitude),
5316
- i.Math.toDegrees(w.latitude),
5619
+ const d = i.Cartographic.fromCartesian(l[0]), u = i.Cartographic.fromCartesian(l[1]), g = d.height || 0, p = u.height || 0, m = g <= p ? l[0] : l[1], f = g > p ? l[0] : l[1], y = n.entities.add({ position: m, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), w = n.entities.add({ position: f, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5620
+ this.pointEntities.push(y, w);
5621
+ const v = i.Cartographic.fromCartesian(m), P = Math.max(g, p), b = i.Cartesian3.fromDegrees(
5622
+ i.Math.toDegrees(v.longitude),
5623
+ i.Math.toDegrees(v.latitude),
5317
5624
  P
5318
5625
  ), C = n.entities.add({
5319
5626
  polyline: { positions: [m, b], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5320
- }), E = n.entities.add({
5321
- polyline: { positions: [b, f], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5322
5627
  }), L = n.entities.add({
5628
+ polyline: { positions: [b, f], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5629
+ }), E = n.entities.add({
5323
5630
  polyline: { positions: [m, f], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5324
5631
  });
5325
- this.segmentEntities.push(C, E, L);
5326
- const M = i.Cartesian3.distance(m, b), x = i.Cartesian3.distance(b, f), I = i.Cartesian3.distance(m, f), D = new i.Cartesian3((m.x + b.x) / 2, (m.y + b.y) / 2, (m.z + b.z) / 2), T = new i.Cartesian3((b.x + f.x) / 2, (b.y + f.y) / 2, (b.z + f.z) / 2), S = new i.Cartesian3((m.x + f.x) / 2, (m.y + f.y) / 2, (m.z + f.z) / 2), _ = i.Cartographic.fromCartesian(D), k = i.Cartographic.fromCartesian(T), A = i.Cartographic.fromCartesian(S), $ = t.id + "_tri_v", O = t.id + "_tri_h", G = t.id + "_tri_hyp";
5327
- this.segmentLabelIds = [$, O, G], this.htmlLabelPool.add({ text: `${M.toFixed(2)} m` }, { id: $, lon: i.Math.toDegrees(_.longitude), lat: i.Math.toDegrees(_.latitude), height: _.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${x.toFixed(2)} m` }, { id: O, lon: i.Math.toDegrees(k.longitude), lat: i.Math.toDegrees(k.latitude), height: k.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${I.toFixed(2)} m` }, { id: G, lon: i.Math.toDegrees(A.longitude), lat: i.Math.toDegrees(A.latitude), height: A.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5328
- const B = i.Cartesian3.subtract(f, m, new i.Cartesian3()), N = i.Cartesian3.subtract(b, m, new i.Cartesian3()), K = i.Cartesian3.subtract(b, f, new i.Cartesian3()), q = i.Cartesian3.subtract(m, f, new i.Cartesian3()), se = i.Cartesian3.dot(B, N), pe = Math.sqrt(i.Cartesian3.dot(B, B)) * Math.sqrt(i.Cartesian3.dot(N, N)), me = i.Cartesian3.dot(K, q), Ce = Math.sqrt(i.Cartesian3.dot(K, K)) * Math.sqrt(i.Cartesian3.dot(q, q)), Y = Math.acos(Math.min(Math.max(se / (pe || 1), -1), 1)), le = Math.acos(Math.min(Math.max(me / (Ce || 1), -1), 1)), ee = i.Cartographic.fromCartesian(m), j = i.Cartographic.fromCartesian(f), Z = s.labelText || { angle: "角度" }, ne = t.id + "_tri_angA", ge = t.id + "_tri_angB";
5329
- this.angleLabelIds = [ne, ge], this.htmlLabelPool.add({ text: `${Z.angle}:${(Y * 180 / Math.PI).toFixed(2)}°` }, { id: ne, lon: i.Math.toDegrees(ee.longitude), lat: i.Math.toDegrees(ee.latitude), height: ee.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${Z.angle}:${(le * 180 / Math.PI).toFixed(2)}°` }, { id: ge, lon: i.Math.toDegrees(j.longitude), lat: i.Math.toDegrees(j.latitude), height: j.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5330
- const W = Math.max(0.01, Math.min(0.5, s.angleMarkerRatio ?? 0.2)), V = Math.min(M, x) * W;
5632
+ this.segmentEntities.push(C, L, E);
5633
+ const M = i.Cartesian3.distance(m, b), x = i.Cartesian3.distance(b, f), I = i.Cartesian3.distance(m, f), D = new i.Cartesian3((m.x + b.x) / 2, (m.y + b.y) / 2, (m.z + b.z) / 2), T = new i.Cartesian3((b.x + f.x) / 2, (b.y + f.y) / 2, (b.z + f.z) / 2), S = new i.Cartesian3((m.x + f.x) / 2, (m.y + f.y) / 2, (m.z + f.z) / 2), _ = i.Cartographic.fromCartesian(D), k = i.Cartographic.fromCartesian(T), A = i.Cartographic.fromCartesian(S), R = t.id + "_tri_v", H = t.id + "_tri_h", B = t.id + "_tri_hyp";
5634
+ this.segmentLabelIds = [R, H, B], this.htmlLabelPool.add({ text: `${M.toFixed(2)} m` }, { id: R, lon: i.Math.toDegrees(_.longitude), lat: i.Math.toDegrees(_.latitude), height: _.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${x.toFixed(2)} m` }, { id: H, lon: i.Math.toDegrees(k.longitude), lat: i.Math.toDegrees(k.latitude), height: k.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${I.toFixed(2)} m` }, { id: B, lon: i.Math.toDegrees(A.longitude), lat: i.Math.toDegrees(A.latitude), height: A.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5635
+ const Y = i.Cartesian3.subtract(f, m, new i.Cartesian3()), N = i.Cartesian3.subtract(b, m, new i.Cartesian3()), z = i.Cartesian3.subtract(b, f, new i.Cartesian3()), V = i.Cartesian3.subtract(m, f, new i.Cartesian3()), se = i.Cartesian3.dot(Y, N), pe = Math.sqrt(i.Cartesian3.dot(Y, Y)) * Math.sqrt(i.Cartesian3.dot(N, N)), me = i.Cartesian3.dot(z, V), Ce = Math.sqrt(i.Cartesian3.dot(z, z)) * Math.sqrt(i.Cartesian3.dot(V, V)), j = Math.acos(Math.min(Math.max(se / (pe || 1), -1), 1)), le = Math.acos(Math.min(Math.max(me / (Ce || 1), -1), 1)), ee = i.Cartographic.fromCartesian(m), W = i.Cartographic.fromCartesian(f), Z = s.labelText || { angle: "角度" }, ne = t.id + "_tri_angA", ge = t.id + "_tri_angB";
5636
+ this.angleLabelIds = [ne, ge], this.htmlLabelPool.add({ text: `${Z.angle}:${(j * 180 / Math.PI).toFixed(2)}°` }, { id: ne, lon: i.Math.toDegrees(ee.longitude), lat: i.Math.toDegrees(ee.latitude), height: ee.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${Z.angle}:${(le * 180 / Math.PI).toFixed(2)}°` }, { id: ge, lon: i.Math.toDegrees(W.longitude), lat: i.Math.toDegrees(W.latitude), height: W.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
5637
+ const U = Math.max(0.01, Math.min(0.5, s.angleMarkerRatio ?? 0.2)), K = Math.min(M, x) * U;
5331
5638
  if (M > 1e-3 && x > 1e-3) {
5332
- const J = i.Cartesian3.normalize(i.Cartesian3.subtract(m, b, new i.Cartesian3()), new i.Cartesian3()), R = i.Cartesian3.normalize(i.Cartesian3.subtract(f, b, new i.Cartesian3()), new i.Cartesian3()), U = new i.Cartesian3(b.x + J.x * V, b.y + J.y * V, b.z + J.z * V), Q = new i.Cartesian3(b.x + R.x * V, b.y + R.y * V, b.z + R.z * V), Te = new i.Cartesian3(b.x + J.x * V + R.x * V, b.y + J.y * V + R.y * V, b.z + J.z * V + R.z * V), Ft = n.entities.add({ polyline: { positions: [U, Te], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } }), zt = n.entities.add({ polyline: { positions: [Q, Te], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } });
5333
- this.angleMarkerEntities.push(Ft, zt);
5639
+ const J = i.Cartesian3.normalize(i.Cartesian3.subtract(m, b, new i.Cartesian3()), new i.Cartesian3()), $ = i.Cartesian3.normalize(i.Cartesian3.subtract(f, b, new i.Cartesian3()), new i.Cartesian3()), X = new i.Cartesian3(b.x + J.x * K, b.y + J.y * K, b.z + J.z * K), Q = new i.Cartesian3(b.x + $.x * K, b.y + $.y * K, b.z + $.z * K), Te = new i.Cartesian3(b.x + J.x * K + $.x * K, b.y + J.y * K + $.y * K, b.z + J.z * K + $.z * K), Ft = n.entities.add({ polyline: { positions: [X, Te], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } }), Nt = n.entities.add({ polyline: { positions: [Q, Te], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } });
5640
+ this.angleMarkerEntities.push(Ft, Nt);
5334
5641
  }
5335
5642
  }
5336
5643
  }
@@ -5355,7 +5662,7 @@ class yt {
5355
5662
  const e = this.Cesium, i = this.viewer;
5356
5663
  if (!this.htmlLabelPool) {
5357
5664
  const n = t.overlayContainerId || "html-label-container";
5358
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-space", {
5665
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-space", {
5359
5666
  createElement: (s, o) => {
5360
5667
  var r;
5361
5668
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -5378,24 +5685,24 @@ class yt {
5378
5685
  });
5379
5686
  if (this.tempPoints.push(o), this.positions.length === 2) {
5380
5687
  this.stop(), this.previewEntity && (this.viewer.entities.remove(this.previewEntity), this.previewEntity = null), this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
5381
- const d = this.positions[0], u = this.positions[1], p = t.lineColor || t.color || e.Color.YELLOW, g = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED;
5688
+ const d = this.positions[0], u = this.positions[1], g = t.lineColor || t.color || e.Color.YELLOW, p = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED;
5382
5689
  this.entity = i.entities.add({
5383
5690
  polyline: {
5384
5691
  positions: [d, u],
5385
5692
  width: t.width || 3,
5386
- material: p,
5693
+ material: g,
5387
5694
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5388
- color: g,
5695
+ color: p,
5389
5696
  dashLength: 12,
5390
5697
  dashPattern: 255
5391
5698
  })
5392
5699
  }
5393
5700
  });
5394
- const m = e.Cartesian3.distance(d, u), f = u, y = e.Cartographic.fromCartesian(f), v = this.htmlLabelId || `measure_space_${Date.now()}`;
5395
- this.htmlLabelId = v, this.htmlLabelPool.add(
5701
+ const m = e.Cartesian3.distance(d, u), f = u, y = e.Cartographic.fromCartesian(f), w = this.htmlLabelId || `measure_space_${Date.now()}`;
5702
+ this.htmlLabelId = w, this.htmlLabelPool.add(
5396
5703
  { text: `${m.toFixed(2)} m` },
5397
5704
  {
5398
- id: v,
5705
+ id: w,
5399
5706
  lon: e.Math.toDegrees(y.longitude),
5400
5707
  lat: e.Math.toDegrees(y.latitude),
5401
5708
  height: y.height || 0,
@@ -5404,17 +5711,17 @@ class yt {
5404
5711
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
5405
5712
  }
5406
5713
  );
5407
- const w = {
5714
+ const v = {
5408
5715
  entity: this.entity,
5409
5716
  label: this.labelEntity,
5410
5717
  positions: this.positions,
5411
5718
  distance: m,
5412
5719
  clear: () => this.clear()
5413
5720
  };
5414
- (l = t.onComplete) == null || l.call(t, w);
5721
+ (l = t.onComplete) == null || l.call(t, v);
5415
5722
  }
5416
5723
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
5417
- var g, m;
5724
+ var p, m;
5418
5725
  if (this.positions.length !== 1) return;
5419
5726
  const s = i.scene.pickPosition(n.endPosition);
5420
5727
  if (!s) return;
@@ -5436,14 +5743,14 @@ class yt {
5436
5743
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
5437
5744
  }
5438
5745
  );
5439
- const u = t.lineColor || t.color || e.Color.YELLOW, p = ((m = (g = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : m.call(g, 0.9)) || e.Color.RED;
5746
+ const u = t.lineColor || t.color || e.Color.YELLOW, g = ((m = (p = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : m.call(p, 0.9)) || e.Color.RED;
5440
5747
  this.previewEntity || (this.previewEntity = i.entities.add({
5441
5748
  polyline: {
5442
5749
  positions: new e.CallbackProperty(() => !this.previewPos || !this.positions.length ? [] : [this.positions[0], this.previewPos], !1),
5443
5750
  width: t.width || 3,
5444
5751
  material: u,
5445
5752
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5446
- color: p,
5753
+ color: g,
5447
5754
  dashLength: 12,
5448
5755
  dashPattern: 255
5449
5756
  })
@@ -5459,25 +5766,25 @@ class yt {
5459
5766
  }
5460
5767
  rehydrate(t, e) {
5461
5768
  var d, u;
5462
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((u = (d = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : u.call(d, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((p) => new i.Cartesian3(p[0], p[1], p[2]));
5769
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((u = (d = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : u.call(d, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((g) => new i.Cartesian3(g[0], g[1], g[2]));
5463
5770
  if (l.length) {
5464
5771
  if (!this.htmlLabelPool) {
5465
- const p = s.overlayContainerId || "html-label-container";
5466
- this.htmlLabelPool = e || new z(i, n, p), this.htmlLabelPool.registerTheme("measure-space", {
5467
- createElement: (g, m) => {
5772
+ const g = s.overlayContainerId || "html-label-container";
5773
+ this.htmlLabelPool = e || new G(i, n, g), this.htmlLabelPool.registerTheme("measure-space", {
5774
+ createElement: (p, m) => {
5468
5775
  var f;
5469
- g.innerHTML = String(((f = m == null ? void 0 : m.data) == null ? void 0 : f.text) || ""), g.style.background = "rgba(0,0,0,0.6)", g.style.color = "#fff", g.style.font = "14px sans-serif", g.style.padding = "4px 6px", g.style.borderRadius = "4px", g.style.whiteSpace = "pre";
5776
+ p.innerHTML = String(((f = m == null ? void 0 : m.data) == null ? void 0 : f.text) || ""), p.style.background = "rgba(0,0,0,0.6)", p.style.color = "#fff", p.style.font = "14px sans-serif", p.style.padding = "4px 6px", p.style.borderRadius = "4px", p.style.whiteSpace = "pre";
5470
5777
  },
5471
5778
  options: { offset: { x: 0, y: -10 } }
5472
5779
  });
5473
5780
  }
5474
5781
  if (l.length >= 1) {
5475
- const p = n.entities.add({ position: l[0], point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5476
- this.tempPoints.push(p);
5782
+ const g = n.entities.add({ position: l[0], point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5783
+ this.tempPoints.push(g);
5477
5784
  }
5478
5785
  if (l.length >= 2) {
5479
- const p = n.entities.add({ position: l[1], point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5480
- this.tempPoints.push(p), this.entity = n.entities.add({
5786
+ const g = n.entities.add({ position: l[1], point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5787
+ this.tempPoints.push(g), this.entity = n.entities.add({
5481
5788
  polyline: {
5482
5789
  positions: [l[0], l[1]],
5483
5790
  width: a,
@@ -5485,8 +5792,8 @@ class yt {
5485
5792
  depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 })
5486
5793
  }
5487
5794
  });
5488
- const g = i.Cartesian3.distance(l[0], l[1]), m = i.Cartographic.fromCartesian(l[1]), f = t.id + "_label";
5489
- this.htmlLabelId = f, this.htmlLabelPool.add({ text: `${g.toFixed(2)} m` }, {
5795
+ const p = i.Cartesian3.distance(l[0], l[1]), m = i.Cartographic.fromCartesian(l[1]), f = t.id + "_label";
5796
+ this.htmlLabelId = f, this.htmlLabelPool.add({ text: `${p.toFixed(2)} m` }, {
5490
5797
  id: f,
5491
5798
  lon: i.Math.toDegrees(m.longitude),
5492
5799
  lat: i.Math.toDegrees(m.latitude),
@@ -5499,7 +5806,7 @@ class yt {
5499
5806
  }
5500
5807
  }
5501
5808
  }
5502
- const Re = class Re {
5809
+ const $e = class $e {
5503
5810
  constructor(t, e) {
5504
5811
  c(this, "Cesium");
5505
5812
  c(this, "viewer");
@@ -5530,7 +5837,7 @@ const Re = class Re {
5530
5837
  const e = this.Cesium, i = this.viewer;
5531
5838
  if (!this.htmlLabelPool) {
5532
5839
  const n = t.overlayContainerId || "html-label-container";
5533
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-area", {
5840
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-area", {
5534
5841
  createElement: (s, o) => {
5535
5842
  var r;
5536
5843
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -5550,8 +5857,8 @@ const Re = class Re {
5550
5857
  options: { offset: { x: 0, y: -10 } }
5551
5858
  });
5552
5859
  }
5553
- this.tooltip = new ce(), this.tooltip.show(Re.TIP_TEXT), this._bindGlobalEvents(t, e, i), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
5554
- var p, g;
5860
+ this.tooltip = new ce(), this.tooltip.show($e.TIP_TEXT), this._bindGlobalEvents(t, e, i), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
5861
+ var g, p;
5555
5862
  const s = i.scene.pickPosition(n.position);
5556
5863
  if (!s) return;
5557
5864
  this.positions.push(s);
@@ -5584,14 +5891,14 @@ const Re = class Re {
5584
5891
  })
5585
5892
  }), i.scene.primitives.add(this.primitive), this.positions.length >= 2) {
5586
5893
  if (this.edgeEntities.length) {
5587
- for (const w of this.edgeEntities)
5894
+ for (const v of this.edgeEntities)
5588
5895
  try {
5589
- i.entities.remove(w);
5896
+ i.entities.remove(v);
5590
5897
  } catch {
5591
5898
  }
5592
5899
  this.edgeEntities = [];
5593
5900
  }
5594
- const m = t.lineColor || t.color || e.Color.YELLOW, f = ((g = (p = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : g.call(p, 0.9)) || e.Color.RED, y = this.positions.concat([this.positions[0]]), v = i.entities.add({
5901
+ const m = t.lineColor || t.color || e.Color.YELLOW, f = ((p = (g = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : p.call(g, 0.9)) || e.Color.RED, y = this.positions.concat([this.positions[0]]), w = i.entities.add({
5595
5902
  polyline: {
5596
5903
  positions: y,
5597
5904
  width: t.width || 2,
@@ -5605,7 +5912,7 @@ const Re = class Re {
5605
5912
  })
5606
5913
  }
5607
5914
  });
5608
- this.edgeEntities.push(v);
5915
+ this.edgeEntities.push(w);
5609
5916
  }
5610
5917
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
5611
5918
  var m, f;
@@ -5614,23 +5921,23 @@ const Re = class Re {
5614
5921
  if (!s) return;
5615
5922
  this.previewPos = s;
5616
5923
  const o = this.positions.concat([s]), r = new e.Cartesian3(
5617
- o.reduce((y, v) => y + v.x, 0) / o.length,
5618
- o.reduce((y, v) => y + v.y, 0) / o.length,
5619
- o.reduce((y, v) => y + v.z, 0) / o.length
5924
+ o.reduce((y, w) => y + w.x, 0) / o.length,
5925
+ o.reduce((y, w) => y + w.y, 0) / o.length,
5926
+ o.reduce((y, w) => y + w.z, 0) / o.length
5620
5927
  ), l = new e.EllipsoidTangentPlane(r, e.Ellipsoid.WGS84).projectPointsOntoPlane(o);
5621
5928
  let d = 0;
5622
5929
  for (let y = 0; y < l.length; y++) {
5623
- const v = (y + 1) % l.length;
5624
- d += l[y].x * l[v].y - l[v].x * l[y].y;
5930
+ const w = (y + 1) % l.length;
5931
+ d += l[y].x * l[w].y - l[w].x * l[y].y;
5625
5932
  }
5626
5933
  d = Math.abs(d) / 2;
5627
- const u = e.Cartographic.fromCartesian(r), p = this.previewLabelId || "measure_area_preview";
5628
- this.previewLabelId = p;
5629
- const g = t.labelText || { area: "面积" };
5934
+ const u = e.Cartographic.fromCartesian(r), g = this.previewLabelId || "measure_area_preview";
5935
+ this.previewLabelId = g;
5936
+ const p = t.labelText || { area: "面积" };
5630
5937
  if (this.htmlLabelPool.add(
5631
- { text: `${g.area}:${d.toFixed(2)} m²` },
5938
+ { text: `${p.area}:${d.toFixed(2)} m²` },
5632
5939
  {
5633
- id: p,
5940
+ id: g,
5634
5941
  lon: e.Math.toDegrees(u.longitude),
5635
5942
  lat: e.Math.toDegrees(u.latitude),
5636
5943
  height: u.height || 0,
@@ -5651,16 +5958,16 @@ const Re = class Re {
5651
5958
  arcType: e.ArcType.NONE
5652
5959
  }
5653
5960
  });
5654
- const v = t.lineColor || t.color || e.Color.YELLOW, w = ((f = (m = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || e.Color.RED;
5961
+ const w = t.lineColor || t.color || e.Color.YELLOW, v = ((f = (m = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || e.Color.RED;
5655
5962
  this.previewEdgeEntity = i.entities.add({
5656
5963
  polyline: {
5657
5964
  positions: new e.CallbackProperty(() => !this.previewPos || !this.positions.length ? [] : this.positions.concat([this.previewPos, this.positions[0]]), !1),
5658
5965
  width: t.width || 2,
5659
- material: v,
5966
+ material: w,
5660
5967
  clampToGround: !1,
5661
5968
  arcType: e.ArcType.NONE,
5662
5969
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5663
- color: w,
5970
+ color: v,
5664
5971
  dashLength: 12,
5665
5972
  dashPattern: 255
5666
5973
  })
@@ -5753,15 +6060,15 @@ const Re = class Re {
5753
6060
  closed: !0
5754
6061
  })
5755
6062
  }), i.scene.primitives.add(this.primitive), this.positions.length >= 2) {
5756
- const u = t.lineColor || t.color || e.Color.YELLOW, p = ((d = (l = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : d.call(l, 0.9)) || e.Color.RED, g = this.positions.concat([this.positions[0]]), m = i.entities.add({
6063
+ const u = t.lineColor || t.color || e.Color.YELLOW, g = ((d = (l = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : d.call(l, 0.9)) || e.Color.RED, p = this.positions.concat([this.positions[0]]), m = i.entities.add({
5757
6064
  polyline: {
5758
- positions: g,
6065
+ positions: p,
5759
6066
  width: t.width || 2,
5760
6067
  material: u,
5761
6068
  clampToGround: !1,
5762
6069
  arcType: e.ArcType.NONE,
5763
6070
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5764
- color: p,
6071
+ color: g,
5765
6072
  dashLength: 12,
5766
6073
  dashPattern: 255
5767
6074
  })
@@ -5777,7 +6084,7 @@ const Re = class Re {
5777
6084
  n && i.entities.remove(n), this._clearPreviewState(), this._rebuildShape(t, e, i);
5778
6085
  }
5779
6086
  _finishMeasurement(t, e, i) {
5780
- var g;
6087
+ var p;
5781
6088
  if (i && this.positions.length >= 3) {
5782
6089
  this.positions.pop();
5783
6090
  const m = this.tempPoints.pop();
@@ -5814,14 +6121,14 @@ const Re = class Re {
5814
6121
  }
5815
6122
  ), this.labelEntity = this.htmlLabelId;
5816
6123
  for (let m = 0; m < this.positions.length; m++) {
5817
- const f = (m + 1) % this.positions.length, y = this.positions[m], v = this.positions[f], w = e.Cartographic.fromCartesian(y), P = e.Cartographic.fromCartesian(v), C = new e.EllipsoidGeodesic(w, P).surfaceDistance, E = new e.Cartesian3((y.x + v.x) / 2, (y.y + v.y) / 2, (y.z + v.z) / 2), L = e.Cartographic.fromCartesian(E), M = `measure_area_seg_${Date.now()}_${m}`;
6124
+ const f = (m + 1) % this.positions.length, y = this.positions[m], w = this.positions[f], v = e.Cartographic.fromCartesian(y), P = e.Cartographic.fromCartesian(w), C = new e.EllipsoidGeodesic(v, P).surfaceDistance, L = new e.Cartesian3((y.x + w.x) / 2, (y.y + w.y) / 2, (y.z + w.z) / 2), E = e.Cartographic.fromCartesian(L), M = `measure_area_seg_${Date.now()}_${m}`;
5818
6125
  this.segmentLabelIds.push(M), this.htmlLabelPool.add(
5819
6126
  { text: `${d.side}:${C.toFixed(2)} m` },
5820
6127
  {
5821
6128
  id: M,
5822
- lon: e.Math.toDegrees(L.longitude),
5823
- lat: e.Math.toDegrees(L.latitude),
5824
- height: L.height || 0,
6129
+ lon: e.Math.toDegrees(E.longitude),
6130
+ lat: e.Math.toDegrees(E.latitude),
6131
+ height: E.height || 0,
5825
6132
  theme: "measure-area-seg",
5826
6133
  show: !0
5827
6134
  }
@@ -5829,9 +6136,9 @@ const Re = class Re {
5829
6136
  }
5830
6137
  const u = o;
5831
6138
  for (let m = 0; m < u.length; m++) {
5832
- const f = u[(m - 1 + u.length) % u.length], y = u[m], v = u[(m + 1) % u.length], w = f.x - y.x, P = f.y - y.y, b = v.x - y.x, C = v.y - y.y, E = Math.sqrt(w * w + P * P), L = Math.sqrt(b * b + C * C);
5833
- if (!E || !L) continue;
5834
- const M = w / E * (b / L) + P / E * (C / L), x = Math.acos(Math.min(1, Math.max(-1, M))) * (180 / Math.PI), I = e.Cartographic.fromCartesian(this.positions[m]), D = `measure_area_angle_${Date.now()}_${m}`;
6139
+ const f = u[(m - 1 + u.length) % u.length], y = u[m], w = u[(m + 1) % u.length], v = f.x - y.x, P = f.y - y.y, b = w.x - y.x, C = w.y - y.y, L = Math.sqrt(v * v + P * P), E = Math.sqrt(b * b + C * C);
6140
+ if (!L || !E) continue;
6141
+ const M = v / L * (b / E) + P / L * (C / E), x = Math.acos(Math.min(1, Math.max(-1, M))) * (180 / Math.PI), I = e.Cartographic.fromCartesian(this.positions[m]), D = `measure_area_angle_${Date.now()}_${m}`;
5835
6142
  this.angleLabelIds.push(D), this.htmlLabelPool.add(
5836
6143
  { text: `${d.angle}:${x.toFixed(2)} °` },
5837
6144
  {
@@ -5844,14 +6151,14 @@ const Re = class Re {
5844
6151
  }
5845
6152
  );
5846
6153
  }
5847
- const p = {
6154
+ const g = {
5848
6155
  entity: this.primitive,
5849
6156
  label: this.labelEntity,
5850
6157
  positions: this.positions,
5851
6158
  area: r,
5852
6159
  clear: () => this.clear()
5853
6160
  };
5854
- (g = t.onComplete) == null || g.call(t, p);
6161
+ (p = t.onComplete) == null || p.call(t, g);
5855
6162
  }
5856
6163
  _bindGlobalEvents(t, e, i) {
5857
6164
  this.keydownHandler = (n) => {
@@ -5865,73 +6172,73 @@ const Re = class Re {
5865
6172
  if (o.length < 3) return;
5866
6173
  if (!this.htmlLabelPool) {
5867
6174
  const C = s.overlayContainerId || "html-label-container";
5868
- this.htmlLabelPool = e || new z(i, n, C), this.htmlLabelPool.registerTheme("measure-area", {
5869
- createElement: (E, L) => {
6175
+ this.htmlLabelPool = e || new G(i, n, C), this.htmlLabelPool.registerTheme("measure-area", {
6176
+ createElement: (L, E) => {
5870
6177
  var M;
5871
- E.innerHTML = String(((M = L == null ? void 0 : L.data) == null ? void 0 : M.text) || ""), E.style.background = "rgba(0,0,0,0.6)", E.style.color = "#fff", E.style.font = "14px sans-serif", E.style.padding = "4px 6px", E.style.borderRadius = "4px", E.style.whiteSpace = "pre";
6178
+ L.innerHTML = String(((M = E == null ? void 0 : E.data) == null ? void 0 : M.text) || ""), L.style.background = "rgba(0,0,0,0.6)", L.style.color = "#fff", L.style.font = "14px sans-serif", L.style.padding = "4px 6px", L.style.borderRadius = "4px", L.style.whiteSpace = "pre";
5872
6179
  },
5873
6180
  options: { offset: { x: 0, y: -10 } }
5874
6181
  }), this.htmlLabelPool.registerTheme("measure-area-seg", {
5875
- createElement: (E, L) => {
6182
+ createElement: (L, E) => {
5876
6183
  var M;
5877
- E.innerHTML = String(((M = L == null ? void 0 : L.data) == null ? void 0 : M.text) || ""), E.style.background = "rgba(0,0,0,0.6)", E.style.color = "#fff", E.style.font = "14px sans-serif", E.style.padding = "4px 6px", E.style.borderRadius = "4px", E.style.whiteSpace = "pre";
6184
+ L.innerHTML = String(((M = E == null ? void 0 : E.data) == null ? void 0 : M.text) || ""), L.style.background = "rgba(0,0,0,0.6)", L.style.color = "#fff", L.style.font = "14px sans-serif", L.style.padding = "4px 6px", L.style.borderRadius = "4px", L.style.whiteSpace = "pre";
5878
6185
  },
5879
6186
  options: { offset: { x: 0, y: -10 } }
5880
6187
  }), this.htmlLabelPool.registerTheme("measure-area-angle", {
5881
- createElement: (E, L) => {
6188
+ createElement: (L, E) => {
5882
6189
  var M;
5883
- E.innerHTML = String(((M = L == null ? void 0 : L.data) == null ? void 0 : M.text) || ""), E.style.background = "rgba(0,0,0,0.6)", E.style.color = "#fff", E.style.font = "14px sans-serif", E.style.padding = "4px 6px", E.style.borderRadius = "4px", E.style.whiteSpace = "pre";
6190
+ L.innerHTML = String(((M = E == null ? void 0 : E.data) == null ? void 0 : M.text) || ""), L.style.background = "rgba(0,0,0,0.6)", L.style.color = "#fff", L.style.font = "14px sans-serif", L.style.padding = "4px 6px", L.style.borderRadius = "4px", L.style.whiteSpace = "pre";
5884
6191
  },
5885
6192
  options: { offset: { x: 0, y: -10 } }
5886
6193
  });
5887
6194
  }
5888
6195
  for (const C of o) {
5889
- const E = n.entities.add({ position: C, point: { pixelSize: 8, color: s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5890
- this.tempPoints.push(E);
6196
+ const L = n.entities.add({ position: C, point: { pixelSize: 8, color: s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
6197
+ this.tempPoints.push(L);
5891
6198
  }
5892
6199
  const r = new i.Cartesian3(
5893
- o.reduce((C, E) => C + E.x, 0) / o.length,
5894
- o.reduce((C, E) => C + E.y, 0) / o.length,
5895
- o.reduce((C, E) => C + E.z, 0) / o.length
6200
+ o.reduce((C, L) => C + L.x, 0) / o.length,
6201
+ o.reduce((C, L) => C + L.y, 0) / o.length,
6202
+ o.reduce((C, L) => C + L.z, 0) / o.length
5896
6203
  ), l = new i.EllipsoidTangentPlane(r, i.Ellipsoid.WGS84).projectPointsOntoPlane(o);
5897
6204
  let d = 0;
5898
6205
  for (let C = 0; C < l.length; C++) {
5899
- const E = (C + 1) % l.length;
5900
- d += l[C].x * l[E].y - l[E].x * l[C].y;
6206
+ const L = (C + 1) % l.length;
6207
+ d += l[C].x * l[L].y - l[L].x * l[C].y;
5901
6208
  }
5902
6209
  d = Math.abs(d) / 2;
5903
- const u = i.Cartographic.fromCartesian(r), p = t.id + "_area";
5904
- this.htmlLabelId = p;
5905
- const g = s.labelText || { area: "面积", side: "边长", angle: "角度" };
5906
- this.htmlLabelPool.add({ text: `${g.area}:${d.toFixed(2)} m²` }, {
5907
- id: p,
6210
+ const u = i.Cartographic.fromCartesian(r), g = t.id + "_area";
6211
+ this.htmlLabelId = g;
6212
+ const p = s.labelText || { area: "面积", side: "边长", angle: "角度" };
6213
+ this.htmlLabelPool.add({ text: `${p.area}:${d.toFixed(2)} m²` }, {
6214
+ id: g,
5908
6215
  lon: i.Math.toDegrees(u.longitude),
5909
6216
  lat: i.Math.toDegrees(u.latitude),
5910
6217
  height: u.height || 0,
5911
6218
  theme: "measure-area",
5912
6219
  show: !0
5913
6220
  });
5914
- const m = new i.PolygonHierarchy(o), f = new i.PolygonGeometry({ polygonHierarchy: m, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT, perPositionHeight: !0 }), y = new i.GeometryInstance({ geometry: f }), v = s.color || i.Color.YELLOW.withAlpha(0.4), w = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), P = new i.Primitive({
6221
+ const m = new i.PolygonHierarchy(o), f = new i.PolygonGeometry({ polygonHierarchy: m, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT, perPositionHeight: !0 }), y = new i.GeometryInstance({ geometry: f }), w = s.color || i.Color.YELLOW.withAlpha(0.4), v = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), P = new i.Primitive({
5915
6222
  geometryInstances: y,
5916
- appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: v }), translucent: !0, closed: !0 }),
5917
- depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: w }), translucent: !0, closed: !0 })
6223
+ appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: w }), translucent: !0, closed: !0 }),
6224
+ depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: v }), translucent: !0, closed: !0 })
5918
6225
  });
5919
6226
  n.scene.primitives.add(P), this.primitive = P;
5920
6227
  for (let C = 0; C < o.length; C++) {
5921
- const E = (C + 1) % o.length, L = o[C], M = o[E], x = i.Cartographic.fromCartesian(L), I = i.Cartographic.fromCartesian(M), T = new i.EllipsoidGeodesic(x, I).surfaceDistance, S = new i.Cartesian3((L.x + M.x) / 2, (L.y + M.y) / 2, (L.z + M.z) / 2), _ = i.Cartographic.fromCartesian(S), k = t.id + `_area_seg_${C}`;
5922
- this.segmentLabelIds.push(k), this.htmlLabelPool.add({ text: `${g.side}:${T.toFixed(2)} m` }, { id: k, lon: i.Math.toDegrees(_.longitude), lat: i.Math.toDegrees(_.latitude), height: _.height || 0, theme: "measure-area-seg", show: !0 });
6228
+ const L = (C + 1) % o.length, E = o[C], M = o[L], x = i.Cartographic.fromCartesian(E), I = i.Cartographic.fromCartesian(M), T = new i.EllipsoidGeodesic(x, I).surfaceDistance, S = new i.Cartesian3((E.x + M.x) / 2, (E.y + M.y) / 2, (E.z + M.z) / 2), _ = i.Cartographic.fromCartesian(S), k = t.id + `_area_seg_${C}`;
6229
+ this.segmentLabelIds.push(k), this.htmlLabelPool.add({ text: `${p.side}:${T.toFixed(2)} m` }, { id: k, lon: i.Math.toDegrees(_.longitude), lat: i.Math.toDegrees(_.latitude), height: _.height || 0, theme: "measure-area-seg", show: !0 });
5923
6230
  }
5924
6231
  const b = l;
5925
6232
  for (let C = 0; C < b.length; C++) {
5926
- const E = b[(C - 1 + b.length) % b.length], L = b[C], M = b[(C + 1) % b.length], x = E.x - L.x, I = E.y - L.y, D = M.x - L.x, T = M.y - L.y, S = Math.sqrt(x * x + I * I), _ = Math.sqrt(D * D + T * T);
6233
+ const L = b[(C - 1 + b.length) % b.length], E = b[C], M = b[(C + 1) % b.length], x = L.x - E.x, I = L.y - E.y, D = M.x - E.x, T = M.y - E.y, S = Math.sqrt(x * x + I * I), _ = Math.sqrt(D * D + T * T);
5927
6234
  if (!S || !_) continue;
5928
- const k = x / S * (D / _) + I / S * (T / _), A = Math.acos(Math.min(1, Math.max(-1, k))) * (180 / Math.PI), $ = i.Cartographic.fromCartesian(o[C]), O = t.id + `_area_angle_${C}`;
5929
- this.angleLabelIds.push(O), this.htmlLabelPool.add({ text: `${g.angle}:${A.toFixed(2)} °` }, { id: O, lon: i.Math.toDegrees($.longitude), lat: i.Math.toDegrees($.latitude), height: $.height || 0, theme: "measure-area-angle", show: !0 });
6235
+ const k = x / S * (D / _) + I / S * (T / _), A = Math.acos(Math.min(1, Math.max(-1, k))) * (180 / Math.PI), R = i.Cartographic.fromCartesian(o[C]), H = t.id + `_area_angle_${C}`;
6236
+ this.angleLabelIds.push(H), this.htmlLabelPool.add({ text: `${p.angle}:${A.toFixed(2)} °` }, { id: H, lon: i.Math.toDegrees(R.longitude), lat: i.Math.toDegrees(R.latitude), height: R.height || 0, theme: "measure-area-angle", show: !0 });
5930
6237
  }
5931
6238
  }
5932
6239
  };
5933
- c(Re, "TIP_TEXT", "单击左键添加点,右键撤销,双击左键或Esc结束");
5934
- let Ae = Re;
6240
+ c($e, "TIP_TEXT", "单击左键添加点,右键撤销,双击左键或Esc结束");
6241
+ let Ae = $e;
5935
6242
  class wt {
5936
6243
  constructor(t, e) {
5937
6244
  c(this, "Cesium");
@@ -5954,7 +6261,7 @@ class wt {
5954
6261
  const e = this.Cesium, i = this.viewer;
5955
6262
  if (!this.htmlLabelPool) {
5956
6263
  const n = t.overlayContainerId || "html-label-container";
5957
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-circle", {
6264
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-circle", {
5958
6265
  createElement: (s, o) => {
5959
6266
  var a;
5960
6267
  const r = ((a = o == null ? void 0 : o.data) == null ? void 0 : a.text) || "";
@@ -5968,15 +6275,15 @@ class wt {
5968
6275
  const s = i.scene.pickPosition(n.position);
5969
6276
  if (s && (this.positions.push(s), this.positions.length === 2)) {
5970
6277
  this.stop();
5971
- const r = this.positions[0], a = this.positions[1], l = e.Cartesian3.distance(r, a), d = Math.PI * l * l, u = 2 * Math.PI * l, p = t.labelText || { radius: "半径", area: "面积", circumference: "周长" }, g = r;
5972
- this.labelEntity ? (this.labelEntity.position = g, this.labelEntity.label.text = `${p.radius}:${l.toFixed(2)} m
5973
- ${p.area}:${d.toFixed(2)} m²
5974
- ${p.circumference}:${u.toFixed(2)} m`) : this.labelEntity = i.entities.add({
5975
- position: g,
6278
+ const r = this.positions[0], a = this.positions[1], l = e.Cartesian3.distance(r, a), d = Math.PI * l * l, u = 2 * Math.PI * l, g = t.labelText || { radius: "半径", area: "面积", circumference: "周长" }, p = r;
6279
+ this.labelEntity ? (this.labelEntity.position = p, this.labelEntity.label.text = `${g.radius}:${l.toFixed(2)} m
6280
+ ${g.area}:${d.toFixed(2)} m²
6281
+ ${g.circumference}:${u.toFixed(2)} m`) : this.labelEntity = i.entities.add({
6282
+ position: p,
5976
6283
  label: {
5977
- text: `${p.radius}:${l.toFixed(2)} m
5978
- ${p.area}:${d.toFixed(2)} m²
5979
- ${p.circumference}:${u.toFixed(2)} m`,
6284
+ text: `${g.radius}:${l.toFixed(2)} m
6285
+ ${g.area}:${d.toFixed(2)} m²
6286
+ ${g.circumference}:${u.toFixed(2)} m`,
5980
6287
  font: "14px sans-serif",
5981
6288
  fillColor: e.Color.WHITE,
5982
6289
  outlineColor: e.Color.BLACK,
@@ -5997,26 +6304,26 @@ ${p.circumference}:${u.toFixed(2)} m`,
5997
6304
  semiMinorAxis: l,
5998
6305
  height: m.height || 0,
5999
6306
  vertexFormat: e.MaterialAppearance.VERTEX_FORMAT
6000
- }), y = new e.GeometryInstance({ geometry: f }), v = t.color || e.Color.YELLOW.withAlpha(0.5), w = t.color && t.color.withAlpha ? t.color.withAlpha(0.25) : e.Color.RED.withAlpha(0.4);
6307
+ }), y = new e.GeometryInstance({ geometry: f }), w = t.color || e.Color.YELLOW.withAlpha(0.5), v = t.color && t.color.withAlpha ? t.color.withAlpha(0.25) : e.Color.RED.withAlpha(0.4);
6001
6308
  this.ellipsePrimitive && (i.scene.primitives.remove(this.ellipsePrimitive), this.ellipsePrimitive = null), this.ellipsePrimitive = new e.Primitive({
6002
6309
  geometryInstances: y,
6003
6310
  appearance: new e.MaterialAppearance({
6004
- material: e.Material.fromType("Color", { color: v }),
6311
+ material: e.Material.fromType("Color", { color: w }),
6005
6312
  translucent: !0,
6006
6313
  closed: !0
6007
6314
  }),
6008
6315
  depthFailAppearance: new e.MaterialAppearance({
6009
- material: e.Material.fromType("Color", { color: w }),
6316
+ material: e.Material.fromType("Color", { color: v }),
6010
6317
  translucent: !0,
6011
6318
  closed: !0
6012
6319
  })
6013
6320
  }), i.scene.primitives.add(this.ellipsePrimitive), this.entity = this.ellipsePrimitive, this.isPrimitive = !0;
6014
- const P = e.Cartographic.fromCartesian(r), b = e.Math.toDegrees(P.longitude), C = e.Math.toDegrees(P.latitude), E = P.height || 0, L = this.htmlLabelId || `measure_circle_${Date.now()}`;
6015
- this.htmlLabelId = L;
6016
- const M = `${p.radius}:${l.toFixed(2)} m
6017
- ${p.area}:${d.toFixed(2)} m²
6018
- ${p.circumference}:${u.toFixed(2)} m`;
6019
- this.htmlLabelPool.add({ text: M }, { id: L, lon: b, lat: C, height: E, theme: "measure-circle", show: !0 });
6321
+ const P = e.Cartographic.fromCartesian(r), b = e.Math.toDegrees(P.longitude), C = e.Math.toDegrees(P.latitude), L = P.height || 0, E = this.htmlLabelId || `measure_circle_${Date.now()}`;
6322
+ this.htmlLabelId = E;
6323
+ const M = `${g.radius}:${l.toFixed(2)} m
6324
+ ${g.area}:${d.toFixed(2)} m²
6325
+ ${g.circumference}:${u.toFixed(2)} m`;
6326
+ this.htmlLabelPool.add({ text: M }, { id: E, lon: b, lat: C, height: L, theme: "measure-circle", show: !0 });
6020
6327
  const x = {
6021
6328
  entity: this.entity,
6022
6329
  label: this.labelEntity,
@@ -6034,15 +6341,15 @@ ${p.circumference}:${u.toFixed(2)} m`;
6034
6341
  if (!r) return;
6035
6342
  const a = e.Cartesian3.distance(s, r);
6036
6343
  this.currentRadius = a;
6037
- const l = e.Cartographic.fromCartesian(s), d = Math.PI * a * a, u = 2 * Math.PI * a, p = t.labelText || { radius: "半径", area: "面积", circumference: "周长" }, g = s;
6038
- this.labelEntity ? (this.labelEntity.position = g, this.labelEntity.label.text = `${p.radius}:${a.toFixed(2)} m
6039
- ${p.area}:${d.toFixed(2)} m²
6040
- ${p.circumference}:${u.toFixed(2)} m`) : this.labelEntity = i.entities.add({
6041
- position: g,
6344
+ const l = e.Cartographic.fromCartesian(s), d = Math.PI * a * a, u = 2 * Math.PI * a, g = t.labelText || { radius: "半径", area: "面积", circumference: "周长" }, p = s;
6345
+ this.labelEntity ? (this.labelEntity.position = p, this.labelEntity.label.text = `${g.radius}:${a.toFixed(2)} m
6346
+ ${g.area}:${d.toFixed(2)} m²
6347
+ ${g.circumference}:${u.toFixed(2)} m`) : this.labelEntity = i.entities.add({
6348
+ position: p,
6042
6349
  label: {
6043
- text: `${p.radius}:${a.toFixed(2)} m
6044
- ${p.area}:${d.toFixed(2)} m²
6045
- ${p.circumference}:${u.toFixed(2)} m`,
6350
+ text: `${g.radius}:${a.toFixed(2)} m
6351
+ ${g.area}:${d.toFixed(2)} m²
6352
+ ${g.circumference}:${u.toFixed(2)} m`,
6046
6353
  font: "14px sans-serif",
6047
6354
  fillColor: e.Color.WHITE,
6048
6355
  outlineColor: e.Color.BLACK,
@@ -6057,12 +6364,12 @@ ${p.circumference}:${u.toFixed(2)} m`,
6057
6364
  show: !1
6058
6365
  }
6059
6366
  });
6060
- const m = e.Cartographic.fromCartesian(s), f = e.Math.toDegrees(m.longitude), y = e.Math.toDegrees(m.latitude), v = m.height || 0, w = this.htmlLabelId || `measure_circle_${Date.now()}`;
6061
- this.htmlLabelId = w;
6062
- const P = `${p.radius}:${a.toFixed(2)} m
6063
- ${p.area}:${d.toFixed(2)} m²
6064
- ${p.circumference}:${u.toFixed(2)} m`;
6065
- if (this.htmlLabelPool.add({ text: P }, { id: w, lon: f, lat: y, height: v, theme: "measure-circle", show: !0 }), !this.previewEntity) {
6367
+ const m = e.Cartographic.fromCartesian(s), f = e.Math.toDegrees(m.longitude), y = e.Math.toDegrees(m.latitude), w = m.height || 0, v = this.htmlLabelId || `measure_circle_${Date.now()}`;
6368
+ this.htmlLabelId = v;
6369
+ const P = `${g.radius}:${a.toFixed(2)} m
6370
+ ${g.area}:${d.toFixed(2)} m²
6371
+ ${g.circumference}:${u.toFixed(2)} m`;
6372
+ if (this.htmlLabelPool.add({ text: P }, { id: v, lon: f, lat: y, height: w, theme: "measure-circle", show: !0 }), !this.previewEntity) {
6066
6373
  const b = t.color || e.Color.YELLOW.withAlpha(0.5);
6067
6374
  this.previewEntity = i.entities.add({
6068
6375
  position: s,
@@ -6083,34 +6390,34 @@ ${p.circumference}:${u.toFixed(2)} m`;
6083
6390
  this.stop(), this.entity && (this.isPrimitive ? this.viewer.scene.primitives.remove(this.entity) : this.viewer.entities.remove(this.entity), this.entity = null, this.isPrimitive = !1), this.previewEntity && (this.viewer.entities.remove(this.previewEntity), this.previewEntity = null), this.labelEntity && (this.viewer.entities.remove(this.labelEntity), this.labelEntity = null), this.previewLabel && (this.viewer.entities.remove(this.previewLabel), this.previewLabel = null), this.ellipsePrimitive && (this.viewer.scene.primitives.remove(this.ellipsePrimitive), this.ellipsePrimitive = null), this.htmlLabelPool && this.htmlLabelId && (this.htmlLabelPool.removeByIds([this.htmlLabelId]), this.htmlLabelId = null), this.positions = [], this.currentRadius = 0;
6084
6391
  }
6085
6392
  rehydrate(t, e) {
6086
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = (t.positions || []).map((E) => new i.Cartesian3(E[0], E[1], E[2]));
6393
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = (t.positions || []).map((L) => new i.Cartesian3(L[0], L[1], L[2]));
6087
6394
  if (o.length < 2) return;
6088
6395
  if (!this.htmlLabelPool) {
6089
- const E = s.overlayContainerId || "html-label-container";
6090
- this.htmlLabelPool = e || new z(i, n, E), this.htmlLabelPool.registerTheme("measure-circle", {
6091
- createElement: (L, M) => {
6396
+ const L = s.overlayContainerId || "html-label-container";
6397
+ this.htmlLabelPool = e || new G(i, n, L), this.htmlLabelPool.registerTheme("measure-circle", {
6398
+ createElement: (E, M) => {
6092
6399
  var I;
6093
6400
  const x = ((I = M == null ? void 0 : M.data) == null ? void 0 : I.text) || "";
6094
- L.innerHTML = String(x), L.style.background = "rgba(0,0,0,0.6)", L.style.color = "#fff", L.style.font = "14px sans-serif", L.style.padding = "4px 6px", L.style.borderRadius = "4px", L.style.whiteSpace = "pre";
6401
+ E.innerHTML = String(x), E.style.background = "rgba(0,0,0,0.6)", E.style.color = "#fff", E.style.font = "14px sans-serif", E.style.padding = "4px 6px", E.style.borderRadius = "4px", E.style.whiteSpace = "pre";
6095
6402
  },
6096
6403
  options: { offset: { x: 0, y: -10 } }
6097
6404
  });
6098
6405
  }
6099
- const r = o[0], a = o[1], l = i.Cartesian3.distance(r, a), d = Math.PI * l * l, u = 2 * Math.PI * l, p = i.Cartographic.fromCartesian(r), g = new i.EllipseGeometry({ center: r, semiMajorAxis: l, semiMinorAxis: l, height: p.height || 0, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT }), m = new i.GeometryInstance({ geometry: g }), f = s.color || i.Color.YELLOW.withAlpha(0.5), y = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), v = new i.Primitive({
6406
+ const r = o[0], a = o[1], l = i.Cartesian3.distance(r, a), d = Math.PI * l * l, u = 2 * Math.PI * l, g = i.Cartographic.fromCartesian(r), p = new i.EllipseGeometry({ center: r, semiMajorAxis: l, semiMinorAxis: l, height: g.height || 0, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT }), m = new i.GeometryInstance({ geometry: p }), f = s.color || i.Color.YELLOW.withAlpha(0.5), y = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), w = new i.Primitive({
6100
6407
  geometryInstances: m,
6101
6408
  appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: f }), translucent: !0, closed: !0 }),
6102
6409
  depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: y }), translucent: !0, closed: !0 })
6103
6410
  });
6104
- n.scene.primitives.add(v), this.ellipsePrimitive = v, this.entity = v, this.isPrimitive = !0;
6105
- const w = i.Cartographic.fromCartesian(r), P = t.id + "_circle";
6411
+ n.scene.primitives.add(w), this.ellipsePrimitive = w, this.entity = w, this.isPrimitive = !0;
6412
+ const v = i.Cartographic.fromCartesian(r), P = t.id + "_circle";
6106
6413
  this.htmlLabelId = P;
6107
6414
  const b = s.labelText || { radius: "半径", area: "面积", circumference: "周长" }, C = `${b.radius}:${l.toFixed(2)} m
6108
6415
  ${b.area}:${d.toFixed(2)} m²
6109
6416
  ${b.circumference}:${u.toFixed(2)} m`;
6110
- this.htmlLabelPool.add({ text: C }, { id: P, lon: i.Math.toDegrees(w.longitude), lat: i.Math.toDegrees(w.latitude), height: w.height || 0, theme: "measure-circle", show: !0 });
6417
+ this.htmlLabelPool.add({ text: C }, { id: P, lon: i.Math.toDegrees(v.longitude), lat: i.Math.toDegrees(v.latitude), height: v.height || 0, theme: "measure-circle", show: !0 });
6111
6418
  }
6112
6419
  }
6113
- const Oe = class Oe {
6420
+ const He = class He {
6114
6421
  constructor(t, e) {
6115
6422
  c(this, "Cesium");
6116
6423
  c(this, "viewer");
@@ -6138,7 +6445,7 @@ const Oe = class Oe {
6138
6445
  const e = this.Cesium, i = this.viewer;
6139
6446
  if (!this.htmlLabelPool) {
6140
6447
  const n = t.overlayContainerId || "html-label-container";
6141
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-polyline-total", {
6448
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-polyline-total", {
6142
6449
  createElement: (s, o) => {
6143
6450
  var r;
6144
6451
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -6152,7 +6459,7 @@ const Oe = class Oe {
6152
6459
  options: { offset: { x: 0, y: -10 } }
6153
6460
  });
6154
6461
  }
6155
- this.tooltip = new ce(), this.tooltip.show(Oe.TIP_TEXT), this._bindGlobalEvents(t, e, i), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
6462
+ this.tooltip = new ce(), this.tooltip.show(He.TIP_TEXT), this._bindGlobalEvents(t, e, i), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
6156
6463
  var r, a;
6157
6464
  const s = i.scene.pickPosition(n.position);
6158
6465
  if (!s) return;
@@ -6177,15 +6484,15 @@ const Oe = class Oe {
6177
6484
  })
6178
6485
  }
6179
6486
  }), this.positions.length >= 2) {
6180
- const l = this.positions[this.positions.length - 2], d = this.positions[this.positions.length - 1], u = e.Cartographic.fromCartesian(l), p = e.Cartographic.fromCartesian(d), m = new e.EllipsoidGeodesic(u, p).surfaceDistance, f = new e.Cartesian3(
6487
+ const l = this.positions[this.positions.length - 2], d = this.positions[this.positions.length - 1], u = e.Cartographic.fromCartesian(l), g = e.Cartographic.fromCartesian(d), m = new e.EllipsoidGeodesic(u, g).surfaceDistance, f = new e.Cartesian3(
6181
6488
  (l.x + d.x) / 2,
6182
6489
  (l.y + d.y) / 2,
6183
6490
  (l.z + d.z) / 2
6184
- ), y = e.Cartographic.fromCartesian(f), v = `measure_polyline_seg_${this.segmentLabelIds.length}_${Date.now()}`;
6185
- this.segmentLabelIds.push(v), this.htmlLabelPool.add(
6491
+ ), y = e.Cartographic.fromCartesian(f), w = `measure_polyline_seg_${this.segmentLabelIds.length}_${Date.now()}`;
6492
+ this.segmentLabelIds.push(w), this.htmlLabelPool.add(
6186
6493
  { text: `${m.toFixed(2)} m` },
6187
6494
  {
6188
- id: v,
6495
+ id: w,
6189
6496
  lon: e.Math.toDegrees(y.longitude),
6190
6497
  lat: e.Math.toDegrees(y.latitude),
6191
6498
  height: y.height || 0,
@@ -6208,14 +6515,14 @@ const Oe = class Oe {
6208
6515
  (o.x + s.x) / 2,
6209
6516
  (o.y + s.y) / 2,
6210
6517
  (o.z + s.z) / 2
6211
- ), p = e.Cartographic.fromCartesian(u), g = this.previewLabelId || "measure_polyline_preview";
6212
- this.previewLabelId = g, this.htmlLabelPool.add(
6518
+ ), g = e.Cartographic.fromCartesian(u), p = this.previewLabelId || "measure_polyline_preview";
6519
+ this.previewLabelId = p, this.htmlLabelPool.add(
6213
6520
  { text: `${d.toFixed(2)} m` },
6214
6521
  {
6215
- id: g,
6216
- lon: e.Math.toDegrees(p.longitude),
6217
- lat: e.Math.toDegrees(p.latitude),
6218
- height: p.height || 0,
6522
+ id: p,
6523
+ lon: e.Math.toDegrees(g.longitude),
6524
+ lat: e.Math.toDegrees(g.latitude),
6525
+ height: g.height || 0,
6219
6526
  theme: "measure-polyline-seg",
6220
6527
  show: !0
6221
6528
  }
@@ -6273,7 +6580,7 @@ const Oe = class Oe {
6273
6580
  this.stop(), this._clearPreviewState();
6274
6581
  let n = 0;
6275
6582
  for (let d = 1; d < this.positions.length; d++) {
6276
- const u = this.positions[d - 1], p = this.positions[d], g = e.Cartographic.fromCartesian(u), m = e.Cartographic.fromCartesian(p), f = new e.EllipsoidGeodesic(g, m);
6583
+ const u = this.positions[d - 1], g = this.positions[d], p = e.Cartographic.fromCartesian(u), m = e.Cartographic.fromCartesian(g), f = new e.EllipsoidGeodesic(p, m);
6277
6584
  n += f.surfaceDistance;
6278
6585
  }
6279
6586
  const s = this.positions[this.positions.length - 1];
@@ -6313,54 +6620,54 @@ const Oe = class Oe {
6313
6620
  if (l.length < 2) return;
6314
6621
  if (!this.htmlLabelPool) {
6315
6622
  const y = s.overlayContainerId || "html-label-container";
6316
- this.htmlLabelPool = e || new z(i, n, y), this.htmlLabelPool.registerTheme("measure-polyline-total", {
6317
- createElement: (v, w) => {
6623
+ this.htmlLabelPool = e || new G(i, n, y), this.htmlLabelPool.registerTheme("measure-polyline-total", {
6624
+ createElement: (w, v) => {
6318
6625
  var P;
6319
- v.innerHTML = String(((P = w == null ? void 0 : w.data) == null ? void 0 : P.text) || ""), v.style.background = "rgba(0,0,0,0.6)", v.style.color = "#fff", v.style.font = "14px sans-serif", v.style.padding = "4px 6px", v.style.borderRadius = "4px", v.style.whiteSpace = "pre";
6626
+ w.innerHTML = String(((P = v == null ? void 0 : v.data) == null ? void 0 : P.text) || ""), w.style.background = "rgba(0,0,0,0.6)", w.style.color = "#fff", w.style.font = "14px sans-serif", w.style.padding = "4px 6px", w.style.borderRadius = "4px", w.style.whiteSpace = "pre";
6320
6627
  },
6321
6628
  options: { offset: { x: 0, y: -10 } }
6322
6629
  }), this.htmlLabelPool.registerTheme("measure-polyline-seg", {
6323
- createElement: (v, w) => {
6630
+ createElement: (w, v) => {
6324
6631
  var P;
6325
- v.innerHTML = String(((P = w == null ? void 0 : w.data) == null ? void 0 : P.text) || ""), v.style.background = "rgba(0,0,0,0.6)", v.style.color = "#fff", v.style.font = "14px sans-serif", v.style.padding = "4px 6px", v.style.borderRadius = "4px", v.style.whiteSpace = "pre";
6632
+ w.innerHTML = String(((P = v == null ? void 0 : v.data) == null ? void 0 : P.text) || ""), w.style.background = "rgba(0,0,0,0.6)", w.style.color = "#fff", w.style.font = "14px sans-serif", w.style.padding = "4px 6px", w.style.borderRadius = "4px", w.style.whiteSpace = "pre";
6326
6633
  },
6327
6634
  options: { offset: { x: 0, y: -10 } }
6328
6635
  });
6329
6636
  }
6330
6637
  for (const y of l) {
6331
- const v = n.entities.add({ position: y, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
6332
- this.tempPoints.push(v);
6638
+ const w = n.entities.add({ position: y, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
6639
+ this.tempPoints.push(w);
6333
6640
  }
6334
6641
  this.entity = n.entities.add({ polyline: { positions: l, width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } });
6335
6642
  let d = 0;
6336
6643
  for (let y = 1; y < l.length; y++) {
6337
- const v = i.Cartographic.fromCartesian(l[y - 1]), w = i.Cartographic.fromCartesian(l[y]), P = new i.EllipsoidGeodesic(v, w);
6644
+ const w = i.Cartographic.fromCartesian(l[y - 1]), v = i.Cartographic.fromCartesian(l[y]), P = new i.EllipsoidGeodesic(w, v);
6338
6645
  d += P.surfaceDistance;
6339
- const b = l[y - 1], C = l[y], E = new i.Cartesian3((b.x + C.x) / 2, (b.y + C.y) / 2, (b.z + C.z) / 2), L = i.Cartographic.fromCartesian(E), M = t.id + `_seg_${y - 1}`;
6646
+ const b = l[y - 1], C = l[y], L = new i.Cartesian3((b.x + C.x) / 2, (b.y + C.y) / 2, (b.z + C.z) / 2), E = i.Cartographic.fromCartesian(L), M = t.id + `_seg_${y - 1}`;
6340
6647
  this.segmentLabelIds.push(M), this.htmlLabelPool.add({ text: `${P.surfaceDistance.toFixed(2)} m` }, {
6341
6648
  id: M,
6342
- lon: i.Math.toDegrees(L.longitude),
6343
- lat: i.Math.toDegrees(L.latitude),
6344
- height: L.height || 0,
6649
+ lon: i.Math.toDegrees(E.longitude),
6650
+ lat: i.Math.toDegrees(E.latitude),
6651
+ height: E.height || 0,
6345
6652
  theme: "measure-polyline-seg",
6346
6653
  show: !0,
6347
6654
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
6348
6655
  });
6349
6656
  }
6350
- const u = l[l.length - 1], p = i.Cartographic.fromCartesian(u), g = t.id + "_total";
6351
- this.totalLabelId = g, this.htmlLabelPool.add({ text: `${d.toFixed(2)} m` }, {
6352
- id: g,
6353
- lon: i.Math.toDegrees(p.longitude),
6354
- lat: i.Math.toDegrees(p.latitude),
6355
- height: p.height || 0,
6657
+ const u = l[l.length - 1], g = i.Cartographic.fromCartesian(u), p = t.id + "_total";
6658
+ this.totalLabelId = p, this.htmlLabelPool.add({ text: `${d.toFixed(2)} m` }, {
6659
+ id: p,
6660
+ lon: i.Math.toDegrees(g.longitude),
6661
+ lat: i.Math.toDegrees(g.latitude),
6662
+ height: g.height || 0,
6356
6663
  theme: "measure-polyline-total",
6357
6664
  show: !0,
6358
6665
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
6359
6666
  });
6360
6667
  }
6361
6668
  };
6362
- c(Oe, "TIP_TEXT", "单击左键添加点,右键撤销,双击左键或Esc结束");
6363
- let ke = Oe;
6669
+ c(He, "TIP_TEXT", "单击左键添加点,右键撤销,双击左键或Esc结束");
6670
+ let ke = He;
6364
6671
  class vt {
6365
6672
  constructor(t, e) {
6366
6673
  c(this, "Cesium");
@@ -6379,7 +6686,7 @@ class vt {
6379
6686
  const e = this.Cesium, i = this.viewer;
6380
6687
  if (!this.htmlLabelPool) {
6381
6688
  const n = t.overlayContainerId || "html-label-container";
6382
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-terrainHeight", {
6689
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-terrainHeight", {
6383
6690
  createElement: (s, o) => {
6384
6691
  var r;
6385
6692
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -6420,9 +6727,9 @@ class vt {
6420
6727
  })
6421
6728
  }
6422
6729
  });
6423
- const u = t.labelText || { height: "高程" }, p = (o.height || 0) - r, g = `${u.height}:${r.toFixed(2)} m`, m = this.htmlLabelId || `measure_terrain_${Date.now()}`;
6730
+ const u = t.labelText || { height: "高程" }, g = (o.height || 0) - r, p = `${u.height}:${r.toFixed(2)} m`, m = this.htmlLabelId || `measure_terrain_${Date.now()}`;
6424
6731
  this.htmlLabelId = m, this.htmlLabelPool.add(
6425
- { text: g },
6732
+ { text: p },
6426
6733
  {
6427
6734
  id: m,
6428
6735
  lon: a,
@@ -6438,7 +6745,7 @@ class vt {
6438
6745
  zeroPosition: d,
6439
6746
  line: this.lineEntity,
6440
6747
  terrainHeight: r,
6441
- difference: p,
6748
+ difference: g,
6442
6749
  clear: () => this.clear()
6443
6750
  };
6444
6751
  (y = t.onComplete) == null || y.call(t, f), this.stop();
@@ -6459,20 +6766,20 @@ class vt {
6459
6766
  if (o.length < 1) return;
6460
6767
  if (!this.htmlLabelPool) {
6461
6768
  const f = s.overlayContainerId || "html-label-container";
6462
- this.htmlLabelPool = e || new z(i, n, f), this.htmlLabelPool.registerTheme("measure-terrainHeight", {
6463
- createElement: (y, v) => {
6464
- var w;
6465
- y.innerHTML = String(((w = v == null ? void 0 : v.data) == null ? void 0 : w.text) || ""), y.style.background = "rgba(0,0,0,0.6)", y.style.color = "#fff", y.style.font = "14px sans-serif", y.style.padding = "4px 6px", y.style.borderRadius = "4px", y.style.whiteSpace = "pre";
6769
+ this.htmlLabelPool = e || new G(i, n, f), this.htmlLabelPool.registerTheme("measure-terrainHeight", {
6770
+ createElement: (y, w) => {
6771
+ var v;
6772
+ y.innerHTML = String(((v = w == null ? void 0 : w.data) == null ? void 0 : v.text) || ""), y.style.background = "rgba(0,0,0,0.6)", y.style.color = "#fff", y.style.font = "14px sans-serif", y.style.padding = "4px 6px", y.style.borderRadius = "4px", y.style.whiteSpace = "pre";
6466
6773
  },
6467
6774
  options: { offset: { x: 0, y: -10 } }
6468
6775
  });
6469
6776
  }
6470
- const r = o[0], a = i.Cartographic.fromCartesian(r), l = n.scene.globe.getHeight(new i.Cartographic(a.longitude, a.latitude, 0)) || 0, d = i.Math.toDegrees(a.longitude), u = i.Math.toDegrees(a.latitude), p = i.Cartesian3.fromDegrees(d, u, l);
6471
- this.topPoint = n.entities.add({ position: r, point: { pixelSize: 8, color: s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this.zeroPoint = n.entities.add({ position: p, point: { pixelSize: 8, color: i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this.lineEntity = n.entities.add({ polyline: { positions: [p, r], width: s.width || 3, material: s.color || i.Color.YELLOW, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: i.Color.RED, dashLength: 12, dashPattern: 255 }) } });
6472
- const g = s.labelText || { height: "高程" };
6777
+ const r = o[0], a = i.Cartographic.fromCartesian(r), l = n.scene.globe.getHeight(new i.Cartographic(a.longitude, a.latitude, 0)) || 0, d = i.Math.toDegrees(a.longitude), u = i.Math.toDegrees(a.latitude), g = i.Cartesian3.fromDegrees(d, u, l);
6778
+ this.topPoint = n.entities.add({ position: r, point: { pixelSize: 8, color: s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this.zeroPoint = n.entities.add({ position: g, point: { pixelSize: 8, color: i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this.lineEntity = n.entities.add({ polyline: { positions: [g, r], width: s.width || 3, material: s.color || i.Color.YELLOW, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: i.Color.RED, dashLength: 12, dashPattern: 255 }) } });
6779
+ const p = s.labelText || { height: "高程" };
6473
6780
  (a.height || 0) - l;
6474
6781
  const m = t.id + "_terrain";
6475
- this.htmlLabelId = m, this.htmlLabelPool.add({ text: `${g.height}:${l.toFixed(2)} m` }, { id: m, lon: d, lat: u, height: a.height || 0, theme: "measure-terrainHeight", show: !0 });
6782
+ this.htmlLabelId = m, this.htmlLabelPool.add({ text: `${p.height}:${l.toFixed(2)} m` }, { id: m, lon: d, lat: u, height: a.height || 0, theme: "measure-terrainHeight", show: !0 });
6476
6783
  }
6477
6784
  }
6478
6785
  class Ct {
@@ -6491,7 +6798,7 @@ class Ct {
6491
6798
  const e = this.Cesium, i = this.viewer;
6492
6799
  if (!this.htmlLabelPool) {
6493
6800
  const n = t.overlayContainerId || "html-label-container";
6494
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-coordinate", {
6801
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-coordinate", {
6495
6802
  createElement: (s, o) => {
6496
6803
  var r;
6497
6804
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -6500,7 +6807,7 @@ class Ct {
6500
6807
  });
6501
6808
  }
6502
6809
  this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
6503
- var g;
6810
+ var p;
6504
6811
  const s = i.scene.pickPosition(n.position);
6505
6812
  if (!s) return;
6506
6813
  const o = e.Cartographic.fromCartesian(s), r = e.Math.toDegrees(o.longitude), a = e.Math.toDegrees(o.latitude), l = o.height || 0;
@@ -6528,13 +6835,13 @@ ${u.height}:${l.toFixed(2)} m` },
6528
6835
  show: !0
6529
6836
  }
6530
6837
  ), this.labelEntity = this.htmlLabelId;
6531
- const p = {
6838
+ const g = {
6532
6839
  entity: this.entity,
6533
6840
  label: this.labelEntity,
6534
6841
  lnglat: { lng: r, lat: a, height: l },
6535
6842
  clear: () => this.clear()
6536
6843
  };
6537
- (g = t.onComplete) == null || g.call(t, p), this.stop();
6844
+ (p = t.onComplete) == null || p.call(t, g), this.stop();
6538
6845
  }, e.ScreenSpaceEventType.LEFT_CLICK);
6539
6846
  }
6540
6847
  stop() {
@@ -6556,22 +6863,22 @@ ${u.height}:${l.toFixed(2)} m` },
6556
6863
  if (!o.length) return;
6557
6864
  if (!this.htmlLabelPool) {
6558
6865
  const f = s.overlayContainerId || "html-label-container";
6559
- this.htmlLabelPool = e || new z(i, n, f), this.htmlLabelPool.registerTheme("measure-coordinate", {
6560
- createElement: (y, v) => {
6561
- var w;
6562
- y.innerHTML = String(((w = v == null ? void 0 : v.data) == null ? void 0 : w.text) || ""), y.style.background = "rgba(0,0,0,0.6)", y.style.color = "#fff", y.style.font = "14px sans-serif", y.style.padding = "4px 6px", y.style.borderRadius = "4px", y.style.whiteSpace = "pre";
6866
+ this.htmlLabelPool = e || new G(i, n, f), this.htmlLabelPool.registerTheme("measure-coordinate", {
6867
+ createElement: (y, w) => {
6868
+ var v;
6869
+ y.innerHTML = String(((v = w == null ? void 0 : w.data) == null ? void 0 : v.text) || ""), y.style.background = "rgba(0,0,0,0.6)", y.style.color = "#fff", y.style.font = "14px sans-serif", y.style.padding = "4px 6px", y.style.borderRadius = "4px", y.style.whiteSpace = "pre";
6563
6870
  },
6564
6871
  options: { offset: { x: 0, y: -10 } }
6565
6872
  });
6566
6873
  }
6567
6874
  const r = o[0], a = i.Cartographic.fromCartesian(r), l = i.Math.toDegrees(a.longitude), d = i.Math.toDegrees(a.latitude), u = a.height || 0;
6568
6875
  this.entity = n.entities.add({ position: r, point: { pixelSize: 10, color: s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
6569
- const p = t.id + "_coord";
6570
- this.htmlLabelId = p;
6571
- const g = s.labelText || { lng: "经", lat: "纬", height: "高" };
6572
- this.htmlLabelPool.add({ text: `${g.lng}:${l.toFixed(6)}
6573
- ${g.lat}:${d.toFixed(6)}
6574
- ${g.height}:${u.toFixed(2)} m` }, { id: p, lon: l, lat: d, height: u, theme: "measure-coordinate", show: !0 });
6876
+ const g = t.id + "_coord";
6877
+ this.htmlLabelId = g;
6878
+ const p = s.labelText || { lng: "经", lat: "纬", height: "高" };
6879
+ this.htmlLabelPool.add({ text: `${p.lng}:${l.toFixed(6)}
6880
+ ${p.lat}:${d.toFixed(6)}
6881
+ ${p.height}:${u.toFixed(2)} m` }, { id: g, lon: l, lat: d, height: u, theme: "measure-coordinate", show: !0 });
6575
6882
  }
6576
6883
  }
6577
6884
  class bt {
@@ -6602,7 +6909,7 @@ class bt {
6602
6909
  const e = this.Cesium, i = this.viewer;
6603
6910
  if (!this.htmlLabelPool) {
6604
6911
  const n = t.overlayContainerId || "html-label-container";
6605
- this.htmlLabelPool = new z(e, i, n), this.htmlLabelPool.registerTheme("measure-rectangle", {
6912
+ this.htmlLabelPool = new G(e, i, n), this.htmlLabelPool.registerTheme("measure-rectangle", {
6606
6913
  createElement: (s, o) => {
6607
6914
  var r;
6608
6915
  s.innerHTML = String(((r = o == null ? void 0 : o.data) == null ? void 0 : r.text) || ""), s.style.background = "rgba(0,0,0,0.6)", s.style.color = "#fff", s.style.font = "14px sans-serif", s.style.padding = "4px 6px", s.style.borderRadius = "4px", s.style.whiteSpace = "pre";
@@ -6634,17 +6941,17 @@ class bt {
6634
6941
  return;
6635
6942
  }
6636
6943
  this.stop();
6637
- const { corners: a, center: l, width: d, height: u, area: p } = r;
6944
+ const { corners: a, center: l, width: d, height: u, area: g } = r;
6638
6945
  this.previewEntity && (i.entities.remove(this.previewEntity), this.previewEntity = null), this.primitive && (i.scene.primitives.remove(this.primitive), this.primitive = null), this.entity && (i.entities.remove(this.entity), this.entity = null);
6639
- const g = this.htmlLabelId || `measure_rectangle_${Date.now()}`;
6640
- this.htmlLabelId = g;
6946
+ const p = this.htmlLabelId || `measure_rectangle_${Date.now()}`;
6947
+ this.htmlLabelId = p;
6641
6948
  const m = e.Cartographic.fromCartesian(l), f = t.labelText || { width: "宽", heightLabel: "高", area: "面积", side: "边长" };
6642
6949
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null), this.htmlLabelPool.add(
6643
6950
  { text: `${f.width}:${d.toFixed(2)} m
6644
6951
  ${f.heightLabel}:${u.toFixed(2)} m
6645
- ${f.area}:${p.toFixed(2)} m²` },
6952
+ ${f.area}:${g.toFixed(2)} m²` },
6646
6953
  {
6647
- id: g,
6954
+ id: p,
6648
6955
  lon: e.Math.toDegrees(m.longitude),
6649
6956
  lat: e.Math.toDegrees(m.latitude),
6650
6957
  height: m.height || 0,
@@ -6659,11 +6966,11 @@ ${f.area}:${p.toFixed(2)} m²` },
6659
6966
  [a[3], a[0]]
6660
6967
  ];
6661
6968
  for (let A = 0; A < y.length; A++) {
6662
- const [$, O] = y[A], G = A === 0 || A === 2 ? d : u, B = new e.Cartesian3(($.x + O.x) / 2, ($.y + O.y) / 2, ($.z + O.z) / 2), N = e.Cartographic.fromCartesian(B), K = `measure_rectangle_seg_${Date.now()}_${A}`;
6663
- this.segmentLabelIds.push(K), this.htmlLabelPool.add(
6664
- { text: `${f.side}:${Number(G).toFixed(2)} m` },
6969
+ const [R, H] = y[A], B = A === 0 || A === 2 ? d : u, Y = new e.Cartesian3((R.x + H.x) / 2, (R.y + H.y) / 2, (R.z + H.z) / 2), N = e.Cartographic.fromCartesian(Y), z = `measure_rectangle_seg_${Date.now()}_${A}`;
6970
+ this.segmentLabelIds.push(z), this.htmlLabelPool.add(
6971
+ { text: `${f.side}:${Number(B).toFixed(2)} m` },
6665
6972
  {
6666
- id: K,
6973
+ id: z,
6667
6974
  lon: e.Math.toDegrees(N.longitude),
6668
6975
  lat: e.Math.toDegrees(N.latitude),
6669
6976
  height: N.height || 0,
@@ -6672,12 +6979,12 @@ ${f.area}:${p.toFixed(2)} m²` },
6672
6979
  }
6673
6980
  );
6674
6981
  }
6675
- const v = this.buildSurfaceRectanglePositions(a), w = new e.PolygonHierarchy(v), P = new e.PolygonGeometry({
6676
- polygonHierarchy: w,
6982
+ const w = this.buildSurfaceRectanglePositions(a), v = new e.PolygonHierarchy(w), P = new e.PolygonGeometry({
6983
+ polygonHierarchy: v,
6677
6984
  vertexFormat: e.MaterialAppearance.VERTEX_FORMAT,
6678
6985
  perPositionHeight: !0,
6679
6986
  arcType: e.ArcType.NONE
6680
- }), b = new e.GeometryInstance({ geometry: P }), C = t.color || e.Color.YELLOW.withAlpha(0.4), E = t.color && t.color.withAlpha ? t.color.withAlpha(0.25) : e.Color.RED.withAlpha(0.4);
6987
+ }), b = new e.GeometryInstance({ geometry: P }), C = t.color || e.Color.YELLOW.withAlpha(0.4), L = t.color && t.color.withAlpha ? t.color.withAlpha(0.25) : e.Color.RED.withAlpha(0.4);
6681
6988
  this.primitive = new e.Primitive({
6682
6989
  geometryInstances: b,
6683
6990
  appearance: new e.MaterialAppearance({
@@ -6686,16 +6993,16 @@ ${f.area}:${p.toFixed(2)} m²` },
6686
6993
  closed: !0
6687
6994
  }),
6688
6995
  depthFailAppearance: new e.MaterialAppearance({
6689
- material: e.Material.fromType("Color", { color: E }),
6996
+ material: e.Material.fromType("Color", { color: L }),
6690
6997
  translucent: !0,
6691
6998
  closed: !0
6692
6999
  })
6693
7000
  }), i.scene.primitives.add(this.primitive);
6694
- const L = t.lineColor || t.color || e.Color.YELLOW, M = ((_ = (S = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : _.call(S, 0.9)) || e.Color.RED, x = [...v, v[0]], I = i.entities.add({
7001
+ const E = t.lineColor || t.color || e.Color.YELLOW, M = ((_ = (S = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : _.call(S, 0.9)) || e.Color.RED, x = [...w, w[0]], I = i.entities.add({
6695
7002
  polyline: {
6696
7003
  positions: x,
6697
7004
  width: t.width || 2,
6698
- material: L,
7005
+ material: E,
6699
7006
  clampToGround: !1,
6700
7007
  arcType: e.ArcType.NONE,
6701
7008
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -6708,7 +7015,7 @@ ${f.area}:${p.toFixed(2)} m²` },
6708
7015
  this.edgeEntities.push(I);
6709
7016
  const D = t.pointColor || t.color || e.Color.YELLOW;
6710
7017
  for (const A of a) {
6711
- const $ = i.entities.add({
7018
+ const R = i.entities.add({
6712
7019
  position: A,
6713
7020
  point: {
6714
7021
  pixelSize: 8,
@@ -6716,7 +7023,7 @@ ${f.area}:${p.toFixed(2)} m²` },
6716
7023
  disableDepthTestDistance: Number.POSITIVE_INFINITY
6717
7024
  }
6718
7025
  });
6719
- this.pointEntities.push($);
7026
+ this.pointEntities.push(R);
6720
7027
  }
6721
7028
  const T = {
6722
7029
  entity: this.primitive,
@@ -6724,22 +7031,22 @@ ${f.area}:${p.toFixed(2)} m²` },
6724
7031
  positions: [this.startPoint, this.secondPoint, o],
6725
7032
  width: d,
6726
7033
  height: u,
6727
- area: p,
7034
+ area: g,
6728
7035
  clear: () => this.clear()
6729
7036
  };
6730
7037
  (k = t.onComplete) == null || k.call(t, T);
6731
7038
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
6732
- var y, v;
7039
+ var y, w;
6733
7040
  const s = i.scene.pickPosition(n.endPosition);
6734
7041
  if (!s) return;
6735
7042
  if (this.startPoint && !this.secondPoint) {
6736
7043
  if (this.endPoint = s, !this.previewEdgeEntity) {
6737
- const w = t.lineColor || t.color || e.Color.YELLOW, P = ((v = (y = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : v.call(y, 0.9)) || e.Color.RED;
7044
+ const v = t.lineColor || t.color || e.Color.YELLOW, P = ((w = (y = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : w.call(y, 0.9)) || e.Color.RED;
6738
7045
  this.previewEdgeEntity = i.entities.add({
6739
7046
  polyline: {
6740
7047
  positions: new e.CallbackProperty(() => !this.startPoint || !this.endPoint ? [] : [this.startPoint, this.endPoint], !1),
6741
7048
  width: t.width || 2,
6742
- material: w,
7049
+ material: v,
6743
7050
  clampToGround: !1,
6744
7051
  arcType: e.ArcType.NONE,
6745
7052
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -6756,7 +7063,7 @@ ${f.area}:${p.toFixed(2)} m²` },
6756
7063
  color: b,
6757
7064
  disableDepthTestDistance: Number.POSITIVE_INFINITY
6758
7065
  }
6759
- }), E = i.entities.add({
7066
+ }), L = i.entities.add({
6760
7067
  position: new e.CallbackProperty(() => this.endPoint || this.startPoint, !1),
6761
7068
  point: {
6762
7069
  pixelSize: 8,
@@ -6764,16 +7071,16 @@ ${f.area}:${p.toFixed(2)} m²` },
6764
7071
  disableDepthTestDistance: Number.POSITIVE_INFINITY
6765
7072
  }
6766
7073
  });
6767
- this.previewPointEntities.push(C, E);
7074
+ this.previewPointEntities.push(C, L);
6768
7075
  }
6769
7076
  return;
6770
7077
  }
6771
7078
  if (!this.startPoint || !this.secondPoint) return;
6772
7079
  const o = this.computeRectangle(this.startPoint, this.secondPoint, s);
6773
7080
  if (!o) return;
6774
- const { corners: r, center: a, width: l, height: d, area: u } = o, p = this.buildSurfaceRectanglePositions(r);
6775
- this.currentCorners = p;
6776
- const g = e.Cartographic.fromCartesian(a), m = this.previewLabelId || "measure_rectangle_preview";
7081
+ const { corners: r, center: a, width: l, height: d, area: u } = o, g = this.buildSurfaceRectanglePositions(r);
7082
+ this.currentCorners = g;
7083
+ const p = e.Cartographic.fromCartesian(a), m = this.previewLabelId || "measure_rectangle_preview";
6777
7084
  this.previewLabelId = m;
6778
7085
  const f = t.labelText || { width: "宽", heightLabel: "高", area: "面积" };
6779
7086
  if (this.htmlLabelPool.add(
@@ -6782,21 +7089,21 @@ ${f.heightLabel}:${d.toFixed(2)} m
6782
7089
  ${f.area}:${u.toFixed(2)} m²` },
6783
7090
  {
6784
7091
  id: m,
6785
- lon: e.Math.toDegrees(g.longitude),
6786
- lat: e.Math.toDegrees(g.latitude),
6787
- height: g.height || 0,
7092
+ lon: e.Math.toDegrees(p.longitude),
7093
+ lat: e.Math.toDegrees(p.latitude),
7094
+ height: p.height || 0,
6788
7095
  theme: "measure-rectangle",
6789
7096
  show: !0
6790
7097
  }
6791
7098
  ), !this.previewEntity) {
6792
- const w = t.color || e.Color.YELLOW.withAlpha(0.4);
7099
+ const v = t.color || e.Color.YELLOW.withAlpha(0.4);
6793
7100
  this.previewEntity = i.entities.add({
6794
7101
  polygon: {
6795
7102
  hierarchy: new e.CallbackProperty(() => {
6796
7103
  if (!(!this.startPoint || !this.secondPoint || !this.currentCorners.length))
6797
7104
  return new e.PolygonHierarchy(this.currentCorners);
6798
7105
  }, !1),
6799
- material: w,
7106
+ material: v,
6800
7107
  perPositionHeight: !0,
6801
7108
  arcType: e.ArcType.NONE
6802
7109
  }
@@ -6842,7 +7149,7 @@ ${f.area}:${u.toFixed(2)} m²` },
6842
7149
  if (o.length < 3) return;
6843
7150
  if (!this.htmlLabelPool) {
6844
7151
  const D = s.overlayContainerId || "html-label-container";
6845
- this.htmlLabelPool = e || new z(i, n, D), this.htmlLabelPool.registerTheme("measure-rectangle", {
7152
+ this.htmlLabelPool = e || new G(i, n, D), this.htmlLabelPool.registerTheme("measure-rectangle", {
6846
7153
  createElement: (T, S) => {
6847
7154
  var _;
6848
7155
  T.innerHTML = String(((_ = S == null ? void 0 : S.data) == null ? void 0 : _.text) || ""), T.style.background = "rgba(0,0,0,0.6)", T.style.color = "#fff", T.style.font = "14px sans-serif", T.style.padding = "4px 6px", T.style.borderRadius = "4px", T.style.whiteSpace = "pre";
@@ -6858,10 +7165,10 @@ ${f.area}:${u.toFixed(2)} m²` },
6858
7165
  }
6859
7166
  const r = this.computeRectangle(o[0], o[1], o[2]);
6860
7167
  if (!r) return;
6861
- const a = r.corners, l = r.center, d = r.width, u = r.height, p = r.area, g = i.Cartographic.fromCartesian(l), m = t.id + "_rectangle", f = s.labelText || { width: "宽", heightLabel: "高", area: "面积", side: "边长" };
7168
+ const a = r.corners, l = r.center, d = r.width, u = r.height, g = r.area, p = i.Cartographic.fromCartesian(l), m = t.id + "_rectangle", f = s.labelText || { width: "宽", heightLabel: "高", area: "面积", side: "边长" };
6862
7169
  this.htmlLabelId = m, this.htmlLabelPool.add({ text: `${f.width}:${d.toFixed(2)} m
6863
7170
  ${f.heightLabel}:${u.toFixed(2)} m
6864
- ${f.area}:${p.toFixed(2)} m²` }, { id: m, lon: i.Math.toDegrees(g.longitude), lat: i.Math.toDegrees(g.latitude), height: g.height || 0, theme: "measure-rectangle", show: !0 });
7171
+ ${f.area}:${g.toFixed(2)} m²` }, { id: m, lon: i.Math.toDegrees(p.longitude), lat: i.Math.toDegrees(p.latitude), height: p.height || 0, theme: "measure-rectangle", show: !0 });
6865
7172
  const y = [
6866
7173
  [a[0], a[1]],
6867
7174
  [a[1], a[2]],
@@ -6869,25 +7176,25 @@ ${f.area}:${p.toFixed(2)} m²` }, { id: m, lon: i.Math.toDegrees(g.longitude), l
6869
7176
  [a[3], a[0]]
6870
7177
  ];
6871
7178
  for (let D = 0; D < y.length; D++) {
6872
- const [T, S] = y[D], _ = D === 0 || D === 2 ? d : u, k = new i.Cartesian3((T.x + S.x) / 2, (T.y + S.y) / 2, (T.z + S.z) / 2), A = i.Cartographic.fromCartesian(k), $ = t.id + `_rectangle_seg_${D}`;
6873
- this.segmentLabelIds.push($), this.htmlLabelPool.add({ text: `${f.side}:${Number(_).toFixed(2)} m` }, { id: $, lon: i.Math.toDegrees(A.longitude), lat: i.Math.toDegrees(A.latitude), height: A.height || 0, theme: "measure-rectangle-seg", show: !0 });
7179
+ const [T, S] = y[D], _ = D === 0 || D === 2 ? d : u, k = new i.Cartesian3((T.x + S.x) / 2, (T.y + S.y) / 2, (T.z + S.z) / 2), A = i.Cartographic.fromCartesian(k), R = t.id + `_rectangle_seg_${D}`;
7180
+ this.segmentLabelIds.push(R), this.htmlLabelPool.add({ text: `${f.side}:${Number(_).toFixed(2)} m` }, { id: R, lon: i.Math.toDegrees(A.longitude), lat: i.Math.toDegrees(A.latitude), height: A.height || 0, theme: "measure-rectangle-seg", show: !0 });
6874
7181
  }
6875
- const v = new i.PolygonHierarchy(a), w = new i.PolygonGeometry({
6876
- polygonHierarchy: v,
7182
+ const w = new i.PolygonHierarchy(a), v = new i.PolygonGeometry({
7183
+ polygonHierarchy: w,
6877
7184
  vertexFormat: i.MaterialAppearance.VERTEX_FORMAT,
6878
7185
  perPositionHeight: !0,
6879
7186
  arcType: i.ArcType.NONE
6880
- }), P = new i.GeometryInstance({ geometry: w }), b = s.color || i.Color.YELLOW.withAlpha(0.4), C = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), E = new i.Primitive({
7187
+ }), P = new i.GeometryInstance({ geometry: v }), b = s.color || i.Color.YELLOW.withAlpha(0.4), C = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), L = new i.Primitive({
6881
7188
  geometryInstances: P,
6882
7189
  appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: b }), translucent: !0, closed: !0 }),
6883
7190
  depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: C }), translucent: !0, closed: !0 })
6884
7191
  });
6885
- this.primitive = E, n.scene.primitives.add(this.primitive);
6886
- const L = s.lineColor || b, M = [...a, a[0]], x = n.entities.add({
7192
+ this.primitive = L, n.scene.primitives.add(this.primitive);
7193
+ const E = s.lineColor || b, M = [...a, a[0]], x = n.entities.add({
6887
7194
  polyline: {
6888
7195
  positions: M,
6889
7196
  width: s.width || 2,
6890
- material: L,
7197
+ material: E,
6891
7198
  clampToGround: !1,
6892
7199
  arcType: i.ArcType.NONE
6893
7200
  }
@@ -6909,24 +7216,24 @@ ${f.area}:${p.toFixed(2)} m²` }, { id: m, lon: i.Math.toDegrees(g.longitude), l
6909
7216
  computeRectangle(t, e, i) {
6910
7217
  const n = this.Cesium, s = new n.EllipsoidTangentPlane(t, n.Ellipsoid.WGS84), o = s.projectPointsOntoPlane([t, e, i]);
6911
7218
  if (!o || o.length < 3) return null;
6912
- const r = o[0], a = o[1], l = o[2], d = a.x - r.x, u = a.y - r.y, p = Math.sqrt(d * d + u * u);
6913
- if (!p) return null;
6914
- const g = d / p, f = -(u / p), y = g, v = l.x - a.x, w = l.y - a.y, P = v * f + w * y;
7219
+ const r = o[0], a = o[1], l = o[2], d = a.x - r.x, u = a.y - r.y, g = Math.sqrt(d * d + u * u);
7220
+ if (!g) return null;
7221
+ const p = d / g, f = -(u / g), y = p, w = l.x - a.x, v = l.y - a.y, P = w * f + v * y;
6915
7222
  if (!P) return null;
6916
- const b = new n.Cartesian2(a.x + f * P, a.y + y * P), C = new n.Cartesian2(r.x + f * P, r.y + y * P), E = s.projectPointsOntoEllipsoid([r, a, b, C]);
6917
- if (!E || E.length < 4) return null;
6918
- const L = E, M = L[0], x = L[2], I = Math.abs(p), D = Math.abs(P), T = new n.Cartesian3(
7223
+ const b = new n.Cartesian2(a.x + f * P, a.y + y * P), C = new n.Cartesian2(r.x + f * P, r.y + y * P), L = s.projectPointsOntoEllipsoid([r, a, b, C]);
7224
+ if (!L || L.length < 4) return null;
7225
+ const E = L, M = E[0], x = E[2], I = Math.abs(g), D = Math.abs(P), T = new n.Cartesian3(
6919
7226
  (M.x + x.x) / 2,
6920
7227
  (M.y + x.y) / 2,
6921
7228
  (M.z + x.z) / 2
6922
- ), _ = new n.EllipsoidTangentPlane(T, n.Ellipsoid.WGS84).projectPointsOntoPlane(L);
7229
+ ), _ = new n.EllipsoidTangentPlane(T, n.Ellipsoid.WGS84).projectPointsOntoPlane(E);
6923
7230
  let k = 0;
6924
- for (let $ = 0; $ < _.length; $++) {
6925
- const O = ($ + 1) % _.length;
6926
- k += _[$].x * _[O].y - _[O].x * _[$].y;
7231
+ for (let R = 0; R < _.length; R++) {
7232
+ const H = (R + 1) % _.length;
7233
+ k += _[R].x * _[H].y - _[H].x * _[R].y;
6927
7234
  }
6928
7235
  const A = Math.abs(k) / 2;
6929
- return { corners: L, center: T, width: I, height: D, area: A };
7236
+ return { corners: E, center: T, width: I, height: D, area: A };
6930
7237
  }
6931
7238
  }
6932
7239
  class Pt {
@@ -6955,7 +7262,7 @@ class Pt {
6955
7262
  const e = this.Cesium, i = this.viewer, n = Math.max(t.sides || 6, 6);
6956
7263
  if (!this.htmlLabelPool) {
6957
7264
  const s = t.overlayContainerId || "html-label-container";
6958
- this.htmlLabelPool = new z(e, i, s), this.htmlLabelPool.registerTheme("measure-regular", {
7265
+ this.htmlLabelPool = new G(e, i, s), this.htmlLabelPool.registerTheme("measure-regular", {
6959
7266
  createElement: (o, r) => {
6960
7267
  var a;
6961
7268
  o.innerHTML = String(((a = r == null ? void 0 : r.data) == null ? void 0 : a.text) || ""), o.style.background = "rgba(0,0,0,0.6)", o.style.color = "#fff", o.style.font = "14px sans-serif", o.style.padding = "4px 6px", o.style.borderRadius = "4px", o.style.whiteSpace = "pre";
@@ -6974,28 +7281,28 @@ class Pt {
6974
7281
  const o = i.scene.pickPosition(s.position);
6975
7282
  if (o && (this.positions.push(o), this.positions.length === 2)) {
6976
7283
  this.stop();
6977
- const d = this.positions[0], u = this.positions[1], p = e.Cartesian3.distance(d, u), g = this.buildRegularPolygonPoints(d, p, n);
7284
+ const d = this.positions[0], u = this.positions[1], g = e.Cartesian3.distance(d, u), p = this.buildRegularPolygonPoints(d, g, n);
6978
7285
  this.previewEntity && (i.entities.remove(this.previewEntity), this.previewEntity = null), this.primitive && (i.scene.primitives.remove(this.primitive), this.primitive = null);
6979
- const m = new e.PolygonHierarchy(g), f = new e.PolygonGeometry({
7286
+ const m = new e.PolygonHierarchy(p), f = new e.PolygonGeometry({
6980
7287
  polygonHierarchy: m,
6981
7288
  vertexFormat: e.MaterialAppearance.VERTEX_FORMAT,
6982
7289
  perPositionHeight: !0,
6983
7290
  arcType: e.ArcType.NONE
6984
- }), y = new e.GeometryInstance({ geometry: f }), v = t.color || e.Color.YELLOW.withAlpha(0.4), w = t.color && t.color.withAlpha ? t.color.withAlpha(0.25) : e.Color.RED.withAlpha(0.4);
7291
+ }), y = new e.GeometryInstance({ geometry: f }), w = t.color || e.Color.YELLOW.withAlpha(0.4), v = t.color && t.color.withAlpha ? t.color.withAlpha(0.25) : e.Color.RED.withAlpha(0.4);
6985
7292
  this.primitive = new e.Primitive({
6986
7293
  geometryInstances: y,
6987
7294
  appearance: new e.MaterialAppearance({
6988
- material: e.Material.fromType("Color", { color: v }),
7295
+ material: e.Material.fromType("Color", { color: w }),
6989
7296
  translucent: !0,
6990
7297
  closed: !0
6991
7298
  }),
6992
7299
  depthFailAppearance: new e.MaterialAppearance({
6993
- material: e.Material.fromType("Color", { color: w }),
7300
+ material: e.Material.fromType("Color", { color: v }),
6994
7301
  translucent: !0,
6995
7302
  closed: !0
6996
7303
  })
6997
7304
  }), i.scene.primitives.add(this.primitive);
6998
- const P = t.lineColor || v, b = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED, C = g.slice(), E = i.entities.add({
7305
+ const P = t.lineColor || w, b = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED, C = p.slice(), L = i.entities.add({
6999
7306
  polyline: {
7000
7307
  positions: C,
7001
7308
  width: t.width || 2,
@@ -7009,35 +7316,35 @@ class Pt {
7009
7316
  })
7010
7317
  }
7011
7318
  });
7012
- this.edgeEntities.push(E);
7013
- const L = t.pointColor || v, M = g.slice(0, g.length - 1);
7319
+ this.edgeEntities.push(L);
7320
+ const E = t.pointColor || w, M = p.slice(0, p.length - 1);
7014
7321
  for (const k of M) {
7015
7322
  const A = i.entities.add({
7016
7323
  position: k,
7017
7324
  point: {
7018
7325
  pixelSize: 8,
7019
- color: L,
7326
+ color: E,
7020
7327
  disableDepthTestDistance: Number.POSITIVE_INFINITY
7021
7328
  }
7022
7329
  });
7023
7330
  this.pointEntities.push(A);
7024
7331
  }
7025
- const x = this.computeAreaByPlane(g), I = e.Cartographic.fromCartesian(d), D = this.htmlLabelId || `measure_regular_${Date.now()}`;
7332
+ const x = this.computeAreaByPlane(p), I = e.Cartographic.fromCartesian(d), D = this.htmlLabelId || `measure_regular_${Date.now()}`;
7026
7333
  this.htmlLabelId = D;
7027
7334
  const T = t.labelText || { sides: "边数", radius: "半径", circumference: "周长", area: "面积", side: "边长" };
7028
7335
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
7029
7336
  let S = 0;
7030
- for (let k = 1; k < g.length; k++) {
7031
- const A = g[k - 1], $ = g[k], O = e.Cartographic.fromCartesian(A), G = e.Cartographic.fromCartesian($), N = new e.EllipsoidGeodesic(O, G).surfaceDistance;
7337
+ for (let k = 1; k < p.length; k++) {
7338
+ const A = p[k - 1], R = p[k], H = e.Cartographic.fromCartesian(A), B = e.Cartographic.fromCartesian(R), N = new e.EllipsoidGeodesic(H, B).surfaceDistance;
7032
7339
  S += N;
7033
- const K = new e.Cartesian3((A.x + $.x) / 2, (A.y + $.y) / 2, (A.z + $.z) / 2), q = e.Cartographic.fromCartesian(K), se = `measure_regular_seg_${Date.now()}_${k - 1}`;
7340
+ const z = new e.Cartesian3((A.x + R.x) / 2, (A.y + R.y) / 2, (A.z + R.z) / 2), V = e.Cartographic.fromCartesian(z), se = `measure_regular_seg_${Date.now()}_${k - 1}`;
7034
7341
  this.segmentLabelIds.push(se), this.htmlLabelPool.add(
7035
7342
  { text: `${T.side}:${N.toFixed(2)} m` },
7036
7343
  {
7037
7344
  id: se,
7038
- lon: e.Math.toDegrees(q.longitude),
7039
- lat: e.Math.toDegrees(q.latitude),
7040
- height: q.height || 0,
7345
+ lon: e.Math.toDegrees(V.longitude),
7346
+ lat: e.Math.toDegrees(V.latitude),
7347
+ height: V.height || 0,
7041
7348
  theme: "measure-regular-seg",
7042
7349
  show: !0
7043
7350
  }
@@ -7045,7 +7352,7 @@ class Pt {
7045
7352
  }
7046
7353
  this.htmlLabelPool.add(
7047
7354
  { text: `${T.sides}:${n}
7048
- ${T.radius}:${p.toFixed(2)} m
7355
+ ${T.radius}:${g.toFixed(2)} m
7049
7356
  ${T.circumference}:${S.toFixed(2)} m
7050
7357
  ${T.area}:${x.toFixed(2)} m²` },
7051
7358
  {
@@ -7060,8 +7367,8 @@ ${T.area}:${x.toFixed(2)} m²` },
7060
7367
  const _ = {
7061
7368
  entity: this.primitive,
7062
7369
  label: this.labelEntity,
7063
- positions: g,
7064
- radius: p,
7370
+ positions: p,
7371
+ radius: g,
7065
7372
  sides: n,
7066
7373
  perimeter: S,
7067
7374
  area: x,
@@ -7076,24 +7383,24 @@ ${T.area}:${x.toFixed(2)} m²` },
7076
7383
  if (!a) return;
7077
7384
  const l = e.Cartesian3.distance(o, a);
7078
7385
  if (this.currentPoints = this.buildRegularPolygonPoints(o, l, n), !this.previewEntity) {
7079
- const v = t.color || e.Color.YELLOW.withAlpha(0.4);
7386
+ const w = t.color || e.Color.YELLOW.withAlpha(0.4);
7080
7387
  this.previewEntity = i.entities.add({
7081
7388
  polygon: {
7082
7389
  hierarchy: new e.CallbackProperty(() => {
7083
7390
  if (!(!this.currentPoints || this.currentPoints.length === 0))
7084
7391
  return new e.PolygonHierarchy(this.currentPoints);
7085
7392
  }, !1),
7086
- material: v,
7393
+ material: w,
7087
7394
  perPositionHeight: !0,
7088
7395
  arcType: e.ArcType.NONE
7089
7396
  }
7090
7397
  });
7091
- const w = t.lineColor || t.color || e.Color.YELLOW, P = ((y = (f = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : y.call(f, 0.9)) || e.Color.RED;
7398
+ const v = t.lineColor || t.color || e.Color.YELLOW, P = ((y = (f = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : y.call(f, 0.9)) || e.Color.RED;
7092
7399
  this.previewEdgeEntity = i.entities.add({
7093
7400
  polyline: {
7094
7401
  positions: new e.CallbackProperty(() => !this.currentPoints || this.currentPoints.length === 0 ? [] : this.currentPoints.slice(), !1),
7095
7402
  width: t.width || 2,
7096
- material: w,
7403
+ material: v,
7097
7404
  clampToGround: !1,
7098
7405
  arcType: e.ArcType.NONE,
7099
7406
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -7110,7 +7417,7 @@ ${T.area}:${x.toFixed(2)} m²` },
7110
7417
  color: b,
7111
7418
  disableDepthTestDistance: Number.POSITIVE_INFINITY
7112
7419
  }
7113
- }), E = i.entities.add({
7420
+ }), L = i.entities.add({
7114
7421
  position: new e.CallbackProperty(() => a || o, !1),
7115
7422
  point: {
7116
7423
  pixelSize: 8,
@@ -7118,15 +7425,15 @@ ${T.area}:${x.toFixed(2)} m²` },
7118
7425
  disableDepthTestDistance: Number.POSITIVE_INFINITY
7119
7426
  }
7120
7427
  });
7121
- this.previewPointEntities.push(C, E);
7428
+ this.previewPointEntities.push(C, L);
7122
7429
  }
7123
7430
  let d = 0;
7124
- for (let v = 1; v < this.currentPoints.length; v++) {
7125
- const w = this.currentPoints[v - 1], P = this.currentPoints[v], b = e.Cartographic.fromCartesian(w), C = e.Cartographic.fromCartesian(P), E = new e.EllipsoidGeodesic(b, C);
7126
- d += E.surfaceDistance;
7431
+ for (let w = 1; w < this.currentPoints.length; w++) {
7432
+ const v = this.currentPoints[w - 1], P = this.currentPoints[w], b = e.Cartographic.fromCartesian(v), C = e.Cartographic.fromCartesian(P), L = new e.EllipsoidGeodesic(b, C);
7433
+ d += L.surfaceDistance;
7127
7434
  }
7128
- const u = this.computeAreaByPlane(this.currentPoints), p = e.Cartographic.fromCartesian(o), g = this.previewLabelId || "measure_regular_preview";
7129
- this.previewLabelId = g;
7435
+ const u = this.computeAreaByPlane(this.currentPoints), g = e.Cartographic.fromCartesian(o), p = this.previewLabelId || "measure_regular_preview";
7436
+ this.previewLabelId = p;
7130
7437
  const m = t.labelText || { sides: "边数", radius: "半径", circumference: "周长", area: "面积" };
7131
7438
  this.htmlLabelPool.add(
7132
7439
  { text: `${m.sides}:${n}
@@ -7134,10 +7441,10 @@ ${m.radius}:${l.toFixed(2)} m
7134
7441
  ${m.circumference}:${d.toFixed(2)} m
7135
7442
  ${m.area}:${u.toFixed(2)} m²` },
7136
7443
  {
7137
- id: g,
7138
- lon: e.Math.toDegrees(p.longitude),
7139
- lat: e.Math.toDegrees(p.latitude),
7140
- height: p.height || 0,
7444
+ id: p,
7445
+ lon: e.Math.toDegrees(g.longitude),
7446
+ lat: e.Math.toDegrees(g.latitude),
7447
+ height: g.height || 0,
7141
7448
  theme: "measure-regular",
7142
7449
  show: !0
7143
7450
  }
@@ -7175,12 +7482,12 @@ ${m.area}:${u.toFixed(2)} m²` },
7175
7482
  this.labelEntity && (this.viewer.entities.remove(this.labelEntity), this.labelEntity = null), this.htmlLabelPool && this.htmlLabelId && (this.htmlLabelPool.removeByIds([this.htmlLabelId]), this.htmlLabelId = null), this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null), this.segmentLabelIds.length && this.htmlLabelPool && this.htmlLabelPool.removeByIds(this.segmentLabelIds.slice()), this.segmentLabelIds = [], this.positions = [], this.currentPoints = [];
7176
7483
  }
7177
7484
  rehydrate(t, e) {
7178
- var E;
7179
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = ((E = t.data) == null ? void 0 : E.sides) || s.sides || 3, r = (t.positions || []).map((L) => new i.Cartesian3(L[0], L[1], L[2]));
7485
+ var L;
7486
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = ((L = t.data) == null ? void 0 : L.sides) || s.sides || 3, r = (t.positions || []).map((E) => new i.Cartesian3(E[0], E[1], E[2]));
7180
7487
  if (r.length < 2) return;
7181
7488
  if (!this.htmlLabelPool) {
7182
- const L = s.overlayContainerId || "html-label-container";
7183
- this.htmlLabelPool = e || new z(i, n, L), this.htmlLabelPool.registerTheme("measure-regular", {
7489
+ const E = s.overlayContainerId || "html-label-container";
7490
+ this.htmlLabelPool = e || new G(i, n, E), this.htmlLabelPool.registerTheme("measure-regular", {
7184
7491
  createElement: (M, x) => {
7185
7492
  var I;
7186
7493
  M.innerHTML = String(((I = x == null ? void 0 : x.data) == null ? void 0 : I.text) || ""), M.style.background = "rgba(0,0,0,0.6)", M.style.color = "#fff", M.style.font = "14px sans-serif", M.style.padding = "4px 6px", M.style.borderRadius = "4px", M.style.whiteSpace = "pre";
@@ -7201,34 +7508,34 @@ ${m.area}:${u.toFixed(2)} m²` },
7201
7508
  a.reduce((M, x) => M + x.y, 0) / a.length,
7202
7509
  a.reduce((M, x) => M + x.z, 0) / a.length
7203
7510
  );
7204
- const L = a[0];
7205
- a[Math.floor(a.length / 2)] || a[1], d = i.Cartesian3.distance(l, L);
7511
+ const E = a[0];
7512
+ a[Math.floor(a.length / 2)] || a[1], d = i.Cartesian3.distance(l, E);
7206
7513
  } else {
7207
- const L = r[1];
7208
- d = i.Cartesian3.distance(l, L), a = this.buildRegularPolygonPoints(l, d, Math.max(o, 3));
7514
+ const E = r[1];
7515
+ d = i.Cartesian3.distance(l, E), a = this.buildRegularPolygonPoints(l, d, Math.max(o, 3));
7209
7516
  }
7210
- const u = new i.PolygonHierarchy(a), p = new i.PolygonGeometry({ polygonHierarchy: u, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT, perPositionHeight: !0 }), g = new i.GeometryInstance({ geometry: p }), m = s.color || i.Color.YELLOW.withAlpha(0.4), f = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), y = new i.Primitive({ geometryInstances: g, appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: m }), translucent: !0, closed: !0 }), depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: f }), translucent: !0, closed: !0 }) });
7517
+ const u = new i.PolygonHierarchy(a), g = new i.PolygonGeometry({ polygonHierarchy: u, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT, perPositionHeight: !0 }), p = new i.GeometryInstance({ geometry: g }), m = s.color || i.Color.YELLOW.withAlpha(0.4), f = s.color && s.color.withAlpha ? s.color.withAlpha(0.25) : i.Color.RED.withAlpha(0.4), y = new i.Primitive({ geometryInstances: p, appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: m }), translucent: !0, closed: !0 }), depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: f }), translucent: !0, closed: !0 }) });
7211
7518
  n.scene.primitives.add(y), this.primitive = y;
7212
- const v = this.computeAreaByPlane(a), w = i.Cartographic.fromCartesian(l), P = t.id + "_regular";
7519
+ const w = this.computeAreaByPlane(a), v = i.Cartographic.fromCartesian(l), P = t.id + "_regular";
7213
7520
  this.htmlLabelId = P;
7214
7521
  const b = s.labelText || { sides: "边数", radius: "半径", circumference: "周长", area: "面积", side: "边长" };
7215
7522
  let C = 0;
7216
- for (let L = 1; L < a.length; L++) {
7217
- const M = a[L - 1], x = a[L], I = i.Cartographic.fromCartesian(M), D = i.Cartographic.fromCartesian(x), S = new i.EllipsoidGeodesic(I, D).surfaceDistance;
7523
+ for (let E = 1; E < a.length; E++) {
7524
+ const M = a[E - 1], x = a[E], I = i.Cartographic.fromCartesian(M), D = i.Cartographic.fromCartesian(x), S = new i.EllipsoidGeodesic(I, D).surfaceDistance;
7218
7525
  C += S;
7219
- const _ = new i.Cartesian3((M.x + x.x) / 2, (M.y + x.y) / 2, (M.z + x.z) / 2), k = i.Cartographic.fromCartesian(_), A = t.id + `_regular_seg_${L - 1}`;
7526
+ const _ = new i.Cartesian3((M.x + x.x) / 2, (M.y + x.y) / 2, (M.z + x.z) / 2), k = i.Cartographic.fromCartesian(_), A = t.id + `_regular_seg_${E - 1}`;
7220
7527
  this.segmentLabelIds.push(A), this.htmlLabelPool.add({ text: `${b.side}:${S.toFixed(2)} m` }, { id: A, lon: i.Math.toDegrees(k.longitude), lat: i.Math.toDegrees(k.latitude), height: k.height || 0, theme: "measure-regular-seg", show: !0 });
7221
7528
  }
7222
7529
  this.htmlLabelPool.add({ text: `${b.sides}:${Math.max(o, 3)}
7223
7530
  ${b.radius}:${d.toFixed(2)} m
7224
7531
  ${b.circumference}:${C.toFixed(2)} m
7225
- ${b.area}:${v.toFixed(2)} m²` }, { id: P, lon: i.Math.toDegrees(w.longitude), lat: i.Math.toDegrees(w.latitude), height: w.height || 0, theme: "measure-regular", show: !0 });
7532
+ ${b.area}:${w.toFixed(2)} m²` }, { id: P, lon: i.Math.toDegrees(v.longitude), lat: i.Math.toDegrees(v.latitude), height: v.height || 0, theme: "measure-regular", show: !0 });
7226
7533
  }
7227
7534
  buildRegularPolygonPoints(t, e, i) {
7228
7535
  const n = this.Cesium, s = new n.EllipsoidTangentPlane(t, n.Ellipsoid.WGS84), o = 2 * Math.PI / i, r = [];
7229
7536
  for (let d = 0; d < i; d++) {
7230
- const u = d * o, p = e * Math.cos(u), g = e * Math.sin(u);
7231
- r.push(new n.Cartesian2(p, g));
7537
+ const u = d * o, g = e * Math.cos(u), p = e * Math.sin(u);
7538
+ r.push(new n.Cartesian2(g, p));
7232
7539
  }
7233
7540
  const l = s.projectPointsOntoEllipsoid(r).slice();
7234
7541
  return l.push(l[0]), l;
@@ -7247,7 +7554,7 @@ ${b.area}:${v.toFixed(2)} m²` }, { id: P, lon: i.Math.toDegrees(w.longitude), l
7247
7554
  return Math.abs(o) / 2;
7248
7555
  }
7249
7556
  }
7250
- class Ho {
7557
+ class No {
7251
7558
  constructor({ Cesium: t, viewer: e }) {
7252
7559
  c(this, "Cesium");
7253
7560
  c(this, "viewer");
@@ -7494,7 +7801,7 @@ class Ho {
7494
7801
  else {
7495
7802
  if (this.specifiedClear = !0, !this.deleteLabelPool) {
7496
7803
  const e = t || "html-label-container";
7497
- this.deleteLabelPool = new z(this.Cesium, this.viewer, e), this.deleteLabelPool.registerTheme("measure-delete-label", {
7804
+ this.deleteLabelPool = new G(this.Cesium, this.viewer, e), this.deleteLabelPool.registerTheme("measure-delete-label", {
7498
7805
  createElement: (i, n) => {
7499
7806
  i.innerHTML = "删除", i.style.background = "rgba(255,0,0,0.7)", i.style.color = "#fff", i.style.font = "12px sans-serif", i.style.padding = "2px 6px", i.style.borderRadius = "4px", i.style.whiteSpace = "nowrap";
7500
7807
  },
@@ -7575,7 +7882,7 @@ class Ho {
7575
7882
  return null;
7576
7883
  }
7577
7884
  }
7578
- class Fo {
7885
+ class zo {
7579
7886
  constructor({ Cesium: t, viewer: e }) {
7580
7887
  c(this, "Cesium");
7581
7888
  c(this, "viewer");
@@ -7633,12 +7940,12 @@ class Fo {
7633
7940
  _setupEntities(t) {
7634
7941
  const e = t.waypoints || [], i = new this.Cesium.SampledPositionProperty(), n = new this.Cesium.SampledProperty(this.Cesium.Quaternion), s = [];
7635
7942
  for (const u of e) {
7636
- let p;
7637
- u.destination ? u.destination.x !== void 0 ? p = new this.Cesium.Cartesian3(u.destination.x, u.destination.y, u.destination.z) : p = u.destination : u.lon !== void 0 && u.lat !== void 0 && (p = this.Cesium.Cartesian3.fromDegrees(u.lon, u.lat, u.height ?? 0));
7638
7943
  let g;
7639
- u.orientation ? g = new this.Cesium.HeadingPitchRoll(u.orientation.heading, u.orientation.pitch, u.orientation.roll) : g = this.Cesium.HeadingPitchRoll.fromDegrees(u.heading ?? 0, u.pitch ?? -30, u.roll ?? 0);
7640
- const m = this.Cesium.Transforms.headingPitchRollQuaternion(p, g);
7641
- s.push({ position: p, orientation: m });
7944
+ u.destination ? u.destination.x !== void 0 ? g = new this.Cesium.Cartesian3(u.destination.x, u.destination.y, u.destination.z) : g = u.destination : u.lon !== void 0 && u.lat !== void 0 && (g = this.Cesium.Cartesian3.fromDegrees(u.lon, u.lat, u.height ?? 0));
7945
+ let p;
7946
+ u.orientation ? p = new this.Cesium.HeadingPitchRoll(u.orientation.heading, u.orientation.pitch, u.orientation.roll) : p = this.Cesium.HeadingPitchRoll.fromDegrees(u.heading ?? 0, u.pitch ?? -30, u.roll ?? 0);
7947
+ const m = this.Cesium.Transforms.headingPitchRollQuaternion(g, p);
7948
+ s.push({ position: g, orientation: m });
7642
7949
  }
7643
7950
  const o = this.Cesium.JulianDate.now(), r = t.speed || 100;
7644
7951
  let a = 0;
@@ -7647,8 +7954,8 @@ class Fo {
7647
7954
  if (u === 0)
7648
7955
  l.push(o.clone());
7649
7956
  else {
7650
- const g = this.Cesium.Cartesian3.distance(s[u - 1].position, s[u].position) / Math.max(r, 0.1);
7651
- a += g, l.push(this.Cesium.JulianDate.addSeconds(o, a, new this.Cesium.JulianDate()));
7957
+ const p = this.Cesium.Cartesian3.distance(s[u - 1].position, s[u].position) / Math.max(r, 0.1);
7958
+ a += p, l.push(this.Cesium.JulianDate.addSeconds(o, a, new this.Cesium.JulianDate()));
7652
7959
  }
7653
7960
  i.addSample(l[u], s[u].position), n.addSample(l[u], s[u].orientation);
7654
7961
  }
@@ -7672,8 +7979,8 @@ class Fo {
7672
7979
  material: this.Cesium.Color.GREEN
7673
7980
  // clampToGround: false
7674
7981
  }
7675
- })), this.entity = this.viewer.entities.add(d), t.showStops && s.forEach((u, p) => {
7676
- const g = this.Cesium.Cartographic.fromCartesian(u.position), m = this.Cesium.Cartesian3.fromRadians(g.longitude, g.latitude, 0);
7982
+ })), this.entity = this.viewer.entities.add(d), t.showStops && s.forEach((u, g) => {
7983
+ const p = this.Cesium.Cartographic.fromCartesian(u.position), m = this.Cesium.Cartesian3.fromRadians(p.longitude, p.latitude, 0);
7677
7984
  this.viewEntities.push(this.viewer.entities.add({
7678
7985
  position: u.position,
7679
7986
  point: {
@@ -7683,7 +7990,7 @@ class Fo {
7683
7990
  outlineWidth: 1
7684
7991
  },
7685
7992
  label: {
7686
- text: "" + (p + 1),
7993
+ text: "" + (g + 1),
7687
7994
  font: "12px sans-serif",
7688
7995
  pixelOffset: new this.Cesium.Cartesian2(0, -15),
7689
7996
  fillColor: this.Cesium.Color.WHITE,
@@ -7728,7 +8035,7 @@ class Fo {
7728
8035
  // Legacy/Helper methods compatibility if needed, but we are refactoring.
7729
8036
  // We'll keep minimal interface compliance.
7730
8037
  }
7731
- class zo {
8038
+ class Go {
7732
8039
  constructor({ Cesium: t, viewer: e }) {
7733
8040
  c(this, "Cesium");
7734
8041
  c(this, "viewer");
@@ -7772,10 +8079,10 @@ class zo {
7772
8079
  const e = this.normalizePositions(t.positions || []);
7773
8080
  if (!e.length) return;
7774
8081
  const i = t.speed ?? 30, n = this.buildTimes(e, i), s = new this.Cesium.SampledPositionProperty();
7775
- for (let g = 0; g < e.length; g++)
7776
- s.addSample(n[g], e[g]);
8082
+ for (let p = 0; p < e.length; p++)
8083
+ s.addSample(n[p], e[p]);
7777
8084
  this.positionProperty = s;
7778
- const o = new this.Cesium.VelocityOrientationProperty(s), r = t.showPath ?? !0, a = t.pathColor ?? this.Cesium.Color.YELLOW, l = t.pathWidth ?? 3, d = t.pointColor ?? this.Cesium.Color.RED, u = t.pointPixelSize ?? 8, p = {
8085
+ const o = new this.Cesium.VelocityOrientationProperty(s), r = t.showPath ?? !0, a = t.pathColor ?? this.Cesium.Color.YELLOW, l = t.pathWidth ?? 3, d = t.pointColor ?? this.Cesium.Color.RED, u = t.pointPixelSize ?? 8, g = {
7779
8086
  availability: new this.Cesium.TimeIntervalCollection([
7780
8087
  new this.Cesium.TimeInterval({ start: this.startTime, stop: this.stopTime })
7781
8088
  ]),
@@ -7783,12 +8090,12 @@ class zo {
7783
8090
  orientation: o,
7784
8091
  path: r ? { material: a, width: l, leadTime: 0 } : void 0
7785
8092
  };
7786
- t.modelUrl ? p.model = {
8093
+ t.modelUrl ? g.model = {
7787
8094
  uri: t.modelUrl,
7788
8095
  scale: t.modelScale ?? 1,
7789
8096
  minimumPixelSize: 64,
7790
8097
  runAnimations: t.modelAnimate ?? !0
7791
- } : p.point = { color: d, pixelSize: u }, this.entity = this.viewer.entities.add(p), this.viewer.clock.startTime = this.startTime.clone(), this.viewer.clock.stopTime = this.stopTime.clone(), this.viewer.clock.currentTime = this.startTime.clone(), this.viewer.clock.clockRange = t.loop ? this.Cesium.ClockRange.LOOP_STOP : this.Cesium.ClockRange.CLAMPED, this.viewer.clock.multiplier = 1, this.viewer.clock.shouldAnimate = !0, t.initialView ? (this.viewer.camera.setView({
8098
+ } : g.point = { color: d, pixelSize: u }, this.entity = this.viewer.entities.add(g), this.viewer.clock.startTime = this.startTime.clone(), this.viewer.clock.stopTime = this.stopTime.clone(), this.viewer.clock.currentTime = this.startTime.clone(), this.viewer.clock.clockRange = t.loop ? this.Cesium.ClockRange.LOOP_STOP : this.Cesium.ClockRange.CLAMPED, this.viewer.clock.multiplier = 1, this.viewer.clock.shouldAnimate = !0, t.initialView ? (this.viewer.camera.setView({
7792
8099
  destination: t.initialView.destination,
7793
8100
  orientation: t.initialView.orientation
7794
8101
  }), this.cameraOffset = null) : t.followCamera ? this.viewer.trackedEntity = this.entity : t.lookAtOffset && this.viewer.camera.lookAt(this.entity.position, t.lookAtOffset), this.viewer.clock.onTick.addEventListener(this.onTick);
@@ -7827,25 +8134,25 @@ class zo {
7827
8134
  }
7828
8135
  export {
7829
8136
  Ae as AreaMeasure,
7830
- Io as BufferedHierarchicalAggregator,
7831
- Fo as CameraRoamTool,
8137
+ _o as BufferedHierarchicalAggregator,
8138
+ zo as CameraRoamTool,
7832
8139
  wt as CircleMeasure,
7833
8140
  Ct as CoordinateMeasure,
7834
8141
  Yt as DOM_EVENT_MAP,
7835
- To as DrawTool,
7836
- Po as EditMode,
7837
- $o as EntityLayerManager,
7838
- _o as GLTFManage,
7839
- Lo as GLTFManageEventKey,
8142
+ Do as DrawTool,
8143
+ Eo as EditMode,
8144
+ Ho as EntityLayerManager,
8145
+ So as GLTFManage,
8146
+ Mo as GLTFManageEventKey,
7840
8147
  Se as HorizontalMeasure,
7841
- z as HtmlOverlayLabelPool,
8148
+ G as HtmlOverlayLabelPool,
7842
8149
  Bt as MarkerEventBus,
7843
8150
  te as MarkerEventKey,
7844
- ko as MaterialManager,
7845
- Ho as MeasurementTool,
7846
- zo as PathRoamTool,
8151
+ $o as MaterialManager,
8152
+ No as MeasurementTool,
8153
+ Go as PathRoamTool,
7847
8154
  ke as PolylineDistanceMeasure,
7848
- Oo as PrimitiveManager,
8155
+ Fo as PrimitiveManager,
7849
8156
  bt as RectangleMeasure,
7850
8157
  Pt as RegularPolygonMeasure,
7851
8158
  yt as SpaceMeasure,
@@ -7853,8 +8160,8 @@ export {
7853
8160
  ce as TooltipManager,
7854
8161
  ft as TriangleMeasure,
7855
8162
  gt as VerticalMeasure,
7856
- Ro as convertGeoJsonToEntityData,
7857
- Do as getDynamicImgMaterial,
7858
- Ao as getPolylineFlowMaterialProperty,
7859
- So as getWallMaterial
8163
+ Oo as convertGeoJsonToEntityData,
8164
+ Ao as getDynamicImgMaterial,
8165
+ Ro as getPolylineFlowMaterialProperty,
8166
+ ko as getWallMaterial
7860
8167
  };