cesium-pocket 0.7.2-alpha → 0.7.4-alpha
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/{CircleDrawer-D2dAuEcD.js → CircleDrawer-CF3y41Db.js} +200 -139
- package/analysis.js +5 -0
- package/czml.d.ts +1 -1
- package/czml.js +319 -0
- package/drawer.js +1 -1
- package/gauger.js +1 -1
- package/index.css +1 -1
- package/index.js +842 -1043
- package/package.json +1 -1
- package/{polygonSolid-DpagI6AO.js → polygonSolid-CiAmYON1.js} +157 -138
- package/src/drawer/CP2dDrawer.d.ts +6 -0
- package/src/drawer/DataCenter.d.ts +12 -0
- package/src/drawer/RectDrawer.d.ts +8 -2
- package/src/gauger/util.d.ts +24 -0
- package/submerger-Bqh-bzY0.js +294 -0
- package/src/drawer/util.d.ts +0 -9
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { Cartographic as D, EllipsoidGeodesic as
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
1
|
+
import { Cartographic as D, EllipsoidGeodesic as J, Cartesian3 as d, BoundingSphere as Q, Transforms as _, Matrix4 as B, CustomDataSource as x, ConstantPositionProperty as b, ConstantProperty as u, Color as h, Cartesian2 as C, VerticalOrigin as v, HorizontalOrigin as P, LabelStyle as L, Math as U, ScreenSpaceEventHandler as j, ScreenSpaceEventType as y, Primitive as q, PerInstanceColorAppearance as V, GeometryInstance as $, ColorGeometryInstanceAttribute as tt, EllipseGeometry as et, ArcType as it, PolygonHierarchy as z } from "cesium";
|
|
2
|
+
import { a as st, R as at, P as rt, D as O, C as Z, b as nt } from "./CircleDrawer-CF3y41Db.js";
|
|
3
|
+
import { toRaw as X } from "vue";
|
|
4
|
+
const k = (l) => X(l), N = (l) => {
|
|
5
|
+
const t = X(l);
|
|
6
|
+
return new d(t.x, t.y, t.z);
|
|
7
|
+
}, m = (l, t) => {
|
|
4
8
|
const r = D.fromCartesian(l), i = D.fromCartesian(t);
|
|
5
|
-
return new
|
|
6
|
-
},
|
|
7
|
-
const r = new
|
|
8
|
-
return
|
|
9
|
+
return new J(r, i).surfaceDistance;
|
|
10
|
+
}, R = (l, t) => {
|
|
11
|
+
const r = new d();
|
|
12
|
+
return d.add(l, t, r), d.divideByScalar(r, 2, r), r;
|
|
9
13
|
}, f = (l) => {
|
|
10
14
|
let t = "";
|
|
11
15
|
return l > 1e3 * 100 ? t = (l / 1e3).toFixed(0) + " 公里" : l > 1e3 ? t = (l / 1e3).toFixed(2) + " 公里" : t = l.toFixed(2) + " 米", t;
|
|
@@ -15,15 +19,15 @@ const m = (l, t) => {
|
|
|
15
19
|
const e = l.length;
|
|
16
20
|
return l.forEach((a) => {
|
|
17
21
|
t += a.x, r += a.y, i += a.z;
|
|
18
|
-
}), new
|
|
22
|
+
}), new d(
|
|
19
23
|
t / e,
|
|
20
24
|
r / e,
|
|
21
25
|
i / e
|
|
22
26
|
);
|
|
23
|
-
},
|
|
27
|
+
}, lt = (l) => l.reduce((r, i) => r + D.fromCartesian(i).height, 0) / l.length, Y = (l) => {
|
|
24
28
|
if (l.length < 3) return 0;
|
|
25
|
-
const r =
|
|
26
|
-
(n) => B.multiplyByPoint(e, n, new
|
|
29
|
+
const r = Q.fromPoints(l).center, i = _.eastNorthUpToFixedFrame(r), e = B.inverse(i, new B()), s = l.map(
|
|
30
|
+
(n) => B.multiplyByPoint(e, n, new d())
|
|
27
31
|
);
|
|
28
32
|
let a = 0;
|
|
29
33
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -31,11 +35,14 @@ const m = (l, t) => {
|
|
|
31
35
|
a += s[n].x * s[o].y, a -= s[o].x * s[n].y;
|
|
32
36
|
}
|
|
33
37
|
return Math.abs(a / 2);
|
|
34
|
-
},
|
|
38
|
+
}, G = (l) => {
|
|
35
39
|
let t = "";
|
|
36
40
|
return l > 1e3 * 1e3 * 1e3 ? t = (l / 1e3 / 1e3 / 1e4).toFixed(2) + "万平方公里" : l > 1e3 * 100 ? t = (l / 1e3 / 1e3).toFixed(2) + "平方公里" : t = l.toFixed(0) + "平方米", t;
|
|
37
|
-
},
|
|
38
|
-
|
|
41
|
+
}, T = (l) => G(Y(l)), ot = (l, t) => Math.max(0, l) * Math.max(0, t), ht = (l) => {
|
|
42
|
+
let t = "0米";
|
|
43
|
+
return l >= 1e12 ? t = (l / 1e13).toFixed(2) + "万立方公里" : l >= 1e7 ? t = (l / 1e9).toFixed(2) + "立方公里" : t = l.toFixed(2) + "立方米", t;
|
|
44
|
+
};
|
|
45
|
+
class Dt {
|
|
39
46
|
constructor(t, r) {
|
|
40
47
|
this.tmpDistanceLabel = null, this.tmpAreaLabel = null, this.distanceLabel = null, this.areaLabel = null, this.dataSource = new x("gagugerDataSource"), this.assistDataSource = new x("assistDataSource"), this.circleEditFun = (i, e) => {
|
|
41
48
|
let s = 0;
|
|
@@ -45,7 +52,7 @@ class dt {
|
|
|
45
52
|
this.distanceLabel.position = new b(e), this.distanceLabel.label && (this.distanceLabel.label.text = new u(a));
|
|
46
53
|
}
|
|
47
54
|
if (this.areaLabel) {
|
|
48
|
-
const a = window.Math.PI * s * s, n = "面积:" +
|
|
55
|
+
const a = window.Math.PI * s * s, n = "面积:" + G(a);
|
|
49
56
|
this.areaLabel.position = new b(i), this.areaLabel.label && (this.areaLabel.label.text = new u(n));
|
|
50
57
|
}
|
|
51
58
|
}, this.circleMovingFun = (i, e) => {
|
|
@@ -56,12 +63,12 @@ class dt {
|
|
|
56
63
|
this.tmpDistanceLabel.show = !0, this.tmpDistanceLabel.position = new b(e), this.tmpDistanceLabel.label && (this.tmpDistanceLabel.label.text = new u(a));
|
|
57
64
|
}
|
|
58
65
|
if (this.tmpAreaLabel) {
|
|
59
|
-
const a = window.Math.PI * s * s, n = "面积:" +
|
|
66
|
+
const a = window.Math.PI * s * s, n = "面积:" + G(a);
|
|
60
67
|
this.tmpAreaLabel.position = new b(i), this.tmpAreaLabel.label && (this.tmpAreaLabel.label.text = new u(n));
|
|
61
68
|
}
|
|
62
69
|
}, this.circleOverFun = (i, e) => {
|
|
63
70
|
this.tmpDistanceLabel.show = !1, this.tmpAreaLabel.show = !1;
|
|
64
|
-
const s = this.createTextLabel(new
|
|
71
|
+
const s = this.createTextLabel(new d(), "", h.DARKRED), a = this.createTextLabel(new d(), "", h.BLACK);
|
|
65
72
|
this.distanceLabel = this.assistDataSource.entities.add(s), this.areaLabel = this.assistDataSource.entities.add(a), this.circleEditFun(i, e);
|
|
66
73
|
}, this.createTextLabel = (i, e, s = h.DARKRED, a = -20) => {
|
|
67
74
|
const n = {
|
|
@@ -70,9 +77,9 @@ class dt {
|
|
|
70
77
|
fillColor: h.WHITE,
|
|
71
78
|
showBackground: !0,
|
|
72
79
|
backgroundColor: s,
|
|
73
|
-
style:
|
|
80
|
+
style: L.FILL_AND_OUTLINE,
|
|
74
81
|
horizontalOrigin: P.CENTER,
|
|
75
|
-
verticalOrigin:
|
|
82
|
+
verticalOrigin: v.CENTER,
|
|
76
83
|
pixelOffset: new C(0, a),
|
|
77
84
|
//偏移量
|
|
78
85
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
@@ -86,7 +93,7 @@ class dt {
|
|
|
86
93
|
start() {
|
|
87
94
|
var i;
|
|
88
95
|
(i = this.circleDrawer) == null || i.start();
|
|
89
|
-
const t = this.createTextLabel(new
|
|
96
|
+
const t = this.createTextLabel(new d(), "", h.DARKRED.withAlpha(0.6)), r = this.createTextLabel(new d(), "", h.BLACK.withAlpha(0.6));
|
|
90
97
|
this.tmpDistanceLabel = this.assistDataSource.entities.add(t), this.tmpAreaLabel = this.assistDataSource.entities.add(r);
|
|
91
98
|
}
|
|
92
99
|
getStatus() {
|
|
@@ -107,24 +114,24 @@ class dt {
|
|
|
107
114
|
circleMovingFun: this.circleMovingFun,
|
|
108
115
|
circleOverFun: this.circleOverFun
|
|
109
116
|
}, ...t };
|
|
110
|
-
this.circleDrawer = new
|
|
117
|
+
this.circleDrawer = new st(this.viewer, i);
|
|
111
118
|
}
|
|
112
119
|
}
|
|
113
|
-
class
|
|
120
|
+
class ft {
|
|
114
121
|
constructor(t, r) {
|
|
115
122
|
this.tmpLabel = null, this.totalLabel = null, this.dataSource = new x("gagugerDataSource"), this.assistDataSource = new x("assistDataSource"), this.rectEditFun = (i) => {
|
|
116
123
|
if (this.totalLabel) {
|
|
117
|
-
const e = A(i), s = "面积:" +
|
|
124
|
+
const e = A(i), s = "面积:" + T(i);
|
|
118
125
|
e && (this.totalLabel.show = !0, this.totalLabel.position = new b(e), this.totalLabel.label && (this.totalLabel.label.text = new u(s)));
|
|
119
126
|
}
|
|
120
127
|
}, this.rectMovingFun = (i) => {
|
|
121
128
|
if (this.tmpLabel) {
|
|
122
|
-
const e = A(i), s = "面积:" +
|
|
129
|
+
const e = A(i), s = "面积:" + T(i);
|
|
123
130
|
e && (this.tmpLabel.show = !0, this.tmpLabel.position = new b(e), this.tmpLabel.label && (this.tmpLabel.label.text = new u(s)));
|
|
124
131
|
}
|
|
125
132
|
}, this.rectOverFun = (i) => {
|
|
126
133
|
if (this.tmpLabel && (this.tmpLabel.show = !1), !this.totalLabel) {
|
|
127
|
-
const e = A(i), s = "面积:" +
|
|
134
|
+
const e = A(i), s = "面积:" + T(i);
|
|
128
135
|
if (e) {
|
|
129
136
|
const a = this.createTextlabel(e, s, h.BLACK);
|
|
130
137
|
this.totalLabel = this.assistDataSource.entities.add(a);
|
|
@@ -137,9 +144,9 @@ class wt {
|
|
|
137
144
|
fillColor: h.WHITE,
|
|
138
145
|
showBackground: !0,
|
|
139
146
|
backgroundColor: s,
|
|
140
|
-
style:
|
|
147
|
+
style: L.FILL_AND_OUTLINE,
|
|
141
148
|
horizontalOrigin: P.CENTER,
|
|
142
|
-
verticalOrigin:
|
|
149
|
+
verticalOrigin: v.CENTER,
|
|
143
150
|
pixelOffset: new C(0, a),
|
|
144
151
|
//偏移量
|
|
145
152
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
@@ -150,16 +157,16 @@ class wt {
|
|
|
150
157
|
};
|
|
151
158
|
}, this.createTmplabel = () => {
|
|
152
159
|
let e = {
|
|
153
|
-
position: new
|
|
160
|
+
position: new d(),
|
|
154
161
|
label: {
|
|
155
162
|
text: "",
|
|
156
163
|
font: "12px sans-serif bold",
|
|
157
164
|
fillColor: h.WHITE,
|
|
158
165
|
showBackground: !0,
|
|
159
166
|
backgroundColor: h.BLACK.withAlpha(0.6),
|
|
160
|
-
style:
|
|
167
|
+
style: L.FILL_AND_OUTLINE,
|
|
161
168
|
horizontalOrigin: P.LEFT,
|
|
162
|
-
verticalOrigin:
|
|
169
|
+
verticalOrigin: v.BOTTOM,
|
|
163
170
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
164
171
|
},
|
|
165
172
|
show: !1
|
|
@@ -189,11 +196,11 @@ class wt {
|
|
|
189
196
|
rectMovingFun: this.rectMovingFun,
|
|
190
197
|
rectOverFun: this.rectOverFun
|
|
191
198
|
}, ...t };
|
|
192
|
-
this.rectDrawer = new
|
|
199
|
+
this.rectDrawer = new at(this.viewer, i);
|
|
193
200
|
}
|
|
194
201
|
}
|
|
195
|
-
const
|
|
196
|
-
class
|
|
202
|
+
const ct = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAMgCAYAAABYroDnAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnM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Pq101+dYvmNF+TreV5mVqitz9hMbaWSuFd1e68k2bj4vUf8Utw9Qt3Y7mdZ36ofHqbScTj3DiSVB76X+4n+V6R8BBgDKRo2v+bLvIgAAAABJRU5ErkJggg==";
|
|
203
|
+
class mt {
|
|
197
204
|
constructor(t, r) {
|
|
198
205
|
this.editCallback = (i, e) => {
|
|
199
206
|
const s = this.getLonLatStr(i);
|
|
@@ -205,7 +212,7 @@ class pt {
|
|
|
205
212
|
label: {
|
|
206
213
|
text: e,
|
|
207
214
|
font: "500 14px Helvetica",
|
|
208
|
-
style:
|
|
215
|
+
style: L.FILL,
|
|
209
216
|
fillColor: h.WHITE,
|
|
210
217
|
outlineColor: h.BLACK,
|
|
211
218
|
pixelOffset: new C(0, -90),
|
|
@@ -215,11 +222,11 @@ class pt {
|
|
|
215
222
|
horizontalOrigin: P.LEFT
|
|
216
223
|
},
|
|
217
224
|
billboard: {
|
|
218
|
-
image:
|
|
225
|
+
image: ct,
|
|
219
226
|
width: 30,
|
|
220
227
|
height: 100,
|
|
221
228
|
scale: 1,
|
|
222
|
-
verticalOrigin:
|
|
229
|
+
verticalOrigin: v.BOTTOM
|
|
223
230
|
},
|
|
224
231
|
show: !0
|
|
225
232
|
});
|
|
@@ -254,26 +261,26 @@ class pt {
|
|
|
254
261
|
addPointFun: this.addPointFun,
|
|
255
262
|
editPointFun: this.editPointFun
|
|
256
263
|
};
|
|
257
|
-
this.delConfirmFun && (t.delConfirmFun = this.delConfirmFun), this.pointDrawer = new
|
|
264
|
+
this.delConfirmFun && (t.delConfirmFun = this.delConfirmFun), this.pointDrawer = new rt(this.viewer, t);
|
|
258
265
|
}
|
|
259
266
|
getLonLatStr(t) {
|
|
260
|
-
const r = D.fromCartesian(t), i =
|
|
267
|
+
const r = D.fromCartesian(t), i = U.toDegrees(r.longitude), e = U.toDegrees(r.latitude);
|
|
261
268
|
return `${i.toFixed(2)}, ${e.toFixed(2)}`;
|
|
262
269
|
}
|
|
263
270
|
}
|
|
264
|
-
class
|
|
271
|
+
class At {
|
|
265
272
|
constructor(t, r) {
|
|
266
273
|
this.tmpLabel = null, this.totalLabel = null, this.itemDisSource = new x("itemDisDataSource"), this.totalDisSource = new x("totalDisSource"), this.afterAddPointFun = (i) => {
|
|
267
274
|
var e, s, a;
|
|
268
|
-
if (((e = this.lineDrawer) == null ? void 0 : e.getStatus()) ==
|
|
275
|
+
if (((e = this.lineDrawer) == null ? void 0 : e.getStatus()) == O.DRAWABLE) {
|
|
269
276
|
const n = (s = i.position) == null ? void 0 : s.getValue(), o = this.lineDrawer.getPositions();
|
|
270
|
-
let
|
|
271
|
-
if (
|
|
272
|
-
const
|
|
273
|
-
let g = this.createTextlabel(
|
|
277
|
+
let w = o.length;
|
|
278
|
+
if (w > 1) {
|
|
279
|
+
const c = R(o[w - 2], n), E = m(o[w - 2], n), p = f(E);
|
|
280
|
+
let g = this.createTextlabel(c, p);
|
|
274
281
|
this.itemDisSource.entities.add(g);
|
|
275
282
|
}
|
|
276
|
-
} else ((a = this.lineDrawer) == null ? void 0 : a.getStatus()) ==
|
|
283
|
+
} else ((a = this.lineDrawer) == null ? void 0 : a.getStatus()) == O.EDITABLE && this.reCreateAll();
|
|
277
284
|
}, this.movingCallbackFun = (i) => {
|
|
278
285
|
if (this.tmpLabel) {
|
|
279
286
|
const e = this.lineDrawer.getPositions(), s = e[e.length - 1];
|
|
@@ -282,38 +289,38 @@ class bt {
|
|
|
282
289
|
}
|
|
283
290
|
}, this.editCallbackFun = (i, e) => {
|
|
284
291
|
const s = this.lineDrawer.getPositions();
|
|
285
|
-
let a = -1, n = -1, o = 0,
|
|
292
|
+
let a = -1, n = -1, o = 0, w = 0;
|
|
286
293
|
if (e > 0) {
|
|
287
294
|
a = e;
|
|
288
|
-
const
|
|
295
|
+
const p = this.itemDisSource.entities.values[e - 1], g = s[e - 1], S = R(g, i);
|
|
289
296
|
o = m(g, i);
|
|
290
297
|
const F = f(o);
|
|
291
|
-
|
|
298
|
+
p.position = new b(S), p.label.text = new u(F);
|
|
292
299
|
}
|
|
293
300
|
if (e < s.length - 1) {
|
|
294
301
|
n = e + 1;
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
const F = f(
|
|
298
|
-
|
|
302
|
+
const p = this.itemDisSource.entities.values[e], g = s[e + 1], S = R(i, g);
|
|
303
|
+
w = m(i, g);
|
|
304
|
+
const F = f(w);
|
|
305
|
+
p.position = new b(S), p.label.text = new u(F);
|
|
299
306
|
}
|
|
300
307
|
e == s.length - 1 && this.totalLabel && (this.totalLabel.position = new b(i));
|
|
301
|
-
let
|
|
302
|
-
for (let
|
|
303
|
-
if (a ==
|
|
308
|
+
let c = 0;
|
|
309
|
+
for (let p = 1, g = s.length; p < g; p++) {
|
|
310
|
+
if (a == p || n == p)
|
|
304
311
|
continue;
|
|
305
|
-
const S = s[
|
|
306
|
-
|
|
312
|
+
const S = s[p - 1], F = s[p], K = m(S, F);
|
|
313
|
+
c += K;
|
|
307
314
|
}
|
|
308
|
-
|
|
309
|
-
let E = "共:" + f(
|
|
315
|
+
c += o, c += w;
|
|
316
|
+
let E = "共:" + f(c);
|
|
310
317
|
this.totalLabel && (this.totalLabel.label.text = new u(E));
|
|
311
318
|
}, this.stopDrawCallbackFun = () => {
|
|
312
319
|
if (this.tmpLabel && (this.tmpLabel.show = !1), !this.totalLabel) {
|
|
313
320
|
const i = this.lineDrawer.getPositions();
|
|
314
321
|
let e = 0, s = i.length;
|
|
315
322
|
for (let o = 1; o < s; o++) {
|
|
316
|
-
const
|
|
323
|
+
const w = i[o - 1], c = i[o], E = m(w, c);
|
|
317
324
|
e += E;
|
|
318
325
|
}
|
|
319
326
|
let a = "共:" + f(e), n = this.createTextlabel(i[s - 1], a, h.BLACK, -20);
|
|
@@ -326,9 +333,9 @@ class bt {
|
|
|
326
333
|
fillColor: h.WHITE,
|
|
327
334
|
showBackground: !0,
|
|
328
335
|
backgroundColor: s,
|
|
329
|
-
style:
|
|
336
|
+
style: L.FILL_AND_OUTLINE,
|
|
330
337
|
horizontalOrigin: P.CENTER,
|
|
331
|
-
verticalOrigin:
|
|
338
|
+
verticalOrigin: v.CENTER,
|
|
332
339
|
pixelOffset: new C(0, a),
|
|
333
340
|
//偏移量
|
|
334
341
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
@@ -342,9 +349,9 @@ class bt {
|
|
|
342
349
|
const i = this.lineDrawer.getPositions();
|
|
343
350
|
let e = 0, s = i.length;
|
|
344
351
|
for (let o = 1; o < s; o++) {
|
|
345
|
-
const
|
|
346
|
-
e +=
|
|
347
|
-
let g = f(
|
|
352
|
+
const w = i[o - 1], c = i[o], E = R(w, c), p = m(w, c);
|
|
353
|
+
e += p;
|
|
354
|
+
let g = f(p), S = this.createTextlabel(E, g);
|
|
348
355
|
this.itemDisSource.entities.add(S);
|
|
349
356
|
}
|
|
350
357
|
let a = "共:" + f(e), n = this.createTextlabel(i[s - 1], a, h.BLACK, -20);
|
|
@@ -398,27 +405,27 @@ class bt {
|
|
|
398
405
|
stopDrawCallbackFun: this.stopDrawCallbackFun,
|
|
399
406
|
delCallbackFun: this.reCreateAll
|
|
400
407
|
}, ...t };
|
|
401
|
-
this.lineDrawer = new
|
|
408
|
+
this.lineDrawer = new Z(this.viewer, i);
|
|
402
409
|
}
|
|
403
410
|
}
|
|
404
|
-
class
|
|
411
|
+
class Ct {
|
|
405
412
|
constructor(t, r) {
|
|
406
413
|
this.tmpLabel = null, this.totalLabel = null, this.openTmpLabel = !1, this.dataSource = new x("gagugerDataSource"), this.assistDataSource = new x("totalAreaDataSource"), this.afterAddPointFun = () => {
|
|
407
414
|
var i, e;
|
|
408
|
-
((i = this.polygonDrawer) == null ? void 0 : i.getStatus()) ==
|
|
415
|
+
((i = this.polygonDrawer) == null ? void 0 : i.getStatus()) == O.DRAWABLE ? this.polygonDrawer.getPositions().length > 1 && (this.openTmpLabel = !0) : ((e = this.polygonDrawer) == null ? void 0 : e.getStatus()) == O.EDITABLE && this.reCreateAll();
|
|
409
416
|
}, this.movingCallbackFun = (i) => {
|
|
410
417
|
if (this.openTmpLabel && this.tmpLabel) {
|
|
411
|
-
const s = [...this.polygonDrawer.getPositions(), i], a = A(s), n = "面积:" +
|
|
418
|
+
const s = [...this.polygonDrawer.getPositions(), i], a = A(s), n = "面积:" + T(s);
|
|
412
419
|
a && (this.tmpLabel.show = !0, this.tmpLabel.position = new b(a), this.tmpLabel.label && (this.tmpLabel.label.text = new u(n)));
|
|
413
420
|
}
|
|
414
421
|
}, this.editCallbackFun = (i) => {
|
|
415
422
|
if (this.openTmpLabel && this.totalLabel) {
|
|
416
|
-
const s = [...this.polygonDrawer.getPositions(), i], a = A(s), n = "面积:" +
|
|
423
|
+
const s = [...this.polygonDrawer.getPositions(), i], a = A(s), n = "面积:" + T(s);
|
|
417
424
|
a && (this.totalLabel.show = !0, this.totalLabel.position = new b(a), this.totalLabel.label && (this.totalLabel.label.text = new u(n)));
|
|
418
425
|
}
|
|
419
426
|
}, this.stopDrawCallbackFun = () => {
|
|
420
427
|
if (this.tmpLabel && (this.tmpLabel.show = !1), !this.totalLabel) {
|
|
421
|
-
const i = this.polygonDrawer.getPositions(), e = A(i), s = "面积:" +
|
|
428
|
+
const i = this.polygonDrawer.getPositions(), e = A(i), s = "面积:" + T(i);
|
|
422
429
|
if (e) {
|
|
423
430
|
const a = this.createTextlabel(e, s, h.BLACK);
|
|
424
431
|
this.totalLabel = this.assistDataSource.entities.add(a);
|
|
@@ -431,9 +438,9 @@ class gt {
|
|
|
431
438
|
fillColor: h.WHITE,
|
|
432
439
|
showBackground: !0,
|
|
433
440
|
backgroundColor: s,
|
|
434
|
-
style:
|
|
441
|
+
style: L.FILL_AND_OUTLINE,
|
|
435
442
|
horizontalOrigin: P.CENTER,
|
|
436
|
-
verticalOrigin:
|
|
443
|
+
verticalOrigin: v.CENTER,
|
|
437
444
|
pixelOffset: new C(0, a),
|
|
438
445
|
//偏移量
|
|
439
446
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
@@ -444,16 +451,16 @@ class gt {
|
|
|
444
451
|
};
|
|
445
452
|
}, this.createTmplabel = () => {
|
|
446
453
|
let e = {
|
|
447
|
-
position: new
|
|
454
|
+
position: new d(),
|
|
448
455
|
label: {
|
|
449
456
|
text: "",
|
|
450
457
|
font: "12px sans-serif bold",
|
|
451
458
|
fillColor: h.WHITE,
|
|
452
459
|
showBackground: !0,
|
|
453
460
|
backgroundColor: h.BLACK.withAlpha(0.6),
|
|
454
|
-
style:
|
|
461
|
+
style: L.FILL_AND_OUTLINE,
|
|
455
462
|
horizontalOrigin: P.CENTER,
|
|
456
|
-
verticalOrigin:
|
|
463
|
+
verticalOrigin: v.CENTER,
|
|
457
464
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
458
465
|
},
|
|
459
466
|
show: !1
|
|
@@ -461,7 +468,7 @@ class gt {
|
|
|
461
468
|
return this.assistDataSource.entities.add(e);
|
|
462
469
|
}, this.reCreateAll = () => {
|
|
463
470
|
this.dataSource.entities.removeAll(), this.assistDataSource.entities.removeAll();
|
|
464
|
-
const i = this.polygonDrawer.getPositions(), e = A(i), s =
|
|
471
|
+
const i = this.polygonDrawer.getPositions(), e = A(i), s = T(i);
|
|
465
472
|
if (e) {
|
|
466
473
|
const a = this.createTextlabel(e, s, h.BLACK);
|
|
467
474
|
this.totalLabel = this.assistDataSource.entities.add(a);
|
|
@@ -490,32 +497,32 @@ class gt {
|
|
|
490
497
|
}
|
|
491
498
|
init(t) {
|
|
492
499
|
let i = { ...{
|
|
493
|
-
drawerMode:
|
|
500
|
+
drawerMode: nt.POLYGON,
|
|
494
501
|
afterAddPointFun: this.afterAddPointFun,
|
|
495
502
|
movingCallbackFun: this.movingCallbackFun,
|
|
496
503
|
editCallbackFun: this.editCallbackFun,
|
|
497
504
|
stopDrawCallbackFun: this.stopDrawCallbackFun,
|
|
498
505
|
delCallbackFun: this.reCreateAll
|
|
499
506
|
}, ...t };
|
|
500
|
-
this.polygonDrawer = new
|
|
507
|
+
this.polygonDrawer = new Z(this.viewer, i);
|
|
501
508
|
}
|
|
502
509
|
}
|
|
503
|
-
let I = null,
|
|
504
|
-
const
|
|
510
|
+
let I = null, ut = 0;
|
|
511
|
+
const dt = 0.8, wt = (l) => l >= 1e3 ? `${(l / 1e3).toFixed(2)} km` : `${l.toFixed(2)} m`, W = (l, t, r, i) => {
|
|
505
512
|
const e = D.fromCartesian(l);
|
|
506
|
-
return
|
|
513
|
+
return d.fromRadians(e.longitude, e.latitude, t + r, void 0, i);
|
|
507
514
|
};
|
|
508
|
-
class
|
|
515
|
+
class vt {
|
|
509
516
|
constructor(t, r) {
|
|
510
517
|
this.records = /* @__PURE__ */ new Map(), this.drag = null, this.placing = !1, this.suppressClick = !1, this.cameraHeld = !1, this.destroyed = !1, this.lastPosition = { x: 0, y: 0 }, this.applyExtrude = (e, s) => {
|
|
511
518
|
const a = Math.max(0, s);
|
|
512
|
-
e.extrude = a,
|
|
519
|
+
e.extrude = a, W(e.base, e.baseHeight, a, e.top), W(e.base, e.baseHeight, a + dt, e.tip), d.subtract(e.tip, e.base, e.translation), e.disk.modelMatrix = B.fromTranslation(e.translation, e.modelMatrix);
|
|
513
520
|
const n = a > 0.05;
|
|
514
521
|
e.line.polyline.positions = new u([e.base, e.top]), e.line.show = n, e.label.position = new b(e.top), e.label.show = n;
|
|
515
|
-
const o = `高差:${
|
|
522
|
+
const o = `高差:${wt(a)}`;
|
|
516
523
|
o !== e.labelText && (e.labelText = o, e.label.label.text = new u(o)), this.viewer.isDestroyed() || this.viewer.scene.requestRender();
|
|
517
524
|
}, this.metersPerPixel = (e) => {
|
|
518
|
-
const s = Math.max(
|
|
525
|
+
const s = Math.max(d.distance(this.viewer.camera.positionWC, e), 1), n = this.viewer.camera.frustum.fovy ?? Math.PI / 3;
|
|
519
526
|
return 2 * s * Math.tan(n / 2) / Math.max(this.viewer.scene.canvas.clientHeight, 1);
|
|
520
527
|
}, this.find = (e) => {
|
|
521
528
|
if (this.destroyed || this.viewer.isDestroyed()) return null;
|
|
@@ -566,7 +573,7 @@ class Dt {
|
|
|
566
573
|
e.button !== 0 || this.destroyed || !this.find(this.canvasPosition(e)) || (this.viewer.scene.screenSpaceCameraController.enableRotate = !1, this.cameraHeld = !0);
|
|
567
574
|
}, this.restoreCamera = () => {
|
|
568
575
|
!this.cameraHeld || this.viewer.isDestroyed() || (this.cameraHeld = !1, this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
|
|
569
|
-
}, this.viewer = t, this.onPlace = r == null ? void 0 : r.onPlace, this.handler = new
|
|
576
|
+
}, this.viewer = t, this.onPlace = r == null ? void 0 : r.onPlace, this.handler = new j(t.scene.canvas), this.handler.setInputAction(this.onClick, y.LEFT_CLICK), this.handler.setInputAction(this.onDown, y.LEFT_DOWN), this.handler.setInputAction(this.onMove, y.MOUSE_MOVE), this.handler.setInputAction(this.onUp, y.LEFT_UP);
|
|
570
577
|
const i = t.scene.canvas;
|
|
571
578
|
i.addEventListener("pointerdown", this.stopCamera, !0), i.addEventListener("pointerup", this.restoreCamera, !0), i.addEventListener("pointercancel", this.restoreCamera, !0);
|
|
572
579
|
}
|
|
@@ -576,34 +583,34 @@ class Dt {
|
|
|
576
583
|
}
|
|
577
584
|
add(t) {
|
|
578
585
|
if (this.destroyed || this.viewer.isDestroyed()) return;
|
|
579
|
-
const r = D.fromCartesian(t), i = this.viewer.scene.globe.getHeight(r), e = typeof i == "number" ? i : r.height, s =
|
|
586
|
+
const r = D.fromCartesian(t), i = this.viewer.scene.globe.getHeight(r), e = typeof i == "number" ? i : r.height, s = d.fromRadians(r.longitude, r.latitude, e), a = Math.max(this.metersPerPixel(s) * 12, 8), n = `height-disk-${++ut}`, o = d.clone(s), w = d.clone(s), c = {
|
|
580
587
|
diskId: n,
|
|
581
588
|
base: s,
|
|
582
589
|
baseHeight: e,
|
|
583
590
|
extrude: 0,
|
|
584
591
|
top: o,
|
|
585
|
-
tip:
|
|
586
|
-
translation: new
|
|
592
|
+
tip: w,
|
|
593
|
+
translation: new d(),
|
|
587
594
|
modelMatrix: new B(),
|
|
588
595
|
labelText: "高差:0 m"
|
|
589
596
|
};
|
|
590
|
-
|
|
591
|
-
new
|
|
592
|
-
geometryInstances: new
|
|
597
|
+
c.disk = this.viewer.scene.primitives.add(
|
|
598
|
+
new q({
|
|
599
|
+
geometryInstances: new $({
|
|
593
600
|
id: n,
|
|
594
|
-
geometry: new
|
|
601
|
+
geometry: new et({
|
|
595
602
|
center: s,
|
|
596
603
|
semiMajorAxis: a,
|
|
597
604
|
semiMinorAxis: a,
|
|
598
605
|
// 几何建在贴地点高度;抬升与拉高都只改 modelMatrix,避免重建。
|
|
599
606
|
height: e,
|
|
600
|
-
vertexFormat:
|
|
607
|
+
vertexFormat: V.VERTEX_FORMAT
|
|
601
608
|
}),
|
|
602
609
|
attributes: {
|
|
603
|
-
color:
|
|
610
|
+
color: tt.fromColor(h.CYAN.withAlpha(0.55))
|
|
604
611
|
}
|
|
605
612
|
}),
|
|
606
|
-
appearance: new
|
|
613
|
+
appearance: new V({
|
|
607
614
|
flat: !0,
|
|
608
615
|
translucent: !0,
|
|
609
616
|
closed: !1,
|
|
@@ -615,31 +622,31 @@ class Dt {
|
|
|
615
622
|
asynchronous: !1,
|
|
616
623
|
allowPicking: !0
|
|
617
624
|
})
|
|
618
|
-
),
|
|
625
|
+
), c.line = this.viewer.entities.add({
|
|
619
626
|
polyline: {
|
|
620
627
|
positions: [s, o],
|
|
621
628
|
width: 4,
|
|
622
629
|
material: h.CYAN,
|
|
623
|
-
arcType:
|
|
630
|
+
arcType: it.NONE
|
|
624
631
|
},
|
|
625
632
|
show: !1
|
|
626
|
-
}),
|
|
633
|
+
}), c.label = this.viewer.entities.add({
|
|
627
634
|
position: o,
|
|
628
635
|
show: !1,
|
|
629
636
|
label: {
|
|
630
|
-
text:
|
|
637
|
+
text: c.labelText,
|
|
631
638
|
font: "16px sans-serif",
|
|
632
639
|
fillColor: h.WHITE,
|
|
633
640
|
outlineColor: h.BLACK,
|
|
634
641
|
outlineWidth: 2,
|
|
635
|
-
style:
|
|
642
|
+
style: L.FILL_AND_OUTLINE,
|
|
636
643
|
showBackground: !0,
|
|
637
644
|
backgroundColor: h.BLACK.withAlpha(0.7),
|
|
638
645
|
pixelOffset: new C(0, -12),
|
|
639
646
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
640
|
-
verticalOrigin:
|
|
647
|
+
verticalOrigin: v.BOTTOM
|
|
641
648
|
}
|
|
642
|
-
}), this.records.set(n,
|
|
649
|
+
}), this.records.set(n, c), this.records.set(c.line.id, c), this.records.set(c.label.id, c), this.applyExtrude(c, 0);
|
|
643
650
|
}
|
|
644
651
|
hits(t) {
|
|
645
652
|
return this.find(t) !== null;
|
|
@@ -658,8 +665,7 @@ class Dt {
|
|
|
658
665
|
}
|
|
659
666
|
}
|
|
660
667
|
let M = null;
|
|
661
|
-
|
|
662
|
-
class N {
|
|
668
|
+
class H {
|
|
663
669
|
constructor(t) {
|
|
664
670
|
this.records = /* @__PURE__ */ new Map(), this.drag = null, this.cameraHeld = !1, this.paused = !1, this.destroyed = !1, this.lastPosition = { x: 0, y: 0 }, this.currentExtrude = (i, e) => {
|
|
665
671
|
var a;
|
|
@@ -668,28 +674,30 @@ class N {
|
|
|
668
674
|
}, this.applyExtrude = (i, e) => {
|
|
669
675
|
const s = Math.max(0, e);
|
|
670
676
|
i.extrude = s, i.graphic.height = new u(i.baseHeight), i.graphic.extrudedHeight = s > 0.05 ? new u(i.baseHeight + s) : void 0;
|
|
671
|
-
const a = D.fromCartesian(i.center), n =
|
|
672
|
-
i.label.position = new b(n)
|
|
677
|
+
const a = D.fromCartesian(i.center), n = d.fromRadians(a.longitude, a.latitude, i.baseHeight + s);
|
|
678
|
+
i.label.position = new b(n);
|
|
679
|
+
const o = ot(i.area, s);
|
|
680
|
+
i.label.label.text = new u(`体积:${ht(o)}`), i.label.show = s > 0.05, this.viewer.isDestroyed() || this.viewer.scene.requestRender();
|
|
673
681
|
}, this.metersPerPixel = (i) => {
|
|
674
|
-
const e = Math.max(
|
|
682
|
+
const e = Math.max(d.distance(this.viewer.camera.positionWC, i), 1), a = this.viewer.camera.frustum.fovy ?? Math.PI / 3;
|
|
675
683
|
return 2 * e * Math.tan(a / 2) / Math.max(this.viewer.scene.canvas.clientHeight, 1);
|
|
676
684
|
}, this.createLabel = (i, e) => {
|
|
677
685
|
const s = D.fromCartesian(i);
|
|
678
686
|
return this.viewer.entities.add({
|
|
679
|
-
position:
|
|
687
|
+
position: d.fromRadians(s.longitude, s.latitude, e),
|
|
680
688
|
show: !1,
|
|
681
689
|
label: {
|
|
682
|
-
text: "体积:0
|
|
690
|
+
text: "体积:0 立方米",
|
|
683
691
|
font: "16px sans-serif",
|
|
684
692
|
fillColor: h.WHITE,
|
|
685
693
|
outlineColor: h.BLACK,
|
|
686
694
|
outlineWidth: 2,
|
|
687
|
-
style:
|
|
695
|
+
style: L.FILL_AND_OUTLINE,
|
|
688
696
|
showBackground: !0,
|
|
689
697
|
backgroundColor: h.BLACK.withAlpha(0.7),
|
|
690
698
|
pixelOffset: new C(0, -12),
|
|
691
699
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
692
|
-
verticalOrigin:
|
|
700
|
+
verticalOrigin: v.BOTTOM
|
|
693
701
|
}
|
|
694
702
|
});
|
|
695
703
|
}, this.canvasPosition = (i) => {
|
|
@@ -735,8 +743,8 @@ class N {
|
|
|
735
743
|
i.button !== 0 || this.paused || this.destroyed || !this.findVolume(this.canvasPosition(i)) || (this.viewer.scene.screenSpaceCameraController.enableRotate = !1, this.cameraHeld = !0);
|
|
736
744
|
}, this.restoreCamera = () => {
|
|
737
745
|
!this.cameraHeld || this.viewer.isDestroyed() || (this.cameraHeld = !1, this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
|
|
738
|
-
}, this.viewer = t, this.handler = new
|
|
739
|
-
const r =
|
|
746
|
+
}, this.viewer = k(t), this.handler = new j(this.viewer.scene.canvas), this.handler.setInputAction(this.onExtrudeDown, y.LEFT_DOWN), this.handler.setInputAction(this.onExtrudeMove, y.MOUSE_MOVE), this.handler.setInputAction(this.onExtrudeUp, y.LEFT_UP);
|
|
747
|
+
const r = this.viewer.scene.canvas;
|
|
740
748
|
r.addEventListener("pointerdown", this.stopCameraOnVolume, !0), r.addEventListener("pointerup", this.restoreCamera, !0), r.addEventListener("pointercancel", this.restoreCamera, !0);
|
|
741
749
|
}
|
|
742
750
|
/** 贴地绘制过程中暂停上拉,避免和绘制抢鼠标。 */
|
|
@@ -750,45 +758,56 @@ class N {
|
|
|
750
758
|
t == null || t.removeEventListener("pointerdown", this.stopCameraOnVolume, !0), t == null || t.removeEventListener("pointerup", this.restoreCamera, !0), t == null || t.removeEventListener("pointercancel", this.restoreCamera, !0), this.handler.isDestroyed() || this.handler.destroy(), t && this.cameraHeld && (this.viewer.scene.screenSpaceCameraController.enableRotate = !0), this.drag = null, this.records.clear();
|
|
751
759
|
}
|
|
752
760
|
mount(t, r, i, e, s) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
761
|
+
const a = k(t), n = k(r);
|
|
762
|
+
if (this.destroyed || s <= 0 || this.records.has(a.id)) return;
|
|
763
|
+
const o = this.currentExtrude(n, e), w = this.createLabel(i, e + o), c = {
|
|
764
|
+
entity: a,
|
|
765
|
+
graphic: n,
|
|
766
|
+
label: w,
|
|
767
|
+
area: s,
|
|
768
|
+
baseHeight: e,
|
|
769
|
+
extrude: o,
|
|
770
|
+
center: i
|
|
771
|
+
};
|
|
772
|
+
this.records.set(a.id, c), this.records.set(w.id, c), this.applyExtrude(c, o);
|
|
756
773
|
}
|
|
757
774
|
}
|
|
758
|
-
class
|
|
775
|
+
class Lt extends H {
|
|
759
776
|
add(t, r, i) {
|
|
760
|
-
!t.ellipse || i <= 0
|
|
777
|
+
if (!t.ellipse || i <= 0) return;
|
|
778
|
+
const e = N(r);
|
|
779
|
+
t.ellipse.semiMajorAxis = new u(i), t.ellipse.semiMinorAxis = new u(i), this.mount(
|
|
761
780
|
t,
|
|
762
781
|
t.ellipse,
|
|
763
|
-
|
|
764
|
-
D.fromCartesian(
|
|
782
|
+
e,
|
|
783
|
+
D.fromCartesian(e).height,
|
|
765
784
|
Math.PI * i * i
|
|
766
|
-
)
|
|
785
|
+
);
|
|
767
786
|
}
|
|
768
787
|
}
|
|
769
|
-
class
|
|
788
|
+
class xt extends H {
|
|
770
789
|
add(t, r) {
|
|
771
|
-
const i = r.map(
|
|
790
|
+
const i = r.map(N), e = Y(i), s = A(i);
|
|
772
791
|
if (!t.polygon || i.length < 4 || e <= 0 || !s) return;
|
|
773
|
-
t.polygon.hierarchy = new u(new
|
|
792
|
+
t.polygon.hierarchy = new u(new z(i)), t.polygon.perPositionHeight = new u(!1);
|
|
774
793
|
const a = (D.fromCartesian(i[0]).height + D.fromCartesian(i[2]).height) / 2;
|
|
775
794
|
this.mount(t, t.polygon, s, a, e);
|
|
776
795
|
}
|
|
777
796
|
}
|
|
778
|
-
class
|
|
797
|
+
class Et extends H {
|
|
779
798
|
add(t, r) {
|
|
780
|
-
const i = r.map(
|
|
781
|
-
!t.polygon || i.length < 3 || e <= 0 || !s || (t.polygon.hierarchy = new u(new
|
|
799
|
+
const i = r.map(N), e = Y(i), s = A(i);
|
|
800
|
+
!t.polygon || i.length < 3 || e <= 0 || !s || (t.polygon.hierarchy = new u(new z(i)), t.polygon.perPositionHeight = new u(!1), this.mount(t, t.polygon, s, lt(i), e));
|
|
782
801
|
}
|
|
783
802
|
}
|
|
784
803
|
export {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
804
|
+
Dt as C,
|
|
805
|
+
vt as H,
|
|
806
|
+
At as L,
|
|
807
|
+
mt as P,
|
|
808
|
+
ft as R,
|
|
809
|
+
Ct as a,
|
|
810
|
+
Lt as b,
|
|
811
|
+
xt as c,
|
|
812
|
+
Et as d
|
|
794
813
|
};
|