cesium-pocket 0.5.3-alpha → 0.5.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-Cl5jgThe.js → CircleDrawer-DClMwtZ9.js} +94 -91
- package/{PolygonGaguger-CjUuWtEz.js → PolygonGaguger-Brzz7_9X.js} +165 -159
- package/drawer.js +1 -1
- package/gauger.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/src/drawer/CP2dDrawer.d.ts +5 -5
- package/src/drawer/DataCenter.d.ts +4 -3
- package/src/drawer/PointDrawer.d.ts +2 -2
- package/src/gauger/LineGaguger.d.ts +24 -5
- package/src/gauger/PolygonGaguger.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CustomDataSource as O, Cartesian3 as r, JulianDate as U, defined as h, HeightReference as M, Color as E, EntityCollection as N, ScreenSpaceEventType as c, ConstantPositionProperty as A, ScreenSpaceEventHandler as
|
|
2
|
-
import { toRaw as
|
|
1
|
+
import { CustomDataSource as O, Cartesian3 as r, JulianDate as U, defined as h, HeightReference as M, Color as E, EntityCollection as N, ScreenSpaceEventType as c, ConstantPositionProperty as A, ScreenSpaceEventHandler as C, VerticalOrigin as G, KeyboardEventModifier as b, PolylineDashMaterialProperty as x, CallbackProperty as p, PolygonHierarchy as B, Cartographic as P, Transforms as F, Matrix4 as m, EllipsoidGeodesic as Q } from "cesium";
|
|
2
|
+
import { toRaw as u } from "vue";
|
|
3
3
|
const l = {
|
|
4
4
|
STOPED: Symbol("STOPED"),
|
|
5
5
|
//未开启状态
|
|
@@ -87,7 +87,7 @@ class W {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
const K = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAQAElEQVR4AexdfYwkR3V/r3dnb884wUd03O1HTrZj4p09/CFMSBwpkqX8Ayjkj6ALQY6ixHIc8REJRUoiJUK+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tcGACMQG61tiNieXlxGBRRLN8D6PRQfyyxwDfSKJQPqQYmNopbbEf4KyQLEX4n3alWabARGI7Qr0xMcg2M+9Z0h2LTMQWI4v4XsYWBlf+CL3niHZtcyACMRyASR8uRkQgZS7PoLOMgO6BGI5DQkvDBTDgAikGF7Fa0UYEIFUpJCSRjEMiECK4VW8VoQBEUhFCilpFMOAAwIpJnHxKgykYUAEkoYlsfGWARGIt6WXxNMwIAJJw5LYeMuACMTb0kviaRjwWyBpGBIbrxkQgXhdfkk+iQERSBJDMu81AyIQr8svyScxIAJJYkjmvWZABFJQ+cVtNRj4OQAAAP//gm46zwAAAAZJREFUAwB1f5TcL2bFTAAAAABJRU5ErkJggg==";
|
|
90
|
-
class
|
|
90
|
+
class S extends W {
|
|
91
91
|
constructor(e) {
|
|
92
92
|
super(e), this.mainData = [], this.dataSource = new O("drawerDataSource"), this.currentDragPoint = null, this.currentIndex = -1, this.delConfirmFun = this.delCallback, this.viewer.dataSources.add(this.dataSource);
|
|
93
93
|
}
|
|
@@ -135,7 +135,7 @@ class C extends W {
|
|
|
135
135
|
deleteMoveFun(e) {
|
|
136
136
|
if (D.DEL_UNABLED == super.getDelStatus()) {
|
|
137
137
|
const t = this.viewer.scene.pick(e.endPosition);
|
|
138
|
-
h(t) && h(t.id) && this.dataSource.entities.contains(
|
|
138
|
+
h(t) && h(t.id) && this.dataSource.entities.contains(u(t.id)) && this.delEnable();
|
|
139
139
|
} else
|
|
140
140
|
this.delUnable();
|
|
141
141
|
}
|
|
@@ -170,22 +170,22 @@ class C extends W {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
class _ extends
|
|
173
|
+
class _ extends S {
|
|
174
174
|
constructor(e, t = null) {
|
|
175
175
|
super(e), this.handler = null, this.pointCollection = new N(), this.addPointFun = this.addBillboardCallback, this.point_L_ClickEvent = () => {
|
|
176
176
|
var i;
|
|
177
177
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
178
178
|
if (l.DRAWABLE == super.getStatus()) {
|
|
179
|
-
let
|
|
180
|
-
if (h(
|
|
181
|
-
let
|
|
182
|
-
this.mainData.push(
|
|
179
|
+
let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
180
|
+
if (h(s)) {
|
|
181
|
+
let d = this.addPointFun(s);
|
|
182
|
+
this.mainData.push(s), this.pointCollection.add(d), this.afterAddPointFun && this.afterAddPointFun(d);
|
|
183
183
|
}
|
|
184
184
|
} else if (l.DELETABLE == super.getStatus()) {
|
|
185
|
-
const
|
|
186
|
-
if (h(
|
|
187
|
-
const
|
|
188
|
-
this.pointCollection.contains(
|
|
185
|
+
const n = this.viewer.scene.pick(a.position);
|
|
186
|
+
if (h(n) && h(n.id)) {
|
|
187
|
+
const s = u(n.id);
|
|
188
|
+
this.pointCollection.contains(s) && D.DEL_ENABLED == super.getDelStatus() && this.deleteBillboard(s);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}, c.LEFT_CLICK);
|
|
@@ -204,27 +204,27 @@ class _ extends C {
|
|
|
204
204
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
205
205
|
if (l.EDITABLE == super.getStatus())
|
|
206
206
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
207
|
-
const
|
|
208
|
-
if (h(
|
|
209
|
-
let
|
|
210
|
-
this.currentDragPoint =
|
|
207
|
+
const n = this.viewer.scene.pick(a.endPosition);
|
|
208
|
+
if (h(n) && h(n.id) && this.pointCollection.contains(u(n.id))) {
|
|
209
|
+
let s = u(n.id);
|
|
210
|
+
this.currentDragPoint = s, this.editDragEnable();
|
|
211
211
|
}
|
|
212
212
|
} else if (o.DRAGING == super.getEditStatus()) {
|
|
213
|
-
const
|
|
214
|
-
h(
|
|
213
|
+
const n = this.viewer.scene.pickPosition(a.endPosition);
|
|
214
|
+
h(n) && this.currentDragPoint && (this.currentDragPoint.position = new A(n), this.editPointFun && this.editPointFun(n, this.currentDragPoint));
|
|
215
215
|
} else
|
|
216
216
|
this.editDragUnable();
|
|
217
217
|
else if (l.DELETABLE == super.getStatus())
|
|
218
218
|
if (D.DEL_UNABLED == super.getDelStatus()) {
|
|
219
|
-
const
|
|
220
|
-
h(
|
|
219
|
+
const n = this.viewer.scene.pick(a.endPosition);
|
|
220
|
+
h(n) && h(n.id) && this.pointCollection.contains(u(n.id)) && this.delEnable();
|
|
221
221
|
} else
|
|
222
222
|
this.delUnable();
|
|
223
223
|
}, c.MOUSE_MOVE);
|
|
224
224
|
}, t && (this.addPointFun = t.addPointFun ? t.addPointFun : this.addBillboardCallback, this.delConfirmFun = t.delConfirmFun ? t.delConfirmFun : this.delCallback, t.afterAddPointFun && (this.afterAddPointFun = t.afterAddPointFun), t.editPointFun && (this.editPointFun = t.editPointFun));
|
|
225
225
|
}
|
|
226
226
|
start() {
|
|
227
|
-
super.drawableStatus(), this.handler || (this.handler = new
|
|
227
|
+
super.drawableStatus(), this.handler || (this.handler = new C(this.viewer.scene.canvas)), this.point_L_ClickEvent(), this.point_L_DownEvent(), this.point_L_UpEvent(), this.point_moveEvent();
|
|
228
228
|
}
|
|
229
229
|
getEntities() {
|
|
230
230
|
return this.pointCollection;
|
|
@@ -262,30 +262,33 @@ class _ extends C {
|
|
|
262
262
|
}) : confirm("确定要删除吗?") && (this.viewer.entities.remove(e), this.dsToMd());
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
const
|
|
265
|
+
const L = {
|
|
266
266
|
LINE: Symbol("LINE"),
|
|
267
267
|
//画线模式
|
|
268
268
|
POLYGON: Symbol("POLYGON")
|
|
269
269
|
//画面模式
|
|
270
270
|
};
|
|
271
|
-
class Z extends
|
|
271
|
+
class Z extends S {
|
|
272
272
|
constructor(e, t = null) {
|
|
273
|
-
super(e), this.handler = null, this.mainLineEntity = null, this.mainPolygonEntity = null, this.dashLineEntity = null, this.dashEndData = null, this.drawerMode =
|
|
273
|
+
super(e), this.handler = null, this.mainLineEntity = null, this.mainPolygonEntity = null, this.dashLineEntity = null, this.dashEndData = null, this.drawerMode = L.LINE, this.r_ClickEvent = () => {
|
|
274
274
|
var i;
|
|
275
275
|
(i = this.handler) == null || i.setInputAction(() => {
|
|
276
|
-
l.DRAWABLE == super.getStatus() && (this.dashLineEntity && this.viewer.entities.removeById(this.dashLineEntity.id), this.dashEndData = null, this.stopStatus(), this.
|
|
276
|
+
l.DRAWABLE == super.getStatus() && (this.dashLineEntity && this.viewer.entities.removeById(this.dashLineEntity.id), this.dashEndData = null, this.stopStatus(), this.stopDrawCallbackFun && this.stopDrawCallbackFun());
|
|
277
277
|
}, c.RIGHT_CLICK);
|
|
278
278
|
}, this.l_ClickEvent = () => {
|
|
279
279
|
var i;
|
|
280
280
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
281
281
|
if (l.DRAWABLE == super.getStatus()) {
|
|
282
|
-
let
|
|
283
|
-
|
|
282
|
+
let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
283
|
+
if (h(s)) {
|
|
284
|
+
const d = this.addPoint(s);
|
|
285
|
+
this.afterAddPointFun && this.afterAddPointFun(d), this.mainData.push(s), this.mainData.length > 0 && (this.mainLineEntity || this.createMainLine(), this.dashLineEntity || this.createDashline(), this.mainData.length > 1 && this.drawerMode === L.POLYGON && !this.mainPolygonEntity && this.createMainPolygon());
|
|
286
|
+
}
|
|
284
287
|
} else if (l.DELETABLE == super.getStatus()) {
|
|
285
|
-
const
|
|
286
|
-
if (h(
|
|
287
|
-
const
|
|
288
|
-
this.dataSource.entities.contains(
|
|
288
|
+
const n = this.viewer.scene.pick(a.position);
|
|
289
|
+
if (h(n) && h(n.id)) {
|
|
290
|
+
const s = u(n.id);
|
|
291
|
+
this.dataSource.entities.contains(s) && D.DEL_ENABLED == super.getDelStatus() && this.deletePoint(s);
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
294
|
}, c.LEFT_CLICK);
|
|
@@ -294,11 +297,11 @@ class Z extends C {
|
|
|
294
297
|
(i = this.handler) == null || i.setInputAction(
|
|
295
298
|
(a) => {
|
|
296
299
|
if (l.EDITABLE == super.getStatus()) {
|
|
297
|
-
let
|
|
298
|
-
if (h(
|
|
299
|
-
|
|
300
|
-
let
|
|
301
|
-
this.mainData.splice(
|
|
300
|
+
let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
301
|
+
if (h(s)) {
|
|
302
|
+
const d = this.addPoint(s);
|
|
303
|
+
let g = this.measurePoint(s);
|
|
304
|
+
this.mainData.splice(g, 0, s), this.MdToDs(), this.afterAddPointFun && this.afterAddPointFun(d);
|
|
302
305
|
}
|
|
303
306
|
}
|
|
304
307
|
},
|
|
@@ -318,10 +321,10 @@ class Z extends C {
|
|
|
318
321
|
}, this.moveEvent = () => {
|
|
319
322
|
var i;
|
|
320
323
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
const
|
|
324
|
-
h(
|
|
324
|
+
const n = this.viewer.camera.getPickRay(a.endPosition);
|
|
325
|
+
if (n) {
|
|
326
|
+
const s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
327
|
+
h(s) && (l.DRAWABLE == super.getStatus() ? (this.dashEndData = s, this.movingCallbackFun && this.movingCallbackFun(s)) : l.EDITABLE == super.getStatus() ? (this.dashLineEntity.show = !1, this.editMoveFun(a, s)) : l.DELETABLE == super.getStatus() && (this.dashLineEntity.show = !1, this.deleteMoveFun(a)));
|
|
325
328
|
}
|
|
326
329
|
}, c.MOUSE_MOVE);
|
|
327
330
|
}, this.moveCtrlEvent = () => {
|
|
@@ -343,24 +346,24 @@ class Z extends C {
|
|
|
343
346
|
}),
|
|
344
347
|
show: !0,
|
|
345
348
|
clampToGround: !0
|
|
346
|
-
}, i.positions = new
|
|
347
|
-
let a = this.mainData.length,
|
|
348
|
-
return
|
|
349
|
+
}, i.positions = new p(() => {
|
|
350
|
+
let a = this.mainData.length, n = this.mainData[a - 1];
|
|
351
|
+
return n || (n = this.mainData[a - 2]), this.dashEndData ? [n, this.dashEndData] : [n, new r()];
|
|
349
352
|
}, !1), this.dashLineEntity = this.viewer.entities.add({
|
|
350
353
|
polyline: i,
|
|
351
354
|
properties: {
|
|
352
355
|
entityType: "DASHLINE"
|
|
353
356
|
}
|
|
354
357
|
});
|
|
355
|
-
}, t && (t.drawerMode && (this.drawerMode = t.drawerMode), this.point = t.point, this.polyline = t.polyline, this.deshline = t.deshline, this.polygon = t.polygon, t.afterAddPointFun && (this.afterAddPointFun = t.afterAddPointFun), t.movingCallbackFun && (this.movingCallbackFun = t.movingCallbackFun), t.editCallbackFun && (this.editCallbackFun = t.editCallbackFun), t.delCallbackFun && (this.delCallbackFun = t.delCallbackFun), t.
|
|
358
|
+
}, t && (t.drawerMode && (this.drawerMode = t.drawerMode), this.point = t.point, this.polyline = t.polyline, this.deshline = t.deshline, this.polygon = t.polygon, t.afterAddPointFun && (this.afterAddPointFun = t.afterAddPointFun), t.movingCallbackFun && (this.movingCallbackFun = t.movingCallbackFun), t.editCallbackFun && (this.editCallbackFun = t.editCallbackFun), t.delCallbackFun && (this.delCallbackFun = t.delCallbackFun), t.stopDrawCallbackFun && (this.stopDrawCallbackFun = t.stopDrawCallbackFun), this.delConfirmFun = t.delConfirmFun ? t.delConfirmFun : this.delCallback);
|
|
356
359
|
}
|
|
357
360
|
start() {
|
|
358
|
-
super.drawableStatus(), this.handler || (this.handler = new
|
|
361
|
+
super.drawableStatus(), this.handler || (this.handler = new C(this.viewer.scene.canvas)), this.r_ClickEvent(), this.l_ClickEvent(), this.l_ClickCtrlEvent(), this.l_DownEvent(), this.l_UpEvent(), this.moveCtrlEvent(), this.moveEvent();
|
|
359
362
|
}
|
|
360
363
|
getEntity() {
|
|
361
|
-
if (this.drawerMode ===
|
|
364
|
+
if (this.drawerMode === L.LINE)
|
|
362
365
|
return this.mainLineEntity;
|
|
363
|
-
if (this.drawerMode ===
|
|
366
|
+
if (this.drawerMode === L.POLYGON)
|
|
364
367
|
return this.mainPolygonEntity;
|
|
365
368
|
}
|
|
366
369
|
getPositions() {
|
|
@@ -371,29 +374,29 @@ class Z extends C {
|
|
|
371
374
|
}
|
|
372
375
|
measurePoint(e) {
|
|
373
376
|
let t = 1 / 0, i = -1, a = 0;
|
|
374
|
-
for (let
|
|
375
|
-
const
|
|
376
|
-
let
|
|
377
|
+
for (let n = 0, s = this.mainData.length; n < s - 1; n++) {
|
|
378
|
+
const d = this.mainData[n], g = this.mainData[n + 1], v = r.subtract(g, d, new r()), R = r.subtract(e, d, new r()), I = r.dot(v, v);
|
|
379
|
+
let y, w;
|
|
377
380
|
if (I === 0)
|
|
378
|
-
|
|
381
|
+
y = r.distance(e, d), w = 0;
|
|
379
382
|
else {
|
|
380
|
-
|
|
381
|
-
const k = Math.max(0, Math.min(1,
|
|
382
|
-
|
|
383
|
-
r.multiplyByScalar(
|
|
383
|
+
w = r.dot(R, v) / I;
|
|
384
|
+
const k = Math.max(0, Math.min(1, w)), T = r.add(
|
|
385
|
+
d,
|
|
386
|
+
r.multiplyByScalar(v, k, new r()),
|
|
384
387
|
new r()
|
|
385
388
|
);
|
|
386
|
-
|
|
389
|
+
y = r.distance(e, T);
|
|
387
390
|
}
|
|
388
|
-
|
|
391
|
+
y < t && (t = y, i = n, a = w);
|
|
389
392
|
}
|
|
390
393
|
return (a > 1 || a < 0) && (i == 0 ? i = -1 : i == this.mainData.length - 2 && (i = i + 1)), i + 1;
|
|
391
394
|
}
|
|
392
395
|
editMoveFun(e, t) {
|
|
393
396
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
394
397
|
const i = this.viewer.scene.pick(e.endPosition);
|
|
395
|
-
if (h(i) && h(i.id) && this.dataSource.entities.contains(
|
|
396
|
-
let a =
|
|
398
|
+
if (h(i) && h(i.id) && this.dataSource.entities.contains(u(i.id))) {
|
|
399
|
+
let a = u(i.id);
|
|
397
400
|
this.currentDragPoint = a, this.editDragEnable();
|
|
398
401
|
}
|
|
399
402
|
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new A(t), this.mainData[this.currentIndex] = t, this.editCallbackFun && this.editCallbackFun(t, this.currentIndex)) : this.editDragUnable();
|
|
@@ -410,7 +413,7 @@ class Z extends C {
|
|
|
410
413
|
// 是否显示
|
|
411
414
|
show: !0,
|
|
412
415
|
clampToGround: !0
|
|
413
|
-
}, e.positions = new
|
|
416
|
+
}, e.positions = new p(() => this.mainData, !1), this.mainLineEntity = this.viewer.entities.add({
|
|
414
417
|
polyline: e,
|
|
415
418
|
properties: {
|
|
416
419
|
entityType: "LINE"
|
|
@@ -424,7 +427,7 @@ class Z extends C {
|
|
|
424
427
|
hierarchy: [new r(), new r(), new r()],
|
|
425
428
|
material: E.RED.withAlpha(0.4),
|
|
426
429
|
outline: !1
|
|
427
|
-
}, e.hierarchy = new
|
|
430
|
+
}, e.hierarchy = new p(() => {
|
|
428
431
|
let t = this.mainData;
|
|
429
432
|
return this.dashEndData && (t = [...this.mainData, this.dashEndData]), new B(t);
|
|
430
433
|
}, !1), this.mainPolygonEntity = this.viewer.entities.add({
|
|
@@ -435,14 +438,14 @@ class Z extends C {
|
|
|
435
438
|
});
|
|
436
439
|
}
|
|
437
440
|
}
|
|
438
|
-
class V extends
|
|
441
|
+
class V extends S {
|
|
439
442
|
constructor(e, t = null) {
|
|
440
443
|
super(e), this.handler = null, this.firstPoint = null, this.endPoint = null, this.lineEntity = null, this.polygonEntity = null, this.rect_L_ClickEvent = () => {
|
|
441
444
|
var i;
|
|
442
445
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
443
446
|
if (l.DRAWABLE == super.getStatus()) {
|
|
444
|
-
let
|
|
445
|
-
h(
|
|
447
|
+
let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
448
|
+
h(s) && (this.mainData.length === 0 ? (this.addPoint(s), this.firstPoint = s, this.mainData.push(s), this.createLine(), this.createPolygon()) : (this.addPoint(s), this.endPoint = s, this.stopStatus(), this.initMainData(), this.rectOverFun && this.rectOverFun(this.mainData)));
|
|
446
449
|
}
|
|
447
450
|
}, c.LEFT_CLICK);
|
|
448
451
|
}, this.rect_L_DownEvent = () => {
|
|
@@ -458,16 +461,16 @@ class V extends C {
|
|
|
458
461
|
}, this.rect_moveEvent = () => {
|
|
459
462
|
var i;
|
|
460
463
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
const
|
|
464
|
-
h(
|
|
464
|
+
const n = this.viewer.camera.getPickRay(a.endPosition);
|
|
465
|
+
if (n) {
|
|
466
|
+
const s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
467
|
+
h(s) && (l.DRAWABLE == super.getStatus() ? this.firstPoint && (this.endPoint = s, this.initMainData(), this.rectMovingFun && this.rectMovingFun(this.mainData)) : l.EDITABLE == super.getStatus() && (this.rectMove(a, s), this.rectEditFun && this.rectEditFun(this.mainData)));
|
|
465
468
|
}
|
|
466
469
|
}, c.MOUSE_MOVE);
|
|
467
470
|
}, t && (this.point = t.point, this.polyline = t.polyline, this.polygon = t.polygon, t.rectOverFun && (this.rectOverFun = t.rectOverFun), t.rectMovingFun && (this.rectMovingFun = t.rectMovingFun), t.rectEditFun && (this.rectEditFun = t.rectEditFun));
|
|
468
471
|
}
|
|
469
472
|
start() {
|
|
470
|
-
super.drawableStatus(), this.handler || (this.handler = new
|
|
473
|
+
super.drawableStatus(), this.handler || (this.handler = new C(this.viewer.scene.canvas)), this.rect_L_ClickEvent(), this.rect_L_DownEvent(), this.rect_L_UpEvent(), this.rect_moveEvent();
|
|
471
474
|
}
|
|
472
475
|
getEntity() {
|
|
473
476
|
this.polygonEntity;
|
|
@@ -481,16 +484,16 @@ class V extends C {
|
|
|
481
484
|
rectMove(e, t) {
|
|
482
485
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
483
486
|
const i = this.viewer.scene.pick(e.endPosition);
|
|
484
|
-
if (h(i) && h(i.id) && this.dataSource.entities.contains(
|
|
485
|
-
let a =
|
|
487
|
+
if (h(i) && h(i.id) && this.dataSource.entities.contains(u(i.id))) {
|
|
488
|
+
let a = u(i.id);
|
|
486
489
|
this.currentDragPoint = a, this.editDragEnable();
|
|
487
490
|
}
|
|
488
491
|
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new A(t), this.currentIndex === 0 ? this.firstPoint = t : this.endPoint = t, this.initMainData()) : this.editDragUnable();
|
|
489
492
|
}
|
|
490
493
|
initMainData() {
|
|
491
494
|
if (this.firstPoint && this.endPoint) {
|
|
492
|
-
const e =
|
|
493
|
-
this.mainData[0] = this.firstPoint, this.mainData[1] =
|
|
495
|
+
const e = P.fromCartesian(this.firstPoint), t = e.longitude, i = e.latitude, a = P.fromCartesian(this.endPoint), n = a.longitude, s = a.latitude, d = r.fromRadians(t, s), g = r.fromRadians(n, i);
|
|
496
|
+
this.mainData[0] = this.firstPoint, this.mainData[1] = d, this.mainData[2] = this.endPoint, this.mainData[3] = g;
|
|
494
497
|
}
|
|
495
498
|
}
|
|
496
499
|
//创建主线数据
|
|
@@ -505,7 +508,7 @@ class V extends C {
|
|
|
505
508
|
// 是否显示
|
|
506
509
|
show: !0,
|
|
507
510
|
clampToGround: !0
|
|
508
|
-
}, e.positions = new
|
|
511
|
+
}, e.positions = new p(() => [...this.mainData, this.mainData[0]], !1), this.lineEntity = this.viewer.entities.add({
|
|
509
512
|
polyline: e,
|
|
510
513
|
properties: {
|
|
511
514
|
entityType: "LINE"
|
|
@@ -519,7 +522,7 @@ class V extends C {
|
|
|
519
522
|
hierarchy: [new r(), new r(), new r()],
|
|
520
523
|
material: E.RED.withAlpha(0.4),
|
|
521
524
|
outline: !1
|
|
522
|
-
}, e.hierarchy = new
|
|
525
|
+
}, e.hierarchy = new p(() => new B(this.mainData), !1), this.polygonEntity = this.viewer.entities.add({
|
|
523
526
|
polygon: e,
|
|
524
527
|
properties: {
|
|
525
528
|
entityType: "POLYGON"
|
|
@@ -527,14 +530,14 @@ class V extends C {
|
|
|
527
530
|
});
|
|
528
531
|
}
|
|
529
532
|
}
|
|
530
|
-
class X extends
|
|
533
|
+
class X extends S {
|
|
531
534
|
constructor(e, t = null) {
|
|
532
535
|
super(e), this.handler = null, this.firstPoint = new r(), this.endPoint = new r(), this.distance = 0, this.angle = 0, this.endPointEntity = null, this.ellipseEntity = null, this.circle_L_ClickEvent = () => {
|
|
533
536
|
var i;
|
|
534
537
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
535
538
|
if (l.DRAWABLE == super.getStatus()) {
|
|
536
|
-
let
|
|
537
|
-
h(
|
|
539
|
+
let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
540
|
+
h(s) && (this.mainData.length === 0 ? (this.addPoint(s), this.mainData.push(s), this.firstPoint = s, this.createCircle()) : (this.endPoint = s, this.mainData.push(s), this.endPointEntity = this.addPoint(s), this.setAngle(), this.stopStatus(), this.circleOverFun && this.circleOverFun(this.firstPoint, this.endPoint)));
|
|
538
541
|
}
|
|
539
542
|
}, c.LEFT_CLICK);
|
|
540
543
|
}, this.circle_L_DownEvent = () => {
|
|
@@ -550,16 +553,16 @@ class X extends C {
|
|
|
550
553
|
}, this.circle_moveEvent = () => {
|
|
551
554
|
var i;
|
|
552
555
|
(i = this.handler) == null || i.setInputAction((a) => {
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
const
|
|
556
|
-
h(
|
|
556
|
+
const n = this.viewer.camera.getPickRay(a.endPosition);
|
|
557
|
+
if (n) {
|
|
558
|
+
const s = this.viewer.scene.globe.pick(n, this.viewer.scene);
|
|
559
|
+
h(s) && (l.DRAWABLE == super.getStatus() ? this.mainData.length > 0 && (this.endPoint = s, this.countDistance(), this.circleMovingFun && this.circleMovingFun(this.firstPoint, s)) : l.EDITABLE == super.getStatus() && (this.circleMove(a, s), this.circleEditFun && this.circleEditFun(this.firstPoint, this.endPoint)));
|
|
557
560
|
}
|
|
558
561
|
}, c.MOUSE_MOVE);
|
|
559
562
|
}, t && (this.point = t.point, this.ellipse = t.ellipse, t.circleOverFun && (this.circleOverFun = t.circleOverFun), t.circleMovingFun && (this.circleMovingFun = t.circleMovingFun), t.circleEditFun && (this.circleEditFun = t.circleEditFun));
|
|
560
563
|
}
|
|
561
564
|
start() {
|
|
562
|
-
super.drawableStatus(), this.handler || (this.handler = new
|
|
565
|
+
super.drawableStatus(), this.handler || (this.handler = new C(this.viewer.scene.canvas)), this.circle_L_ClickEvent(), this.circle_L_DownEvent(), this.circle_L_UpEvent(), this.circle_moveEvent();
|
|
563
566
|
}
|
|
564
567
|
getEntity() {
|
|
565
568
|
return this.ellipseEntity;
|
|
@@ -571,14 +574,14 @@ class X extends C {
|
|
|
571
574
|
this.clearAllData(), this.firstPoint = new r(), this.endPoint = new r(), this.handler && (this.handler = null), this.ellipseEntity && this.viewer.entities.removeById(this.ellipseEntity.id);
|
|
572
575
|
}
|
|
573
576
|
setAngle() {
|
|
574
|
-
const e = F.eastNorthUpToFixedFrame(this.firstPoint.clone()), t =
|
|
577
|
+
const e = F.eastNorthUpToFixedFrame(this.firstPoint.clone()), t = m.inverse(e, new m()), i = m.multiplyByPoint(t, this.endPoint.clone(), new r());
|
|
575
578
|
this.angle = Math.atan2(i.x, i.y);
|
|
576
579
|
}
|
|
577
580
|
circleMove(e, t) {
|
|
578
581
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
579
582
|
const i = this.viewer.scene.pick(e.endPosition);
|
|
580
|
-
if (h(i) && h(i.id) && this.dataSource.entities.contains(
|
|
581
|
-
let a =
|
|
583
|
+
if (h(i) && h(i.id) && this.dataSource.entities.contains(u(i.id))) {
|
|
584
|
+
let a = u(i.id);
|
|
582
585
|
this.currentDragPoint = a, this.editDragEnable();
|
|
583
586
|
}
|
|
584
587
|
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new A(t), this.currentIndex === 0 ? (this.firstPoint = t, this.ellipseEntity && (this.ellipseEntity.position = new A(this.firstPoint)), this.endPointEntity && (this.updateEndPoint(), this.endPointEntity.position = new A(this.endPoint))) : (this.endPoint = t, this.countDistance())) : this.editDragUnable();
|
|
@@ -589,12 +592,12 @@ class X extends C {
|
|
|
589
592
|
this.distance * Math.cos(this.angle),
|
|
590
593
|
0
|
|
591
594
|
// 保持水平,如果希望保持高度则设为 localEdge.z
|
|
592
|
-
), t = F.eastNorthUpToFixedFrame(this.firstPoint), i =
|
|
595
|
+
), t = F.eastNorthUpToFixedFrame(this.firstPoint), i = m.multiplyByPointAsVector(t, e, new r());
|
|
593
596
|
this.endPoint = r.add(this.firstPoint, i, new r());
|
|
594
597
|
}
|
|
595
598
|
countDistance() {
|
|
596
599
|
if (this.firstPoint && this.endPoint) {
|
|
597
|
-
const e =
|
|
600
|
+
const e = P.fromCartesian(this.firstPoint), t = P.fromCartesian(this.endPoint), i = new Q(e, t);
|
|
598
601
|
this.distance = i.surfaceDistance;
|
|
599
602
|
}
|
|
600
603
|
}
|
|
@@ -615,7 +618,7 @@ class X extends C {
|
|
|
615
618
|
outline: !0,
|
|
616
619
|
// 是否显示边框
|
|
617
620
|
outlineColor: E.RED
|
|
618
|
-
}, e.semiMinorAxis = e.semiMajorAxis = new
|
|
621
|
+
}, e.semiMinorAxis = e.semiMajorAxis = new p(() => this.distance, !1), this.ellipseEntity = this.viewer.entities.add({
|
|
619
622
|
position: new A(this.firstPoint),
|
|
620
623
|
ellipse: e,
|
|
621
624
|
properties: {
|
|
@@ -630,5 +633,5 @@ export {
|
|
|
630
633
|
_ as P,
|
|
631
634
|
V as R,
|
|
632
635
|
X as a,
|
|
633
|
-
|
|
636
|
+
L as b
|
|
634
637
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { Cartographic as
|
|
2
|
-
import { a as
|
|
1
|
+
import { Cartographic as v, EllipsoidGeodesic as Y, Cartesian3 as g, BoundingSphere as N, Transforms as y, Matrix4 as M, CustomDataSource as L, ConstantPositionProperty as d, ConstantProperty as u, Color as c, Cartesian2 as B, VerticalOrigin as F, HorizontalOrigin as T, LabelStyle as x, Math as k } from "cesium";
|
|
2
|
+
import { a as j, R as U, P as W, D as G, C as O, b as Z } from "./CircleDrawer-DClMwtZ9.js";
|
|
3
3
|
const A = (r, t) => {
|
|
4
|
-
const l =
|
|
5
|
-
return new
|
|
6
|
-
},
|
|
7
|
-
const l = new
|
|
8
|
-
return
|
|
9
|
-
},
|
|
4
|
+
const l = v.fromCartesian(r), e = v.fromCartesian(t);
|
|
5
|
+
return new Y(l, e).surfaceDistance;
|
|
6
|
+
}, I = (r, t) => {
|
|
7
|
+
const l = new g();
|
|
8
|
+
return g.add(r, t, l), g.divideByScalar(l, 2, l), l;
|
|
9
|
+
}, p = (r) => {
|
|
10
10
|
let t = "";
|
|
11
11
|
return r > 1e3 * 100 ? t = (r / 1e3).toFixed(0) + " 公里" : r > 1e3 ? t = (r / 1e3).toFixed(2) + " 公里" : t = r.toFixed(2) + " 米", t;
|
|
12
|
-
},
|
|
12
|
+
}, C = (r) => {
|
|
13
13
|
if (!r || r.length === 0) return null;
|
|
14
14
|
let t = 0, l = 0, e = 0;
|
|
15
15
|
const i = r.length;
|
|
16
16
|
return r.forEach((a) => {
|
|
17
17
|
t += a.x, l += a.y, e += a.z;
|
|
18
|
-
}), new
|
|
18
|
+
}), new g(
|
|
19
19
|
t / i,
|
|
20
20
|
l / i,
|
|
21
21
|
e / i
|
|
22
22
|
);
|
|
23
|
-
},
|
|
23
|
+
}, m = (r) => {
|
|
24
24
|
if (r.length < 3) return "0平方米";
|
|
25
|
-
const l = N.fromPoints(r).center, e =
|
|
26
|
-
(n) =>
|
|
25
|
+
const l = N.fromPoints(r).center, e = y.eastNorthUpToFixedFrame(l), i = M.inverse(e, new M()), s = r.map(
|
|
26
|
+
(n) => M.multiplyByPoint(i, n, new g())
|
|
27
27
|
);
|
|
28
28
|
let a = 0;
|
|
29
29
|
for (let n = 0; n < s.length; n++) {
|
|
30
|
-
const
|
|
31
|
-
a += s[n].x * s[
|
|
30
|
+
const o = (n + 1) % s.length;
|
|
31
|
+
a += s[n].x * s[o].y, a -= s[o].x * s[n].y;
|
|
32
32
|
}
|
|
33
|
-
return a = Math.abs(a / 2),
|
|
34
|
-
},
|
|
33
|
+
return a = Math.abs(a / 2), P(a);
|
|
34
|
+
}, P = (r) => {
|
|
35
35
|
let t = "";
|
|
36
36
|
return r > 1e3 * 1e3 * 1e3 ? t = (r / 1e3 / 1e3 / 1e4).toFixed(2) + "万平方公里" : r > 1e3 * 100 ? t = (r / 1e3 / 1e3).toFixed(2) + "平方公里" : t = r.toFixed(0) + "平方米", t;
|
|
37
37
|
};
|
|
@@ -41,39 +41,39 @@ class H {
|
|
|
41
41
|
let s = 0;
|
|
42
42
|
if (this.distanceLabel) {
|
|
43
43
|
s = A(e, i);
|
|
44
|
-
const a = "半径:" +
|
|
44
|
+
const a = "半径:" + p(s);
|
|
45
45
|
this.distanceLabel.position = new d(i), this.distanceLabel.label && (this.distanceLabel.label.text = new u(a));
|
|
46
46
|
}
|
|
47
47
|
if (this.areaLabel) {
|
|
48
|
-
const a = window.Math.PI * s * s, n = "面积:" +
|
|
48
|
+
const a = window.Math.PI * s * s, n = "面积:" + P(a);
|
|
49
49
|
this.areaLabel.position = new d(e), this.areaLabel.label && (this.areaLabel.label.text = new u(n));
|
|
50
50
|
}
|
|
51
51
|
}, this.circleMovingFun = (e, i) => {
|
|
52
52
|
let s = 0;
|
|
53
53
|
if (this.tmpDistanceLabel) {
|
|
54
54
|
s = A(e, i);
|
|
55
|
-
const a = "半径:" +
|
|
55
|
+
const a = "半径:" + p(s);
|
|
56
56
|
this.tmpDistanceLabel.show = !0, this.tmpDistanceLabel.position = new d(i), this.tmpDistanceLabel.label && (this.tmpDistanceLabel.label.text = new u(a));
|
|
57
57
|
}
|
|
58
58
|
if (this.tmpAreaLabel) {
|
|
59
|
-
const a = window.Math.PI * s * s, n = "面积:" +
|
|
59
|
+
const a = window.Math.PI * s * s, n = "面积:" + P(a);
|
|
60
60
|
this.tmpAreaLabel.position = new d(e), this.tmpAreaLabel.label && (this.tmpAreaLabel.label.text = new u(n));
|
|
61
61
|
}
|
|
62
62
|
}, this.circleOverFun = (e, i) => {
|
|
63
63
|
this.tmpDistanceLabel.show = !1, this.tmpAreaLabel.show = !1;
|
|
64
|
-
const s = this.createTextLabel(new
|
|
64
|
+
const s = this.createTextLabel(new g(), "", c.DARKRED), a = this.createTextLabel(new g(), "", c.BLACK);
|
|
65
65
|
this.distanceLabel = this.assistDataSource.entities.add(s), this.areaLabel = this.assistDataSource.entities.add(a), this.circleEditFun(e, i);
|
|
66
|
-
}, this.createTextLabel = (e, i, s =
|
|
66
|
+
}, this.createTextLabel = (e, i, s = c.DARKRED, a = -20) => {
|
|
67
67
|
const n = {
|
|
68
68
|
text: i,
|
|
69
69
|
font: "12px sans-serif bold",
|
|
70
|
-
fillColor:
|
|
70
|
+
fillColor: c.WHITE,
|
|
71
71
|
showBackground: !0,
|
|
72
72
|
backgroundColor: s,
|
|
73
|
-
style:
|
|
74
|
-
horizontalOrigin:
|
|
75
|
-
verticalOrigin:
|
|
76
|
-
pixelOffset: new
|
|
73
|
+
style: x.FILL_AND_OUTLINE,
|
|
74
|
+
horizontalOrigin: T.CENTER,
|
|
75
|
+
verticalOrigin: F.CENTER,
|
|
76
|
+
pixelOffset: new B(0, a),
|
|
77
77
|
//偏移量
|
|
78
78
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
79
79
|
};
|
|
@@ -86,7 +86,7 @@ class H {
|
|
|
86
86
|
start() {
|
|
87
87
|
var e;
|
|
88
88
|
(e = this.circleDrawer) == null || e.start();
|
|
89
|
-
const t = this.createTextLabel(new
|
|
89
|
+
const t = this.createTextLabel(new g(), "", c.DARKRED.withAlpha(0.6)), l = this.createTextLabel(new g(), "", c.BLACK.withAlpha(0.6));
|
|
90
90
|
this.tmpDistanceLabel = this.assistDataSource.entities.add(t), this.tmpAreaLabel = this.assistDataSource.entities.add(l);
|
|
91
91
|
}
|
|
92
92
|
getStatus() {
|
|
@@ -107,40 +107,40 @@ class H {
|
|
|
107
107
|
circleMovingFun: this.circleMovingFun,
|
|
108
108
|
circleOverFun: this.circleOverFun
|
|
109
109
|
}, ...t };
|
|
110
|
-
this.circleDrawer = new
|
|
110
|
+
this.circleDrawer = new j(this.viewer, e);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
class
|
|
113
|
+
class K {
|
|
114
114
|
constructor(t, l = null) {
|
|
115
115
|
this.tmpLabel = null, this.totalLabel = null, this.dataSource = new L("gagugerDataSource"), this.assistDataSource = new L("assistDataSource"), this.rectEditFun = (e) => {
|
|
116
116
|
if (this.totalLabel) {
|
|
117
|
-
const i =
|
|
117
|
+
const i = C(e), s = "面积:" + m(e);
|
|
118
118
|
i && (this.totalLabel.show = !0, this.totalLabel.position = new d(i), this.totalLabel.label && (this.totalLabel.label.text = new u(s)));
|
|
119
119
|
}
|
|
120
120
|
}, this.rectMovingFun = (e) => {
|
|
121
121
|
if (this.tmpLabel) {
|
|
122
|
-
const i =
|
|
122
|
+
const i = C(e), s = "面积:" + m(e);
|
|
123
123
|
i && (this.tmpLabel.show = !0, this.tmpLabel.position = new d(i), this.tmpLabel.label && (this.tmpLabel.label.text = new u(s)));
|
|
124
124
|
}
|
|
125
125
|
}, this.rectOverFun = (e) => {
|
|
126
126
|
if (this.tmpLabel && (this.tmpLabel.show = !1), !this.totalLabel) {
|
|
127
|
-
const i =
|
|
127
|
+
const i = C(e), s = "面积:" + m(e);
|
|
128
128
|
if (i) {
|
|
129
|
-
const a = this.createTextlabel(i, s,
|
|
129
|
+
const a = this.createTextlabel(i, s, c.BLACK);
|
|
130
130
|
this.totalLabel = this.assistDataSource.entities.add(a);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
}, this.createTextlabel = (e, i, s =
|
|
133
|
+
}, this.createTextlabel = (e, i, s = c.DARKRED, a = 0) => {
|
|
134
134
|
const n = {
|
|
135
135
|
text: i,
|
|
136
136
|
font: "12px sans-serif bold",
|
|
137
|
-
fillColor:
|
|
137
|
+
fillColor: c.WHITE,
|
|
138
138
|
showBackground: !0,
|
|
139
139
|
backgroundColor: s,
|
|
140
|
-
style:
|
|
141
|
-
horizontalOrigin:
|
|
142
|
-
verticalOrigin:
|
|
143
|
-
pixelOffset: new
|
|
140
|
+
style: x.FILL_AND_OUTLINE,
|
|
141
|
+
horizontalOrigin: T.CENTER,
|
|
142
|
+
verticalOrigin: F.CENTER,
|
|
143
|
+
pixelOffset: new B(0, a),
|
|
144
144
|
//偏移量
|
|
145
145
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
146
146
|
};
|
|
@@ -150,16 +150,16 @@ class X {
|
|
|
150
150
|
};
|
|
151
151
|
}, this.createTmplabel = () => {
|
|
152
152
|
let i = {
|
|
153
|
-
position: new
|
|
153
|
+
position: new g(),
|
|
154
154
|
label: {
|
|
155
155
|
text: "",
|
|
156
156
|
font: "12px sans-serif bold",
|
|
157
|
-
fillColor:
|
|
157
|
+
fillColor: c.WHITE,
|
|
158
158
|
showBackground: !0,
|
|
159
|
-
backgroundColor:
|
|
160
|
-
style:
|
|
161
|
-
horizontalOrigin:
|
|
162
|
-
verticalOrigin:
|
|
159
|
+
backgroundColor: c.BLACK.withAlpha(0.6),
|
|
160
|
+
style: x.FILL_AND_OUTLINE,
|
|
161
|
+
horizontalOrigin: T.LEFT,
|
|
162
|
+
verticalOrigin: F.BOTTOM,
|
|
163
163
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
164
164
|
},
|
|
165
165
|
show: !1
|
|
@@ -189,11 +189,11 @@ class X {
|
|
|
189
189
|
rectMovingFun: this.rectMovingFun,
|
|
190
190
|
rectOverFun: this.rectOverFun
|
|
191
191
|
}, ...t };
|
|
192
|
-
this.rectDrawer = new
|
|
192
|
+
this.rectDrawer = new U(this.viewer, e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cc+z8Drm2rOtMmtxX0kT9b2kuF4ydLLAW1wNZ5iP89C6wMeeeDPFCiOfT5Dwb4lQqccdTBYgz/26I39OEuhri2xA/z5E6R5Pxapnu+LE5oBH5ZohXp+R6XSFONiZxfsUafSnE5yF+avF9o/GXUXWxOBf+8kSLL4gl7p0Qr7UoWaM5Jl+8zZchPgvx54zb/lqmGjvrij/Q+9uM6Eax9eDCasoPsFJsPfAz/9zrIS6E+CiipjhOraRldtb1XoYdN5bW+nTQyTb4/PjI+iTRtfS168XmUZR1RXh3VkvQdmk+33iIqxYP826u822WxrVU66ZdsQ6+lB6+/GzW5jmWzR8oP/s1T4eddjrfzXCsraT1e9b1yXbLZLF5+Gx96OyxFMdT1B/XHV05BRtXtU9nOO7GL77RAhzr5wchvupoRbsc4sMZEy5eN8rUaNxsUYvjCHycuqo3QrySSt1ur1sJ+kWIay1uH433Yx2uc/nCnKtdfHTOpSblubTKnU1lskypsJYqwZ200sX4Pq101+dYvmNF+TreV5mVqitz9hMbaWSuFd1e68k2bj4vUf8Utw9Qt3Y7mdZ36ofHqbScTj3DiSVB76X+4n+V6R8BBgDKRo2v+bLvIgAAAABJRU5ErkJggg==";
|
|
196
|
+
class J {
|
|
197
197
|
constructor(t, l) {
|
|
198
198
|
this.editCallback = (e, i) => {
|
|
199
199
|
const s = this.getLonLatStr(e);
|
|
@@ -205,21 +205,21 @@ class K {
|
|
|
205
205
|
label: {
|
|
206
206
|
text: i,
|
|
207
207
|
font: "500 14px Helvetica",
|
|
208
|
-
style:
|
|
209
|
-
fillColor:
|
|
210
|
-
outlineColor:
|
|
211
|
-
pixelOffset: new
|
|
208
|
+
style: x.FILL,
|
|
209
|
+
fillColor: c.WHITE,
|
|
210
|
+
outlineColor: c.BLACK,
|
|
211
|
+
pixelOffset: new B(0, -90),
|
|
212
212
|
//偏移量
|
|
213
213
|
showBackground: !0,
|
|
214
|
-
backgroundColor:
|
|
215
|
-
horizontalOrigin:
|
|
214
|
+
backgroundColor: c.ORANGERED,
|
|
215
|
+
horizontalOrigin: T.LEFT
|
|
216
216
|
},
|
|
217
217
|
billboard: {
|
|
218
|
-
image:
|
|
218
|
+
image: V,
|
|
219
219
|
width: 30,
|
|
220
220
|
height: 100,
|
|
221
221
|
scale: 1,
|
|
222
|
-
verticalOrigin:
|
|
222
|
+
verticalOrigin: F.BOTTOM
|
|
223
223
|
},
|
|
224
224
|
show: !0
|
|
225
225
|
});
|
|
@@ -254,79 +254,82 @@ class K {
|
|
|
254
254
|
addPointFun: this.addPointFun,
|
|
255
255
|
editPointFun: this.editPointFun
|
|
256
256
|
};
|
|
257
|
-
this.delConfirmFun && (t.delConfirmFun = this.delConfirmFun), this.pointDrawer = new
|
|
257
|
+
this.delConfirmFun && (t.delConfirmFun = this.delConfirmFun), this.pointDrawer = new W(this.viewer, t);
|
|
258
258
|
}
|
|
259
259
|
getLonLatStr(t) {
|
|
260
|
-
const l =
|
|
260
|
+
const l = v.fromCartesian(t), e = k.toDegrees(l.longitude), i = k.toDegrees(l.latitude);
|
|
261
261
|
return `${e.toFixed(2)}, ${i.toFixed(2)}`;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
class
|
|
264
|
+
class Q {
|
|
265
265
|
constructor(t, l) {
|
|
266
|
-
this.tmpLabel = null, this.totalLabel = null, this.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
266
|
+
this.tmpLabel = null, this.totalLabel = null, this.itemDisSource = new L("itemDisDataSource"), this.totalDisSource = new L("totalDisSource"), this.afterAddPointFun = (e) => {
|
|
267
|
+
var i, s, a;
|
|
268
|
+
if (((i = this.lineDrawer) == null ? void 0 : i.getStatus()) == G.DRAWABLE) {
|
|
269
|
+
const n = (s = e.position) == null ? void 0 : s.getValue(), o = this.lineDrawer.getPositions();
|
|
270
|
+
let b = o.length;
|
|
271
|
+
if (b > 1) {
|
|
272
|
+
const D = I(o[b - 2], n), S = A(o[b - 2], n), h = p(S);
|
|
273
|
+
let w = this.createTextlabel(D, h);
|
|
274
|
+
this.itemDisSource.entities.add(w);
|
|
275
|
+
}
|
|
276
|
+
} else ((a = this.lineDrawer) == null ? void 0 : a.getStatus()) == G.EDITABLE && this.reCreateAll();
|
|
274
277
|
}, this.movingCallbackFun = (e) => {
|
|
275
278
|
if (this.tmpLabel) {
|
|
276
279
|
const i = this.lineDrawer.getPositions(), s = i[i.length - 1];
|
|
277
|
-
let a = A(s, e), n =
|
|
280
|
+
let a = A(s, e), n = p(a);
|
|
278
281
|
this.tmpLabel.show = !0, this.tmpLabel.position = new d(e), this.tmpLabel.label && (this.tmpLabel.label.text = new u(n));
|
|
279
282
|
}
|
|
280
283
|
}, this.editCallbackFun = (e, i) => {
|
|
281
284
|
const s = this.lineDrawer.getPositions();
|
|
282
|
-
let a = -1, n = -1,
|
|
285
|
+
let a = -1, n = -1, o = 0, b = 0;
|
|
283
286
|
if (i > 0) {
|
|
284
287
|
a = i;
|
|
285
|
-
const h = this.
|
|
286
|
-
|
|
287
|
-
const E =
|
|
288
|
-
h.position = new d(
|
|
288
|
+
const h = this.itemDisSource.entities.values[i - 1], w = s[i - 1], f = I(w, e);
|
|
289
|
+
o = A(w, e);
|
|
290
|
+
const E = p(o);
|
|
291
|
+
h.position = new d(f), h.label.text = new u(E);
|
|
289
292
|
}
|
|
290
293
|
if (i < s.length - 1) {
|
|
291
294
|
n = i + 1;
|
|
292
|
-
const h = this.
|
|
293
|
-
|
|
294
|
-
const E =
|
|
295
|
-
h.position = new d(
|
|
295
|
+
const h = this.itemDisSource.entities.values[i], w = s[i + 1], f = I(e, w);
|
|
296
|
+
b = A(e, w);
|
|
297
|
+
const E = p(b);
|
|
298
|
+
h.position = new d(f), h.label.text = new u(E);
|
|
296
299
|
}
|
|
297
300
|
i == s.length - 1 && this.totalLabel && (this.totalLabel.position = new d(e));
|
|
298
301
|
let D = 0;
|
|
299
|
-
for (let h = 1,
|
|
302
|
+
for (let h = 1, w = s.length; h < w; h++) {
|
|
300
303
|
if (a == h || n == h)
|
|
301
304
|
continue;
|
|
302
|
-
const
|
|
303
|
-
D +=
|
|
305
|
+
const f = s[h - 1], E = s[h], R = A(f, E);
|
|
306
|
+
D += R;
|
|
304
307
|
}
|
|
305
|
-
D +=
|
|
306
|
-
let
|
|
307
|
-
this.totalLabel && (this.totalLabel.label.text = new u(
|
|
308
|
-
}, this.
|
|
308
|
+
D += o, D += b;
|
|
309
|
+
let S = "共:" + p(D);
|
|
310
|
+
this.totalLabel && (this.totalLabel.label.text = new u(S));
|
|
311
|
+
}, this.stopDrawCallbackFun = () => {
|
|
309
312
|
if (this.tmpLabel && (this.tmpLabel.show = !1), !this.totalLabel) {
|
|
310
313
|
const e = this.lineDrawer.getPositions();
|
|
311
314
|
let i = 0, s = e.length;
|
|
312
|
-
for (let
|
|
313
|
-
const
|
|
314
|
-
i +=
|
|
315
|
+
for (let o = 1; o < s; o++) {
|
|
316
|
+
const b = e[o - 1], D = e[o], S = A(b, D);
|
|
317
|
+
i += S;
|
|
315
318
|
}
|
|
316
|
-
let a = "共:" +
|
|
317
|
-
this.totalLabel = this.
|
|
319
|
+
let a = "共:" + p(i), n = this.createTextlabel(e[s - 1], a, c.BLACK, -20);
|
|
320
|
+
this.totalLabel = this.totalDisSource.entities.add(n);
|
|
318
321
|
}
|
|
319
|
-
}, this.createTextlabel = (e, i, s =
|
|
322
|
+
}, this.createTextlabel = (e, i, s = c.DARKRED, a = 0) => {
|
|
320
323
|
const n = {
|
|
321
324
|
text: i,
|
|
322
325
|
font: "12px sans-serif bold",
|
|
323
|
-
fillColor:
|
|
326
|
+
fillColor: c.WHITE,
|
|
324
327
|
showBackground: !0,
|
|
325
328
|
backgroundColor: s,
|
|
326
|
-
style:
|
|
327
|
-
horizontalOrigin:
|
|
328
|
-
verticalOrigin:
|
|
329
|
-
pixelOffset: new
|
|
329
|
+
style: x.FILL_AND_OUTLINE,
|
|
330
|
+
horizontalOrigin: T.CENTER,
|
|
331
|
+
verticalOrigin: F.CENTER,
|
|
332
|
+
pixelOffset: new B(0, a),
|
|
330
333
|
//偏移量
|
|
331
334
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
332
335
|
};
|
|
@@ -334,101 +337,104 @@ class J {
|
|
|
334
337
|
position: e,
|
|
335
338
|
label: n
|
|
336
339
|
};
|
|
337
|
-
}, this.createTmplabel = () => {
|
|
338
|
-
let i = {
|
|
339
|
-
position: new b(),
|
|
340
|
-
label: {
|
|
341
|
-
text: "",
|
|
342
|
-
font: "12px sans-serif bold",
|
|
343
|
-
fillColor: o.WHITE,
|
|
344
|
-
showBackground: !0,
|
|
345
|
-
backgroundColor: o.RED.withAlpha(0.6),
|
|
346
|
-
style: C.FILL_AND_OUTLINE,
|
|
347
|
-
horizontalOrigin: f.LEFT,
|
|
348
|
-
verticalOrigin: S.BOTTOM,
|
|
349
|
-
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
350
|
-
},
|
|
351
|
-
show: !1
|
|
352
|
-
};
|
|
353
|
-
return this.assistDataSource.entities.add(i);
|
|
354
340
|
}, this.reCreateAll = () => {
|
|
355
|
-
this.
|
|
341
|
+
this.itemDisSource.entities.removeAll(), this.totalDisSource.entities.removeAll();
|
|
356
342
|
const e = this.lineDrawer.getPositions();
|
|
357
343
|
let i = 0, s = e.length;
|
|
358
|
-
for (let
|
|
359
|
-
const
|
|
344
|
+
for (let o = 1; o < s; o++) {
|
|
345
|
+
const b = e[o - 1], D = e[o], S = I(b, D), h = A(b, D);
|
|
360
346
|
i += h;
|
|
361
|
-
let
|
|
362
|
-
this.
|
|
347
|
+
let w = p(h), f = this.createTextlabel(S, w);
|
|
348
|
+
this.itemDisSource.entities.add(f);
|
|
363
349
|
}
|
|
364
|
-
let a = "共:" +
|
|
365
|
-
this.totalLabel = this.
|
|
366
|
-
}, this.viewer = t, this.viewer.dataSources.add(this.
|
|
350
|
+
let a = "共:" + p(i), n = this.createTextlabel(e[s - 1], a, c.BLACK, -20);
|
|
351
|
+
this.totalLabel = this.totalDisSource.entities.add(n);
|
|
352
|
+
}, this.viewer = t, this.viewer.dataSources.add(this.itemDisSource), this.viewer.dataSources.add(this.totalDisSource), this.init(l);
|
|
367
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* 开始绘制
|
|
356
|
+
*/
|
|
368
357
|
start() {
|
|
369
358
|
var t;
|
|
370
|
-
(t = this.lineDrawer) == null || t.start()
|
|
359
|
+
(t = this.lineDrawer) == null || t.start();
|
|
371
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* 获取状态
|
|
363
|
+
*/
|
|
372
364
|
getStatus() {
|
|
373
365
|
var t;
|
|
374
366
|
(t = this.lineDrawer) == null || t.getStatus();
|
|
375
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* 进入编辑状态
|
|
370
|
+
*/
|
|
376
371
|
setEditStatus() {
|
|
377
372
|
var t;
|
|
378
|
-
(t = this.lineDrawer) == null || t.setEditStatus(), this.
|
|
373
|
+
(t = this.lineDrawer) == null || t.setEditStatus(), this.stopDrawCallbackFun();
|
|
379
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* 进入删除状态
|
|
377
|
+
*/
|
|
380
378
|
setDelStatus() {
|
|
381
379
|
var t;
|
|
382
|
-
(t = this.lineDrawer) == null || t.setDelStatus(), this.
|
|
380
|
+
(t = this.lineDrawer) == null || t.setDelStatus(), this.stopDrawCallbackFun();
|
|
383
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* 全部清理
|
|
384
|
+
*/
|
|
384
385
|
clearAll() {
|
|
385
386
|
var t;
|
|
386
|
-
(t = this.lineDrawer) == null || t.clearAll(), this.
|
|
387
|
+
(t = this.lineDrawer) == null || t.clearAll(), this.itemDisSource.entities.removeAll(), this.totalDisSource.entities.removeAll();
|
|
387
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* 初始化
|
|
391
|
+
* @param options
|
|
392
|
+
*/
|
|
388
393
|
init(t) {
|
|
389
394
|
let e = { ...{
|
|
390
395
|
afterAddPointFun: this.afterAddPointFun,
|
|
391
396
|
movingCallbackFun: this.movingCallbackFun,
|
|
392
397
|
editCallbackFun: this.editCallbackFun,
|
|
393
|
-
|
|
398
|
+
stopDrawCallbackFun: this.stopDrawCallbackFun,
|
|
394
399
|
delCallbackFun: this.reCreateAll
|
|
395
400
|
}, ...t };
|
|
396
|
-
this.lineDrawer = new
|
|
401
|
+
this.lineDrawer = new O(this.viewer, e);
|
|
397
402
|
}
|
|
398
403
|
}
|
|
399
|
-
class
|
|
404
|
+
class q {
|
|
400
405
|
constructor(t, l = null) {
|
|
401
|
-
this.tmpLabel = null, this.totalLabel = null, this.openTmpLabel = !1, this.dataSource = new L("gagugerDataSource"), this.assistDataSource = new L("
|
|
402
|
-
|
|
406
|
+
this.tmpLabel = null, this.totalLabel = null, this.openTmpLabel = !1, this.dataSource = new L("gagugerDataSource"), this.assistDataSource = new L("totalAreaDataSource"), this.afterAddPointFun = () => {
|
|
407
|
+
var e, i;
|
|
408
|
+
((e = this.polygonDrawer) == null ? void 0 : e.getStatus()) == G.DRAWABLE ? this.polygonDrawer.getPositions().length > 1 && (this.openTmpLabel = !0) : ((i = this.polygonDrawer) == null ? void 0 : i.getStatus()) == G.EDITABLE && this.reCreateAll();
|
|
403
409
|
}, this.movingCallbackFun = (e) => {
|
|
404
410
|
if (this.openTmpLabel && this.tmpLabel) {
|
|
405
|
-
const s = [...this.polygonDrawer.getPositions(), e], a =
|
|
411
|
+
const s = [...this.polygonDrawer.getPositions(), e], a = C(s), n = "面积:" + m(s);
|
|
406
412
|
a && (this.tmpLabel.show = !0, this.tmpLabel.position = new d(a), this.tmpLabel.label && (this.tmpLabel.label.text = new u(n)));
|
|
407
413
|
}
|
|
408
414
|
}, this.editCallbackFun = (e) => {
|
|
409
415
|
if (this.openTmpLabel && this.totalLabel) {
|
|
410
|
-
const s = [...this.polygonDrawer.getPositions(), e], a =
|
|
416
|
+
const s = [...this.polygonDrawer.getPositions(), e], a = C(s), n = "面积:" + m(s);
|
|
411
417
|
a && (this.totalLabel.show = !0, this.totalLabel.position = new d(a), this.totalLabel.label && (this.totalLabel.label.text = new u(n)));
|
|
412
418
|
}
|
|
413
|
-
}, this.
|
|
419
|
+
}, this.stopDrawCallbackFun = () => {
|
|
414
420
|
if (this.tmpLabel && (this.tmpLabel.show = !1), !this.totalLabel) {
|
|
415
|
-
const e = this.polygonDrawer.getPositions(), i =
|
|
421
|
+
const e = this.polygonDrawer.getPositions(), i = C(e), s = "面积:" + m(e);
|
|
416
422
|
if (i) {
|
|
417
|
-
const a = this.createTextlabel(i, s,
|
|
423
|
+
const a = this.createTextlabel(i, s, c.BLACK);
|
|
418
424
|
this.totalLabel = this.assistDataSource.entities.add(a);
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
|
-
}, this.createTextlabel = (e, i, s =
|
|
427
|
+
}, this.createTextlabel = (e, i, s = c.DARKRED, a = 0) => {
|
|
422
428
|
const n = {
|
|
423
429
|
text: i,
|
|
424
430
|
font: "12px sans-serif bold",
|
|
425
|
-
fillColor:
|
|
431
|
+
fillColor: c.WHITE,
|
|
426
432
|
showBackground: !0,
|
|
427
433
|
backgroundColor: s,
|
|
428
|
-
style:
|
|
429
|
-
horizontalOrigin:
|
|
430
|
-
verticalOrigin:
|
|
431
|
-
pixelOffset: new
|
|
434
|
+
style: x.FILL_AND_OUTLINE,
|
|
435
|
+
horizontalOrigin: T.CENTER,
|
|
436
|
+
verticalOrigin: F.CENTER,
|
|
437
|
+
pixelOffset: new B(0, a),
|
|
432
438
|
//偏移量
|
|
433
439
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
434
440
|
};
|
|
@@ -438,16 +444,16 @@ class Q {
|
|
|
438
444
|
};
|
|
439
445
|
}, this.createTmplabel = () => {
|
|
440
446
|
let i = {
|
|
441
|
-
position: new
|
|
447
|
+
position: new g(),
|
|
442
448
|
label: {
|
|
443
449
|
text: "",
|
|
444
450
|
font: "12px sans-serif bold",
|
|
445
|
-
fillColor:
|
|
451
|
+
fillColor: c.WHITE,
|
|
446
452
|
showBackground: !0,
|
|
447
|
-
backgroundColor:
|
|
448
|
-
style:
|
|
449
|
-
horizontalOrigin:
|
|
450
|
-
verticalOrigin:
|
|
453
|
+
backgroundColor: c.BLACK.withAlpha(0.6),
|
|
454
|
+
style: x.FILL_AND_OUTLINE,
|
|
455
|
+
horizontalOrigin: T.CENTER,
|
|
456
|
+
verticalOrigin: F.CENTER,
|
|
451
457
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
452
458
|
},
|
|
453
459
|
show: !1
|
|
@@ -455,9 +461,9 @@ class Q {
|
|
|
455
461
|
return this.assistDataSource.entities.add(i);
|
|
456
462
|
}, this.reCreateAll = () => {
|
|
457
463
|
this.dataSource.entities.removeAll(), this.assistDataSource.entities.removeAll();
|
|
458
|
-
const e = this.polygonDrawer.getPositions(), i =
|
|
464
|
+
const e = this.polygonDrawer.getPositions(), i = C(e), s = m(e);
|
|
459
465
|
if (i) {
|
|
460
|
-
const a = this.createTextlabel(i, s,
|
|
466
|
+
const a = this.createTextlabel(i, s, c.BLACK);
|
|
461
467
|
this.totalLabel = this.assistDataSource.entities.add(a);
|
|
462
468
|
}
|
|
463
469
|
}, this.viewer = t, this.viewer.dataSources.add(this.dataSource), this.viewer.dataSources.add(this.assistDataSource), this.init(l);
|
|
@@ -472,11 +478,11 @@ class Q {
|
|
|
472
478
|
}
|
|
473
479
|
setEditStatus() {
|
|
474
480
|
var t;
|
|
475
|
-
(t = this.polygonDrawer) == null || t.setEditStatus(), this.
|
|
481
|
+
(t = this.polygonDrawer) == null || t.setEditStatus(), this.stopDrawCallbackFun();
|
|
476
482
|
}
|
|
477
483
|
setDelStatus() {
|
|
478
484
|
var t;
|
|
479
|
-
(t = this.polygonDrawer) == null || t.setDelStatus(), this.
|
|
485
|
+
(t = this.polygonDrawer) == null || t.setDelStatus(), this.stopDrawCallbackFun();
|
|
480
486
|
}
|
|
481
487
|
clearAll() {
|
|
482
488
|
var t;
|
|
@@ -484,20 +490,20 @@ class Q {
|
|
|
484
490
|
}
|
|
485
491
|
init(t) {
|
|
486
492
|
let e = { ...{
|
|
487
|
-
drawerMode:
|
|
493
|
+
drawerMode: Z.POLYGON,
|
|
488
494
|
afterAddPointFun: this.afterAddPointFun,
|
|
489
495
|
movingCallbackFun: this.movingCallbackFun,
|
|
490
496
|
editCallbackFun: this.editCallbackFun,
|
|
491
|
-
|
|
497
|
+
stopDrawCallbackFun: this.stopDrawCallbackFun,
|
|
492
498
|
delCallbackFun: this.reCreateAll
|
|
493
499
|
}, ...t };
|
|
494
|
-
this.polygonDrawer = new
|
|
500
|
+
this.polygonDrawer = new O(this.viewer, e);
|
|
495
501
|
}
|
|
496
502
|
}
|
|
497
503
|
export {
|
|
498
504
|
H as C,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
505
|
+
Q as L,
|
|
506
|
+
J as P,
|
|
507
|
+
K as R,
|
|
508
|
+
q as a
|
|
503
509
|
};
|
package/drawer.js
CHANGED
package/gauger.js
CHANGED
package/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import * as IA from "three";
|
|
|
3
3
|
import { TrianglesDrawMode as aP, TriangleFanDrawMode as UA, TriangleStripDrawMode as AP, Loader as uP, LoaderUtils as gA, FileLoader as PP, Color as F, LinearSRGBColorSpace as J, SpotLight as pP, PointLight as iP, DirectionalLight as MP, MeshBasicMaterial as vA, SRGBColorSpace as wA, MeshPhysicalMaterial as q, Vector2 as eP, Matrix4 as TA, Vector3 as PA, Quaternion as tP, InstancedMesh as bP, InstancedBufferAttribute as fP, Object3D as nP, TextureLoader as dP, ImageBitmapLoader as mP, BufferAttribute as oA, InterleavedBuffer as yP, InterleavedBufferAttribute as UP, LinearMipmapLinearFilter as sP, NearestMipmapLinearFilter as jP, LinearMipmapNearestFilter as kP, NearestMipmapNearestFilter as LP, LinearFilter as jA, NearestFilter as rP, RepeatWrapping as kA, MirroredRepeatWrapping as SP, ClampToEdgeWrapping as HP, PointsMaterial as OP, Material as aA, LineBasicMaterial as qP, MeshStandardMaterial as BP, DoubleSide as hP, PropertyBinding as VP, BufferGeometry as JP, SkinnedMesh as KP, Mesh as YP, LineSegments as NP, Line as ZP, LineLoop as xP, Points as GP, Group as uA, PerspectiveCamera as XP, MathUtils as WP, OrthographicCamera as FP, Skeleton as RP, AnimationClip as _P, Bone as $P, InterpolateDiscrete as Ae, InterpolateLinear as vP, ColorManagement as JA, Texture as KA, VectorKeyframeTrack as YA, NumberKeyframeTrack as NA, QuaternionKeyframeTrack as ZA, FrontSide as Pe, Interpolant as ee, Box3 as te, Sphere as ne } from "three";
|
|
4
4
|
import { Viewer as x, Math as cA, Cartesian2 as QA, Cartesian3 as Y, Cartographic as gP, SceneTransforms as se, Ray as re, Color as Be, ScreenSpaceEventType as pA, ScreenSpaceEventHandler as ve, createWorldTerrainAsync as ge, EllipsoidTerrainProvider as Ce, WebMapTileServiceImageryProvider as _, Credit as $, JulianDate as V, CzmlDataSource as we } from "cesium";
|
|
5
5
|
import { P as rA, a as xA, b as ce, c as De, d as Ie, C as GA } from "./index-CcaLwHv1.js";
|
|
6
|
-
import { C as un, a as pn, b as Mn, D as bn, P as fn, R as dn } from "./CircleDrawer-
|
|
7
|
-
import { C as yn, L as Un, P as jn, a as kn, R as Ln } from "./PolygonGaguger-
|
|
6
|
+
import { C as un, a as pn, b as Mn, D as bn, P as fn, R as dn } from "./CircleDrawer-DClMwtZ9.js";
|
|
7
|
+
import { C as yn, L as Un, P as jn, a as kn, R as Ln } from "./PolygonGaguger-Brzz7_9X.js";
|
|
8
8
|
function XA(w, A) {
|
|
9
9
|
if (A === aP)
|
|
10
10
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), w;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cartesian3, Viewer, PolylineGraphics, PolygonGraphics, PointGraphics } from 'cesium';
|
|
2
|
-
import { DataCenter,
|
|
2
|
+
import { DataCenter, AddCallbackFn, MovingCallbackFn, DelConfirmFn, NoPropCallbackFn, EditCallbackFn } from './DataCenter.ts';
|
|
3
3
|
export declare const DRAWER_MODE: {
|
|
4
4
|
readonly LINE: symbol;
|
|
5
5
|
readonly POLYGON: symbol;
|
|
@@ -11,12 +11,12 @@ export type CP2dOptions = {
|
|
|
11
11
|
polygon?: PolygonGraphics.ConstructorOptions;
|
|
12
12
|
polyline?: PolylineGraphics.ConstructorOptions;
|
|
13
13
|
deshline?: PolylineGraphics.ConstructorOptions;
|
|
14
|
-
afterAddPointFun?:
|
|
15
|
-
movingCallbackFun?:
|
|
14
|
+
afterAddPointFun?: AddCallbackFn;
|
|
15
|
+
movingCallbackFun?: MovingCallbackFn;
|
|
16
16
|
editCallbackFun?: EditCallbackFn;
|
|
17
17
|
delConfirmFun?: DelConfirmFn;
|
|
18
18
|
delCallbackFun?: NoPropCallbackFn;
|
|
19
|
-
|
|
19
|
+
stopDrawCallbackFun?: NoPropCallbackFn;
|
|
20
20
|
} | null;
|
|
21
21
|
export declare class CP2dDrawer extends DataCenter {
|
|
22
22
|
private handler?;
|
|
@@ -28,7 +28,7 @@ export declare class CP2dDrawer extends DataCenter {
|
|
|
28
28
|
private polygon;
|
|
29
29
|
private deshline;
|
|
30
30
|
private drawerMode;
|
|
31
|
-
private
|
|
31
|
+
private stopDrawCallbackFun;
|
|
32
32
|
constructor(viewer: Viewer, options?: CP2dOptions);
|
|
33
33
|
start(): void;
|
|
34
34
|
getEntity(): any;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Cartesian3, Entity, PointGraphics, Viewer } from 'cesium';
|
|
2
2
|
import { DrawerStatus } from './DrawerStatus';
|
|
3
|
-
export type
|
|
3
|
+
export type AddCallbackFn = (entity: Entity) => void;
|
|
4
|
+
export type MovingCallbackFn = (cartesian: Cartesian3) => void;
|
|
4
5
|
export type EditCallbackFn = (cartesian: Cartesian3, index: number) => void;
|
|
5
6
|
export type DelConfirmFn = () => Promise<boolean>;
|
|
6
7
|
export type NoPropCallbackFn = () => void;
|
|
@@ -10,8 +11,8 @@ export declare class DataCenter extends DrawerStatus {
|
|
|
10
11
|
protected currentDragPoint: Entity | null;
|
|
11
12
|
protected currentIndex: number;
|
|
12
13
|
protected point: PointGraphics.ConstructorOptions | undefined;
|
|
13
|
-
protected afterAddPointFun:
|
|
14
|
-
protected movingCallbackFun:
|
|
14
|
+
protected afterAddPointFun: AddCallbackFn | undefined;
|
|
15
|
+
protected movingCallbackFun: MovingCallbackFn | undefined;
|
|
15
16
|
protected editCallbackFun: EditCallbackFn | undefined;
|
|
16
17
|
protected delCallbackFun: NoPropCallbackFn | undefined;
|
|
17
18
|
protected delConfirmFun: DelConfirmFn;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Cartesian3, Viewer, Entity } from 'cesium';
|
|
2
|
-
import { DataCenter,
|
|
2
|
+
import { DataCenter, AddCallbackFn, DelConfirmFn } from './DataCenter.ts';
|
|
3
3
|
export type EditBillboardFn = (cartesian: Cartesian3, entity: Entity) => void;
|
|
4
4
|
export type EntityCallbackFn = (cartesian: Cartesian3) => Entity;
|
|
5
5
|
export type PointOptions = {
|
|
6
6
|
addPointFun?: EntityCallbackFn;
|
|
7
|
-
afterAddPointFun?:
|
|
7
|
+
afterAddPointFun?: AddCallbackFn;
|
|
8
8
|
editPointFun?: EditBillboardFn;
|
|
9
9
|
delConfirmFun?: DelConfirmFn;
|
|
10
10
|
} | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Viewer, Cartesian3, Entity, PointGraphics, PolylineGraphics } from 'cesium';
|
|
2
|
-
import { DelConfirmFn } from '
|
|
2
|
+
import { DelConfirmFn } from '../drawer/DataCenter';
|
|
3
3
|
export type EntityCallbackFn = (cartesian: Cartesian3) => Entity;
|
|
4
4
|
export type LineGaugerOptions = {
|
|
5
5
|
point?: PointGraphics.ConstructorOptions;
|
|
@@ -12,20 +12,39 @@ export declare class LineGaguger {
|
|
|
12
12
|
private viewer;
|
|
13
13
|
private tmpLabel;
|
|
14
14
|
private totalLabel;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
15
|
+
private itemDisSource;
|
|
16
|
+
private totalDisSource;
|
|
17
17
|
constructor(viewer: Viewer, options?: LineGaugerOptions);
|
|
18
|
+
/**
|
|
19
|
+
* 开始绘制
|
|
20
|
+
*/
|
|
18
21
|
start(): void;
|
|
22
|
+
/**
|
|
23
|
+
* 获取状态
|
|
24
|
+
*/
|
|
19
25
|
getStatus(): void;
|
|
26
|
+
/**
|
|
27
|
+
* 进入编辑状态
|
|
28
|
+
*/
|
|
20
29
|
setEditStatus(): void;
|
|
30
|
+
/**
|
|
31
|
+
* 进入删除状态
|
|
32
|
+
*/
|
|
21
33
|
setDelStatus(): void;
|
|
34
|
+
/**
|
|
35
|
+
* 全部清理
|
|
36
|
+
*/
|
|
22
37
|
clearAll(): void;
|
|
38
|
+
/**
|
|
39
|
+
* 初始化
|
|
40
|
+
* @param options
|
|
41
|
+
*/
|
|
23
42
|
private init;
|
|
24
43
|
private afterAddPointFun;
|
|
25
44
|
private movingCallbackFun;
|
|
26
45
|
private editCallbackFun;
|
|
27
|
-
private
|
|
46
|
+
private stopDrawCallbackFun;
|
|
28
47
|
private createTextlabel;
|
|
29
|
-
|
|
48
|
+
/**重新清除所有再创建所有 */
|
|
30
49
|
private reCreateAll;
|
|
31
50
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Viewer, Cartesian3, Entity, PointGraphics, PolylineGraphics, PolygonGraphics } from 'cesium';
|
|
2
|
-
import { DelConfirmFn } from '
|
|
2
|
+
import { DelConfirmFn } from '../drawer/DataCenter';
|
|
3
3
|
export type EntityCallbackFn = (cartesian: Cartesian3) => Entity;
|
|
4
4
|
export type PolygonGaugerOptions = {
|
|
5
5
|
point?: PointGraphics.ConstructorOptions;
|
|
@@ -26,7 +26,7 @@ export declare class PolygonGaguger {
|
|
|
26
26
|
private afterAddPointFun;
|
|
27
27
|
private movingCallbackFun;
|
|
28
28
|
private editCallbackFun;
|
|
29
|
-
private
|
|
29
|
+
private stopDrawCallbackFun;
|
|
30
30
|
private createTextlabel;
|
|
31
31
|
private createTmplabel;
|
|
32
32
|
private reCreateAll;
|