leiting-bim 2.2.65 → 2.2.67

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
1
  var Nt = Object.defineProperty;
2
2
  var Gt = (h, t, e) => t in h ? Nt(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");
@@ -122,15 +122,15 @@ class Io {
122
122
  if (!l) continue;
123
123
  const d = `${l.x}_${l.y}`, u = r.get(d);
124
124
  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);
125
+ const g = u.allPoints.findIndex((m) => m.id === t.id);
126
+ if (g !== -1 && u.allPoints.splice(g, 1), this._shouldSkipAggregation(i.data)) {
127
+ const m = u.skipPoints.findIndex((p) => p.id === t.id);
128
+ m !== -1 && u.skipPoints.splice(m, 1);
129
129
  } else {
130
- const g = this.groupByTheme ? this._getBillboardTheme(i.data) : this.clusterTheme, m = u.groups.get(g);
131
- if (m) {
132
- const f = m.findIndex((y) => y.id === t.id);
133
- f !== -1 && m.splice(f, 1), m.length === 0 && u.groups.delete(g);
130
+ const m = this.groupByTheme ? this._getBillboardTheme(i.data) : this.clusterTheme, p = u.groups.get(m);
131
+ if (p) {
132
+ const f = p.findIndex((y) => y.id === t.id);
133
+ f !== -1 && p.splice(f, 1), p.length === 0 && u.groups.delete(m);
134
134
  }
135
135
  }
136
136
  }
@@ -203,7 +203,7 @@ class Io {
203
203
  }
204
204
  _update() {
205
205
  if (!this.labelPool) return;
206
- this._syncTilingSchemeAndLevels(), this.labelPool.reset(), this.debugCurrentGrids && this._clearDebugGrids();
206
+ this._syncTilingSchemeAndLevels(), this.labelPool.beginUpdate(), this.debugCurrentGrids && this._clearDebugGrids();
207
207
  const t = this.points.length < this.minGlobalPointCount ? 1 / 0 : this.threshold;
208
208
  let e = 0;
209
209
  const i = (n, s, o, r) => {
@@ -219,7 +219,7 @@ class Io {
219
219
  try {
220
220
  const n = this._getSurfaceTiles();
221
221
  if (!n || n.length === 0) {
222
- this._handleNoSurfaceTiles(e);
222
+ this._handleNoSurfaceTiles(e), this.labelPool.cleanup();
223
223
  return;
224
224
  }
225
225
  this._tilesRetryCount = 0, this._processTiles(n, i);
@@ -278,23 +278,23 @@ class Io {
278
278
  return e;
279
279
  }
280
280
  _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) => {
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, g) => {
282
282
  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);
283
+ const m = this.tilingScheme.tileXYToRectangle(d, u, g);
284
+ return !(!m || m.east <= a.west || m.west >= a.east || m.north <= a.south || m.south >= a.north);
285
285
  };
286
286
  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);
290
- if (m === void 0) continue;
291
- const f = this.levels[m].level, y = d._x ?? d.x, v = d._y ?? d.y;
287
+ const u = d.rectangle, g = d._level ?? d.level;
288
+ if (!u || typeof g != "number") continue;
289
+ const m = this._getGridRefLevel(g), p = this._resolveLevelIndex(m);
290
+ if (p === void 0) continue;
291
+ const f = this.levels[p].level, y = d._x ?? d.x, v = d._y ?? d.y;
292
292
  if (typeof y == "number" && typeof v == "number") {
293
- const T = p - f;
293
+ const T = g - f;
294
294
  if (T >= 0) {
295
295
  const S = 1 << T, _ = Math.floor(y / S), k = Math.floor(v / S), A = `${f}_${_}_${k}`;
296
296
  if (i.has(A)) continue;
297
- i.add(A), e(m, _, k, p);
297
+ i.add(A), e(p, _, k, g);
298
298
  } else {
299
299
  const _ = 1 << Math.min(-T, this.maxRefineLevels), k = y * _, A = v * _;
300
300
  for (let $ = 0; $ < _; $++)
@@ -302,17 +302,17 @@ class Io {
302
302
  const G = k + $, B = A + O;
303
303
  if (!l(G, B, f)) continue;
304
304
  const N = `${f}_${G}_${B}`;
305
- i.has(N) || (i.add(N), e(m, G, B, p));
305
+ i.has(N) || (i.add(N), e(p, G, B, g));
306
306
  }
307
307
  }
308
308
  continue;
309
309
  }
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);
310
+ const P = this.levels[p].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);
311
311
  for (let T = M; T <= x; T++)
312
312
  for (let S = I; S <= D; S++) {
313
313
  if (!l(T, S, f)) continue;
314
314
  const _ = `${f}_${T}_${S}`;
315
- i.has(_) || (i.add(_), e(m, T, S, p));
315
+ i.has(_) || (i.add(_), e(p, T, S, g));
316
316
  }
317
317
  }
318
318
  }
