leiting-bim 2.1.126 → 2.1.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/leiting-bim.es.js +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs +53 -54
- package/plugins/cesium-core/dist/cesium-core.mjs.map +1 -1
- package/plugins/cesium-core/dist/cesium-core.umd.js +5 -5
- package/plugins/cesium-core/dist/cesium-core.umd.js.map +1 -1
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-bubble/index.d.ts +34 -16
- package/plugins/cesium-vue/dist/components/card-content.js +1 -1
- package/plugins/cesium-vue/dist/components/echarts-pro.js +1 -1
- package/plugins/cesium-vue/dist/components/marker-bubble.js +60 -54
- package/plugins/cesium-vue/dist/components/marker-bubble.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-manage.js +323 -307
- package/plugins/cesium-vue/dist/components/marker-manage.js.map +1 -1
- package/plugins/cesium-vue/dist/index-Kqi_S6KA.js +404 -0
- package/plugins/cesium-vue/dist/index-Kqi_S6KA.js.map +1 -0
- package/plugins/cesium-vue/dist/index-McKGafjp.js +45856 -0
- package/plugins/cesium-vue/dist/index-McKGafjp.js.map +1 -0
- package/plugins/cesium-vue/dist/index.js +1 -1
- package/plugins/theme-chalk/dist/theme-chalk.css +1 -0
package/package.json
CHANGED
|
@@ -289,10 +289,10 @@ class Lo {
|
|
|
289
289
|
const S = 1 << Math.min(-x, this.maxRefineLevels), A = y * S, O = w * S;
|
|
290
290
|
for (let _ = 0; _ < S; _++)
|
|
291
291
|
for (let $ = 0; $ < S; $++) {
|
|
292
|
-
const
|
|
293
|
-
if (!l(
|
|
294
|
-
const G = `${p}_${
|
|
295
|
-
i.has(G) || (i.add(G), e(g,
|
|
292
|
+
const F = A + _, z = O + $;
|
|
293
|
+
if (!l(F, z, p)) continue;
|
|
294
|
+
const G = `${p}_${F}_${z}`;
|
|
295
|
+
i.has(G) || (i.add(G), e(g, F, z, u));
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
continue;
|
|
@@ -387,7 +387,7 @@ class Lo {
|
|
|
387
387
|
return i;
|
|
388
388
|
const _ = u == null ? x : x.filter((G) => this._isVisibleAtLevel(G, u));
|
|
389
389
|
if (!_.length) return i;
|
|
390
|
-
const
|
|
390
|
+
const F = ((P = (M = (b = (C = _[0]) == null ? void 0 : C.data) == null ? void 0 : b.billboard) == null ? void 0 : M[0]) == null ? void 0 : P.theme) || this.clusterTheme, z = this.groupByTheme ? `cluster-${o}-${s}-${r}-${I}` : `cluster-${o}-${s}-${r}`;
|
|
391
391
|
this.labelPool.add(
|
|
392
392
|
{
|
|
393
393
|
id: z,
|
|
@@ -402,7 +402,7 @@ class Lo {
|
|
|
402
402
|
lon: T,
|
|
403
403
|
lat: S,
|
|
404
404
|
height: A,
|
|
405
|
-
theme:
|
|
405
|
+
theme: F
|
|
406
406
|
}
|
|
407
407
|
), i++;
|
|
408
408
|
}
|
|
@@ -920,7 +920,7 @@ class Bt {
|
|
|
920
920
|
}
|
|
921
921
|
startDrawing(t) {
|
|
922
922
|
const { Cesium: e, viewer: i } = this;
|
|
923
|
-
this.positions = [], this.tempPoints = [], this.tooltip = new ze(), this.tooltip.show("单击左键添加点,双击左键结束"), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((o) => {
|
|
923
|
+
this.positions = [], this.tempPoints = [], this.entity = null, this.tooltip = new ze(), this.tooltip.show("单击左键添加点,双击左键结束"), this.handler = new e.ScreenSpaceEventHandler(i.canvas), this.handler.setInputAction((o) => {
|
|
924
924
|
var n, l;
|
|
925
925
|
const s = i.scene.pickPosition(o.position);
|
|
926
926
|
if (!s) return;
|
|
@@ -933,19 +933,18 @@ class Bt {
|
|
|
933
933
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
934
934
|
}
|
|
935
935
|
});
|
|
936
|
-
this.tempPoints.push(r), this.entity
|
|
936
|
+
this.tempPoints.push(r), this.entity ? this.entity.polyline.positions = this.positions.slice() : this.entity = i.entities.add({
|
|
937
937
|
polyline: {
|
|
938
|
-
positions:
|
|
938
|
+
positions: this.positions.slice(),
|
|
939
939
|
width: 3,
|
|
940
940
|
material: t.color || e.Color.YELLOW,
|
|
941
|
-
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
942
941
|
depthFailMaterial: ((l = (n = t.color) == null ? void 0 : n.withAlpha) == null ? void 0 : l.call(n, 0.5)) || e.Color.YELLOW.withAlpha(0.5)
|
|
943
942
|
}
|
|
944
|
-
})
|
|
943
|
+
});
|
|
945
944
|
}, e.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction(() => {
|
|
946
945
|
var r, n;
|
|
947
946
|
if (this.stopDrawing(), (r = this.tooltip) == null || r.hide(), this.tooltip = null, this.positions.length < 2) return;
|
|
948
|
-
this.positions.length = this.positions.length - 1;
|
|
947
|
+
this.positions.length = this.positions.length - 1, this.entity && (this.entity.polyline.positions = this.positions.slice());
|
|
949
948
|
const o = this.positions.map((l) => {
|
|
950
949
|
const c = e.Cartographic.fromCartesian(l);
|
|
951
950
|
return {
|
|
@@ -1322,7 +1321,7 @@ function de(a, t) {
|
|
|
1322
1321
|
var e = fi(a, t);
|
|
1323
1322
|
return gi(e) ? e : void 0;
|
|
1324
1323
|
}
|
|
1325
|
-
var
|
|
1324
|
+
var Re = de(ie, "WeakMap"), Ye = Object.create, yi = /* @__PURE__ */ (function() {
|
|
1326
1325
|
function a() {
|
|
1327
1326
|
}
|
|
1328
1327
|
return function(t) {
|
|
@@ -1396,7 +1395,7 @@ var It = Object.prototype, Si = It.hasOwnProperty, Ai = It.propertyIsEnumerable,
|
|
|
1396
1395
|
function Oi() {
|
|
1397
1396
|
return !1;
|
|
1398
1397
|
}
|
|
1399
|
-
var Tt = typeof exports == "object" && exports && !exports.nodeType && exports, Ue = Tt && typeof module == "object" && module && !module.nodeType && module,
|
|
1398
|
+
var Tt = typeof exports == "object" && exports && !exports.nodeType && exports, Ue = Tt && typeof module == "object" && module && !module.nodeType && module, Ri = Ue && Ue.exports === Tt, qe = Ri ? ie.Buffer : void 0, Fi = qe ? qe.isBuffer : void 0, xt = Fi || Oi, ki = "[object Arguments]", Hi = "[object Array]", zi = "[object Boolean]", Ni = "[object Date]", Gi = "[object Error]", Bi = "[object Function]", ji = "[object Map]", Yi = "[object Number]", Vi = "[object Object]", Wi = "[object RegExp]", Ui = "[object Set]", qi = "[object String]", Ki = "[object WeakMap]", Xi = "[object ArrayBuffer]", Ji = "[object DataView]", Qi = "[object Float32Array]", Zi = "[object Float64Array]", es = "[object Int8Array]", ts = "[object Int16Array]", is = "[object Int32Array]", ss = "[object Uint8Array]", rs = "[object Uint8ClampedArray]", os = "[object Uint16Array]", ns = "[object Uint32Array]", H = {};
|
|
1400
1399
|
H[Qi] = H[Zi] = H[es] = H[ts] = H[is] = H[ss] = H[rs] = H[os] = H[ns] = !0;
|
|
1401
1400
|
H[ki] = H[Hi] = H[Xi] = H[zi] = H[Ji] = H[Ni] = H[Gi] = H[Bi] = H[ji] = H[Yi] = H[Vi] = H[Wi] = H[Ui] = H[qi] = H[Ki] = !1;
|
|
1402
1401
|
function as(a) {
|
|
@@ -1504,7 +1503,7 @@ function $s(a) {
|
|
|
1504
1503
|
function Os(a) {
|
|
1505
1504
|
return Se(this.__data__, a) > -1;
|
|
1506
1505
|
}
|
|
1507
|
-
function
|
|
1506
|
+
function Rs(a, t) {
|
|
1508
1507
|
var e = this.__data__, i = Se(e, a);
|
|
1509
1508
|
return i < 0 ? (++this.size, e.push([a, t])) : e[i][1] = t, this;
|
|
1510
1509
|
}
|
|
@@ -1519,9 +1518,9 @@ ae.prototype.clear = _s;
|
|
|
1519
1518
|
ae.prototype.delete = As;
|
|
1520
1519
|
ae.prototype.get = $s;
|
|
1521
1520
|
ae.prototype.has = Os;
|
|
1522
|
-
ae.prototype.set =
|
|
1521
|
+
ae.prototype.set = Rs;
|
|
1523
1522
|
var Le = de(ie, "Map");
|
|
1524
|
-
function
|
|
1523
|
+
function Fs() {
|
|
1525
1524
|
this.size = 0, this.__data__ = {
|
|
1526
1525
|
hash: new he(),
|
|
1527
1526
|
map: new (Le || ae)(),
|
|
@@ -1557,7 +1556,7 @@ function ye(a) {
|
|
|
1557
1556
|
this.set(i[0], i[1]);
|
|
1558
1557
|
}
|
|
1559
1558
|
}
|
|
1560
|
-
ye.prototype.clear =
|
|
1559
|
+
ye.prototype.clear = Fs;
|
|
1561
1560
|
ye.prototype.delete = Hs;
|
|
1562
1561
|
ye.prototype.get = zs;
|
|
1563
1562
|
ye.prototype.has = Ns;
|
|
@@ -1628,8 +1627,8 @@ function sr(a, t, e) {
|
|
|
1628
1627
|
function rr(a) {
|
|
1629
1628
|
return sr(a, ys, ir);
|
|
1630
1629
|
}
|
|
1631
|
-
var
|
|
1632
|
-
(
|
|
1630
|
+
var Fe = de(ie, "DataView"), ke = de(ie, "Promise"), He = de(ie, "Set"), Ze = "[object Map]", or = "[object Object]", et = "[object Promise]", tt = "[object Set]", it = "[object WeakMap]", st = "[object DataView]", nr = ce(Fe), ar = ce(Le), lr = ce(ke), hr = ce(He), cr = ce(Re), ne = Ee;
|
|
1631
|
+
(Fe && ne(new Fe(new ArrayBuffer(1))) != st || Le && ne(new Le()) != Ze || ke && ne(ke.resolve()) != et || He && ne(new He()) != tt || Re && ne(new Re()) != it) && (ne = function(a) {
|
|
1633
1632
|
var t = Ee(a), e = t == or ? a.constructor : void 0, i = e ? ce(e) : "";
|
|
1634
1633
|
if (i)
|
|
1635
1634
|
switch (i) {
|
|
@@ -1673,7 +1672,7 @@ function wr(a, t) {
|
|
|
1673
1672
|
var e = Ge(a.buffer);
|
|
1674
1673
|
return new a.constructor(e, a.byteOffset, a.length);
|
|
1675
1674
|
}
|
|
1676
|
-
var vr = "[object Boolean]", Cr = "[object Date]", br = "[object Map]", Pr = "[object Number]", Lr = "[object RegExp]", Er = "[object Set]", Mr = "[object String]", Ir = "[object Symbol]", Tr = "[object ArrayBuffer]", xr = "[object DataView]", _r = "[object Float32Array]", Dr = "[object Float64Array]", Sr = "[object Int8Array]", Ar = "[object Int16Array]", $r = "[object Int32Array]", Or = "[object Uint8Array]",
|
|
1675
|
+
var vr = "[object Boolean]", Cr = "[object Date]", br = "[object Map]", Pr = "[object Number]", Lr = "[object RegExp]", Er = "[object Set]", Mr = "[object String]", Ir = "[object Symbol]", Tr = "[object ArrayBuffer]", xr = "[object DataView]", _r = "[object Float32Array]", Dr = "[object Float64Array]", Sr = "[object Int8Array]", Ar = "[object Int16Array]", $r = "[object Int32Array]", Or = "[object Uint8Array]", Rr = "[object Uint8ClampedArray]", Fr = "[object Uint16Array]", kr = "[object Uint32Array]";
|
|
1677
1676
|
function Hr(a, t, e) {
|
|
1678
1677
|
var i = a.constructor;
|
|
1679
1678
|
switch (t) {
|
|
@@ -1690,8 +1689,8 @@ function Hr(a, t, e) {
|
|
|
1690
1689
|
case Ar:
|
|
1691
1690
|
case $r:
|
|
1692
1691
|
case Or:
|
|
1693
|
-
case Fr:
|
|
1694
1692
|
case Rr:
|
|
1693
|
+
case Fr:
|
|
1695
1694
|
case kr:
|
|
1696
1695
|
return wr(a);
|
|
1697
1696
|
case br:
|
|
@@ -2357,10 +2356,10 @@ function To(a, t) {
|
|
|
2357
2356
|
return s.freely == "vertical" ? r += "vec4 colorImage = texture(image, vec2(fract(float(" + s.count + ")*st.t " + s.direction + ` time), fract(st.s)));
|
|
2358
2357
|
` : r += "vec4 colorImage = texture(image, vec2(fract(float(" + s.count + ")*st.s " + s.direction + ` time), fract(st.t)));
|
|
2359
2358
|
`, r += `vec4 fragColor;
|
|
2360
|
-
fragColor.rgb = (
|
|
2359
|
+
fragColor.rgb = (color.rgb) / 1.0;
|
|
2361
2360
|
fragColor = czm_gammaCorrect(fragColor);
|
|
2362
|
-
`, r += ` material.diffuse =
|
|
2363
|
-
material.alpha = colorImage.a;
|
|
2361
|
+
`, r += ` material.diffuse = color.rgb;
|
|
2362
|
+
material.alpha = colorImage.a * color.a;
|
|
2364
2363
|
material.emission = fragColor.rgb;
|
|
2365
2364
|
|
|
2366
2365
|
return material;
|
|
@@ -2371,7 +2370,7 @@ function To(a, t) {
|
|
|
2371
2370
|
fabric: {
|
|
2372
2371
|
type: e,
|
|
2373
2372
|
uniforms: {
|
|
2374
|
-
color: new a.Color(1,
|
|
2373
|
+
color: t.color || new a.Color(1, 1, 1, 1),
|
|
2375
2374
|
image: t.image,
|
|
2376
2375
|
time: 0
|
|
2377
2376
|
},
|
|
@@ -3595,16 +3594,16 @@ class ct {
|
|
|
3595
3594
|
(this.positions[0].x + this.positions[1].x) / 2,
|
|
3596
3595
|
(this.positions[0].y + this.positions[1].y) / 2,
|
|
3597
3596
|
(this.positions[0].z + this.positions[1].z) / 2
|
|
3598
|
-
),
|
|
3597
|
+
), F = e.Cartographic.fromCartesian($);
|
|
3599
3598
|
this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
|
|
3600
3599
|
const z = this.htmlLabelId || `measure_vertical_${Date.now()}`;
|
|
3601
3600
|
this.htmlLabelId = z, this.htmlLabelPool.add(
|
|
3602
3601
|
{ text: `${_.toFixed(2)} m` },
|
|
3603
3602
|
{
|
|
3604
3603
|
id: z,
|
|
3605
|
-
lon: e.Math.toDegrees(
|
|
3606
|
-
lat: e.Math.toDegrees(
|
|
3607
|
-
height:
|
|
3604
|
+
lon: e.Math.toDegrees(F.longitude),
|
|
3605
|
+
lat: e.Math.toDegrees(F.latitude),
|
|
3606
|
+
height: F.height || 0,
|
|
3608
3607
|
theme: "measure-vertical",
|
|
3609
3608
|
show: !0,
|
|
3610
3609
|
style: { pointerEvents: "none", userSelect: "none", cursor: "default" }
|
|
@@ -3805,8 +3804,8 @@ class dt {
|
|
|
3805
3804
|
}
|
|
3806
3805
|
});
|
|
3807
3806
|
this.segmentEntities.push(M, P, L);
|
|
3808
|
-
const E = e.Cartesian3.distance(p, v), I = e.Cartesian3.distance(v, y), D = e.Cartesian3.distance(p, y), x = new e.Cartesian3((p.x + v.x) / 2, (p.y + v.y) / 2, (p.z + v.z) / 2), T = new e.Cartesian3((v.x + y.x) / 2, (v.y + y.y) / 2, (v.z + y.z) / 2), S = new e.Cartesian3((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), A = e.Cartographic.fromCartesian(x), O = e.Cartographic.fromCartesian(T), _ = e.Cartographic.fromCartesian(S), $ = "measure_triangle_seg_v",
|
|
3809
|
-
this.segmentLabelIds = [$,
|
|
3807
|
+
const E = e.Cartesian3.distance(p, v), I = e.Cartesian3.distance(v, y), D = e.Cartesian3.distance(p, y), x = new e.Cartesian3((p.x + v.x) / 2, (p.y + v.y) / 2, (p.z + v.z) / 2), T = new e.Cartesian3((v.x + y.x) / 2, (v.y + y.y) / 2, (v.z + y.z) / 2), S = new e.Cartesian3((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), A = e.Cartographic.fromCartesian(x), O = e.Cartographic.fromCartesian(T), _ = e.Cartographic.fromCartesian(S), $ = "measure_triangle_seg_v", F = "measure_triangle_seg_h", z = "measure_triangle_seg_hyp";
|
|
3808
|
+
this.segmentLabelIds = [$, F, z], this.htmlLabelPool.add({ text: `${E.toFixed(2)} m` }, { id: $, 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" } }), this.htmlLabelPool.add({ text: `${I.toFixed(2)} m` }, { id: F, 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: `${D.toFixed(2)} m` }, { id: z, 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" } });
|
|
3810
3809
|
const G = e.Cartesian3.subtract(y, p, new e.Cartesian3()), B = e.Cartesian3.subtract(v, p, new e.Cartesian3()), q = e.Cartesian3.subtract(v, y, new e.Cartesian3()), X = e.Cartesian3.subtract(p, y, new e.Cartesian3()), se = e.Cartesian3.dot(G, B), pe = Math.sqrt(e.Cartesian3.dot(G, G)) * Math.sqrt(e.Cartesian3.dot(B, B)), ue = e.Cartesian3.dot(q, X), ve = Math.sqrt(e.Cartesian3.dot(q, q)) * Math.sqrt(e.Cartesian3.dot(X, X)), j = Math.acos(Math.min(Math.max(se / (pe || 1), -1), 1)), le = Math.acos(Math.min(Math.max(ue / (ve || 1), -1), 1)), ee = e.Cartographic.fromCartesian(p), Y = e.Cartographic.fromCartesian(y), J = "measure_triangle_angle_a", re = "measure_triangle_angle_b";
|
|
3811
3810
|
this.angleLabelIds = [J, re], this.htmlLabelPool.add({ text: `${(j * 180 / Math.PI).toFixed(2)}°` }, { id: J, 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: re, lon: e.Math.toDegrees(Y.longitude), lat: e.Math.toDegrees(Y.latitude), height: Y.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
|
|
3812
3811
|
const me = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), V = Math.min(E, I) * me;
|
|
@@ -3821,7 +3820,7 @@ class dt {
|
|
|
3821
3820
|
v.x + K.x * V,
|
|
3822
3821
|
v.y + K.y * V,
|
|
3823
3822
|
v.z + K.z * V
|
|
3824
|
-
),
|
|
3823
|
+
), R = new e.Cartesian3(
|
|
3825
3824
|
v.x + oe.x * V,
|
|
3826
3825
|
v.y + oe.y * V,
|
|
3827
3826
|
v.z + oe.z * V
|
|
@@ -3838,7 +3837,7 @@ class dt {
|
|
|
3838
3837
|
}
|
|
3839
3838
|
}), Ie = i.entities.add({
|
|
3840
3839
|
polyline: {
|
|
3841
|
-
positions: [
|
|
3840
|
+
positions: [R, U],
|
|
3842
3841
|
width: t.width || 3,
|
|
3843
3842
|
material: C,
|
|
3844
3843
|
depthFailMaterial: new e.PolylineDashMaterialProperty({ color: b, dashLength: 12, dashPattern: 255 })
|
|
@@ -3900,8 +3899,8 @@ class dt {
|
|
|
3900
3899
|
});
|
|
3901
3900
|
this.previewSegmentEntities.push(Y, J, re);
|
|
3902
3901
|
}
|
|
3903
|
-
const f = e.Cartesian3.distance(d, p), v = e.Cartesian3.distance(p, u), C = e.Cartesian3.distance(d, u), b = e.Cartesian3.subtract(u, d, new e.Cartesian3()), M = e.Cartesian3.subtract(p, d, new e.Cartesian3()), P = e.Cartesian3.subtract(p, u, new e.Cartesian3()), L = e.Cartesian3.subtract(d, u, new e.Cartesian3()), E = e.Cartesian3.dot(b, M), I = Math.sqrt(e.Cartesian3.dot(b, b)) * Math.sqrt(e.Cartesian3.dot(M, M)), D = e.Cartesian3.dot(P, L), x = Math.sqrt(e.Cartesian3.dot(P, P)) * Math.sqrt(e.Cartesian3.dot(L, L)), T = Math.acos(Math.min(Math.max(E / (I || 1), -1), 1)), S = Math.acos(Math.min(Math.max(D / (x || 1), -1), 1)), A = new e.Cartesian3((d.x + p.x) / 2, (d.y + p.y) / 2, (d.z + p.z) / 2), O = new e.Cartesian3((p.x + u.x) / 2, (p.y + u.y) / 2, (p.z + u.z) / 2), _ = new e.Cartesian3((d.x + u.x) / 2, (d.y + u.y) / 2, (d.z + u.z) / 2), $ = e.Cartographic.fromCartesian(A),
|
|
3904
|
-
this.segmentLabelIds.length === 0 && (this.segmentLabelIds = [q, X, se]), this.angleLabelIds.length === 0 && (this.angleLabelIds = [pe, ue]), this.htmlLabelPool.add({ text: `${f.toFixed(2)} m` }, { id: q, 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: `${v.toFixed(2)} m` }, { id: X, lon: e.Math.toDegrees(
|
|
3902
|
+
const f = e.Cartesian3.distance(d, p), v = e.Cartesian3.distance(p, u), C = e.Cartesian3.distance(d, u), b = e.Cartesian3.subtract(u, d, new e.Cartesian3()), M = e.Cartesian3.subtract(p, d, new e.Cartesian3()), P = e.Cartesian3.subtract(p, u, new e.Cartesian3()), L = e.Cartesian3.subtract(d, u, new e.Cartesian3()), E = e.Cartesian3.dot(b, M), I = Math.sqrt(e.Cartesian3.dot(b, b)) * Math.sqrt(e.Cartesian3.dot(M, M)), D = e.Cartesian3.dot(P, L), x = Math.sqrt(e.Cartesian3.dot(P, P)) * Math.sqrt(e.Cartesian3.dot(L, L)), T = Math.acos(Math.min(Math.max(E / (I || 1), -1), 1)), S = Math.acos(Math.min(Math.max(D / (x || 1), -1), 1)), A = new e.Cartesian3((d.x + p.x) / 2, (d.y + p.y) / 2, (d.z + p.z) / 2), O = new e.Cartesian3((p.x + u.x) / 2, (p.y + u.y) / 2, (p.z + u.z) / 2), _ = new e.Cartesian3((d.x + u.x) / 2, (d.y + u.y) / 2, (d.z + u.z) / 2), $ = e.Cartographic.fromCartesian(A), F = e.Cartographic.fromCartesian(O), z = e.Cartographic.fromCartesian(_), G = e.Cartographic.fromCartesian(d), B = e.Cartographic.fromCartesian(u), q = "measure_triangle_seg_v", X = "measure_triangle_seg_h", se = "measure_triangle_seg_hyp", pe = "measure_triangle_angle_a", ue = "measure_triangle_angle_b";
|
|
3903
|
+
this.segmentLabelIds.length === 0 && (this.segmentLabelIds = [q, X, se]), this.angleLabelIds.length === 0 && (this.angleLabelIds = [pe, ue]), this.htmlLabelPool.add({ text: `${f.toFixed(2)} m` }, { id: q, 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: `${v.toFixed(2)} m` }, { id: X, lon: e.Math.toDegrees(F.longitude), lat: e.Math.toDegrees(F.latitude), height: F.height || 0, theme: "measure-triangle-seg", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } }), this.htmlLabelPool.add({ text: `${C.toFixed(2)} m` }, { id: se, lon: e.Math.toDegrees(z.longitude), lat: e.Math.toDegrees(z.latitude), height: z.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(G.longitude), lat: e.Math.toDegrees(G.latitude), height: G.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: ue, 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" } });
|
|
3905
3904
|
const ve = Math.max(0.01, Math.min(0.5, t.angleMarkerRatio ?? 0.2)), j = Math.min(f, v) * ve;
|
|
3906
3905
|
if (f > 1e-3 && v > 1e-3) {
|
|
3907
3906
|
const Y = e.Cartesian3.normalize(
|
|
@@ -3957,21 +3956,21 @@ class dt {
|
|
|
3957
3956
|
if (!this.htmlLabelPool) {
|
|
3958
3957
|
const Q = s.overlayContainerId || "html-label-container";
|
|
3959
3958
|
this.htmlLabelPool = e || new N(i, o, Q), this.htmlLabelPool.registerTheme("measure-triangle", {
|
|
3960
|
-
createElement: (
|
|
3959
|
+
createElement: (R, U) => {
|
|
3961
3960
|
var Z;
|
|
3962
|
-
|
|
3961
|
+
R.innerHTML = String(((Z = U == null ? void 0 : U.data) == null ? void 0 : Z.text) || ""), R.style.background = "rgba(0,0,0,0.6)", R.style.color = "#fff", R.style.font = "14px sans-serif", R.style.padding = "4px 6px", R.style.borderRadius = "4px", R.style.whiteSpace = "pre";
|
|
3963
3962
|
},
|
|
3964
3963
|
options: { offset: { x: 0, y: -10 } }
|
|
3965
3964
|
}), this.htmlLabelPool.registerTheme("measure-triangle-seg", {
|
|
3966
|
-
createElement: (
|
|
3965
|
+
createElement: (R, U) => {
|
|
3967
3966
|
var Z;
|
|
3968
|
-
|
|
3967
|
+
R.innerHTML = String(((Z = U == null ? void 0 : U.data) == null ? void 0 : Z.text) || ""), R.style.background = "rgba(0,0,0,0.6)", R.style.color = "#fff", R.style.font = "14px sans-serif", R.style.padding = "4px 6px", R.style.borderRadius = "4px", R.style.whiteSpace = "pre";
|
|
3969
3968
|
},
|
|
3970
3969
|
options: { offset: { x: 0, y: -10 } }
|
|
3971
3970
|
}), this.htmlLabelPool.registerTheme("measure-triangle-angle", {
|
|
3972
|
-
createElement: (
|
|
3971
|
+
createElement: (R, U) => {
|
|
3973
3972
|
var Z;
|
|
3974
|
-
|
|
3973
|
+
R.innerHTML = String(((Z = U == null ? void 0 : U.data) == null ? void 0 : Z.text) || ""), R.style.background = "rgba(0,0,0,0.6)", R.style.color = "#fff", R.style.font = "14px sans-serif", R.style.padding = "4px 6px", R.style.borderRadius = "4px", R.style.whiteSpace = "pre";
|
|
3975
3974
|
},
|
|
3976
3975
|
options: { offset: { x: 0, y: -10 } }
|
|
3977
3976
|
});
|
|
@@ -3990,14 +3989,14 @@ class dt {
|
|
|
3990
3989
|
polyline: { positions: [p, y], width: l, material: r, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: n, dashLength: 12, dashPattern: 255 }) }
|
|
3991
3990
|
});
|
|
3992
3991
|
this.segmentEntities.push(M, P, L);
|
|
3993
|
-
const E = i.Cartesian3.distance(p, b), I = i.Cartesian3.distance(b, y), D = i.Cartesian3.distance(p, y), x = new i.Cartesian3((p.x + b.x) / 2, (p.y + b.y) / 2, (p.z + b.z) / 2), T = new i.Cartesian3((b.x + y.x) / 2, (b.y + y.y) / 2, (b.z + y.z) / 2), S = new i.Cartesian3((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), A = i.Cartographic.fromCartesian(x), O = i.Cartographic.fromCartesian(T), _ = i.Cartographic.fromCartesian(S), $ = t.id + "_tri_v",
|
|
3994
|
-
this.segmentLabelIds = [$,
|
|
3992
|
+
const E = i.Cartesian3.distance(p, b), I = i.Cartesian3.distance(b, y), D = i.Cartesian3.distance(p, y), x = new i.Cartesian3((p.x + b.x) / 2, (p.y + b.y) / 2, (p.z + b.z) / 2), T = new i.Cartesian3((b.x + y.x) / 2, (b.y + y.y) / 2, (b.z + y.z) / 2), S = new i.Cartesian3((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), A = i.Cartographic.fromCartesian(x), O = i.Cartographic.fromCartesian(T), _ = i.Cartographic.fromCartesian(S), $ = t.id + "_tri_v", F = t.id + "_tri_h", z = t.id + "_tri_hyp";
|
|
3993
|
+
this.segmentLabelIds = [$, F, z], this.htmlLabelPool.add({ text: `${E.toFixed(2)} m` }, { id: $, 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" } }), this.htmlLabelPool.add({ text: `${I.toFixed(2)} m` }, { id: F, lon: i.Math.toDegrees(O.longitude), lat: i.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: `${D.toFixed(2)} m` }, { id: z, 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" } });
|
|
3995
3994
|
const G = i.Cartesian3.subtract(y, p, new i.Cartesian3()), B = i.Cartesian3.subtract(b, p, new i.Cartesian3()), q = i.Cartesian3.subtract(b, y, new i.Cartesian3()), X = i.Cartesian3.subtract(p, y, new i.Cartesian3()), se = i.Cartesian3.dot(G, B), pe = Math.sqrt(i.Cartesian3.dot(G, G)) * Math.sqrt(i.Cartesian3.dot(B, B)), ue = i.Cartesian3.dot(q, X), ve = Math.sqrt(i.Cartesian3.dot(q, q)) * Math.sqrt(i.Cartesian3.dot(X, X)), j = Math.acos(Math.min(Math.max(se / (pe || 1), -1), 1)), le = Math.acos(Math.min(Math.max(ue / (ve || 1), -1), 1)), ee = i.Cartographic.fromCartesian(p), Y = i.Cartographic.fromCartesian(y), J = s.labelText || { angle: "角度" }, re = t.id + "_tri_angA", me = t.id + "_tri_angB";
|
|
3996
3995
|
this.angleLabelIds = [re, me], this.htmlLabelPool.add({ text: `${J.angle}:${(j * 180 / Math.PI).toFixed(2)}°` }, { id: re, 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: `${J.angle}:${(le * 180 / Math.PI).toFixed(2)}°` }, { id: me, lon: i.Math.toDegrees(Y.longitude), lat: i.Math.toDegrees(Y.latitude), height: Y.height || 0, theme: "measure-triangle-angle", show: !0, style: { pointerEvents: "none", userSelect: "none", cursor: "default" } });
|
|
3997
3996
|
const V = Math.max(0.01, Math.min(0.5, s.angleMarkerRatio ?? 0.2)), W = Math.min(E, I) * V;
|
|
3998
3997
|
if (E > 1e-3 && I > 1e-3) {
|
|
3999
|
-
const Q = i.Cartesian3.normalize(i.Cartesian3.subtract(p, b, new i.Cartesian3()), new i.Cartesian3()),
|
|
4000
|
-
this.angleMarkerEntities.push(
|
|
3998
|
+
const Q = i.Cartesian3.normalize(i.Cartesian3.subtract(p, b, new i.Cartesian3()), new i.Cartesian3()), R = i.Cartesian3.normalize(i.Cartesian3.subtract(y, b, new i.Cartesian3()), new i.Cartesian3()), U = new i.Cartesian3(b.x + Q.x * W, b.y + Q.y * W, b.z + Q.z * W), Z = new i.Cartesian3(b.x + R.x * W, b.y + R.y * W, b.z + R.z * W), Ie = new i.Cartesian3(b.x + Q.x * W + R.x * W, b.y + Q.y * W + R.y * W, b.z + Q.z * W + R.z * W), Rt = o.entities.add({ polyline: { positions: [U, Ie], width: l, material: r, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: n, dashLength: 12, dashPattern: 255 }) } }), Ft = o.entities.add({ polyline: { positions: [Z, Ie], width: l, material: r, depthFailMaterial: new i.PolylineDashMaterialProperty({ color: n, dashLength: 12, dashPattern: 255 }) } });
|
|
3999
|
+
this.angleMarkerEntities.push(Rt, Ft);
|
|
4001
4000
|
}
|
|
4002
4001
|
}
|
|
4003
4002
|
}
|
|
@@ -4521,8 +4520,8 @@ class ut {
|
|
|
4521
4520
|
for (let M = 0; M < b.length; M++) {
|
|
4522
4521
|
const P = b[(M - 1 + b.length) % b.length], L = b[M], E = b[(M + 1) % b.length], I = P.x - L.x, D = P.y - L.y, x = E.x - L.x, T = E.y - L.y, S = Math.sqrt(I * I + D * D), A = Math.sqrt(x * x + T * T);
|
|
4523
4522
|
if (!S || !A) continue;
|
|
4524
|
-
const O = I / S * (x / A) + D / S * (T / A), _ = Math.acos(Math.min(1, Math.max(-1, O))) * (180 / Math.PI), $ = i.Cartographic.fromCartesian(r[M]),
|
|
4525
|
-
this.angleLabelIds.push(
|
|
4523
|
+
const O = I / S * (x / A) + D / S * (T / A), _ = Math.acos(Math.min(1, Math.max(-1, O))) * (180 / Math.PI), $ = i.Cartographic.fromCartesian(r[M]), F = t.id + `_area_angle_${M}`;
|
|
4524
|
+
this.angleLabelIds.push(F), this.htmlLabelPool.add({ text: `${g.angle}:${_.toFixed(2)} °` }, { id: F, lon: i.Math.toDegrees($.longitude), lat: i.Math.toDegrees($.latitude), height: $.height || 0, theme: "measure-area-angle", show: !0 });
|
|
4526
4525
|
}
|
|
4527
4526
|
}
|
|
4528
4527
|
}
|
|
@@ -5217,7 +5216,7 @@ ${y.area}:${m.toFixed(2)} m²` },
|
|
|
5217
5216
|
[l[3], l[0]]
|
|
5218
5217
|
];
|
|
5219
5218
|
for (let _ = 0; _ < w.length; _++) {
|
|
5220
|
-
const [$,
|
|
5219
|
+
const [$, F] = w[_], z = _ === 0 || _ === 2 ? d : u, G = new e.Cartesian3(($.x + F.x) / 2, ($.y + F.y) / 2, ($.z + F.z) / 2), B = e.Cartographic.fromCartesian(G), q = `measure_rectangle_seg_${Date.now()}_${_}`;
|
|
5221
5220
|
this.segmentLabelIds.push(q), this.htmlLabelPool.add(
|
|
5222
5221
|
{ text: `${y.side}:${Number(z).toFixed(2)} m` },
|
|
5223
5222
|
{
|
|
@@ -5480,8 +5479,8 @@ ${y.area}:${m.toFixed(2)} m²` }, { id: p, lon: i.Math.toDegrees(g.longitude), l
|
|
|
5480
5479
|
), A = new o.EllipsoidTangentPlane(T, o.Ellipsoid.WGS84).projectPointsOntoPlane(L);
|
|
5481
5480
|
let O = 0;
|
|
5482
5481
|
for (let $ = 0; $ < A.length; $++) {
|
|
5483
|
-
const
|
|
5484
|
-
O += A[$].x * A[
|
|
5482
|
+
const F = ($ + 1) % A.length;
|
|
5483
|
+
O += A[$].x * A[F].y - A[F].x * A[$].y;
|
|
5485
5484
|
}
|
|
5486
5485
|
const _ = Math.abs(O) / 2;
|
|
5487
5486
|
return { corners: L, center: T, width: D, height: x, area: _ };
|
|
@@ -5586,7 +5585,7 @@ class vt {
|
|
|
5586
5585
|
this.previewLabelId && this.htmlLabelPool && (this.htmlLabelPool.removeByIds([this.previewLabelId]), this.previewLabelId = null);
|
|
5587
5586
|
let S = 0;
|
|
5588
5587
|
for (let O = 1; O < g.length; O++) {
|
|
5589
|
-
const _ = g[O - 1], $ = g[O],
|
|
5588
|
+
const _ = g[O - 1], $ = g[O], F = e.Cartographic.fromCartesian(_), z = e.Cartographic.fromCartesian($), B = new e.EllipsoidGeodesic(F, z).surfaceDistance;
|
|
5590
5589
|
S += B;
|
|
5591
5590
|
const q = new e.Cartesian3((_.x + $.x) / 2, (_.y + $.y) / 2, (_.z + $.z) / 2), X = e.Cartographic.fromCartesian(q), se = `measure_regular_seg_${Date.now()}_${O - 1}`;
|
|
5592
5591
|
this.segmentLabelIds.push(se), this.htmlLabelPool.add(
|
|
@@ -6286,7 +6285,7 @@ class Oo {
|
|
|
6286
6285
|
// Legacy/Helper methods compatibility if needed, but we are refactoring.
|
|
6287
6286
|
// We'll keep minimal interface compliance.
|
|
6288
6287
|
}
|
|
6289
|
-
class
|
|
6288
|
+
class Ro {
|
|
6290
6289
|
constructor({ Cesium: t, viewer: e }) {
|
|
6291
6290
|
h(this, "Cesium");
|
|
6292
6291
|
h(this, "viewer");
|
|
@@ -6401,7 +6400,7 @@ export {
|
|
|
6401
6400
|
te as MarkerEventKey,
|
|
6402
6401
|
_o as MaterialManager,
|
|
6403
6402
|
$o as MeasurementTool,
|
|
6404
|
-
|
|
6403
|
+
Ro as PathRoamTool,
|
|
6405
6404
|
gt as PolylineDistanceMeasure,
|
|
6406
6405
|
Ao as PrimitiveManager,
|
|
6407
6406
|
wt as RectangleMeasure,
|