@@ -327,7 +327,7 @@ class Io {
327
327
  if (!r) return null;
328
328
  const a = `${e}_${i}`, l = r.get(a);
329
329
  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;
330
+ const d = this.tilingScheme.tileXYToRectangle(e, i, o), u = this.Cesium.Math.toDegrees(d.west), g = this.Cesium.Math.toDegrees(d.south), m = this.Cesium.Math.toDegrees(d.east), p = this.Cesium.Math.toDegrees(d.north), f = (u + m) / 2, y = (g + p) / 2;
331
331
  return {
332
332
  levelIdx: t,
333
333
  tileLevel: o,
@@ -337,9 +337,9 @@ class Io {
337
337
  cell: l,
338
338
  rect: d,
339
339
  west: u,
340
- south: p,
341
- east: g,
342
- north: m,
340
+ south: g,
341
+ east: m,
342
+ north: p,
343
343
  centerLon: f,
344
344
  centerLat: y,
345
345
  viewTileLevel: n
@@ -363,7 +363,7 @@ class Io {
363
363
  return e;
364
364
  }
365
365
  _processCellGroups(t, e, i) {
366
- var p, g, m, f, y, v, w;
366
+ var g, m, p, f, y, v, w;
367
367
  const {
368
368
  levelIdx: n,
369
369
  lonIdx: s,
@@ -379,8 +379,8 @@ class Io {
379
379
  return ((D = I.data) == null ? void 0 : D.show) !== !1;
380
380
  });
381
381
  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)
382
+ let E = a, L = l, M = ((g = C[0]) == null ? void 0 : g.height) || 0;
383
+ if (this.centralPointMode == "firstPoint" && (E = ((m = C[0]) == null ? void 0 : m.lon) || 0, L = ((p = C[0]) == null ? void 0 : p.lat) || 0, M = ((f = C[0]) == null ? void 0 : f.height) || 0), n === this.levels.length - 1 || C.length < e)
384
384
  for (const I of C) {
385
385
  if (i >= this.displayLimit) break;
386
386
  this._isVisibleAtLevel(I, u) && (this.labelPool.add(I.data, {
@@ -563,6 +563,18 @@ const Yt = {
563
563
  [te.MouseDown]: "mousedown",
564
564
  [te.MouseUp]: "mouseup"
565
565
  };
566
+ function jt() {
567
+ var h;
568
+ if (typeof window > "u") return !1;
569
+ try {
570
+ return window.__DEVICE_ALARM_DEBUG__ === !0 || ((h = window.localStorage) == null ? void 0 : h.getItem("deviceAlarmDebug")) === "1";
571
+ } catch {
572
+ return !1;
573
+ }
574
+ }
575
+ function Vt(h, t = {}) {
576
+ jt() && console.log("[DeviceAlarm][OverlayPool]", h, t);
577
+ }
566
578
  class z {
567
579
  /**
568
580
  * 构造函数
@@ -644,57 +656,60 @@ class z {
644
656
  theme: r,
645
657
  show: a = !0,
646
658
  notCreateElement: l = !1,
647
- style: d
648
- } = e, u = this.themes[r];
649
- if (!u) {
659
+ persistent: d = !1,
660
+ style: u
661
+ } = e, g = this.themes[r];
662
+ if (!g) {
650
663
  console.warn(`Theme "${r}" not registered`);
651
664
  return;
652
665
  }
653
- let p = this.labels.get(i);
654
- 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
- }
666
+ let m = this.labels.get(i);
667
+ if (m) {
668
+ const p = m.theme !== r || m.data !== t || m.notCreateElement !== l || !m.el.parentNode;
669
+ if (m.theme = r, m.data = t, m.notCreateElement = l, m.persistent = d, p)
670
+ try {
671
+ typeof m.unload == "function" && m.unload(), m.el.replaceChildren(), m.unload = g.createElement(m.el, { id: i, theme: r, data: t }, g) || {};
672
+ } catch (f) {
673
+ console.error(`Error updating label element for id "${i}":`, f);
674
+ }
675
+ (!l || a) && m.el.parentNode !== this.container && this.container.appendChild(m.el);
661
676
  } else {
662
- const g = document.createElement("div");
663
- Object.assign(g.style, {
677
+ const p = document.createElement("div");
678
+ Object.assign(p.style, {
664
679
  position: "absolute",
665
680
  transform: "translate(0, 0)",
666
681
  pointerEvents: "auto",
667
682
  ...e.style || {}
668
683
  });
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);
684
+ for (const [y, v] of Object.entries(Yt)) {
685
+ p.addEventListener(v, (P) => {
686
+ P.stopPropagation();
687
+ const b = this.labels.get(i);
688
+ this.eventBus.runListener(y, b, P);
674
689
  });
675
- let v = 0;
676
- g.addEventListener("wheel", (w) => {
690
+ let w = 0;
691
+ p.addEventListener("wheel", (P) => {
677
692
  if (!this.openWheel) return;
678
- const P = w.currentTarget;
679
- v = Date.now();
680
- const b = v;
681
- P.style.pointerEvents = "none", setTimeout(() => {
682
- v === b && (P.style.pointerEvents = "auto");
693
+ const b = P.currentTarget;
694
+ w = Date.now();
695
+ const C = w;
696
+ b.style.pointerEvents = "none", setTimeout(() => {
697
+ w === C && (b.style.pointerEvents = "auto");
683
698
  }, 2e3);
684
699
  });
685
700
  }
686
- let m = null;
701
+ let f = null;
687
702
  if (!l || a) {
688
703
  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);
704
+ f = g.createElement(p, { id: i, theme: r, data: t }, g) || {};
705
+ } catch (y) {
706
+ console.error(`Error updating label element for id "${i}":`, y);
692
707
  }
693
- this.container.appendChild(g);
708
+ this.container.appendChild(p);
694
709
  }
695
- p = { id: i, el: g, theme: r, data: t, notCreateElement: l, unload: m }, this.labels.set(i, p);
710
+ m = { id: i, el: p, theme: r, data: t, notCreateElement: l, persistent: d, unload: f }, this.labels.set(i, m);
696
711
  }
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));
712
+ m.el.dataset.lon = String(n), m.el.dataset.lat = String(s), m.el.dataset.height = String(o), m.offset = e.offset, m.anchor = e.anchor || "top-left", Object.assign(m.el.style, e.style || {}), m.el.style.zIndex = (u == null ? void 0 : u.zIndex) || "1", m.el.style.display = a ? "block" : "none", a && this.activeIds.add(i), a ? this._scheduleOcclusionCheck() : (this.activeIds.delete(i), this.occludedIds.delete(i));
698
713
  }
699
714
  /**
700
715
  * 批量添加标签
@@ -738,7 +753,7 @@ class z {
738
753
  return;
739
754
  }
740
755
  try {
741
- i.data = e, n.createElement(i.el, { id: t, theme: i.theme, data: e }, n);
756
+ 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
757
  } catch (s) {
743
758
  console.error(`Failed to update label "${t}":`, s);
744
759
  }
@@ -801,7 +816,19 @@ class z {
801
816
  return this.labels.has(t);
802
817
  }
803
818
  /**
804
- * 清空活跃 ID 列表(不影响 DOM)
819
+ * 开始一次设备聚合的差异化可见性更新。
820
+ * 独立覆盖层不参与聚合计算,必须保留在活跃集合中以继续跟随相机。
821
+ */
822
+ beginUpdate() {
823
+ this.activeIds = new Set(
824
+ [...this.activeIds].filter((t) => {
825
+ var e;
826
+ return ((e = this.labels.get(t)) == null ? void 0 : e.persistent) === !0;
827
+ })
828
+ );
829
+ }
830
+ /**
831
+ * 强制卸载所有当前活跃标签;仅供销毁等需要释放 DOM 的场景使用。
805
832
  */
806
833
  reset() {
807
834
  for (const t of this.activeIds.values()) {
@@ -815,7 +842,13 @@ class z {
815
842
  */
816
843
  cleanup() {
817
844
  for (const [t, e] of this.labels.entries())
818
- this.activeIds.has(t) || (e.el.style.display = "none", this.occludedIds.delete(t));
845
+ if (!this.activeIds.has(t)) {
846
+ if (e.persistent) {
847
+ Vt("skip-persistent-cleanup", { id: t, display: e.el.style.display });
848
+ continue;
849
+ }
850
+ e.el.style.display = "none", this.occludedIds.delete(t);
851
+ }
819
852
  }
820
853
  /**
821
854
  * 经纬度 -> 自动地形高度修正 -> Cartesian3 -> 屏幕坐标
@@ -868,10 +901,10 @@ class z {
868
901
  }
869
902
  const r = this.Cesium.Cartesian3.fromDegrees(n, s, o), a = this.toWindowCoordinates(r);
870
903
  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);
904
+ 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, m = this.occludedIds.has(e);
872
905
  i.el.style.left = `${a.x}px`, i.el.style.top = `${a.y}px`;
873
- 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";
906
+ const p = this.getAnchorTransform(i.anchor);
907
+ i.el.style.transform = `${p}${p ? " " : ""}translate(${u}px, ${g}px)`, i.el.style.display = m ? "none" : "block";
875
908
  } else
876
909
  i.el.style.display = "none";
877
910
  }
@@ -914,8 +947,8 @@ class z {
914
947
  reason: "pick-unsupported"
915
948
  }), !0;
916
949
  try {
917
- const p = r.pickPosition(i);
918
- if (!p || !a.positionWC)
950
+ const g = r.pickPosition(i);
951
+ if (!g || !a.positionWC)
919
952
  return this._pushOcclusionLog({
920
953
  timestamp: Date.now(),
921
954
  id: t,
@@ -925,7 +958,7 @@ class z {
925
958
  occluded: !0,
926
959
  reason: "pick-empty"
927
960
  }), !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;
961
+ const m = Number(this.occlusionOptions.distanceEpsilon) || 0, p = l.Cartesian3.distance(a.positionWC, e), f = l.Cartesian3.distance(a.positionWC, g), y = f + m < p;
929
962
  return this._pushOcclusionLog({
930
963
  timestamp: Date.now(),
931
964
  id: t,
@@ -934,8 +967,8 @@ class z {
934
967
  height: o,
935
968
  occluded: y,
936
969
  reason: "distance-compare",
937
- epsilon: g,
938
- labelDistance: m,
970
+ epsilon: m,
971
+ labelDistance: p,
939
972
  pickedDistance: f
940
973
  }), y;
941
974
  } catch {
@@ -1048,7 +1081,7 @@ class ce {
1048
1081
  this.onMouseMove && (window.removeEventListener("mousemove", this.onMouseMove), this.onMouseMove = null), this.tooltipEl.parentElement && this.tooltipEl.parentElement.removeChild(this.tooltipEl);
1049
1082
  }
1050
1083
  }
1051
- class jt {
1084
+ class Wt {
1052
1085
  constructor(t, e) {
1053
1086
  c(this, "Cesium");
1054
1087
  c(this, "viewer");
@@ -1060,7 +1093,7 @@ class jt {
1060
1093
  startDrawing(t) {
1061
1094
  const { Cesium: e, viewer: i } = this;
1062
1095
  this.tooltip = new ce(), this.tooltip.show("左键添加点"), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
1063
- var p, g;
1096
+ var g, m;
1064
1097
  const s = i.scene.pickPosition(n.position);
1065
1098
  if (!s) return;
1066
1099
  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 +1113,7 @@ class jt {
1080
1113
  this.clear();
1081
1114
  }
1082
1115
  };
1083
- (p = t.onComplete) == null || p.call(t, u), this.stopDrawing(), (g = this.tooltip) == null || g.hide(), this.tooltip = null;
1116
+ (g = t.onComplete) == null || g.call(t, u), this.stopDrawing(), (m = this.tooltip) == null || m.hide(), this.tooltip = null;
1084
1117
  }, e.ScreenSpaceEventType.LEFT_CLICK);
1085
1118
  }
1086
1119
  stopDrawing() {
@@ -1092,7 +1125,7 @@ class jt {
1092
1125
  (t = this.tooltip) == null || t.hide(), this.tooltip = null, this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.stopDrawing();
1093
1126
  }
1094
1127
  }
1095
- class Wt {
1128
+ class Ut {
1096
1129
  constructor(t, e) {
1097
1130
  c(this, "Cesium");
1098
1131
  c(this, "viewer");
@@ -1209,7 +1242,7 @@ class Wt {
1209
1242
  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
1243
  }
1211
1244
  }
1212
- class Vt {
1245
+ class Kt {
1213
1246
  constructor(t, e) {
1214
1247
  c(this, "Cesium");
1215
1248
  c(this, "viewer");
@@ -1231,8 +1264,8 @@ class Vt {
1231
1264
  coordinates: new e.CallbackProperty(() => {
1232
1265
  if (!(!this.startPoint || !this.endPoint))
1233
1266
  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);
1267
+ 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);
1268
+ return new e.Rectangle(l, u, d, g);
1236
1269
  } catch (r) {
1237
1270
  console.warn("Rectangle calculation error:", r);
1238
1271
  return;
@@ -1284,7 +1317,7 @@ class Vt {
1284
1317
  this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.startPoint = null, this.endPoint = null, this.stopDrawing();
1285
1318
  }
1286
1319
  }
1287
- class Ut {
1320
+ class Xt {
1288
1321
  constructor(t, e) {
1289
1322
  c(this, "viewer");
1290
1323
  c(this, "Cesium");
@@ -1333,16 +1366,16 @@ class Ut {
1333
1366
  lat: this.Cesium.Math.toDegrees(s.latitude),
1334
1367
  height: s.height
1335
1368
  }, 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();
1338
- m.setEndPoints(
1369
+ for (let g = 0; g < 360; g += r) {
1370
+ const m = this.Cesium.Math.toRadians(g), p = new this.Cesium.EllipsoidGeodesic();
1371
+ p.setEndPoints(
1339
1372
  s,
1340
1373
  new this.Cesium.Cartographic(
1341
- s.longitude + 1e-4 * Math.cos(g),
1342
- s.latitude + 1e-4 * Math.sin(g)
1374
+ s.longitude + 1e-4 * Math.cos(m),
1375
+ s.latitude + 1e-4 * Math.sin(m)
1343
1376
  )
1344
1377
  );
1345
- const f = m.interpolateUsingSurfaceDistance(n), y = this.Cesium.Ellipsoid.WGS84.cartographicToCartesian(f);
1378
+ const f = p.interpolateUsingSurfaceDistance(n), y = this.Cesium.Ellipsoid.WGS84.cartographicToCartesian(f);
1346
1379
  a.push(y);
1347
1380
  const v = this.Cesium.Cartographic.fromCartesian(y);
1348
1381
  l.push({
@@ -1352,12 +1385,12 @@ class Ut {
1352
1385
  });
1353
1386
  }
1354
1387
  l.push(l[0]);
1355
- const d = this.positions.map((p) => {
1356
- const g = this.Cesium.Cartographic.fromCartesian(p);
1388
+ const d = this.positions.map((g) => {
1389
+ const m = this.Cesium.Cartographic.fromCartesian(g);
1357
1390
  return {
1358
- lng: this.Cesium.Math.toDegrees(g.longitude),
1359
- lat: this.Cesium.Math.toDegrees(g.latitude),
1360
- height: g.height
1391
+ lng: this.Cesium.Math.toDegrees(m.longitude),
1392
+ lat: this.Cesium.Math.toDegrees(m.latitude),
1393
+ height: m.height
1361
1394
  };
1362
1395
  });
1363
1396
  (u = t.onComplete) == null || u.call(t, {
@@ -1380,7 +1413,7 @@ class Ut {
1380
1413
  this.stopDrawing(), this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.positions = [], this.currentRadius = 0;
1381
1414
  }
1382
1415
  }
1383
- class Kt {
1416
+ class qt {
1384
1417
  constructor(t, e) {
1385
1418
  c(this, "Cesium");
1386
1419
  c(this, "viewer");
@@ -1510,7 +1543,7 @@ class Kt {
1510
1543
  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
1544
  }
1512
1545
  }
1513
- class To {
1546
+ class Do {
1514
1547
  constructor(t, e) {
1515
1548
  c(this, "viewer");
1516
1549
  c(this, "Cesium");
@@ -1521,19 +1554,19 @@ class To {
1521
1554
  var i;
1522
1555
  switch (this.clear(), t) {
1523
1556
  case "point":
1524
- this.activeDrawer = new jt(this.Cesium, this.viewer);
1557
+ this.activeDrawer = new Wt(this.Cesium, this.viewer);
1525
1558
  break;
1526
1559
  case "line":
1527
- this.activeDrawer = new Wt(this.Cesium, this.viewer);
1560
+ this.activeDrawer = new Ut(this.Cesium, this.viewer);
1528
1561
  break;
1529
1562
  case "rectangle":
1530
- this.activeDrawer = new Vt(this.Cesium, this.viewer);
1563
+ this.activeDrawer = new Kt(this.Cesium, this.viewer);
1531
1564
  break;
1532
1565
  case "circle":
1533
- this.activeDrawer = new Ut(this.Cesium, this.viewer);
1566
+ this.activeDrawer = new Xt(this.Cesium, this.viewer);
1534
1567
  break;
1535
1568
  case "polygon":
1536
- this.activeDrawer = new Kt(this.Cesium, this.viewer);
1569
+ this.activeDrawer = new qt(this.Cesium, this.viewer);
1537
1570
  break;
1538
1571
  default:
1539
1572
  throw new Error(`Unsupported draw type: ${t}`);
@@ -1547,24 +1580,24 @@ class To {
1547
1580
  this.clear();
1548
1581
  }
1549
1582
  }
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];
1583
+ 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;
1584
+ function ei(h) {
1585
+ var t = Jt.call(h, be), e = h[be];
1553
1586
  try {
1554
1587
  h[be] = void 0;
1555
1588
  var i = !0;
1556
1589
  } catch {
1557
1590
  }
1558
- var n = Zt.call(h);
1591
+ var n = Qt.call(h);
1559
1592
  return i && (t ? h[be] = e : delete h[be]), n;
1560
1593
  }
1561
- var Qt = Object.prototype, ei = Qt.toString;
1562
- function ti(h) {
1563
- return ei.call(h);
1594
+ var ti = Object.prototype, ii = ti.toString;
1595
+ function si(h) {
1596
+ return ii.call(h);
1564
1597
  }
1565
- var ii = "[object Null]", si = "[object Undefined]", Ke = fe ? fe.toStringTag : void 0;
1598
+ var ni = "[object Null]", oi = "[object Undefined]", Ke = fe ? fe.toStringTag : void 0;
1566
1599
  function xe(h) {
1567
- return h == null ? h === void 0 ? si : ii : Ke && Ke in Object(h) ? Jt(h) : ti(h);
1600
+ return h == null ? h === void 0 ? oi : ni : Ke && Ke in Object(h) ? ei(h) : si(h);
1568
1601
  }
1569
1602
  function Ie(h) {
1570
1603
  return h != null && typeof h == "object";
@@ -1574,25 +1607,25 @@ function He(h) {
1574
1607
  var t = typeof h;
1575
1608
  return h != null && (t == "object" || t == "function");
1576
1609
  }
1577
- var ni = "[object AsyncFunction]", oi = "[object Function]", ri = "[object GeneratorFunction]", ai = "[object Proxy]";
1610
+ var ri = "[object AsyncFunction]", ai = "[object Function]", li = "[object GeneratorFunction]", hi = "[object Proxy]";
1578
1611
  function Mt(h) {
1579
1612
  if (!He(h))
1580
1613
  return !1;
1581
1614
  var t = xe(h);
1582
- return t == oi || t == ri || t == ni || t == ai;
1615
+ return t == ai || t == li || t == ri || t == hi;
1583
1616
  }
1584
1617
  var Ne = ie["__core-js_shared__"], Xe = (function() {
1585
1618
  var h = /[^.]+$/.exec(Ne && Ne.keys && Ne.keys.IE_PROTO || "");
1586
1619
  return h ? "Symbol(src)_1." + h : "";
1587
1620
  })();
1588
- function li(h) {
1621
+ function ci(h) {
1589
1622
  return !!Xe && Xe in h;
1590
1623
  }
1591
- var hi = Function.prototype, ci = hi.toString;
1624
+ var di = Function.prototype, ui = di.toString;
1592
1625
  function de(h) {
1593
1626
  if (h != null) {
1594
1627
  try {
1595
- return ci.call(h);
1628
+ return ui.call(h);
1596
1629
  } catch {
1597
1630
  }
1598
1631
  try {
@@ -1602,23 +1635,23 @@ function de(h) {
1602
1635
  }
1603
1636
  return "";
1604
1637
  }
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.*?") + "$"
1638
+ var pi = /[\\^$.*+?()[\]{}|]/g, mi = /^\[object .+?Constructor\]$/, gi = Function.prototype, fi = Object.prototype, yi = gi.toString, wi = fi.hasOwnProperty, vi = RegExp(
1639
+ "^" + yi.call(wi).replace(pi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1607
1640
  );
1608
- function wi(h) {
1609
- if (!He(h) || li(h))
1641
+ function Ci(h) {
1642
+ if (!He(h) || ci(h))
1610
1643
  return !1;
1611
- var t = Mt(h) ? yi : ui;
1644
+ var t = Mt(h) ? vi : mi;
1612
1645
  return t.test(de(h));
1613
1646
  }
1614
- function vi(h, t) {
1647
+ function bi(h, t) {
1615
1648
  return h == null ? void 0 : h[t];
1616
1649
  }
1617
1650
  function ue(h, t) {
1618
- var e = vi(h, t);
1619
- return wi(e) ? e : void 0;
1651
+ var e = bi(h, t);
1652
+ return Ci(e) ? e : void 0;
1620
1653
  }
1621
- var Be = ue(ie, "WeakMap"), qe = Object.create, Ci = /* @__PURE__ */ (function() {
1654
+ var Be = ue(ie, "WeakMap"), qe = Object.create, Pi = /* @__PURE__ */ (function() {
1622
1655
  function h() {
1623
1656
  }
1624
1657
  return function(t) {
@@ -1637,17 +1670,17 @@ var Be = ue(ie, "WeakMap"), qe = Object.create, Ci = /* @__PURE__ */ (function()
1637
1670
  } catch {
1638
1671
  }
1639
1672
  })();
1640
- function bi(h, t) {
1673
+ function Li(h, t) {
1641
1674
  for (var e = -1, i = h == null ? 0 : h.length; ++e < i && t(h[e], e, h) !== !1; )
1642
1675
  ;
1643
1676
  return h;
1644
1677
  }
1645
- var Pi = 9007199254740991, Li = /^(?:0|[1-9]\d*)$/;
1646
- function Ei(h, t) {
1678
+ var Ei = 9007199254740991, Mi = /^(?:0|[1-9]\d*)$/;
1679
+ function xi(h, t) {
1647
1680
  var e = typeof h;
1648
- return t = t ?? Pi, !!t && (e == "number" || e != "symbol" && Li.test(h)) && h > -1 && h % 1 == 0 && h < t;
1681
+ return t = t ?? Ei, !!t && (e == "number" || e != "symbol" && Mi.test(h)) && h > -1 && h % 1 == 0 && h < t;
1649
1682
  }
1650
- function Mi(h, t, e) {
1683
+ function Ii(h, t, e) {
1651
1684
  t == "__proto__" && Ze ? Ze(h, t, {
1652
1685
  configurable: !0,
1653
1686
  enumerable: !0,
@@ -1658,66 +1691,66 @@ function Mi(h, t, e) {
1658
1691
  function xt(h, t) {
1659
1692
  return h === t || h !== h && t !== t;
1660
1693
  }
1661
- var xi = Object.prototype, Ii = xi.hasOwnProperty;
1662
- function Ti(h, t, e) {
1694
+ var Ti = Object.prototype, _i = Ti.hasOwnProperty;
1695
+ function Di(h, t, e) {
1663
1696
  var i = h[t];
1664
- (!(Ii.call(h, t) && xt(i, e)) || e === void 0 && !(t in h)) && Mi(h, t, e);
1697
+ (!(_i.call(h, t) && xt(i, e)) || e === void 0 && !(t in h)) && Ii(h, t, e);
1665
1698
  }
1666
- var _i = 9007199254740991;
1699
+ var Si = 9007199254740991;
1667
1700
  function It(h) {
1668
- return typeof h == "number" && h > -1 && h % 1 == 0 && h <= _i;
1701
+ return typeof h == "number" && h > -1 && h % 1 == 0 && h <= Si;
1669
1702
  }
1670
- function Di(h) {
1703
+ function Ai(h) {
1671
1704
  return h != null && It(h.length) && !Mt(h);
1672
1705
  }
1673
- var Si = Object.prototype;
1706
+ var ki = Object.prototype;
1674
1707
  function Tt(h) {
1675
- var t = h && h.constructor, e = typeof t == "function" && t.prototype || Si;
1708
+ var t = h && h.constructor, e = typeof t == "function" && t.prototype || ki;
1676
1709
  return h === e;
1677
1710
  }
1678
- function Ai(h, t) {
1711
+ function $i(h, t) {
1679
1712
  for (var e = -1, i = Array(h); ++e < h; )
1680
1713
  i[e] = t(e);
1681
1714
  return i;
1682
1715
  }
1683
- var ki = "[object Arguments]";
1716
+ var Ri = "[object Arguments]";
1684
1717
  function Je(h) {
1685
- return Ie(h) && xe(h) == ki;
1718
+ return Ie(h) && xe(h) == Ri;
1686
1719
  }
1687
- var _t = Object.prototype, $i = _t.hasOwnProperty, Ri = _t.propertyIsEnumerable, Oi = Je(/* @__PURE__ */ (function() {
1720
+ var _t = Object.prototype, Oi = _t.hasOwnProperty, Hi = _t.propertyIsEnumerable, Fi = Je(/* @__PURE__ */ (function() {
1688
1721
  return arguments;
1689
1722
  })()) ? Je : function(h) {
1690
- return Ie(h) && $i.call(h, "callee") && !Ri.call(h, "callee");
1723
+ return Ie(h) && Oi.call(h, "callee") && !Hi.call(h, "callee");
1691
1724
  };
1692
- function Hi() {
1725
+ function zi() {
1693
1726
  return !1;
1694
1727
  }
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) {
1728
+ var Dt = typeof exports == "object" && exports && !exports.nodeType && exports, Qe = Dt && typeof module == "object" && module && !module.nodeType && module, Ni = Qe && Qe.exports === Dt, et = Ni ? ie.Buffer : void 0, Gi = et ? et.isBuffer : void 0, St = Gi || zi, Bi = "[object Arguments]", Yi = "[object Array]", ji = "[object Boolean]", Vi = "[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 = {};
1729
+ F[ss] = F[ns] = F[os] = F[rs] = F[as] = F[ls] = F[hs] = F[cs] = F[ds] = !0;
1730
+ F[Bi] = F[Yi] = F[ts] = F[ji] = F[is] = F[Vi] = F[Wi] = F[Ui] = F[Ki] = F[Xi] = F[qi] = F[Zi] = F[Ji] = F[Qi] = F[es] = !1;
1731
+ function us(h) {
1699
1732
  return Ie(h) && It(h.length) && !!F[xe(h)];
1700
1733
  }
1701
- function Ve(h) {
1734
+ function We(h) {
1702
1735
  return function(t) {
1703
1736
  return h(t);
1704
1737
  };
1705
1738
  }
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() {
1739
+ 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
1740
  try {
1708
1741
  var h = Pe && Pe.require && Pe.require("util").types;
1709
1742
  return h || Ge && Ge.binding && Ge.binding("util");
1710
1743
  } catch {
1711
1744
  }
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;
1745
+ })(), tt = ye && ye.isTypedArray, ms = tt ? We(tt) : us, gs = Object.prototype, fs = gs.hasOwnProperty;
1746
+ function ys(h, t) {
1747
+ 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 ? $i(h.length, String) : [], a = r.length;
1715
1748
  for (var l in h)
1716
- ms.call(h, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
1749
+ fs.call(h, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
1717
1750
  (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1718
1751
  n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1719
1752
  s && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
1720
- Ei(l, a))) && r.push(l);
1753
+ xi(l, a))) && r.push(l);
1721
1754
  return r;
1722
1755
  }
1723
1756
  function kt(h, t) {
@@ -1725,44 +1758,44 @@ function kt(h, t) {
1725
1758
  return h(t(e));
1726
1759
  };
1727
1760
  }
1728
- var fs = kt(Object.keys, Object), ys = Object.prototype, ws = ys.hasOwnProperty;
1729
- function vs(h) {
1761
+ var ws = kt(Object.keys, Object), vs = Object.prototype, Cs = vs.hasOwnProperty;
1762
+ function bs(h) {
1730
1763
  if (!Tt(h))
1731
- return fs(h);
1764
+ return ws(h);
1732
1765
  var t = [];
1733
1766
  for (var e in Object(h))
1734
- ws.call(h, e) && e != "constructor" && t.push(e);
1767
+ Cs.call(h, e) && e != "constructor" && t.push(e);
1735
1768
  return t;
1736
1769
  }
1737
- function Cs(h) {
1738
- return Di(h) ? gs(h) : vs(h);
1770
+ function Ps(h) {
1771
+ return Ai(h) ? ys(h) : bs(h);
1739
1772
  }
1740
1773
  var Ee = ue(Object, "create");
1741
- function bs() {
1774
+ function Ls() {
1742
1775
  this.__data__ = Ee ? Ee(null) : {}, this.size = 0;
1743
1776
  }
1744
- function Ps(h) {
1777
+ function Es(h) {
1745
1778
  var t = this.has(h) && delete this.__data__[h];
1746
1779
  return this.size -= t ? 1 : 0, t;
1747
1780
  }
1748
- var Ls = "__lodash_hash_undefined__", Es = Object.prototype, Ms = Es.hasOwnProperty;
1749
- function xs(h) {
1781
+ var Ms = "__lodash_hash_undefined__", xs = Object.prototype, Is = xs.hasOwnProperty;
1782
+ function Ts(h) {
1750
1783
  var t = this.__data__;
1751
1784
  if (Ee) {
1752
1785
  var e = t[h];
1753
- return e === Ls ? void 0 : e;
1786
+ return e === Ms ? void 0 : e;
1754
1787
  }
1755
- return Ms.call(t, h) ? t[h] : void 0;
1788
+ return Is.call(t, h) ? t[h] : void 0;
1756
1789
  }
1757
- var Is = Object.prototype, Ts = Is.hasOwnProperty;
1758
- function _s(h) {
1790
+ var _s = Object.prototype, Ds = _s.hasOwnProperty;
1791
+ function Ss(h) {
1759
1792
  var t = this.__data__;
1760
- return Ee ? t[h] !== void 0 : Ts.call(t, h);
1793
+ return Ee ? t[h] !== void 0 : Ds.call(t, h);
1761
1794
  }
1762
- var Ds = "__lodash_hash_undefined__";
1763
- function Ss(h, t) {
1795
+ var As = "__lodash_hash_undefined__";
1796
+ function ks(h, t) {
1764
1797
  var e = this.__data__;
1765
- return this.size += this.has(h) ? 0 : 1, e[h] = Ee && t === void 0 ? Ds : t, this;
1798
+ return this.size += this.has(h) ? 0 : 1, e[h] = Ee && t === void 0 ? As : t, this;
1766
1799
  }
1767
1800
  function he(h) {
1768
1801
  var t = -1, e = h == null ? 0 : h.length;
@@ -1771,12 +1804,12 @@ function he(h) {
1771
1804
  this.set(i[0], i[1]);
1772
1805
  }
1773
1806
  }
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() {
1807
+ he.prototype.clear = Ls;
1808
+ he.prototype.delete = Es;
1809
+ he.prototype.get = Ts;
1810
+ he.prototype.has = Ss;
1811
+ he.prototype.set = ks;
1812
+ function $s() {
1780
1813
  this.__data__ = [], this.size = 0;
1781
1814
  }
1782
1815
  function Fe(h, t) {
@@ -1785,22 +1818,22 @@ function Fe(h, t) {
1785
1818
  return e;
1786
1819
  return -1;
1787
1820
  }
1788
- var ks = Array.prototype, $s = ks.splice;
1789
- function Rs(h) {
1821
+ var Rs = Array.prototype, Os = Rs.splice;
1822
+ function Hs(h) {
1790
1823
  var t = this.__data__, e = Fe(t, h);
1791
1824
  if (e < 0)
1792
1825
  return !1;
1793
1826
  var i = t.length - 1;
1794
- return e == i ? t.pop() : $s.call(t, e, 1), --this.size, !0;
1827
+ return e == i ? t.pop() : Os.call(t, e, 1), --this.size, !0;
1795
1828
  }
1796
- function Os(h) {
1829
+ function Fs(h) {
1797
1830
  var t = this.__data__, e = Fe(t, h);
1798
1831
  return e < 0 ? void 0 : t[e][1];
1799
1832
  }
1800
- function Hs(h) {
1833
+ function zs(h) {
1801
1834
  return Fe(this.__data__, h) > -1;
1802
1835
  }
1803
- function Fs(h, t) {
1836
+ function Ns(h, t) {
1804
1837
  var e = this.__data__, i = Fe(e, h);
1805
1838
  return i < 0 ? (++this.size, e.push([h, t])) : e[i][1] = t, this;
1806
1839
  }
@@ -1811,38 +1844,38 @@ function ae(h) {
1811
1844
  this.set(i[0], i[1]);
1812
1845
  }
1813
1846
  }
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;
1847
+ ae.prototype.clear = $s;
1848
+ ae.prototype.delete = Hs;
1849
+ ae.prototype.get = Fs;
1850
+ ae.prototype.has = zs;
1851
+ ae.prototype.set = Ns;
1819
1852
  var Me = ue(ie, "Map");
1820
- function zs() {
1853
+ function Gs() {
1821
1854
  this.size = 0, this.__data__ = {
1822
1855
  hash: new he(),
1823
1856
  map: new (Me || ae)(),
1824
1857
  string: new he()
1825
1858
  };
1826
1859
  }
1827
- function Ns(h) {
1860
+ function Bs(h) {
1828
1861
  var t = typeof h;
1829
1862
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? h !== "__proto__" : h === null;
1830
1863
  }
1831
1864
  function ze(h, t) {
1832
1865
  var e = h.__data__;
1833
- return Ns(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
1866
+ return Bs(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
1834
1867
  }
1835
- function Gs(h) {
1868
+ function Ys(h) {
1836
1869
  var t = ze(this, h).delete(h);
1837
1870
  return this.size -= t ? 1 : 0, t;
1838
1871
  }
1839
- function Bs(h) {
1872
+ function js(h) {
1840
1873
  return ze(this, h).get(h);
1841
1874
  }
1842
- function Ys(h) {
1875
+ function Vs(h) {
1843
1876
  return ze(this, h).has(h);
1844
1877
  }
1845
- function js(h, t) {
1878
+ function Ws(h, t) {
1846
1879
  var e = ze(this, h), i = e.size;
1847
1880
  return e.set(h, t), this.size += e.size == i ? 0 : 1, this;
1848
1881
  }
@@ -1853,36 +1886,36 @@ function we(h) {
1853
1886
  this.set(i[0], i[1]);
1854
1887
  }
1855
1888
  }
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) {
1889
+ we.prototype.clear = Gs;
1890
+ we.prototype.delete = Ys;
1891
+ we.prototype.get = js;
1892
+ we.prototype.has = Vs;
1893
+ we.prototype.set = Ws;
1894
+ function Us(h, t) {
1862
1895
  for (var e = -1, i = t.length, n = h.length; ++e < i; )
1863
1896
  h[n + e] = t[e];
1864
1897
  return h;
1865
1898
  }
1866
- var Vs = kt(Object.getPrototypeOf, Object);
1867
- function Us() {
1899
+ var Ks = kt(Object.getPrototypeOf, Object);
1900
+ function Xs() {
1868
1901
  this.__data__ = new ae(), this.size = 0;
1869
1902
  }
1870
- function Ks(h) {
1903
+ function qs(h) {
1871
1904
  var t = this.__data__, e = t.delete(h);
1872
1905
  return this.size = t.size, e;
1873
1906
  }
1874
- function Xs(h) {
1907
+ function Zs(h) {
1875
1908
  return this.__data__.get(h);
1876
1909
  }
1877
- function qs(h) {
1910
+ function Js(h) {
1878
1911
  return this.__data__.has(h);
1879
1912
  }
1880
- var Zs = 200;
1881
- function Js(h, t) {
1913
+ var Qs = 200;
1914
+ function en(h, t) {
1882
1915
  var e = this.__data__;
1883
1916
  if (e instanceof ae) {
1884
1917
  var i = e.__data__;
1885
- if (!Me || i.length < Zs - 1)
1918
+ if (!Me || i.length < Qs - 1)
1886
1919
  return i.push([h, t]), this.size = ++e.size, this;
1887
1920
  e = this.__data__ = new we(i);
1888
1921
  }
@@ -1892,96 +1925,94 @@ function ve(h) {
1892
1925
  var t = this.__data__ = new ae(h);
1893
1926
  this.size = t.size;
1894
1927
  }
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;
1928
+ ve.prototype.clear = Xs;
1929
+ ve.prototype.delete = qs;
1930
+ ve.prototype.get = Zs;
1931
+ ve.prototype.has = Js;
1932
+ ve.prototype.set = en;
1933
+ var $t = typeof exports == "object" && exports && !exports.nodeType && exports, it = $t && typeof module == "object" && module && !module.nodeType && module, tn = it && it.exports === $t, st = tn ? ie.Buffer : void 0;
1901
1934
  st && st.allocUnsafe;
1902
- function en(h, t) {
1935
+ function sn(h, t) {
1903
1936
  return h.slice();
1904
1937
  }
1905
- function tn(h, t) {
1938
+ function nn(h, t) {
1906
1939
  for (var e = -1, i = h == null ? 0 : h.length, n = 0, s = []; ++e < i; ) {
1907
1940
  var o = h[e];
1908
1941
  t(o, e, h) && (s[n++] = o);
1909
1942
  }
1910
1943
  return s;
1911
1944
  }
1912
- function sn() {
1945
+ function on() {
1913
1946
  return [];
1914
1947
  }
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);
1948
+ var rn = Object.prototype, an = rn.propertyIsEnumerable, nt = Object.getOwnPropertySymbols, ln = nt ? function(h) {
1949
+ return h == null ? [] : (h = Object(h), nn(nt(h), function(t) {
1950
+ return an.call(h, t);
1918
1951
  }));
1919
- } : sn;
1920
- function an(h, t, e) {
1952
+ } : on;
1953
+ function hn(h, t, e) {
1921
1954
  var i = t(h);
1922
- return Le(h) ? i : Ws(i, e(h));
1955
+ return Le(h) ? i : Us(i, e(h));
1923
1956
  }
1924
- function ln(h) {
1925
- return an(h, Cs, rn);
1957
+ function cn(h) {
1958
+ return hn(h, Ps, ln);
1926
1959
  }
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) : "";
1960
+ var Ye = ue(ie, "DataView"), je = ue(ie, "Promise"), Ve = 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(je), gn = de(Ve), fn = de(Be), re = xe;
1961
+ (Ye && re(new Ye(new ArrayBuffer(1))) != ht || Me && re(new Me()) != ot || je && re(je.resolve()) != rt || Ve && re(new Ve()) != at || Be && re(new Be()) != lt) && (re = function(h) {
1962
+ var t = xe(h), e = t == dn ? h.constructor : void 0, i = e ? de(e) : "";
1930
1963
  if (i)
1931
1964
  switch (i) {
1932
- case cn:
1965
+ case un:
1933
1966
  return ht;
1934
- case dn:
1967
+ case pn:
1935
1968
  return ot;
1936
- case un:
1969
+ case mn:
1937
1970
  return rt;
1938
- case pn:
1971
+ case gn:
1939
1972
  return at;
1940
- case mn:
1973
+ case fn:
1941
1974
  return lt;
1942
1975
  }
1943
1976
  return t;
1944
1977
  });
1945
- var gn = Object.prototype, fn = gn.hasOwnProperty;
1946
- function yn(h) {
1978
+ var yn = Object.prototype, wn = yn.hasOwnProperty;
1979
+ function vn(h) {
1947
1980
  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;
1981
+ return t && typeof h[0] == "string" && wn.call(h, "index") && (e.index = h.index, e.input = h.input), e;
1949
1982
  }
1950
1983
  var ct = ie.Uint8Array;
1951
1984
  function Ue(h) {
1952
1985
  var t = new h.constructor(h.byteLength);
1953
1986
  return new ct(t).set(new ct(h)), t;
1954
1987
  }
1955
- function wn(h, t) {
1988
+ function Cn(h, t) {
1956
1989
  var e = Ue(h.buffer);
1957
1990
  return new h.constructor(e, h.byteOffset, h.byteLength);
1958
1991
  }
1959
- var vn = /\w*$/;
1960
- function Cn(h) {
1961
- var t = new h.constructor(h.source, vn.exec(h));
1992
+ var bn = /\w*$/;
1993
+ function Pn(h) {
1994
+ var t = new h.constructor(h.source, bn.exec(h));
1962
1995
  return t.lastIndex = h.lastIndex, t;
1963
1996
  }
1964
1997
  var dt = fe ? fe.prototype : void 0, ut = dt ? dt.valueOf : void 0;
1965
- function bn(h) {
1998
+ function Ln(h) {
1966
1999
  return ut ? Object(ut.call(h)) : {};
1967
2000
  }
1968
- function Pn(h, t) {
2001
+ function En(h, t) {
1969
2002
  var e = Ue(h.buffer);
1970
2003
  return new h.constructor(e, h.byteOffset, h.length);
1971
2004
  }
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) {
2005
+ 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]", $n = "[object DataView]", Rn = "[object Float32Array]", On = "[object Float64Array]", Hn = "[object Int8Array]", Fn = "[object Int16Array]", zn = "[object Int32Array]", Nn = "[object Uint8Array]", Gn = "[object Uint8ClampedArray]", Bn = "[object Uint16Array]", Yn = "[object Uint32Array]";
2006
+ function jn(h, t, e) {
1974
2007
  var i = h.constructor;
1975
2008
  switch (t) {
1976
- case Sn:
2009
+ case kn:
1977
2010
  return Ue(h);
1978
- case Ln:
1979
- case En:
2011
+ case Mn:
2012
+ case xn:
1980
2013
  return new i(+h);
1981
- case An:
1982
- return wn(h);
1983
- case kn:
1984
2014
  case $n:
2015
+ return Cn(h);
1985
2016
  case Rn:
1986
2017
  case On:
1987
2018
  case Hn:
@@ -1989,34 +2020,36 @@ function Bn(h, t, e) {
1989
2020
  case zn:
1990
2021
  case Nn:
1991
2022
  case Gn:
1992
- return Pn(h);
1993
- case Mn:
1994
- return new i();
1995
- case xn:
1996
- case _n:
1997
- return new i(h);
2023
+ case Bn:
2024
+ case Yn:
2025
+ return En(h);
1998
2026
  case In:
1999
- return Cn(h);
2000
- case Tn:
2001
2027
  return new i();
2028
+ case Tn:
2029
+ case Sn:
2030
+ return new i(h);
2031
+ case _n:
2032
+ return Pn(h);
2002
2033
  case Dn:
2003
- return bn(h);
2034
+ return new i();
2035
+ case An:
2036
+ return Ln(h);
2004
2037
  }
2005
2038
  }
2006
- function Yn(h) {
2007
- return typeof h.constructor == "function" && !Tt(h) ? Ci(Vs(h)) : {};
2039
+ function Vn(h) {
2040
+ return typeof h.constructor == "function" && !Tt(h) ? Pi(Ks(h)) : {};
2008
2041
  }
2009
- var jn = "[object Map]";
2010
- function Wn(h) {
2011
- return Ie(h) && re(h) == jn;
2042
+ var Wn = "[object Map]";
2043
+ function Un(h) {
2044
+ return Ie(h) && re(h) == Wn;
2012
2045
  }
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;
2046
+ var pt = ye && ye.isMap, Kn = pt ? We(pt) : Un, Xn = "[object Set]";
2047
+ function qn(h) {
2048
+ return Ie(h) && re(h) == Xn;
2016
2049
  }
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;
2050
+ var mt = ye && ye.isSet, Zn = mt ? We(mt) : qn, Rt = "[object Arguments]", Jn = "[object Array]", Qn = "[object Boolean]", eo = "[object Date]", to = "[object Error]", Ot = "[object Function]", io = "[object GeneratorFunction]", so = "[object Map]", no = "[object Number]", Ht = "[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]", H = {};
2051
+ H[Rt] = H[Jn] = H[co] = H[uo] = H[Qn] = H[eo] = H[po] = H[mo] = H[go] = H[fo] = H[yo] = H[so] = H[no] = H[Ht] = H[oo] = H[ro] = H[ao] = H[lo] = H[wo] = H[vo] = H[Co] = H[bo] = !0;
2052
+ H[to] = H[Ot] = H[ho] = !1;
2020
2053
  function De(h, t, e, i, n, s) {
2021
2054
  var o;
2022
2055
  if (o !== void 0)
@@ -2025,39 +2058,39 @@ function De(h, t, e, i, n, s) {
2025
2058
  return h;
2026
2059
  var r = Le(h);
2027
2060
  if (r)
2028
- o = yn(h);
2061
+ o = vn(h);
2029
2062
  else {
2030
- var a = re(h), l = a == Ot || a == eo;
2063
+ var a = re(h), l = a == Ot || a == io;
2031
2064
  if (St(h))
2032
- return en(h);
2065
+ return sn(h);
2033
2066
  if (a == Ht || a == Rt || l && !n)
2034
- o = l ? {} : Yn(h);
2067
+ o = l ? {} : Vn(h);
2035
2068
  else {
2036
2069
  if (!H[a])
2037
2070
  return n ? h : {};
2038
- o = Bn(h, a);
2071
+ o = jn(h, a);
2039
2072
  }
2040
2073
  }
2041
2074
  s || (s = new ve());
2042
2075
  var d = s.get(h);
2043
2076
  if (d)
2044
2077
  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));
2078
+ s.set(h, o), Zn(h) ? h.forEach(function(m) {
2079
+ o.add(De(m, t, e, m, h, s));
2080
+ }) : Kn(h) && h.forEach(function(m, p) {
2081
+ o.set(p, De(m, t, e, p, h, s));
2049
2082
  });
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));
2083
+ var u = cn, g = r ? void 0 : u(h);
2084
+ return Li(g || h, function(m, p) {
2085
+ g && (p = m, m = h[p]), Di(o, p, De(m, t, e, p, h, s));
2053
2086
  }), o;
2054
2087
  }
2055
- var Co = 1, bo = 4;
2088
+ var Po = 1, Lo = 4;
2056
2089
  function _e(h) {
2057
- return De(h, Co | bo);
2090
+ return De(h, Po | Lo);
2058
2091
  }
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 {
2092
+ 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 || {});
2093
+ class So {
2061
2094
  constructor(t) {
2062
2095
  c(this, "primitives", /* @__PURE__ */ new Map());
2063
2096
  c(this, "eventListener", /* @__PURE__ */ new Map());
@@ -2159,8 +2192,8 @@ class _o {
2159
2192
  * @return {*}
2160
2193
  */
2161
2194
  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);
2195
+ var m, p, f, y, v;
2196
+ const i = this.viewer, n = this.Cesium, s = n.Math.toRadians(((m = t.headingPitchRoll) == null ? void 0 : m.heading) || 0), o = n.Math.toRadians(((p = t.headingPitchRoll) == null ? void 0 : p.pitch) || 0), r = n.Math.toRadians(((f = t.headingPitchRoll) == null ? void 0 : f.roll) || 0), a = new n.HeadingPitchRoll(s, o, r);
2164
2197
  let l = t.position;
2165
2198
  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
2199
  throw new Error("GLTFManage.add 缺少有效 position");
@@ -2169,15 +2202,15 @@ class _o {
2169
2202
  ...t.model,
2170
2203
  modelMatrix: d
2171
2204
  };
2172
- let p;
2205
+ let g;
2173
2206
  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));
2207
+ g = i.scene.primitives.add(n.Model.fromGltf(u));
2175
2208
  else if (typeof ((v = n == null ? void 0 : n.Model) == null ? void 0 : v.fromGltfAsync) == "function") {
2176
2209
  const w = await n.Model.fromGltfAsync(u);
2177
- p = i.scene.primitives.add(w);
2210
+ g = i.scene.primitives.add(w);
2178
2211
  } else
2179
2212
  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 });
2213
+ 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
2214
  }
2182
2215
  flyTo(t) {
2183
2216
  const e = this.viewer;
@@ -2403,7 +2436,7 @@ class _o {
2403
2436
  n.Matrix4.fromScale(l),
2404
2437
  new n.Matrix4()
2405
2438
  );
2406
- const u = this.getPrimitiveScale(t), p = this.getPrimitiveRuntimeRadius(t), g = this.getPrimitiveEffectiveRadius(t);
2439
+ const u = this.getPrimitiveScale(t), g = this.getPrimitiveRuntimeRadius(t), m = this.getPrimitiveEffectiveRadius(t);
2407
2440
  return this.debugLog("applyScaleToPrimitive", {
2408
2441
  id: t == null ? void 0 : t.id,
2409
2442
  inputScale: e,
@@ -2411,9 +2444,9 @@ class _o {
2411
2444
  beforeScale: s,
2412
2445
  afterScale: u,
2413
2446
  beforeRadius: o,
2414
- afterRadius: p,
2447
+ afterRadius: g,
2415
2448
  beforeEffectiveRadius: r,
2416
- afterEffectiveRadius: g
2449
+ afterEffectiveRadius: m
2417
2450
  }), t.modelMatrix;
2418
2451
  }
2419
2452
  getGizmoModelMatrix(t) {
@@ -2497,9 +2530,9 @@ class _o {
2497
2530
  */
2498
2531
  initEditBox(t) {
2499
2532
  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;
2533
+ let s = null, o = null, r = null, a = null, l = "", d = "", u = null, g = null, m = null, p = null;
2501
2534
  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();
2535
+ s = null, o = null, r = null, a = null, l = "", d = "", u = null, g = null, m = null, p = null, this.hideFeedback(), this.unlockCamera();
2503
2536
  }, y = (P) => {
2504
2537
  const b = (C) => (P.split(C)[1] || "").split("_");
2505
2538
  if (P.includes("moveAxis_")) {
@@ -2547,19 +2580,19 @@ class _o {
2547
2580
  o,
2548
2581
  new e.Cartesian3()
2549
2582
  );
2550
- g = e.Cartesian3.clone(L), r = e.Cartesian2.clone(
2583
+ m = e.Cartesian3.clone(L), r = e.Cartesian2.clone(
2551
2584
  b.position || b.endPosition,
2552
2585
  new e.Cartesian2()
2553
2586
  );
2554
- const M = e.Transforms.eastNorthUpToFixedFrame(g);
2587
+ const M = e.Transforms.eastNorthUpToFixedFrame(m);
2555
2588
  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);
2589
+ 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(m, x);
2557
2590
  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,
2591
+ g = I && u ? e.IntersectionTests.rayPlane(I, u) : null, g && (p = e.Cartesian3.subtract(
2560
2592
  g,
2593
+ m,
2561
2594
  new e.Cartesian3()
2562
- ), e.Cartesian3.magnitudeSquared(m) > 0 && e.Cartesian3.normalize(m, m)), this.lockCamera();
2595
+ ), e.Cartesian3.magnitudeSquared(p) > 0 && e.Cartesian3.normalize(p, p)), this.lockCamera();
2563
2596
  }
2564
2597
  };
2565
2598
  this.handler.setInputAction((P) => {
@@ -2585,16 +2618,16 @@ class _o {
2585
2618
  startMousePosition: P.position
2586
2619
  }));
2587
2620
  }, 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)) {
2621
+ if (t() && (l === "" ? v(P.endPosition) ? this.showHoverModeHint("向上拖放大,向下拖缩小") : this.scaleCenterHintVisible && this.hideModeHint() : this.scaleCenterHintVisible && this.hideModeHint(), l != "" && s && u && m && g)) {
2589
2622
  const C = i.camera.getPickRay(P.endPosition), E = C ? e.IntersectionTests.rayPlane(C, u) : null;
2590
2623
  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(
2624
+ l === "rotate" ? this.rotateModel(s, o, d, m, p, E) : l === "move" ? this.moveModel(s, o, d, m, g, E) : l === "scale" && this.moveModelScale(
2592
2625
  s,
2593
2626
  o,
2594
2627
  d,
2595
- g,
2628
+ m,
2596
2629
  r,
2597
- p,
2630
+ g,
2598
2631
  a,
2599
2632
  P.endPosition,
2600
2633
  E
@@ -2786,15 +2819,15 @@ class _o {
2786
2819
  }
2787
2820
  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
2821
  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));
2792
- const m = (s.minY + s.maxY) / 2, f = n.Math.clamp(
2793
- m - u / 2,
2822
+ const d = Number(this.modeToolbarEl.offsetWidth || 58), u = Number(this.modeToolbarEl.offsetHeight || 176), g = 18;
2823
+ let m = s.maxX + g;
2824
+ m + d > a - 12 && (m = s.minX - d - g), m = n.Math.clamp(m, 12, Math.max(12, a - d - 12));
2825
+ const p = (s.minY + s.maxY) / 2, f = n.Math.clamp(
2826
+ p - u / 2,
2794
2827
  12,
2795
2828
  Math.max(12, l - u - 12)
2796
2829
  );
2797
- this.modeToolbarEl.style.left = `${g}px`, this.modeToolbarEl.style.top = `${f + u / 2}px`;
2830
+ this.modeToolbarEl.style.left = `${m}px`, this.modeToolbarEl.style.top = `${f + u / 2}px`;
2798
2831
  }
2799
2832
  if (this.feedbackLabelEl && this.feedbackLabelEl.style.display !== "none") {
2800
2833
  const d = this.feedbackAnchor || o, u = this.toWindowCoordinates(d);
@@ -2843,7 +2876,7 @@ class _o {
2843
2876
  });
2844
2877
  }
2845
2878
  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);
2879
+ 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), m = Math.max(e * 1.06, 18), p = Math.max(e * 0.075, 2.4);
2847
2880
  return {
2848
2881
  centerRadius: i,
2849
2882
  axisLength: n,
@@ -2854,17 +2887,17 @@ class _o {
2854
2887
  planeEnd: l,
2855
2888
  planeThickness: d,
2856
2889
  rotationRadius: u,
2857
- rotationThickness: p,
2858
- scaleOffset: g,
2859
- scaleHandleRadius: m
2890
+ rotationThickness: g,
2891
+ scaleOffset: m,
2892
+ scaleHandleRadius: p
2860
2893
  };
2861
2894
  }
2862
2895
  createSegmentInstance(t, e, i, n, s) {
2863
2896
  const o = this.Cesium, r = o.Cartesian3.subtract(i, e, new o.Cartesian3()), a = o.Cartesian3.magnitude(r);
2864
2897
  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);
2898
+ 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()), m = o.Cartesian3.magnitude(g), p = o.Math.clamp(o.Cartesian3.dot(u, l), -1, 1);
2866
2899
  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({
2900
+ return m > 1e-6 ? (o.Cartesian3.normalize(g, g), f = o.Quaternion.fromAxisAngle(g, Math.acos(p))) : p < 0 && (f = o.Quaternion.fromAxisAngle(o.Cartesian3.UNIT_Z, Math.PI)), new o.GeometryInstance({
2868
2901
  id: t,
2869
2902
  geometry: this.createUnitBoxGeometry(),
2870
2903
  modelMatrix: o.Matrix4.fromTranslationQuaternionRotationScale(
@@ -3070,32 +3103,32 @@ class _o {
3070
3103
  color: e.Color.YELLOW.withAlpha(0.92)
3071
3104
  }
3072
3105
  ].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(
3106
+ const g = [];
3107
+ for (let m = 0; m < 90; m += s) {
3108
+ const p = e.Math.toRadians(m), f = e.Math.toRadians(m + s), y = this.getRotationPlanePoint(
3076
3109
  u.plane,
3077
3110
  n.rotationRadius,
3078
- m
3111
+ p
3079
3112
  ), v = this.getRotationPlanePoint(u.plane, n.rotationRadius, f), w = this.createSegmentInstance(
3080
- `rotationArc_${t.id}_${u.axis}_${g}`,
3113
+ `rotationArc_${t.id}_${u.axis}_${m}`,
3081
3114
  y,
3082
3115
  v,
3083
3116
  n.rotationThickness,
3084
3117
  u.color
3085
3118
  );
3086
- w && p.push(w);
3119
+ w && g.push(w);
3087
3120
  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}`,
3121
+ const b = r + l * (P + 0.5), C = this.getRotationPlanePoint(u.plane, b, p), E = this.getRotationPlanePoint(u.plane, b, f), L = this.createSegmentInstance(
3122
+ `rotationSector_${t.id}_${u.axis}_${P}_${m}`,
3090
3123
  C,
3091
3124
  E,
3092
3125
  Math.max(l * 0.92, n.rotationThickness * 1.4),
3093
3126
  u.color.withAlpha(0.04)
3094
3127
  );
3095
- L && p.push(L);
3128
+ L && g.push(L);
3096
3129
  }
3097
3130
  }
3098
- return p;
3131
+ return g;
3099
3132
  });
3100
3133
  this.rotationRing = new e.Primitive({
3101
3134
  geometryInstances: d,
@@ -3181,15 +3214,15 @@ class _o {
3181
3214
  topRadius: o,
3182
3215
  bottomRadius: o
3183
3216
  })
3184
- ), p = e.CylinderGeometry.createGeometry(
3217
+ ), g = e.CylinderGeometry.createGeometry(
3185
3218
  new e.CylinderGeometry({
3186
3219
  length: l,
3187
3220
  topRadius: 0,
3188
3221
  bottomRadius: r
3189
3222
  })
3190
3223
  );
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({
3224
+ let m = a + d, p = (a + d) / 2;
3225
+ this.translate(u, [0, 0, p]), this.translate(g, [0, 0, m]), this.heightArrow = new e.Primitive({
3193
3226
  modelMatrix: t.modelMatrix,
3194
3227
  geometryInstances: [
3195
3228
  new e.GeometryInstance({
@@ -3201,7 +3234,7 @@ class _o {
3201
3234
  }),
3202
3235
  new e.GeometryInstance({
3203
3236
  id: `heightArrow-arrow_${t.id}`,
3204
- geometry: p,
3237
+ geometry: g,
3205
3238
  attributes: {
3206
3239
  color: e.ColorGeometryInstanceAttribute.fromColor(s.withAlpha(0.9))
3207
3240
  }
@@ -3337,10 +3370,10 @@ class _o {
3337
3370
  new r.Matrix4()
3338
3371
  );
3339
3372
  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", {
3373
+ const g = r.Matrix4.getTranslation(u, new r.Cartesian3()), m = r.Cartesian3.magnitude(d), p = ["XY", "YZ", "ZX"].includes(i) ? i : `${i}轴`;
3374
+ this.showFeedback(`${p} ${m.toFixed(2)} m`, g), this.writeDragEndPayload(t.id, "translation", {
3342
3375
  id: t.id,
3343
- position: p
3376
+ position: g
3344
3377
  });
3345
3378
  }
3346
3379
  /**
@@ -3361,19 +3394,19 @@ class _o {
3361
3394
  o.longitude,
3362
3395
  o.latitude,
3363
3396
  (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(
3397
+ ), u = r.Cartographic.toCartesian(d), g = r.Matrix4.getRotation(e, new r.Matrix3()), m = r.Matrix4.fromRotationTranslation(g, u);
3398
+ t.modelMatrix = m, this.updatedTool(m), this.showFeedback(
3366
3399
  `${(((l == null ? void 0 : l.height) || 0) - (o.height || 0)).toFixed(2)} m`,
3367
3400
  u
3368
3401
  );
3369
- let m = new r.Cartesian3(
3370
- g[12],
3371
- g[13],
3372
- g[14]
3402
+ let p = new r.Cartesian3(
3403
+ m[12],
3404
+ m[13],
3405
+ m[14]
3373
3406
  ), f = this.dragEndCallbackMap.get(t.id);
3374
3407
  f || (f = /* @__PURE__ */ new Map(), this.dragEndCallbackMap.set(t.id, f)), f.set("translation", {
3375
3408
  id: t.id,
3376
- position: m
3409
+ position: p
3377
3410
  });
3378
3411
  }
3379
3412
  }
@@ -3382,9 +3415,9 @@ class _o {
3382
3415
  if (!t || !e || !i) return null;
3383
3416
  const o = s.camera.getPickRay(t);
3384
3417
  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;
3418
+ 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), m = -n.Cartesian3.dot(a, d), p = n.Cartesian3.dot(d, d), f = -n.Cartesian3.dot(a, u), y = n.Cartesian3.dot(d, u), v = g * p - m * m;
3386
3419
  if (Math.abs(v) < 1e-6) return null;
3387
- const w = (p * y - g * f) / v;
3420
+ const w = (g * y - m * f) / v;
3388
3421
  return n.Cartesian3.add(
3389
3422
  l,
3390
3423
  n.Cartesian3.multiplyByScalar(d, w, new n.Cartesian3()),
@@ -3408,13 +3441,13 @@ class _o {
3408
3441
  );
3409
3442
  if (r.Cartesian3.magnitudeSquared(a) <= 1e-6) return;
3410
3443
  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(
3444
+ 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);
3445
+ if (!Number.isFinite(g) || g <= 1e-6) return;
3446
+ const m = r.Cartesian3.cross(
3414
3447
  s,
3415
3448
  a,
3416
3449
  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(
3450
+ ), p = r.Cartesian3.dot(m, d) >= 0 ? 1 : -1, f = g * p, y = r.Quaternion.fromAxisAngle(d, f), v = r.Matrix4.fromRotationTranslation(
3418
3451
  r.Matrix3.fromQuaternion(y)
3419
3452
  ), w = this.applyTransformAroundCenter(
3420
3453
  e,
@@ -3439,22 +3472,22 @@ class _o {
3439
3472
  moveModelScale(t, e, i, n, s, o, r, a, l) {
3440
3473
  const d = this.Cesium;
3441
3474
  if (!r) return;
3442
- const u = this.getGizmoMetrics(t), p = d.Transforms.eastNorthUpToFixedFrame(n), g = Math.max(u.scaleOffset * 0.7, 8);
3443
- let m = 0;
3475
+ const u = this.getGizmoMetrics(t), g = d.Transforms.eastNorthUpToFixedFrame(n), m = Math.max(u.scaleOffset * 0.7, 8);
3476
+ let p = 0;
3444
3477
  if (i === "CENTER") {
3445
3478
  if (!s || !a) return;
3446
3479
  const b = Number(s.y || 0) - Number(a.y || 0);
3447
- m = Math.pow(2, b / 180) - 1;
3480
+ p = Math.pow(2, b / 180) - 1;
3448
3481
  } else {
3449
3482
  if (!o || !l) return;
3450
3483
  const b = d.Cartesian3.subtract(
3451
3484
  l,
3452
3485
  o,
3453
3486
  new d.Cartesian3()
3454
- ), C = this.getAxisVector(p, i);
3455
- m = d.Cartesian3.dot(b, C) / g;
3487
+ ), C = this.getAxisVector(g, i);
3488
+ p = d.Cartesian3.dot(b, C) / m;
3456
3489
  }
3457
- const f = Math.max(0.05, 1 + m), y = {
3490
+ const f = Math.max(0.05, 1 + p), y = {
3458
3491
  x: r.x,
3459
3492
  y: r.y,
3460
3493
  z: r.z
@@ -3480,7 +3513,7 @@ class _o {
3480
3513
  z: Number((r == null ? void 0 : r.z) || 1)
3481
3514
  },
3482
3515
  nextScale: y,
3483
- deltaFactor: m,
3516
+ deltaFactor: p,
3484
3517
  factor: f,
3485
3518
  runtimeRadius: this.getPrimitiveRuntimeRadius(t)
3486
3519
  }), this.showFeedback(P, w), this.writeDragEndPayload(t.id, "addScale", {
@@ -3493,7 +3526,7 @@ class _o {
3493
3526
  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
3527
  }
3495
3528
  }
3496
- function Do(h, t) {
3529
+ function Ao(h, t) {
3497
3530
  const e = t.materialType || "DynamicImgMaterial" + Date.now() + Math.floor(Math.random() * 1e3);
3498
3531
  function i(s) {
3499
3532
  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 +3589,7 @@ function Do(h, t) {
3556
3589
  }
3557
3590
  }), new i(t);
3558
3591
  }
3559
- function So(h, t) {
3592
+ function ko(h, t) {
3560
3593
  const e = t.MaterialType || "wallType" + (/* @__PURE__ */ new Date()).getTime() + parseInt(Math.random() * 1e3 + "");
3561
3594
  function i(s) {
3562
3595
  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 +3652,8 @@ function So(h, t) {
3619
3652
  }
3620
3653
  }), new i(t);
3621
3654
  }
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 = {};
3655
+ function $o(h, t) {
3656
+ 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
3657
  let l = t.materialType || "PolylineFlow" + Date.now() + Math.floor(Math.random() * 1e3);
3625
3658
  function d(u) {
3626
3659
  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 +3671,13 @@ function Ao(h, t) {
3638
3671
  }
3639
3672
  }), d.prototype.getType = function(u) {
3640
3673
  return l;
3641
- }, d.prototype.getValue = function(u, p) {
3642
- return p || (p = {}), p.color = o.getValueOrClonedDefault(
3674
+ }, d.prototype.getValue = function(u, g) {
3675
+ return g || (g = {}), g.color = o.getValueOrClonedDefault(
3643
3676
  this._color,
3644
3677
  u,
3645
3678
  h.Color.WHITE,
3646
- p.color
3647
- ), p.duration = this._duration, p;
3679
+ g.color
3680
+ ), g.duration = this._duration, g;
3648
3681
  }, d.prototype.equals = function(u) {
3649
3682
  return this === u || u instanceof d && o.equals(this._color, u._color);
3650
3683
  }, i(d.prototype, {
@@ -3682,7 +3715,7 @@ function Ao(h, t) {
3682
3715
  }
3683
3716
  }), new d(t);
3684
3717
  }
3685
- class ko {
3718
+ class Ro {
3686
3719
  constructor() {
3687
3720
  c(this, "categoryMap", /* @__PURE__ */ new Map());
3688
3721
  c(this, "CategoryGet", {});
@@ -3779,7 +3812,7 @@ class ko {
3779
3812
  return [...this.categoryMap.keys()];
3780
3813
  }
3781
3814
  }
3782
- class Eo {
3815
+ class xo {
3783
3816
  constructor(t) {
3784
3817
  c(this, "id");
3785
3818
  c(this, "entities", []);
@@ -3835,7 +3868,7 @@ class Eo {
3835
3868
  };
3836
3869
  }
3837
3870
  }
3838
- class Mo {
3871
+ class Io {
3839
3872
  constructor(t, e, i, n, s, o) {
3840
3873
  c(this, "id");
3841
3874
  c(this, "groupMap", /* @__PURE__ */ new Map());
@@ -3891,7 +3924,7 @@ class Mo {
3891
3924
  }), n = (w, P = 0) => {
3892
3925
  const b = Number(w);
3893
3926
  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(
3927
+ }, 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), g = (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
3928
  (w) => this.Cesium.Cartesian3.fromDegrees(w[0], w[1], w[2] || 0)
3896
3929
  );
3897
3930
  let v = {
@@ -3901,7 +3934,7 @@ class Mo {
3901
3934
  wall: {
3902
3935
  ...v,
3903
3936
  positions: y,
3904
- minimumHeights: p,
3937
+ minimumHeights: g,
3905
3938
  maximumHeights: f
3906
3939
  },
3907
3940
  show: (t.show ?? !0) && e
@@ -3981,7 +4014,7 @@ class Mo {
3981
4014
  });
3982
4015
  const r = this.createBillboardPoints(n);
3983
4016
  r.length && e && this.aggregator.appendPoints(r, !1), this.createCard(n);
3984
- const a = new Eo({
4017
+ const a = new xo({
3985
4018
  id: i,
3986
4019
  entities: s,
3987
4020
  primitives: [],
@@ -4038,7 +4071,7 @@ class Mo {
4038
4071
  this.groupMap.forEach((t) => t.removeAll(this.viewer)), this.groupMap.clear();
4039
4072
  }
4040
4073
  }
4041
- class $o {
4074
+ class Oo {
4042
4075
  constructor(t, e, i, n, s) {
4043
4076
  c(this, "Cesium");
4044
4077
  c(this, "viewer");
@@ -4051,7 +4084,7 @@ class $o {
4051
4084
  addLayer(t) {
4052
4085
  this.layerMap.has(t) || this.layerMap.set(
4053
4086
  t,
4054
- new Mo(
4087
+ new Io(
4055
4088
  t,
4056
4089
  this.Cesium,
4057
4090
  this.viewer,
@@ -4089,7 +4122,7 @@ class $o {
4089
4122
  (i = this.layerMap.get(t)) == null || i.removeGroups(e);
4090
4123
  }
4091
4124
  }
4092
- function Ro(h) {
4125
+ function Ho(h) {
4093
4126
  const t = [];
4094
4127
  return h.features.forEach((e, i) => {
4095
4128
  if (e.geometry && e.properties) {
@@ -4166,7 +4199,7 @@ function Ro(h) {
4166
4199
  }
4167
4200
  }), t;
4168
4201
  }
4169
- class Oo {
4202
+ class Fo {
4170
4203
  constructor(t) {
4171
4204
  c(this, "Cesium");
4172
4205
  c(this, "viewer");
@@ -4202,7 +4235,7 @@ class Oo {
4202
4235
  }
4203
4236
  //注册主题
4204
4237
  initTheme(t) {
4205
- var n, s, o, r, a, l, d, u, p, g, m, f;
4238
+ var n, s, o, r, a, l, d, u, g, m, p, f;
4206
4239
  let e = this.materialManager, i = this.Cesium;
4207
4240
  if (t.category == "polyline") {
4208
4241
  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);
@@ -4210,7 +4243,7 @@ class Oo {
4210
4243
  if (y) {
4211
4244
  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
4245
  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({
4246
+ v = `DashedLineMaterial_pattern_${b.dashPattern}_dashLength_${b.dashLength}_color_${(g = t.properties) == null ? void 0 : g.color}`, e.has(v) || e.register({
4214
4247
  themeKey: v,
4215
4248
  material: i.Material.fromType("PolylineDash", {
4216
4249
  color: i.Color.fromCssColorString(t.properties.color || "#FFFFFF").withAlpha(
@@ -4223,7 +4256,7 @@ class Oo {
4223
4256
  })
4224
4257
  });
4225
4258
  } else
4226
- v = `LineMaterial_color_${(g = t.properties) == null ? void 0 : g.color}`, e.has(v) || e.register({
4259
+ v = `LineMaterial_color_${(m = t.properties) == null ? void 0 : m.color}`, e.has(v) || e.register({
4227
4260
  themeKey: v,
4228
4261
  material: i.Material.fromType("Color", {
4229
4262
  color: i.Color.fromCssColorString(t.properties.color || "#FFFFFF").withAlpha(
@@ -4232,7 +4265,7 @@ class Oo {
4232
4265
  })
4233
4266
  });
4234
4267
  } else if (t.category == "polygon") {
4235
- let y = `polygonMaterial_color_${(m = t.properties) == null ? void 0 : m.color}`;
4268
+ let y = `polygonMaterial_color_${(p = t.properties) == null ? void 0 : p.color}`;
4236
4269
  e.has(y) || e.register({
4237
4270
  themeKey: y,
4238
4271
  material: i.Material.fromType("Color", {
@@ -4488,15 +4521,15 @@ class Oo {
4488
4521
  }
4489
4522
  const r = o.geometry, a = r._positions || r._polygonHierarchy.positions;
4490
4523
  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;
4524
+ let l = a[0].x, d = a[0].y, u = a[0].z, g = a[0].x, m = a[0].y, p = a[0].z;
4492
4525
  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);
4526
+ l = Math.min(l, P.x), d = Math.min(d, P.y), u = Math.min(u, P.z), g = Math.max(g, P.x), m = Math.max(m, P.y), p = Math.max(p, P.z);
4494
4527
  });
4495
4528
  const f = new this.Cesium.Cartesian3(
4496
- (l + p) / 2,
4497
- (d + g) / 2,
4498
- (u + m) / 2
4499
- ), v = new this.Cesium.Cartesian3(p - l, g - d, m - u).z, w = Math.abs(v || 1) * 1.5;
4529
+ (l + g) / 2,
4530
+ (d + m) / 2,
4531
+ (u + p) / 2
4532
+ ), v = new this.Cesium.Cartesian3(g - l, m - d, p - u).z, w = Math.abs(v || 1) * 1.5;
4500
4533
  this.viewer.camera.flyTo({
4501
4534
  destination: f,
4502
4535
  duration: 2,
@@ -4559,7 +4592,7 @@ const $e = class $e {
4559
4592
  });
4560
4593
  }
4561
4594
  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;
4595
+ var p, f, y, v;
4563
4596
  const s = i.scene.pickPosition(n.position);
4564
4597
  if (!s) return;
4565
4598
  const o = e.Cartographic.fromCartesian(s), r = e.Math.toDegrees(o.longitude), a = e.Math.toDegrees(o.latitude);
@@ -4575,18 +4608,18 @@ const $e = class $e {
4575
4608
  }
4576
4609
  });
4577
4610
  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({
4611
+ const u = s, g = ((f = (p = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(p, 0.9)) || e.Color.RED, m = i.entities.add({
4579
4612
  polyline: {
4580
4613
  positions: [u, l],
4581
4614
  width: t.width || 3,
4582
4615
  material: new e.PolylineDashMaterialProperty({
4583
- color: p,
4616
+ color: g,
4584
4617
  dashLength: 12,
4585
4618
  dashPattern: 255
4586
4619
  })
4587
4620
  }
4588
4621
  });
4589
- if (this.groundLineEntities.push(g), this.positions.length >= 2) {
4622
+ if (this.groundLineEntities.push(m), this.positions.length >= 2) {
4590
4623
  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({
4591
4624
  polyline: {
4592
4625
  positions: [w, P],
@@ -4645,13 +4678,13 @@ const $e = class $e {
4645
4678
  this.hoverPos = s;
4646
4679
  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
4680
  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(
4681
+ const d = this.positions[this.positions.length - 1], u = i.Cartographic.fromCartesian(d), g = i.Cartographic.fromCartesian(l), p = new i.EllipsoidGeodesic(u, g).surfaceDistance, f = new i.Cartesian3(
4649
4682
  (d.x + l.x) / 2,
4650
4683
  (d.y + l.y) / 2,
4651
4684
  (d.z + l.z) / 2
4652
4685
  ), y = i.Cartographic.fromCartesian(f), v = this.previewLabelId || "measure_horizontal_preview";
4653
4686
  this.previewLabelId = v, this.htmlLabelPool.add(
4654
- { text: `${m.toFixed(2)} m` },
4687
+ { text: `${p.toFixed(2)} m` },
4655
4688
  {
4656
4689
  id: v,
4657
4690
  lon: i.Math.toDegrees(y.longitude),
@@ -4717,8 +4750,8 @@ const $e = class $e {
4717
4750
  this.stop(), this._clearPreviewState();
4718
4751
  let i = 0;
4719
4752
  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);
4721
- i += m.surfaceDistance;
4753
+ const d = this.positions[l - 1], u = this.positions[l], g = e.Cartographic.fromCartesian(d), m = e.Cartographic.fromCartesian(u), p = new e.EllipsoidGeodesic(g, m);
4754
+ i += p.surfaceDistance;
4722
4755
  }
4723
4756
  const n = this.positions[this.positions.length - 1], s = e.Cartographic.fromCartesian(n), o = this.totalLabelId || `measure_horizontal_total_${Date.now()}`;
4724
4757
  this.totalLabelId = o, this.htmlLabelPool.add(
@@ -4756,8 +4789,8 @@ const $e = class $e {
4756
4789
  this.stop(), this.segmentEntities.forEach((t) => this.viewer.entities.remove(t)), this.segmentEntities = [], this.groundLineEntities.forEach((t) => this.viewer.entities.remove(t)), this.groundLineEntities = [], this.tempPoints.forEach((t) => this.viewer.entities.remove(t)), this.tempPoints = [], this.totalLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.totalLabelId]), this.totalLabelId = null), this.previewEntity && (this.viewer.entities.remove(this.previewEntity), this.previewEntity = null), this.previewGroundEntity && (this.viewer.entities.remove(this.previewGroundEntity), this.previewGroundEntity = 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.hoverPos = null, this.labelEntity = null, this.firstHeight = null, this.previewPos = null, this.previewGroundPos = null;
4757
4790
  }
4758
4791
  rehydrate(t, e) {
4759
- var m, f;
4760
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((f = (m = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((y) => new i.Cartesian3(y[0], y[1], y[2]));
4792
+ var p, f;
4793
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((f = (p = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : f.call(p, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((y) => new i.Cartesian3(y[0], y[1], y[2]));
4761
4794
  if (!l.length) return;
4762
4795
  if (!this.htmlLabelPool) {
4763
4796
  const y = s.overlayContainerId || "html-label-container";
@@ -4813,12 +4846,12 @@ const $e = class $e {
4813
4846
  const v = i.Cartographic.fromCartesian(l[y - 1]), w = i.Cartographic.fromCartesian(l[y]), P = new i.EllipsoidGeodesic(v, w);
4814
4847
  d += P.surfaceDistance;
4815
4848
  }
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,
4849
+ const u = l[l.length - 1], g = i.Cartographic.fromCartesian(u), m = t.id + "_total";
4850
+ this.totalLabelId = m, this.htmlLabelPool.add({ text: `${d.toFixed(2)} m` }, {
4851
+ id: m,
4852
+ lon: i.Math.toDegrees(g.longitude),
4853
+ lat: i.Math.toDegrees(g.latitude),
4854
+ height: g.height || 0,
4822
4855
  theme: "measure-horizontal-total",
4823
4856
  show: !0,
4824
4857
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
@@ -4864,23 +4897,23 @@ class gt {
4864
4897
  let o = s ? i.scene.globe.pick(s, i.scene) : null;
4865
4898
  if (o || (o = i.camera.pickEllipsoid(n.position, e.Ellipsoid.WGS84)), o || (o = i.scene.pickPosition(n.position)), !!o)
4866
4899
  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);
4871
- const m = i.entities.add({
4872
- position: g,
4900
+ const g = e.Cartographic.fromCartesian(o);
4901
+ this.baseCarto = new e.Cartographic(g.longitude, g.latitude, 0);
4902
+ const m = e.Ellipsoid.WGS84.cartographicToCartesian(this.baseCarto);
4903
+ this.baseUp = e.Ellipsoid.WGS84.geodeticSurfaceNormalCartographic(this.baseCarto), this.positions.push(m);
4904
+ const p = i.entities.add({
4905
+ position: m,
4873
4906
  point: {
4874
4907
  pixelSize: 8,
4875
4908
  color: t.pointColor || t.color || e.Color.YELLOW,
4876
4909
  disableDepthTestDistance: Number.POSITIVE_INFINITY
4877
4910
  }
4878
4911
  });
4879
- this.tempPoints.push(m);
4912
+ this.tempPoints.push(p);
4880
4913
  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
4914
  this.previewEntity = i.entities.add({
4882
4915
  polyline: {
4883
- positions: [g, g],
4916
+ positions: [m, m],
4884
4917
  width: t.width || 3,
4885
4918
  material: f,
4886
4919
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -4892,9 +4925,9 @@ class gt {
4892
4925
  });
4893
4926
  } else {
4894
4927
  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;
4928
+ const g = this.positions[0], m = i.camera.getPickRay(n.position);
4929
+ if (!m) return;
4930
+ const p = m.origin, f = e.Cartesian3.normalize(m.direction, new e.Cartesian3()), y = g, v = this.baseUp, w = e.Cartesian3.subtract(p, 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;
4898
4931
  if (Math.abs(M) < 1e-6) return;
4899
4932
  const x = (P * L - b * E) / M, I = e.Cartesian3.add(
4900
4933
  y,
@@ -4905,7 +4938,7 @@ class gt {
4905
4938
  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
4939
  this.entity = i.entities.add({
4907
4940
  polyline: {
4908
- positions: [p, I],
4941
+ positions: [g, I],
4909
4942
  width: t.width || 3,
4910
4943
  material: D,
4911
4944
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -4961,9 +4994,9 @@ class gt {
4961
4994
  }
4962
4995
  const s = this.positions[0], o = i.camera.getPickRay(n.endPosition);
4963
4996
  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;
4997
+ 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), m = -e.Cartesian3.dot(a, d), p = e.Cartesian3.dot(d, d), f = -e.Cartesian3.dot(a, u), y = e.Cartesian3.dot(d, u), v = g * p - m * m;
4965
4998
  if (Math.abs(v) < 1e-6) return;
4966
- const w = (p * y - g * f) / v, P = e.Cartesian3.add(
4999
+ const w = (g * y - m * f) / v, P = e.Cartesian3.add(
4967
5000
  l,
4968
5001
  e.Cartesian3.multiplyByScalar(d, w, new e.Cartesian3()),
4969
5002
  new e.Cartesian3()
@@ -5030,9 +5063,9 @@ class gt {
5030
5063
  options: { offset: { x: 0, y: -10 } }
5031
5064
  });
5032
5065
  }
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";
5066
+ 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 } }), m = n.entities.add({ position: u, point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5067
+ this.tempPoints.push(g), this.tempPoints.push(m), this.entity = n.entities.add({ polyline: { positions: [d, u], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) } });
5068
+ const p = i.Cartographic.fromCartesian(d), f = i.Cartographic.fromCartesian(u), y = Math.abs((f.height || 0) - (p.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";
5036
5069
  this.htmlLabelId = P, this.htmlLabelPool.add({ text: `${y.toFixed(2)} m` }, {
5037
5070
  id: P,
5038
5071
  lon: i.Math.toDegrees(w.longitude),
@@ -5109,15 +5142,15 @@ class ft {
5109
5142
  });
5110
5143
  if (this.pointEntities.push(o), this.positions.length === 2) {
5111
5144
  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);
5145
+ const d = e.Cartographic.fromCartesian(this.positions[0]), u = e.Cartographic.fromCartesian(this.positions[1]), g = d.height || 0, m = u.height || 0, p = g <= m ? this.positions[0] : this.positions[1], f = g > m ? this.positions[0] : this.positions[1], y = e.Cartographic.fromCartesian(p);
5113
5146
  e.Cartographic.fromCartesian(f);
5114
- const v = Math.max(p, g), w = e.Cartesian3.fromDegrees(
5147
+ const v = Math.max(g, m), w = e.Cartesian3.fromDegrees(
5115
5148
  e.Math.toDegrees(y.longitude),
5116
5149
  e.Math.toDegrees(y.latitude),
5117
5150
  v
5118
5151
  ), 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
5152
  polyline: {
5120
- positions: [m, w],
5153
+ positions: [p, w],
5121
5154
  width: t.width || 3,
5122
5155
  material: P,
5123
5156
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
@@ -5131,37 +5164,37 @@ class ft {
5131
5164
  }
5132
5165
  }), L = i.entities.add({
5133
5166
  polyline: {
5134
- positions: [m, f],
5167
+ positions: [p, f],
5135
5168
  width: t.width || 3,
5136
5169
  material: P,
5137
5170
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
5138
5171
  }
5139
5172
  });
5140
5173
  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";
5174
+ const M = e.Cartesian3.distance(p, w), x = e.Cartesian3.distance(w, f), I = e.Cartesian3.distance(p, f), D = new e.Cartesian3((p.x + w.x) / 2, (p.y + w.y) / 2, (p.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((p.x + f.x) / 2, (p.y + f.y) / 2, (p.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
5175
  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";
5176
+ const B = e.Cartesian3.subtract(f, p, new e.Cartesian3()), N = e.Cartesian3.subtract(w, p, new e.Cartesian3()), K = e.Cartesian3.subtract(w, f, new e.Cartesian3()), q = e.Cartesian3.subtract(p, 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(p), j = e.Cartographic.fromCartesian(f), Z = "measure_triangle_angle_a", ne = "measure_triangle_angle_b";
5144
5177
  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;
5178
+ const ge = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), V = Math.min(M, x) * ge;
5146
5179
  if (M > 1e-3 && x > 1e-3) {
5147
5180
  const X = e.Cartesian3.normalize(
5148
- e.Cartesian3.subtract(m, w, new e.Cartesian3()),
5181
+ e.Cartesian3.subtract(p, w, new e.Cartesian3()),
5149
5182
  new e.Cartesian3()
5150
5183
  ), oe = e.Cartesian3.normalize(
5151
5184
  e.Cartesian3.subtract(f, w, new e.Cartesian3()),
5152
5185
  new e.Cartesian3()
5153
5186
  ), J = new e.Cartesian3(
5154
- w.x + X.x * W,
5155
- w.y + X.y * W,
5156
- w.z + X.z * W
5187
+ w.x + X.x * V,
5188
+ w.y + X.y * V,
5189
+ w.z + X.z * V
5157
5190
  ), R = new e.Cartesian3(
5158
- w.x + oe.x * W,
5159
- w.y + oe.y * W,
5160
- w.z + oe.z * W
5191
+ w.x + oe.x * V,
5192
+ w.y + oe.y * V,
5193
+ w.z + oe.z * V
5161
5194
  ), 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
5195
+ w.x + X.x * V + oe.x * V,
5196
+ w.y + X.y * V + oe.y * V,
5197
+ w.z + X.z * V + oe.z * V
5165
5198
  ), Q = i.entities.add({
5166
5199
  polyline: {
5167
5200
  positions: [J, U],
@@ -5180,26 +5213,26 @@ class ft {
5180
5213
  this.angleMarkerEntities.push(Q, Te);
5181
5214
  }
5182
5215
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
5183
- const V = {
5216
+ const W = {
5184
5217
  entity: this.segmentEntities,
5185
- positions: [m, f, w],
5218
+ positions: [p, f, w],
5186
5219
  lengths: { vertical: M, horizontal: x, hypotenuse: I },
5187
5220
  angles: { acuteA: Y, acuteB: le },
5188
5221
  clear: () => this.clear()
5189
5222
  };
5190
- (l = t.onComplete) == null || l.call(t, V);
5223
+ (l = t.onComplete) == null || l.call(t, W);
5191
5224
  }
5192
5225
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
5193
5226
  var le, ee;
5194
5227
  if (this.positions.length !== 1) return;
5195
5228
  const s = i.scene.pickPosition(n.endPosition);
5196
5229
  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
5230
+ 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), m = Math.max(a, l), p = e.Cartesian3.fromDegrees(
5231
+ this.Cesium.Math.toDegrees(g.longitude),
5232
+ this.Cesium.Math.toDegrees(g.latitude),
5233
+ m
5201
5234
  );
5202
- this.previewLow = d, this.previewHigh = u, this.previewThird = m;
5235
+ this.previewLow = d, this.previewHigh = u, this.previewThird = p;
5203
5236
  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;
5204
5237
  if (this.previewPointEntity ? this.previewPointEntity.position = s : this.previewPointEntity = i.entities.add({
5205
5238
  position: s,
@@ -5233,31 +5266,31 @@ class ft {
5233
5266
  });
5234
5267
  this.previewSegmentEntities.push(j, Z, ne);
5235
5268
  }
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";
5269
+ const v = e.Cartesian3.distance(d, p), w = e.Cartesian3.distance(p, u), P = e.Cartesian3.distance(d, u), b = e.Cartesian3.subtract(u, d, new e.Cartesian3()), C = e.Cartesian3.subtract(p, d, new e.Cartesian3()), E = e.Cartesian3.subtract(p, 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 + p.x) / 2, (d.y + p.y) / 2, (d.z + p.z) / 2), k = new e.Cartesian3((p.x + u.x) / 2, (p.y + u.y) / 2, (p.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
5270
  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
5271
  const Ce = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), Y = Math.min(v, w) * Ce;
5239
5272
  if (v > 1e-3 && w > 1e-3) {
5240
5273
  const j = e.Cartesian3.normalize(
5241
- e.Cartesian3.subtract(d, m, new e.Cartesian3()),
5274
+ e.Cartesian3.subtract(d, p, new e.Cartesian3()),
5242
5275
  new e.Cartesian3()
5243
5276
  ), Z = e.Cartesian3.normalize(
5244
- e.Cartesian3.subtract(u, m, new e.Cartesian3()),
5277
+ e.Cartesian3.subtract(u, p, new e.Cartesian3()),
5245
5278
  new e.Cartesian3()
5246
5279
  ), ne = new e.Cartesian3(
5247
- m.x + j.x * Y,
5248
- m.y + j.y * Y,
5249
- m.z + j.z * Y
5280
+ p.x + j.x * Y,
5281
+ p.y + j.y * Y,
5282
+ p.z + j.z * Y
5250
5283
  ), 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
5284
+ p.x + Z.x * Y,
5285
+ p.y + Z.y * Y,
5286
+ p.z + Z.z * Y
5287
+ ), V = new e.Cartesian3(
5288
+ p.x + j.x * Y + Z.x * Y,
5289
+ p.y + j.y * Y + Z.y * Y,
5290
+ p.z + j.z * Y + Z.z * Y
5258
5291
  );
5259
- if (this.previewMarkerP1 = ne, this.previewMarkerP2 = ge, this.previewMarkerCorner = W, !this.previewAngleMarkerEntities.length) {
5260
- const V = i.entities.add({
5292
+ if (this.previewMarkerP1 = ne, this.previewMarkerP2 = ge, this.previewMarkerCorner = V, !this.previewAngleMarkerEntities.length) {
5293
+ const W = i.entities.add({
5261
5294
  polyline: {
5262
5295
  positions: new e.CallbackProperty(() => !this.previewMarkerP1 || !this.previewMarkerCorner ? [] : [this.previewMarkerP1, this.previewMarkerCorner], !1),
5263
5296
  width: t.width || 3,
@@ -5272,7 +5305,7 @@ class ft {
5272
5305
  depthFailMaterial: new e.PolylineDashMaterialProperty({ color: y, dashLength: 12, dashPattern: 255 })
5273
5306
  }
5274
5307
  });
5275
- this.previewAngleMarkerEntities.push(V, X);
5308
+ this.previewAngleMarkerEntities.push(W, X);
5276
5309
  }
5277
5310
  }
5278
5311
  }, e.ScreenSpaceEventType.MOUSE_MOVE);
@@ -5309,27 +5342,27 @@ class ft {
5309
5342
  options: { offset: { x: 0, y: -10 } }
5310
5343
  });
5311
5344
  }
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 } });
5345
+ const d = i.Cartographic.fromCartesian(l[0]), u = i.Cartographic.fromCartesian(l[1]), g = d.height || 0, m = u.height || 0, p = g <= m ? l[0] : l[1], f = g > m ? l[0] : l[1], y = n.entities.add({ position: p, 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
5346
  this.pointEntities.push(y, v);
5314
- const w = i.Cartographic.fromCartesian(m), P = Math.max(p, g), b = i.Cartesian3.fromDegrees(
5347
+ const w = i.Cartographic.fromCartesian(p), P = Math.max(g, m), b = i.Cartesian3.fromDegrees(
5315
5348
  i.Math.toDegrees(w.longitude),
5316
5349
  i.Math.toDegrees(w.latitude),
5317
5350
  P
5318
5351
  ), C = n.entities.add({
5319
- polyline: { positions: [m, b], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5352
+ polyline: { positions: [p, b], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5320
5353
  }), E = n.entities.add({
5321
5354
  polyline: { positions: [b, f], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5322
5355
  }), L = n.entities.add({
5323
- polyline: { positions: [m, f], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5356
+ polyline: { positions: [p, f], width: a, material: o, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 }) }
5324
5357
  });
5325
5358
  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";
5359
+ const M = i.Cartesian3.distance(p, b), x = i.Cartesian3.distance(b, f), I = i.Cartesian3.distance(p, f), D = new i.Cartesian3((p.x + b.x) / 2, (p.y + b.y) / 2, (p.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((p.x + f.x) / 2, (p.y + f.y) / 2, (p.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
5360
  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";
5361
+ const B = i.Cartesian3.subtract(f, p, new i.Cartesian3()), N = i.Cartesian3.subtract(b, p, new i.Cartesian3()), K = i.Cartesian3.subtract(b, f, new i.Cartesian3()), q = i.Cartesian3.subtract(p, 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(p), j = i.Cartographic.fromCartesian(f), Z = s.labelText || { angle: "角度" }, ne = t.id + "_tri_angA", ge = t.id + "_tri_angB";
5329
5362
  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;
5363
+ const V = Math.max(0.01, Math.min(0.5, s.angleMarkerRatio ?? 0.2)), W = Math.min(M, x) * V;
5331
5364
  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 }) } });
5365
+ const J = i.Cartesian3.normalize(i.Cartesian3.subtract(p, 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 * W, b.y + J.y * W, b.z + J.z * W), Q = new i.Cartesian3(b.x + R.x * W, b.y + R.y * W, b.z + R.z * W), Te = new i.Cartesian3(b.x + J.x * W + R.x * W, b.y + J.y * W + R.y * W, b.z + J.z * W + R.z * W), 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
5366
  this.angleMarkerEntities.push(Ft, zt);
5334
5367
  }
5335
5368
  }
@@ -5378,22 +5411,22 @@ class yt {
5378
5411
  });
5379
5412
  if (this.tempPoints.push(o), this.positions.length === 2) {
5380
5413
  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;
5414
+ const d = this.positions[0], u = this.positions[1], g = t.lineColor || t.color || e.Color.YELLOW, m = ((a = (r = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : a.call(r, 0.9)) || e.Color.RED;
5382
5415
  this.entity = i.entities.add({
5383
5416
  polyline: {
5384
5417
  positions: [d, u],
5385
5418
  width: t.width || 3,
5386
- material: p,
5419
+ material: g,
5387
5420
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5388
- color: g,
5421
+ color: m,
5389
5422
  dashLength: 12,
5390
5423
  dashPattern: 255
5391
5424
  })
5392
5425
  }
5393
5426
  });
5394
- const m = e.Cartesian3.distance(d, u), f = u, y = e.Cartographic.fromCartesian(f), v = this.htmlLabelId || `measure_space_${Date.now()}`;
5427
+ const p = e.Cartesian3.distance(d, u), f = u, y = e.Cartographic.fromCartesian(f), v = this.htmlLabelId || `measure_space_${Date.now()}`;
5395
5428
  this.htmlLabelId = v, this.htmlLabelPool.add(
5396
- { text: `${m.toFixed(2)} m` },
5429
+ { text: `${p.toFixed(2)} m` },
5397
5430
  {
5398
5431
  id: v,
5399
5432
  lon: e.Math.toDegrees(y.longitude),
@@ -5408,13 +5441,13 @@ class yt {
5408
5441
  entity: this.entity,
5409
5442
  label: this.labelEntity,
5410
5443
  positions: this.positions,
5411
- distance: m,
5444
+ distance: p,
5412
5445
  clear: () => this.clear()
5413
5446
  };
5414
5447
  (l = t.onComplete) == null || l.call(t, w);
5415
5448
  }
5416
5449
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
5417
- var g, m;
5450
+ var m, p;
5418
5451
  if (this.positions.length !== 1) return;
5419
5452
  const s = i.scene.pickPosition(n.endPosition);
5420
5453
  if (!s) return;
@@ -5436,14 +5469,14 @@ class yt {
5436
5469
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
5437
5470
  }
5438
5471
  );
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;
5472
+ const u = t.lineColor || t.color || e.Color.YELLOW, g = ((p = (m = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : p.call(m, 0.9)) || e.Color.RED;
5440
5473
  this.previewEntity || (this.previewEntity = i.entities.add({
5441
5474
  polyline: {
5442
5475
  positions: new e.CallbackProperty(() => !this.previewPos || !this.positions.length ? [] : [this.positions[0], this.previewPos], !1),
5443
5476
  width: t.width || 3,
5444
5477
  material: u,
5445
5478
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5446
- color: p,
5479
+ color: g,
5447
5480
  dashLength: 12,
5448
5481
  dashPattern: 255
5449
5482
  })
@@ -5459,25 +5492,25 @@ class yt {
5459
5492
  }
5460
5493
  rehydrate(t, e) {
5461
5494
  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]));
5495
+ 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
5496
  if (l.length) {
5464
5497
  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) => {
5498
+ const g = s.overlayContainerId || "html-label-container";
5499
+ this.htmlLabelPool = e || new z(i, n, g), this.htmlLabelPool.registerTheme("measure-space", {
5500
+ createElement: (m, p) => {
5468
5501
  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";
5502
+ m.innerHTML = String(((f = p == null ? void 0 : p.data) == null ? void 0 : f.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";
5470
5503
  },
5471
5504
  options: { offset: { x: 0, y: -10 } }
5472
5505
  });
5473
5506
  }
5474
5507
  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);
5508
+ const g = n.entities.add({ position: l[0], point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5509
+ this.tempPoints.push(g);
5477
5510
  }
5478
5511
  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({
5512
+ const g = n.entities.add({ position: l[1], point: { pixelSize: 8, color: s.pointColor || s.color || i.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
5513
+ this.tempPoints.push(g), this.entity = n.entities.add({
5481
5514
  polyline: {
5482
5515
  positions: [l[0], l[1]],
5483
5516
  width: a,
@@ -5485,12 +5518,12 @@ class yt {
5485
5518
  depthFailMaterial: new i.PolylineDashMaterialProperty({ color: r, dashLength: 12, dashPattern: 255 })
5486
5519
  }
5487
5520
  });
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` }, {
5521
+ const m = i.Cartesian3.distance(l[0], l[1]), p = i.Cartographic.fromCartesian(l[1]), f = t.id + "_label";
5522
+ this.htmlLabelId = f, this.htmlLabelPool.add({ text: `${m.toFixed(2)} m` }, {
5490
5523
  id: f,
5491
- lon: i.Math.toDegrees(m.longitude),
5492
- lat: i.Math.toDegrees(m.latitude),
5493
- height: m.height || 0,
5524
+ lon: i.Math.toDegrees(p.longitude),
5525
+ lat: i.Math.toDegrees(p.latitude),
5526
+ height: p.height || 0,
5494
5527
  theme: "measure-space",
5495
5528
  show: !0,
5496
5529
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
@@ -5551,7 +5584,7 @@ const Re = class Re {
5551
5584
  });
5552
5585
  }
5553
5586
  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;
5587
+ var g, m;
5555
5588
  const s = i.scene.pickPosition(n.position);
5556
5589
  if (!s) return;
5557
5590
  this.positions.push(s);
@@ -5591,11 +5624,11 @@ const Re = class Re {
5591
5624
  }
5592
5625
  this.edgeEntities = [];
5593
5626
  }
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({
5627
+ const p = t.lineColor || t.color || e.Color.YELLOW, f = ((m = (g = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : m.call(g, 0.9)) || e.Color.RED, y = this.positions.concat([this.positions[0]]), v = i.entities.add({
5595
5628
  polyline: {
5596
5629
  positions: y,
5597
5630
  width: t.width || 2,
5598
- material: m,
5631
+ material: p,
5599
5632
  clampToGround: !1,
5600
5633
  arcType: e.ArcType.NONE,
5601
5634
  depthFailMaterial: new e.PolylineDashMaterialProperty({
@@ -5608,7 +5641,7 @@ const Re = class Re {
5608
5641
  this.edgeEntities.push(v);
5609
5642
  }
5610
5643
  }, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction((n) => {
5611
- var m, f;
5644
+ var p, f;
5612
5645
  if (this.positions.length === 0) return;
5613
5646
  const s = i.scene.pickPosition(n.endPosition);
5614
5647
  if (!s) return;
@@ -5624,13 +5657,13 @@ const Re = class Re {
5624
5657
  d += l[y].x * l[v].y - l[v].x * l[y].y;
5625
5658
  }
5626
5659
  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: "面积" };
5660
+ const u = e.Cartographic.fromCartesian(r), g = this.previewLabelId || "measure_area_preview";
5661
+ this.previewLabelId = g;
5662
+ const m = t.labelText || { area: "面积" };
5630
5663
  if (this.htmlLabelPool.add(
5631
- { text: `${g.area}:${d.toFixed(2)} m²` },
5664
+ { text: `${m.area}:${d.toFixed(2)} m²` },
5632
5665
  {
5633
- id: p,
5666
+ id: g,
5634
5667
  lon: e.Math.toDegrees(u.longitude),
5635
5668
  lat: e.Math.toDegrees(u.latitude),
5636
5669
  height: u.height || 0,
@@ -5651,7 +5684,7 @@ const Re = class Re {
5651
5684
  arcType: e.ArcType.NONE
5652
5685
  }
5653
5686
  });
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;
5687
+ const v = t.lineColor || t.color || e.Color.YELLOW, w = ((f = (p = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(p, 0.9)) || e.Color.RED;
5655
5688
  this.previewEdgeEntity = i.entities.add({
5656
5689
  polyline: {
5657
5690
  positions: new e.CallbackProperty(() => !this.previewPos || !this.positions.length ? [] : this.positions.concat([this.previewPos, this.positions[0]]), !1),
@@ -5753,21 +5786,21 @@ const Re = class Re {
5753
5786
  closed: !0
5754
5787
  })
5755
5788
  }), 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({
5789
+ 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, m = this.positions.concat([this.positions[0]]), p = i.entities.add({
5757
5790
  polyline: {
5758
- positions: g,
5791
+ positions: m,
5759
5792
  width: t.width || 2,
5760
5793
  material: u,
5761
5794
  clampToGround: !1,
5762
5795
  arcType: e.ArcType.NONE,
5763
5796
  depthFailMaterial: new e.PolylineDashMaterialProperty({
5764
- color: p,
5797
+ color: g,
5765
5798
  dashLength: 12,
5766
5799
  dashPattern: 255
5767
5800
  })
5768
5801
  }
5769
5802
  });
5770
- this.edgeEntities.push(m);
5803
+ this.edgeEntities.push(p);
5771
5804
  }
5772
5805
  }
5773
5806
  _undoLastPoint(t, e, i) {
@@ -5777,11 +5810,11 @@ const Re = class Re {
5777
5810
  n && i.entities.remove(n), this._clearPreviewState(), this._rebuildShape(t, e, i);
5778
5811
  }
5779
5812
  _finishMeasurement(t, e, i) {
5780
- var g;
5813
+ var m;
5781
5814
  if (i && this.positions.length >= 3) {
5782
5815
  this.positions.pop();
5783
- const m = this.tempPoints.pop();
5784
- m && this.viewer.entities.remove(m);
5816
+ const p = this.tempPoints.pop();
5817
+ p && this.viewer.entities.remove(p);
5785
5818
  }
5786
5819
  if (this.positions.length < 3) {
5787
5820
  this.clear();
@@ -5789,14 +5822,14 @@ const Re = class Re {
5789
5822
  }
5790
5823
  this._clearPreviewState(), this.stop();
5791
5824
  const n = new e.Cartesian3(
5792
- this.positions.reduce((m, f) => m + f.x, 0) / this.positions.length,
5793
- this.positions.reduce((m, f) => m + f.y, 0) / this.positions.length,
5794
- this.positions.reduce((m, f) => m + f.z, 0) / this.positions.length
5825
+ this.positions.reduce((p, f) => p + f.x, 0) / this.positions.length,
5826
+ this.positions.reduce((p, f) => p + f.y, 0) / this.positions.length,
5827
+ this.positions.reduce((p, f) => p + f.z, 0) / this.positions.length
5795
5828
  ), o = new e.EllipsoidTangentPlane(n, e.Ellipsoid.WGS84).projectPointsOntoPlane(this.positions);
5796
5829
  let r = 0;
5797
- for (let m = 0; m < o.length; m++) {
5798
- const f = (m + 1) % o.length;
5799
- r += o[m].x * o[f].y - o[f].x * o[m].y;
5830
+ for (let p = 0; p < o.length; p++) {
5831
+ const f = (p + 1) % o.length;
5832
+ r += o[p].x * o[f].y - o[f].x * o[p].y;
5800
5833
  }
5801
5834
  r = Math.abs(r) / 2;
5802
5835
  const a = e.Cartographic.fromCartesian(n), l = this.htmlLabelId || `measure_area_${Date.now()}`;
@@ -5813,8 +5846,8 @@ const Re = class Re {
5813
5846
  show: !0
5814
5847
  }
5815
5848
  ), this.labelEntity = this.htmlLabelId;
5816
- 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}`;
5849
+ for (let p = 0; p < this.positions.length; p++) {
5850
+ const f = (p + 1) % this.positions.length, y = this.positions[p], 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()}_${p}`;
5818
5851
  this.segmentLabelIds.push(M), this.htmlLabelPool.add(
5819
5852
  { text: `${d.side}:${C.toFixed(2)} m` },
5820
5853
  {
@@ -5828,10 +5861,10 @@ const Re = class Re {
5828
5861
  );
5829
5862
  }
5830
5863
  const u = o;
5831
- 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);
5864
+ for (let p = 0; p < u.length; p++) {
5865
+ const f = u[(p - 1 + u.length) % u.length], y = u[p], v = u[(p + 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
5866
  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}`;
5867
+ 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[p]), D = `measure_area_angle_${Date.now()}_${p}`;
5835
5868
  this.angleLabelIds.push(D), this.htmlLabelPool.add(
5836
5869
  { text: `${d.angle}:${x.toFixed(2)} °` },
5837
5870
  {
@@ -5844,14 +5877,14 @@ const Re = class Re {
5844
5877
  }
5845
5878
  );
5846
5879
  }
5847
- const p = {
5880
+ const g = {
5848
5881
  entity: this.primitive,
5849
5882
  label: this.labelEntity,
5850
5883
  positions: this.positions,
5851
5884
  area: r,
5852
5885
  clear: () => this.clear()
5853
5886
  };
5854
- (g = t.onComplete) == null || g.call(t, p);
5887
+ (m = t.onComplete) == null || m.call(t, g);
5855
5888
  }
5856
5889
  _bindGlobalEvents(t, e, i) {
5857
5890
  this.keydownHandler = (n) => {
@@ -5900,18 +5933,18 @@ const Re = class Re {
5900
5933
  d += l[C].x * l[E].y - l[E].x * l[C].y;
5901
5934
  }
5902
5935
  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,
5936
+ const u = i.Cartographic.fromCartesian(r), g = t.id + "_area";
5937
+ this.htmlLabelId = g;
5938
+ const m = s.labelText || { area: "面积", side: "边长", angle: "角度" };
5939
+ this.htmlLabelPool.add({ text: `${m.area}:${d.toFixed(2)} m²` }, {
5940
+ id: g,
5908
5941
  lon: i.Math.toDegrees(u.longitude),
5909
5942
  lat: i.Math.toDegrees(u.latitude),
5910
5943
  height: u.height || 0,
5911
5944
  theme: "measure-area",
5912
5945
  show: !0
5913
5946
  });
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({
5947
+ const p = new i.PolygonHierarchy(o), f = new i.PolygonGeometry({ polygonHierarchy: p, 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({
5915
5948
  geometryInstances: y,
5916
5949
  appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: v }), translucent: !0, closed: !0 }),
5917
5950
  depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: w }), translucent: !0, closed: !0 })
@@ -5919,14 +5952,14 @@ const Re = class Re {
5919
5952
  n.scene.primitives.add(P), this.primitive = P;
5920
5953
  for (let C = 0; C < o.length; C++) {
5921
5954
  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 });
5955
+ this.segmentLabelIds.push(k), this.htmlLabelPool.add({ text: `${m.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
5956
  }
5924
5957
  const b = l;
5925
5958
  for (let C = 0; C < b.length; C++) {
5926
5959
  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);
5927
5960
  if (!S || !_) continue;
5928
5961
  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 });
5962
+ this.angleLabelIds.push(O), this.htmlLabelPool.add({ text: `${m.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 });
5930
5963
  }
5931
5964
  }
5932
5965
  };
@@ -5968,15 +6001,15 @@ class wt {
5968
6001
  const s = i.scene.pickPosition(n.position);
5969
6002
  if (s && (this.positions.push(s), this.positions.length === 2)) {
5970
6003
  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,
6004
+ 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: "周长" }, m = r;
6005
+ this.labelEntity ? (this.labelEntity.position = m, this.labelEntity.label.text = `${g.radius}:${l.toFixed(2)} m
6006
+ ${g.area}:${d.toFixed(2)} m²
6007
+ ${g.circumference}:${u.toFixed(2)} m`) : this.labelEntity = i.entities.add({
6008
+ position: m,
5976
6009
  label: {
5977
- text: `${p.radius}:${l.toFixed(2)} m
5978
- ${p.area}:${d.toFixed(2)} m²
5979
- ${p.circumference}:${u.toFixed(2)} m`,
6010
+ text: `${g.radius}:${l.toFixed(2)} m
6011
+ ${g.area}:${d.toFixed(2)} m²
6012
+ ${g.circumference}:${u.toFixed(2)} m`,
5980
6013
  font: "14px sans-serif",
5981
6014
  fillColor: e.Color.WHITE,
5982
6015
  outlineColor: e.Color.BLACK,
@@ -5991,11 +6024,11 @@ ${p.circumference}:${u.toFixed(2)} m`,
5991
6024
  show: !1
5992
6025
  }
5993
6026
  }), this.previewEntity && (i.entities.remove(this.previewEntity), this.previewEntity = null);
5994
- const m = e.Cartographic.fromCartesian(r), f = new e.EllipseGeometry({
6027
+ const p = e.Cartographic.fromCartesian(r), f = new e.EllipseGeometry({
5995
6028
  center: r,
5996
6029
  semiMajorAxis: l,
5997
6030
  semiMinorAxis: l,
5998
- height: m.height || 0,
6031
+ height: p.height || 0,
5999
6032
  vertexFormat: e.MaterialAppearance.VERTEX_FORMAT
6000
6033
  }), 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);
6001
6034
  this.ellipsePrimitive && (i.scene.primitives.remove(this.ellipsePrimitive), this.ellipsePrimitive = null), this.ellipsePrimitive = new e.Primitive({
@@ -6013,9 +6046,9 @@ ${p.circumference}:${u.toFixed(2)} m`,
6013
6046
  }), i.scene.primitives.add(this.ellipsePrimitive), this.entity = this.ellipsePrimitive, this.isPrimitive = !0;
6014
6047
  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
6048
  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`;
6049
+ const M = `${g.radius}:${l.toFixed(2)} m
6050
+ ${g.area}:${d.toFixed(2)} m²
6051
+ ${g.circumference}:${u.toFixed(2)} m`;
6019
6052
  this.htmlLabelPool.add({ text: M }, { id: L, lon: b, lat: C, height: E, theme: "measure-circle", show: !0 });
6020
6053
  const x = {
6021
6054
  entity: this.entity,
@@ -6034,15 +6067,15 @@ ${p.circumference}:${u.toFixed(2)} m`;
6034
6067
  if (!r) return;
6035
6068
  const a = e.Cartesian3.distance(s, r);
6036
6069
  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,
6070
+ const l = e.Cartographic.fromCartesian(s), d = Math.PI * a * a, u = 2 * Math.PI * a, g = t.labelText || { radius: "半径", area: "面积", circumference: "周长" }, m = s;
6071
+ this.labelEntity ? (this.labelEntity.position = m, this.labelEntity.label.text = `${g.radius}:${a.toFixed(2)} m
6072
+ ${g.area}:${d.toFixed(2)} m²
6073
+ ${g.circumference}:${u.toFixed(2)} m`) : this.labelEntity = i.entities.add({
6074
+ position: m,
6042
6075
  label: {
6043
- text: `${p.radius}:${a.toFixed(2)} m
6044
- ${p.area}:${d.toFixed(2)} m²
6045
- ${p.circumference}:${u.toFixed(2)} m`,
6076
+ text: `${g.radius}:${a.toFixed(2)} m
6077
+ ${g.area}:${d.toFixed(2)} m²
6078
+ ${g.circumference}:${u.toFixed(2)} m`,
6046
6079
  font: "14px sans-serif",
6047
6080
  fillColor: e.Color.WHITE,
6048
6081
  outlineColor: e.Color.BLACK,
@@ -6057,11 +6090,11 @@ ${p.circumference}:${u.toFixed(2)} m`,
6057
6090
  show: !1
6058
6091
  }
6059
6092
  });
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()}`;
6093
+ const p = e.Cartographic.fromCartesian(s), f = e.Math.toDegrees(p.longitude), y = e.Math.toDegrees(p.latitude), v = p.height || 0, w = this.htmlLabelId || `measure_circle_${Date.now()}`;
6061
6094
  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`;
6095
+ const P = `${g.radius}:${a.toFixed(2)} m
6096
+ ${g.area}:${d.toFixed(2)} m²
6097
+ ${g.circumference}:${u.toFixed(2)} m`;
6065
6098
  if (this.htmlLabelPool.add({ text: P }, { id: w, lon: f, lat: y, height: v, theme: "measure-circle", show: !0 }), !this.previewEntity) {
6066
6099
  const b = t.color || e.Color.YELLOW.withAlpha(0.5);
6067
6100
  this.previewEntity = i.entities.add({
@@ -6096,8 +6129,8 @@ ${p.circumference}:${u.toFixed(2)} m`;
6096
6129
  options: { offset: { x: 0, y: -10 } }
6097
6130
  });
6098
6131
  }
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({
6100
- geometryInstances: m,
6132
+ 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), m = new i.EllipseGeometry({ center: r, semiMajorAxis: l, semiMinorAxis: l, height: g.height || 0, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT }), p = new i.GeometryInstance({ geometry: m }), 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({
6133
+ geometryInstances: p,
6101
6134
  appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: f }), translucent: !0, closed: !0 }),
6102
6135
  depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: y }), translucent: !0, closed: !0 })
6103
6136
  });
@@ -6177,13 +6210,13 @@ const Oe = class Oe {
6177
6210
  })
6178
6211
  }
6179
6212
  }), 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(
6213
+ 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), p = new e.EllipsoidGeodesic(u, g).surfaceDistance, f = new e.Cartesian3(
6181
6214
  (l.x + d.x) / 2,
6182
6215
  (l.y + d.y) / 2,
6183
6216
  (l.z + d.z) / 2
6184
6217
  ), y = e.Cartographic.fromCartesian(f), v = `measure_polyline_seg_${this.segmentLabelIds.length}_${Date.now()}`;
6185
6218
  this.segmentLabelIds.push(v), this.htmlLabelPool.add(
6186
- { text: `${m.toFixed(2)} m` },
6219
+ { text: `${p.toFixed(2)} m` },
6187
6220
  {
6188
6221
  id: v,
6189
6222
  lon: e.Math.toDegrees(y.longitude),
@@ -6199,7 +6232,7 @@ const Oe = class Oe {
6199
6232
  }, e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.handler.setInputAction(() => {
6200
6233
  this._undoLastPoint();
6201
6234
  }, e.ScreenSpaceEventType.RIGHT_CLICK), this.handler.setInputAction((n) => {
6202
- var m, f;
6235
+ var p, f;
6203
6236
  if (this.positions.length === 0) return;
6204
6237
  const s = i.scene.pickPosition(n.endPosition);
6205
6238
  if (!s) return;
@@ -6208,14 +6241,14 @@ const Oe = class Oe {
6208
6241
  (o.x + s.x) / 2,
6209
6242
  (o.y + s.y) / 2,
6210
6243
  (o.z + s.z) / 2
6211
- ), p = e.Cartographic.fromCartesian(u), g = this.previewLabelId || "measure_polyline_preview";
6212
- this.previewLabelId = g, this.htmlLabelPool.add(
6244
+ ), g = e.Cartographic.fromCartesian(u), m = this.previewLabelId || "measure_polyline_preview";
6245
+ this.previewLabelId = m, this.htmlLabelPool.add(
6213
6246
  { text: `${d.toFixed(2)} m` },
6214
6247
  {
6215
- id: g,
6216
- lon: e.Math.toDegrees(p.longitude),
6217
- lat: e.Math.toDegrees(p.latitude),
6218
- height: p.height || 0,
6248
+ id: m,
6249
+ lon: e.Math.toDegrees(g.longitude),
6250
+ lat: e.Math.toDegrees(g.latitude),
6251
+ height: g.height || 0,
6219
6252
  theme: "measure-polyline-seg",
6220
6253
  show: !0
6221
6254
  }
@@ -6225,7 +6258,7 @@ const Oe = class Oe {
6225
6258
  width: t.width || 3,
6226
6259
  material: t.lineColor || t.color || e.Color.YELLOW,
6227
6260
  depthFailMaterial: new e.PolylineDashMaterialProperty({
6228
- color: ((f = (m = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || e.Color.RED,
6261
+ color: ((f = (p = t.dashLineColor || t.lineColor || t.color || e.Color.RED).withAlpha) == null ? void 0 : f.call(p, 0.9)) || e.Color.RED,
6229
6262
  dashLength: 12,
6230
6263
  dashPattern: 255
6231
6264
  })
@@ -6273,7 +6306,7 @@ const Oe = class Oe {
6273
6306
  this.stop(), this._clearPreviewState();
6274
6307
  let n = 0;
6275
6308
  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);
6309
+ const u = this.positions[d - 1], g = this.positions[d], m = e.Cartographic.fromCartesian(u), p = e.Cartographic.fromCartesian(g), f = new e.EllipsoidGeodesic(m, p);
6277
6310
  n += f.surfaceDistance;
6278
6311
  }
6279
6312
  const s = this.positions[this.positions.length - 1];
@@ -6308,8 +6341,8 @@ const Oe = class Oe {
6308
6341
  }, i.canvas.addEventListener("contextmenu", this.contextMenuHandler);
6309
6342
  }
6310
6343
  rehydrate(t, e) {
6311
- var m, f;
6312
- const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((f = (m = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : f.call(m, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((y) => new i.Cartesian3(y[0], y[1], y[2]));
6344
+ var p, f;
6345
+ const i = this.Cesium, n = this.viewer, s = t.options || {}, o = s.lineColor || s.color || i.Color.YELLOW, r = ((f = (p = s.dashLineColor || s.lineColor || s.color || i.Color.RED).withAlpha) == null ? void 0 : f.call(p, 0.9)) || i.Color.RED, a = s.width || 3, l = (t.positions || []).map((y) => new i.Cartesian3(y[0], y[1], y[2]));
6313
6346
  if (l.length < 2) return;
6314
6347
  if (!this.htmlLabelPool) {
6315
6348
  const y = s.overlayContainerId || "html-label-container";
@@ -6347,12 +6380,12 @@ const Oe = class Oe {
6347
6380
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
6348
6381
  });
6349
6382
  }
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,
6383
+ const u = l[l.length - 1], g = i.Cartographic.fromCartesian(u), m = t.id + "_total";
6384
+ this.totalLabelId = m, this.htmlLabelPool.add({ text: `${d.toFixed(2)} m` }, {
6385
+ id: m,
6386
+ lon: i.Math.toDegrees(g.longitude),
6387
+ lat: i.Math.toDegrees(g.latitude),
6388
+ height: g.height || 0,
6356
6389
  theme: "measure-polyline-total",
6357
6390
  show: !0,
6358
6391
  style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
@@ -6420,11 +6453,11 @@ class vt {
6420
6453
  })
6421
6454
  }
6422
6455
  });
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()}`;
6424
- this.htmlLabelId = m, this.htmlLabelPool.add(
6425
- { text: g },
6456
+ const u = t.labelText || { height: "高程" }, g = (o.height || 0) - r, m = `${u.height}:${r.toFixed(2)} m`, p = this.htmlLabelId || `measure_terrain_${Date.now()}`;
6457
+ this.htmlLabelId = p, this.htmlLabelPool.add(
6458
+ { text: m },
6426
6459
  {
6427
- id: m,
6460
+ id: p,
6428
6461
  lon: a,
6429
6462
  lat: l,
6430
6463
  height: o.height || 0,
@@ -6438,7 +6471,7 @@ class vt {
6438
6471
  zeroPosition: d,
6439
6472
  line: this.lineEntity,
6440
6473
  terrainHeight: r,
6441
- difference: p,
6474
+ difference: g,
6442
6475
  clear: () => this.clear()
6443
6476
  };
6444
6477
  (y = t.onComplete) == null || y.call(t, f), this.stop();
@@ -6467,12 +6500,12 @@ class vt {
6467
6500
  options: { offset: { x: 0, y: -10 } }
6468
6501
  });
6469
6502
  }
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: "高程" };
6503
+ 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);
6504
+ 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 }) } });
6505
+ const m = s.labelText || { height: "高程" };
6473
6506
  (a.height || 0) - l;
6474
- 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 });
6507
+ const p = t.id + "_terrain";
6508
+ this.htmlLabelId = p, this.htmlLabelPool.add({ text: `${m.height}:${l.toFixed(2)} m` }, { id: p, lon: d, lat: u, height: a.height || 0, theme: "measure-terrainHeight", show: !0 });
6476
6509
  }
6477
6510
  }
6478
6511
  class Ct {
@@ -6500,7 +6533,7 @@ class Ct {
6500
6533
  });
6501
6534
  }
6502
6535
  this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((n) => {
6503
- var g;
6536
+ var m;
6504
6537
  const s = i.scene.pickPosition(n.position);
6505
6538
  if (!s) return;
6506
6539
  const o = e.Cartographic.fromCartesian(s), r = e.Math.toDegrees(o.longitude), a = e.Math.toDegrees(o.latitude), l = o.height || 0;
@@ -6528,13 +6561,13 @@ ${u.height}:${l.toFixed(2)} m` },
6528
6561
  show: !0
6529
6562
  }
6530
6563
  ), this.labelEntity = this.htmlLabelId;
6531
- const p = {
6564
+ const g = {
6532
6565
  entity: this.entity,
6533
6566
  label: this.labelEntity,
6534
6567
  lnglat: { lng: r, lat: a, height: l },
6535
6568
  clear: () => this.clear()
6536
6569
  };
6537
- (g = t.onComplete) == null || g.call(t, p), this.stop();
6570
+ (m = t.onComplete) == null || m.call(t, g), this.stop();
6538
6571
  }, e.ScreenSpaceEventType.LEFT_CLICK);
6539
6572
  }
6540
6573
  stop() {
@@ -6544,10 +6577,10 @@ ${u.height}:${l.toFixed(2)} m` },
6544
6577
  this.stop(), this.entity && (this.viewer.entities.remove(this.entity), this.entity = null), this.htmlLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.htmlLabelId]), this.htmlLabelId = null);
6545
6578
  }
6546
6579
  rehydrate(t, e) {
6547
- var m;
6580
+ var p;
6548
6581
  const i = this.Cesium, n = this.viewer, s = t.options || {}, o = (t.positions || []).map((f) => new i.Cartesian3(f[0], f[1], f[2]));
6549
6582
  if (!o.length) {
6550
- const f = (m = t.data) == null ? void 0 : m.lnglat;
6583
+ const f = (p = t.data) == null ? void 0 : p.lnglat;
6551
6584
  if (f && typeof f.lng == "number" && typeof f.lat == "number") {
6552
6585
  const y = i.Cartesian3.fromDegrees(f.lng, f.lat, f.height || 0);
6553
6586
  o.push(y);
@@ -6566,12 +6599,12 @@ ${u.height}:${l.toFixed(2)} m` },
6566
6599
  }
6567
6600
  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
6601
  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 });
6602
+ const g = t.id + "_coord";
6603
+ this.htmlLabelId = g;
6604
+ const m = s.labelText || { lng: "经", lat: "纬", height: "高" };
6605
+ this.htmlLabelPool.add({ text: `${m.lng}:${l.toFixed(6)}
6606
+ ${m.lat}:${d.toFixed(6)}
6607
+ ${m.height}:${u.toFixed(2)} m` }, { id: g, lon: l, lat: d, height: u, theme: "measure-coordinate", show: !0 });
6575
6608
  }
6576
6609
  }
6577
6610
  class bt {
@@ -6634,20 +6667,20 @@ class bt {
6634
6667
  return;
6635
6668
  }
6636
6669
  this.stop();
6637
- const { corners: a, center: l, width: d, height: u, area: p } = r;
6670
+ const { corners: a, center: l, width: d, height: u, area: g } = r;
6638
6671
  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;
6641
- const m = e.Cartographic.fromCartesian(l), f = t.labelText || { width: "宽", heightLabel: "高", area: "面积", side: "边长" };
6672
+ const m = this.htmlLabelId || `measure_rectangle_${Date.now()}`;
6673
+ this.htmlLabelId = m;
6674
+ const p = e.Cartographic.fromCartesian(l), f = t.labelText || { width: "宽", heightLabel: "高", area: "面积", side: "边长" };
6642
6675
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null), this.htmlLabelPool.add(
6643
6676
  { text: `${f.width}:${d.toFixed(2)} m
6644
6677
  ${f.heightLabel}:${u.toFixed(2)} m
6645
- ${f.area}:${p.toFixed(2)} m²` },
6678
+ ${f.area}:${g.toFixed(2)} m²` },
6646
6679
  {
6647
- id: g,
6648
- lon: e.Math.toDegrees(m.longitude),
6649
- lat: e.Math.toDegrees(m.latitude),
6650
- height: m.height || 0,
6680
+ id: m,
6681
+ lon: e.Math.toDegrees(p.longitude),
6682
+ lat: e.Math.toDegrees(p.latitude),
6683
+ height: p.height || 0,
6651
6684
  theme: "measure-rectangle",
6652
6685
  show: !0
6653
6686
  }
@@ -6724,7 +6757,7 @@ ${f.area}:${p.toFixed(2)} m²` },
6724
6757
  positions: [this.startPoint, this.secondPoint, o],
6725
6758
  width: d,
6726
6759
  height: u,
6727
- area: p,
6760
+ area: g,
6728
6761
  clear: () => this.clear()
6729
6762
  };
6730
6763
  (k = t.onComplete) == null || k.call(t, T);
@@ -6771,20 +6804,20 @@ ${f.area}:${p.toFixed(2)} m²` },
6771
6804
  if (!this.startPoint || !this.secondPoint) return;
6772
6805
  const o = this.computeRectangle(this.startPoint, this.secondPoint, s);
6773
6806
  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";
6777
- this.previewLabelId = m;
6807
+ const { corners: r, center: a, width: l, height: d, area: u } = o, g = this.buildSurfaceRectanglePositions(r);
6808
+ this.currentCorners = g;
6809
+ const m = e.Cartographic.fromCartesian(a), p = this.previewLabelId || "measure_rectangle_preview";
6810
+ this.previewLabelId = p;
6778
6811
  const f = t.labelText || { width: "宽", heightLabel: "高", area: "面积" };
6779
6812
  if (this.htmlLabelPool.add(
6780
6813
  { text: `${f.width}:${l.toFixed(2)} m
6781
6814
  ${f.heightLabel}:${d.toFixed(2)} m
6782
6815
  ${f.area}:${u.toFixed(2)} m²` },
6783
6816
  {
6784
- id: m,
6785
- lon: e.Math.toDegrees(g.longitude),
6786
- lat: e.Math.toDegrees(g.latitude),
6787
- height: g.height || 0,
6817
+ id: p,
6818
+ lon: e.Math.toDegrees(m.longitude),
6819
+ lat: e.Math.toDegrees(m.latitude),
6820
+ height: m.height || 0,
6788
6821
  theme: "measure-rectangle",
6789
6822
  show: !0
6790
6823
  }
@@ -6858,10 +6891,10 @@ ${f.area}:${u.toFixed(2)} m²` },
6858
6891
  }
6859
6892
  const r = this.computeRectangle(o[0], o[1], o[2]);
6860
6893
  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: "边长" };
6862
- this.htmlLabelId = m, this.htmlLabelPool.add({ text: `${f.width}:${d.toFixed(2)} m
6894
+ const a = r.corners, l = r.center, d = r.width, u = r.height, g = r.area, m = i.Cartographic.fromCartesian(l), p = t.id + "_rectangle", f = s.labelText || { width: "宽", heightLabel: "高", area: "面积", side: "边长" };
6895
+ this.htmlLabelId = p, this.htmlLabelPool.add({ text: `${f.width}:${d.toFixed(2)} m
6863
6896
  ${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 });
6897
+ ${f.area}:${g.toFixed(2)} m²` }, { id: p, lon: i.Math.toDegrees(m.longitude), lat: i.Math.toDegrees(m.latitude), height: m.height || 0, theme: "measure-rectangle", show: !0 });
6865
6898
  const y = [
6866
6899
  [a[0], a[1]],
6867
6900
  [a[1], a[2]],
@@ -6909,13 +6942,13 @@ ${f.area}:${p.toFixed(2)} m²` }, { id: m, lon: i.Math.toDegrees(g.longitude), l
6909
6942
  computeRectangle(t, e, i) {
6910
6943
  const n = this.Cesium, s = new n.EllipsoidTangentPlane(t, n.Ellipsoid.WGS84), o = s.projectPointsOntoPlane([t, e, i]);
6911
6944
  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;
6945
+ 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);
6946
+ if (!g) return null;
6947
+ const m = d / g, f = -(u / g), y = m, v = l.x - a.x, w = l.y - a.y, P = v * f + w * y;
6915
6948
  if (!P) return null;
6916
6949
  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
6950
  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(
6951
+ const L = E, M = L[0], x = L[2], I = Math.abs(g), D = Math.abs(P), T = new n.Cartesian3(
6919
6952
  (M.x + x.x) / 2,
6920
6953
  (M.y + x.y) / 2,
6921
6954
  (M.z + x.z) / 2
@@ -6974,10 +7007,10 @@ class Pt {
6974
7007
  const o = i.scene.pickPosition(s.position);
6975
7008
  if (o && (this.positions.push(o), this.positions.length === 2)) {
6976
7009
  this.stop();
6977
- const d = this.positions[0], u = this.positions[1], p = e.Cartesian3.distance(d, u), g = this.buildRegularPolygonPoints(d, p, n);
7010
+ const d = this.positions[0], u = this.positions[1], g = e.Cartesian3.distance(d, u), m = this.buildRegularPolygonPoints(d, g, n);
6978
7011
  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({
6980
- polygonHierarchy: m,
7012
+ const p = new e.PolygonHierarchy(m), f = new e.PolygonGeometry({
7013
+ polygonHierarchy: p,
6981
7014
  vertexFormat: e.MaterialAppearance.VERTEX_FORMAT,
6982
7015
  perPositionHeight: !0,
6983
7016
  arcType: e.ArcType.NONE
@@ -6995,7 +7028,7 @@ class Pt {
6995
7028
  closed: !0
6996
7029
  })
6997
7030
  }), 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({
7031
+ 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 = m.slice(), E = i.entities.add({
6999
7032
  polyline: {
7000
7033
  positions: C,
7001
7034
  width: t.width || 2,
@@ -7010,7 +7043,7 @@ class Pt {
7010
7043
  }
7011
7044
  });
7012
7045
  this.edgeEntities.push(E);
7013
- const L = t.pointColor || v, M = g.slice(0, g.length - 1);
7046
+ const L = t.pointColor || v, M = m.slice(0, m.length - 1);
7014
7047
  for (const k of M) {
7015
7048
  const A = i.entities.add({
7016
7049
  position: k,
@@ -7022,13 +7055,13 @@ class Pt {
7022
7055
  });
7023
7056
  this.pointEntities.push(A);
7024
7057
  }
7025
- const x = this.computeAreaByPlane(g), I = e.Cartographic.fromCartesian(d), D = this.htmlLabelId || `measure_regular_${Date.now()}`;
7058
+ const x = this.computeAreaByPlane(m), I = e.Cartographic.fromCartesian(d), D = this.htmlLabelId || `measure_regular_${Date.now()}`;
7026
7059
  this.htmlLabelId = D;
7027
7060
  const T = t.labelText || { sides: "边数", radius: "半径", circumference: "周长", area: "面积", side: "边长" };
7028
7061
  this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
7029
7062
  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;
7063
+ for (let k = 1; k < m.length; k++) {
7064
+ const A = m[k - 1], $ = m[k], O = e.Cartographic.fromCartesian(A), G = e.Cartographic.fromCartesian($), N = new e.EllipsoidGeodesic(O, G).surfaceDistance;
7032
7065
  S += N;
7033
7066
  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}`;
7034
7067
  this.segmentLabelIds.push(se), this.htmlLabelPool.add(
@@ -7045,7 +7078,7 @@ class Pt {
7045
7078
  }
7046
7079
  this.htmlLabelPool.add(
7047
7080
  { text: `${T.sides}:${n}
7048
- ${T.radius}:${p.toFixed(2)} m
7081
+ ${T.radius}:${g.toFixed(2)} m
7049
7082
  ${T.circumference}:${S.toFixed(2)} m
7050
7083
  ${T.area}:${x.toFixed(2)} m²` },
7051
7084
  {
@@ -7060,8 +7093,8 @@ ${T.area}:${x.toFixed(2)} m²` },
7060
7093
  const _ = {
7061
7094
  entity: this.primitive,
7062
7095
  label: this.labelEntity,
7063
- positions: g,
7064
- radius: p,
7096
+ positions: m,
7097
+ radius: g,
7065
7098
  sides: n,
7066
7099
  perimeter: S,
7067
7100
  area: x,
@@ -7125,19 +7158,19 @@ ${T.area}:${x.toFixed(2)} m²` },
7125
7158
  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
7159
  d += E.surfaceDistance;
7127
7160
  }
7128
- const u = this.computeAreaByPlane(this.currentPoints), p = e.Cartographic.fromCartesian(o), g = this.previewLabelId || "measure_regular_preview";
7129
- this.previewLabelId = g;
7130
- const m = t.labelText || { sides: "边数", radius: "半径", circumference: "周长", area: "面积" };
7161
+ const u = this.computeAreaByPlane(this.currentPoints), g = e.Cartographic.fromCartesian(o), m = this.previewLabelId || "measure_regular_preview";
7162
+ this.previewLabelId = m;
7163
+ const p = t.labelText || { sides: "边数", radius: "半径", circumference: "周长", area: "面积" };
7131
7164
  this.htmlLabelPool.add(
7132
- { text: `${m.sides}:${n}
7133
- ${m.radius}:${l.toFixed(2)} m
7134
- ${m.circumference}:${d.toFixed(2)} m
7135
- ${m.area}:${u.toFixed(2)} m²` },
7165
+ { text: `${p.sides}:${n}
7166
+ ${p.radius}:${l.toFixed(2)} m
7167
+ ${p.circumference}:${d.toFixed(2)} m
7168
+ ${p.area}:${u.toFixed(2)} m²` },
7136
7169
  {
7137
- id: g,
7138
- lon: e.Math.toDegrees(p.longitude),
7139
- lat: e.Math.toDegrees(p.latitude),
7140
- height: p.height || 0,
7170
+ id: m,
7171
+ lon: e.Math.toDegrees(g.longitude),
7172
+ lat: e.Math.toDegrees(g.latitude),
7173
+ height: g.height || 0,
7141
7174
  theme: "measure-regular",
7142
7175
  show: !0
7143
7176
  }
@@ -7207,7 +7240,7 @@ ${m.area}:${u.toFixed(2)} m²` },
7207
7240
  const L = r[1];
7208
7241
  d = i.Cartesian3.distance(l, L), a = this.buildRegularPolygonPoints(l, d, Math.max(o, 3));
7209
7242
  }
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 }) });
7243
+ const u = new i.PolygonHierarchy(a), g = new i.PolygonGeometry({ polygonHierarchy: u, vertexFormat: i.MaterialAppearance.VERTEX_FORMAT, perPositionHeight: !0 }), m = new i.GeometryInstance({ geometry: g }), p = 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: m, appearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: p }), translucent: !0, closed: !0 }), depthFailAppearance: new i.MaterialAppearance({ material: i.Material.fromType("Color", { color: f }), translucent: !0, closed: !0 }) });
7211
7244
  n.scene.primitives.add(y), this.primitive = y;
7212
7245
  const v = this.computeAreaByPlane(a), w = i.Cartographic.fromCartesian(l), P = t.id + "_regular";
7213
7246
  this.htmlLabelId = P;
@@ -7227,8 +7260,8 @@ ${b.area}:${v.toFixed(2)} m²` }, { id: P, lon: i.Math.toDegrees(w.longitude), l
7227
7260
  buildRegularPolygonPoints(t, e, i) {
7228
7261
  const n = this.Cesium, s = new n.EllipsoidTangentPlane(t, n.Ellipsoid.WGS84), o = 2 * Math.PI / i, r = [];
7229
7262
  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));
7263
+ const u = d * o, g = e * Math.cos(u), m = e * Math.sin(u);
7264
+ r.push(new n.Cartesian2(g, m));
7232
7265
  }
7233
7266
  const l = s.projectPointsOntoEllipsoid(r).slice();
7234
7267
  return l.push(l[0]), l;
@@ -7247,7 +7280,7 @@ ${b.area}:${v.toFixed(2)} m²` }, { id: P, lon: i.Math.toDegrees(w.longitude), l
7247
7280
  return Math.abs(o) / 2;
7248
7281
  }
7249
7282
  }
7250
- class Ho {
7283
+ class zo {
7251
7284
  constructor({ Cesium: t, viewer: e }) {
7252
7285
  c(this, "Cesium");
7253
7286
  c(this, "viewer");
@@ -7575,7 +7608,7 @@ class Ho {
7575
7608
  return null;
7576
7609
  }
7577
7610
  }
7578
- class Fo {
7611
+ class No {
7579
7612
  constructor({ Cesium: t, viewer: e }) {
7580
7613
  c(this, "Cesium");
7581
7614
  c(this, "viewer");
@@ -7633,12 +7666,12 @@ class Fo {
7633
7666
  _setupEntities(t) {
7634
7667
  const e = t.waypoints || [], i = new this.Cesium.SampledPositionProperty(), n = new this.Cesium.SampledProperty(this.Cesium.Quaternion), s = [];
7635
7668
  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
7669
  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 });
7670
+ 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));
7671
+ let m;
7672
+ u.orientation ? m = new this.Cesium.HeadingPitchRoll(u.orientation.heading, u.orientation.pitch, u.orientation.roll) : m = this.Cesium.HeadingPitchRoll.fromDegrees(u.heading ?? 0, u.pitch ?? -30, u.roll ?? 0);
7673
+ const p = this.Cesium.Transforms.headingPitchRollQuaternion(g, m);
7674
+ s.push({ position: g, orientation: p });
7642
7675
  }
7643
7676
  const o = this.Cesium.JulianDate.now(), r = t.speed || 100;
7644
7677
  let a = 0;
@@ -7647,8 +7680,8 @@ class Fo {
7647
7680
  if (u === 0)
7648
7681
  l.push(o.clone());
7649
7682
  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()));
7683
+ const m = this.Cesium.Cartesian3.distance(s[u - 1].position, s[u].position) / Math.max(r, 0.1);
7684
+ a += m, l.push(this.Cesium.JulianDate.addSeconds(o, a, new this.Cesium.JulianDate()));
7652
7685
  }
7653
7686
  i.addSample(l[u], s[u].position), n.addSample(l[u], s[u].orientation);
7654
7687
  }
@@ -7672,8 +7705,8 @@ class Fo {
7672
7705
  material: this.Cesium.Color.GREEN
7673
7706
  // clampToGround: false
7674
7707
  }
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);
7708
+ })), this.entity = this.viewer.entities.add(d), t.showStops && s.forEach((u, g) => {
7709
+ const m = this.Cesium.Cartographic.fromCartesian(u.position), p = this.Cesium.Cartesian3.fromRadians(m.longitude, m.latitude, 0);
7677
7710
  this.viewEntities.push(this.viewer.entities.add({
7678
7711
  position: u.position,
7679
7712
  point: {
@@ -7683,7 +7716,7 @@ class Fo {
7683
7716
  outlineWidth: 1
7684
7717
  },
7685
7718
  label: {
7686
- text: "" + (p + 1),
7719
+ text: "" + (g + 1),
7687
7720
  font: "12px sans-serif",
7688
7721
  pixelOffset: new this.Cesium.Cartesian2(0, -15),
7689
7722
  fillColor: this.Cesium.Color.WHITE,
@@ -7692,7 +7725,7 @@ class Fo {
7692
7725
  style: this.Cesium.LabelStyle.FILL_AND_OUTLINE
7693
7726
  },
7694
7727
  polyline: {
7695
- positions: [u.position, m],
7728
+ positions: [u.position, p],
7696
7729
  width: 2,
7697
7730
  material: new this.Cesium.PolylineDashMaterialProperty({
7698
7731
  color: this.Cesium.Color.RED,
@@ -7728,7 +7761,7 @@ class Fo {
7728
7761
  // Legacy/Helper methods compatibility if needed, but we are refactoring.
7729
7762
  // We'll keep minimal interface compliance.
7730
7763
  }
7731
- class zo {
7764
+ class Go {
7732
7765
  constructor({ Cesium: t, viewer: e }) {
7733
7766
  c(this, "Cesium");
7734
7767
  c(this, "viewer");
@@ -7772,10 +7805,10 @@ class zo {
7772
7805
  const e = this.normalizePositions(t.positions || []);
7773
7806
  if (!e.length) return;
7774
7807
  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]);
7808
+ for (let m = 0; m < e.length; m++)
7809
+ s.addSample(n[m], e[m]);
7777
7810
  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 = {
7811
+ 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
7812
  availability: new this.Cesium.TimeIntervalCollection([
7780
7813
  new this.Cesium.TimeInterval({ start: this.startTime, stop: this.stopTime })
7781
7814
  ]),
@@ -7783,12 +7816,12 @@ class zo {
7783
7816
  orientation: o,
7784
7817
  path: r ? { material: a, width: l, leadTime: 0 } : void 0
7785
7818
  };
7786
- t.modelUrl ? p.model = {
7819
+ t.modelUrl ? g.model = {
7787
7820
  uri: t.modelUrl,
7788
7821
  scale: t.modelScale ?? 1,
7789
7822
  minimumPixelSize: 64,
7790
7823
  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({
7824
+ } : 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
7825
  destination: t.initialView.destination,
7793
7826
  orientation: t.initialView.orientation
7794
7827
  }), 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 +7860,25 @@ class zo {
7827
7860
  }
7828
7861
  export {
7829
7862
  Ae as AreaMeasure,
7830
- Io as BufferedHierarchicalAggregator,
7831
- Fo as CameraRoamTool,
7863
+ _o as BufferedHierarchicalAggregator,
7864
+ No as CameraRoamTool,
7832
7865
  wt as CircleMeasure,
7833
7866
  Ct as CoordinateMeasure,
7834
7867
  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,
7868
+ Do as DrawTool,
7869
+ Eo as EditMode,
7870
+ Oo as EntityLayerManager,
7871
+ So as GLTFManage,
7872
+ Mo as GLTFManageEventKey,
7840
7873
  Se as HorizontalMeasure,
7841
7874
  z as HtmlOverlayLabelPool,
7842
7875
  Bt as MarkerEventBus,
7843
7876
  te as MarkerEventKey,
7844
- ko as MaterialManager,
7845
- Ho as MeasurementTool,
7846
- zo as PathRoamTool,
7877
+ Ro as MaterialManager,
7878
+ zo as MeasurementTool,
7879
+ Go as PathRoamTool,
7847
7880
  ke as PolylineDistanceMeasure,
7848
- Oo as PrimitiveManager,
7881
+ Fo as PrimitiveManager,
7849
7882
  bt as RectangleMeasure,
7850
7883
  Pt as RegularPolygonMeasure,
7851
7884
  yt as SpaceMeasure,
@@ -7853,8 +7886,8 @@ export {
7853
7886
  ce as TooltipManager,
7854
7887
  ft as TriangleMeasure,
7855
7888
  gt as VerticalMeasure,
7856
- Ro as convertGeoJsonToEntityData,
7857
- Do as getDynamicImgMaterial,
7858
- Ao as getPolylineFlowMaterialProperty,
7859
- So as getWallMaterial
7889
+ Ho as convertGeoJsonToEntityData,
7890
+ Ao as getDynamicImgMaterial,
7891
+ $o as getPolylineFlowMaterialProperty,
7892
+ ko as getWallMaterial
7860
7893
  };