cesium-pocket 0.2.1-alpha → 0.3.0-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.
@@ -0,0 +1,562 @@
1
+ import { CustomDataSource as C, Cartesian3 as r, JulianDate as I, defined as l, ConstantPositionProperty as E, HeightReference as P, Color as u, EntityCollection as B, ScreenSpaceEventType as c, ScreenSpaceEventHandler as w, VerticalOrigin as R, PolylineDashMaterialProperty as M, CallbackProperty as A, PolygonHierarchy as m, Cartographic as y, Transforms as S, Matrix4 as g, EllipsoidGeodesic as k } from "cesium";
2
+ import { toRaw as d } from "vue";
3
+ const h = {
4
+ STOPED: Symbol("STOPED"),
5
+ //未开启状态
6
+ DRAWABLE: Symbol("DRAWABLE"),
7
+ //可绘绘制状态
8
+ EDITABLE: Symbol("EDITABLE"),
9
+ //可编辑经纬度状态
10
+ HIGHTABLE: Symbol("HIGHTABLE"),
11
+ //可编辑经纬度状态
12
+ DELETABLE: Symbol("DELETABLE")
13
+ //可删除状态
14
+ }, o = {
15
+ DRAG_UNABLED: Symbol("DRAG_UNABLED"),
16
+ //不可拖拽
17
+ DRAG_ENABLED: Symbol("DRAG_ENABLED"),
18
+ //可拖拽
19
+ DRAGING: Symbol("DRAGING")
20
+ //正在拖拽中
21
+ }, p = {
22
+ DEL_UNABLED: Symbol("DEL_UNABLED"),
23
+ //不删除
24
+ DEL_ENABLED: Symbol("DEL_ENABLED")
25
+ //可拖拽
26
+ };
27
+ class G {
28
+ constructor(e) {
29
+ this.status = h.STOPED, this.editStatus = o.DRAG_UNABLED, this.delStatus = p.DEL_UNABLED, this.viewer = e;
30
+ }
31
+ getStatus() {
32
+ return this.status;
33
+ }
34
+ getEditStatus() {
35
+ return this.editStatus;
36
+ }
37
+ getDelStatus() {
38
+ return this.delStatus;
39
+ }
40
+ setEditStatus() {
41
+ this.editableStatus();
42
+ }
43
+ setDelStatus() {
44
+ this.deletableStatus();
45
+ }
46
+ /**
47
+ * 可添加点
48
+ */
49
+ drawableStatus() {
50
+ this.status = h.DRAWABLE, this.viewer.canvas.style.cursor = "crosshair";
51
+ }
52
+ /**
53
+ * 可移动点
54
+ */
55
+ editableStatus() {
56
+ this.status = h.EDITABLE, this.viewer.canvas.style.cursor = "pointer";
57
+ }
58
+ deletableStatus() {
59
+ this.status = h.DELETABLE, this.viewer.canvas.style.cursor = "grabbing";
60
+ }
61
+ /**
62
+ * 停止操作
63
+ */
64
+ stopStatus() {
65
+ this.status = h.STOPED, this.viewer.canvas.style.cursor = "default";
66
+ }
67
+ //----------------------------------------
68
+ editDragUnable() {
69
+ this.editStatus = o.DRAG_UNABLED, this.viewer.canvas.style.cursor = "pointer";
70
+ }
71
+ editDragEnable() {
72
+ this.editStatus = o.DRAG_ENABLED, this.viewer.canvas.style.cursor = "grab";
73
+ }
74
+ editDraging() {
75
+ this.editStatus = o.DRAGING, this.viewer.canvas.style.cursor = "move";
76
+ }
77
+ //------------------------
78
+ delUnable() {
79
+ this.delStatus = p.DEL_UNABLED, this.viewer.canvas.style.cursor = "pointer";
80
+ }
81
+ delEnable() {
82
+ this.delStatus = p.DEL_ENABLED, this.viewer.canvas.style.cursor = "grabbing";
83
+ }
84
+ }
85
+ const U = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAQAElEQVR4AexdfYwkR3V/r3dnb884wUd03O1HTrZj4p09/CFMSBwpkqX8Ayjkj6ALQY6ixHIc8REJRUoiJUK+80eI7QQH28IOR+xIxOGwyCVRIHEE2JgD6cAfCPt2d9b4ZMt3O7uAfUYceG9ndrp4r6d1N7eeme7prq7q6np7VdvdVa/e+73f699M983OTADyIwwIAwMZEIEMpEYmhAEAEYicBcLAEAZEIEPIkSlhQAQi54AwMISBAgUyJKpMCQOOMCACcaRQAtMOAyIQO7xLVEcYEIE4UiiBaYcBEYgd3iWqIwy4KRBHyBWY7jMgAnG/hpJBgQyIQAokV1y7z4AIxP0aSgYFMiACKZBcce0+Ay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hdfkk+iQERSBJDMu81AyIQr8svyScxIAJJYkjmvWZABFJQ+cVtNRj4OQAAAP//gm46zwAAAAZJREFUAwB1f5TcL2bFTAAAAABJRU5ErkJggg==";
86
+ class L extends G {
87
+ constructor(e) {
88
+ super(e), this.mainData = [], this.dataSource = new C("drawerDataSource"), this.currentDragPoint = null, this.currentIndex = -1, this.delCallbackFun = this.delCallback, this.viewer.dataSources.add(this.dataSource);
89
+ }
90
+ /**
91
+ * 获取DataSource
92
+ * @returns
93
+ */
94
+ getDataSource() {
95
+ return this.dataSource;
96
+ }
97
+ /**
98
+ * 获取所有节点数据
99
+ * @returns Cartesian3[]
100
+ */
101
+ refreshPositionsData() {
102
+ return this.mainData = [], this.dataSource.entities.values.forEach((e) => {
103
+ var t;
104
+ const i = new r();
105
+ (t = e.position) == null || t.getValue(I.now(), i), this.mainData.push(i);
106
+ }), this.mainData;
107
+ }
108
+ clearAllData() {
109
+ this.mainData = [], this.currentDragPoint = null, this.currentIndex = -1, this.dataSource && this.viewer.dataSources.remove(this.dataSource, !0), super.stopStatus();
110
+ }
111
+ getEntityIndex() {
112
+ var e;
113
+ for (let i = 0, t = this.dataSource.entities.values.length; i < t; i++)
114
+ if (this.dataSource.entities.values[i].id == ((e = this.currentDragPoint) == null ? void 0 : e.id)) {
115
+ this.currentIndex = i;
116
+ break;
117
+ }
118
+ }
119
+ editMoveFun(e, i) {
120
+ if (o.DRAG_UNABLED == super.getEditStatus()) {
121
+ const t = this.viewer.scene.pick(e.endPosition);
122
+ if (l(t) && l(t.id) && this.dataSource.entities.contains(d(t.id))) {
123
+ let a = d(t.id);
124
+ this.currentDragPoint = a, this.editDragEnable();
125
+ }
126
+ } else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(i), this.mainData[this.currentIndex] = i) : this.editDragUnable();
127
+ }
128
+ deleteMoveFun(e) {
129
+ if (p.DEL_UNABLED == super.getDelStatus()) {
130
+ const i = this.viewer.scene.pick(e.endPosition);
131
+ l(i) && l(i.id) && this.dataSource.entities.contains(d(i.id)) && this.delEnable();
132
+ } else
133
+ this.delUnable();
134
+ }
135
+ addPoint(e) {
136
+ let i = null;
137
+ return this.point ? i = this.point : i = {
138
+ pixelSize: 6,
139
+ color: u.TRANSPARENT,
140
+ outlineColor: u.YELLOW,
141
+ outlineWidth: 2,
142
+ heightReference: P.CLAMP_TO_GROUND
143
+ //贴地
144
+ }, this.dataSource.entities.add({
145
+ position: e,
146
+ point: i,
147
+ properties: {
148
+ entityType: "POINT"
149
+ },
150
+ show: !0
151
+ });
152
+ }
153
+ //在删除状态下,删除节点
154
+ deletePoint(e) {
155
+ this.delCallbackFun && this.delCallbackFun().then((i) => {
156
+ i && (this.dataSource.entities.remove(e), this.refreshPositionsData());
157
+ });
158
+ }
159
+ delCallback() {
160
+ return new Promise((e) => {
161
+ const i = confirm("确定删除吗?");
162
+ e(!!i);
163
+ });
164
+ }
165
+ }
166
+ class F extends L {
167
+ constructor(e, i = null) {
168
+ super(e), this.handler = null, this.pointCollection = new B(), this.billboardCallbackFun = this.addBillboardCallback, this.point_L_ClickEvent = () => {
169
+ var t;
170
+ (t = this.handler) == null || t.setInputAction((a) => {
171
+ if (h.DRAWABLE == super.getStatus()) {
172
+ let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
173
+ if (l(s)) {
174
+ let v = this.billboardCallbackFun(s);
175
+ this.mainData.push(s), this.pointCollection.add(v);
176
+ }
177
+ } else if (h.DELETABLE == super.getStatus()) {
178
+ const n = this.viewer.scene.pick(a.position);
179
+ if (l(n) && l(n.id)) {
180
+ const s = d(n.id);
181
+ this.pointCollection.contains(s) && p.DEL_ENABLED == super.getDelStatus() && this.deleteBillboard(s);
182
+ }
183
+ }
184
+ }, c.LEFT_CLICK);
185
+ }, this.point_L_DownEvent = () => {
186
+ var t;
187
+ (t = this.handler) == null || t.setInputAction(() => {
188
+ h.EDITABLE == super.getStatus() && o.DRAG_ENABLED == super.getEditStatus() && (super.editDraging(), this.viewer.scene.screenSpaceCameraController.enableRotate = !1);
189
+ }, c.LEFT_DOWN);
190
+ }, this.point_L_UpEvent = () => {
191
+ var t;
192
+ (t = this.handler) == null || t.setInputAction(() => {
193
+ o.DRAGING == super.getEditStatus() && (this.editDragUnable(), this.currentDragPoint = null, this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
194
+ }, c.LEFT_UP);
195
+ }, this.point_moveEvent = () => {
196
+ var t;
197
+ (t = this.handler) == null || t.setInputAction((a) => {
198
+ if (h.EDITABLE == super.getStatus())
199
+ if (o.DRAG_UNABLED == super.getEditStatus()) {
200
+ const n = this.viewer.scene.pick(a.endPosition);
201
+ if (l(n) && l(n.id) && this.pointCollection.contains(d(n.id))) {
202
+ let s = d(n.id);
203
+ this.currentDragPoint = s, this.editDragEnable();
204
+ }
205
+ } else if (o.DRAGING == super.getEditStatus()) {
206
+ const n = this.viewer.scene.pickPosition(a.endPosition);
207
+ l(n) && this.currentDragPoint && (this.currentDragPoint.position = new E(n));
208
+ } else
209
+ this.editDragUnable();
210
+ else if (h.DELETABLE == super.getStatus())
211
+ if (p.DEL_UNABLED == super.getDelStatus()) {
212
+ const n = this.viewer.scene.pick(a.endPosition);
213
+ l(n) && l(n.id) && this.pointCollection.contains(d(n.id)) && this.delEnable();
214
+ } else
215
+ this.delUnable();
216
+ }, c.MOUSE_MOVE);
217
+ }, i && (i.billboardCallbackFun && (this.billboardCallbackFun = i.billboardCallbackFun), i.delCallbackFun && (this.delCallbackFun = i.delCallbackFun));
218
+ }
219
+ start() {
220
+ super.drawableStatus(), this.handler || (this.handler = new w(this.viewer.scene.canvas)), this.point_L_ClickEvent(), this.point_L_DownEvent(), this.point_L_UpEvent(), this.point_moveEvent();
221
+ }
222
+ getEntity() {
223
+ return this.pointCollection;
224
+ }
225
+ clearAll() {
226
+ var e;
227
+ this.clearAllData(), this.billboardCallbackFun = this.addBillboardCallback;
228
+ for (let i = 0, t = this.pointCollection.values.length; i < t; i++) {
229
+ const a = this.pointCollection.values[i];
230
+ this.viewer.entities.removeById(a.id);
231
+ }
232
+ (e = this.handler) == null || e.destroy();
233
+ }
234
+ addBillboardCallback(e) {
235
+ return this.viewer.entities.add({
236
+ // 设置经纬度位置 (经度, 纬度, 海拔高度)
237
+ position: e,
238
+ billboard: {
239
+ image: U,
240
+ // 设置图片显示的宽度和高度 (像素)
241
+ width: 40,
242
+ height: 40,
243
+ // 可选项:缩放倍数
244
+ scale: 1,
245
+ verticalOrigin: R.BOTTOM,
246
+ heightReference: P.CLAMP_TO_GROUND
247
+ //贴地
248
+ },
249
+ show: !0
250
+ });
251
+ }
252
+ deleteBillboard(e) {
253
+ this.delCallbackFun ? this.delCallbackFun().then((i) => {
254
+ i && (this.dataSource.entities.remove(e), this.refreshPositionsData());
255
+ }) : confirm("确定要删除吗?") && (this.viewer.entities.remove(e), this.refreshPositionsData());
256
+ }
257
+ }
258
+ const f = {
259
+ LINE: Symbol("LINE"),
260
+ //画线模式
261
+ POLYGON: Symbol("POLYGON")
262
+ //画面模式
263
+ };
264
+ class O extends L {
265
+ constructor(e, i = null) {
266
+ super(e), this.handler = null, this.mainLineEntity = null, this.mainPolygonEntity = null, this.dashLineEntity = null, this.dashEndData = new r(), this.drawerMode = f.LINE, this.line_L_ClickEvent = () => {
267
+ var t;
268
+ (t = this.handler) == null || t.setInputAction((a) => {
269
+ if (h.DRAWABLE == super.getStatus()) {
270
+ let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
271
+ l(s) && (this.addPoint(s), this.mainData.push(s), this.mainData.length > 0 && (this.mainLineEntity || this.createMainLine(), this.dashLineEntity || this.createDashline(), this.mainData.length > 2 && this.drawerMode === f.POLYGON && !this.mainPolygonEntity && this.createMainPolygon()));
272
+ } else if (h.DELETABLE == super.getStatus()) {
273
+ const n = this.viewer.scene.pick(a.position);
274
+ if (l(n) && l(n.id)) {
275
+ const s = d(n.id);
276
+ this.dataSource.entities.contains(s) && p.DEL_ENABLED == super.getDelStatus() && this.deletePoint(s);
277
+ }
278
+ }
279
+ }, c.LEFT_CLICK);
280
+ }, this.line_L_DownEvent = () => {
281
+ var t;
282
+ (t = this.handler) == null || t.setInputAction(() => {
283
+ h.EDITABLE == super.getStatus() && o.DRAG_ENABLED == super.getEditStatus() && (super.editDraging(), this.getEntityIndex(), this.viewer.scene.screenSpaceCameraController.enableRotate = !1);
284
+ }, c.LEFT_DOWN);
285
+ }, this.line_L_UpEvent = () => {
286
+ var t;
287
+ (t = this.handler) == null || t.setInputAction(() => {
288
+ o.DRAGING == super.getEditStatus() && (this.editDragUnable(), this.currentDragPoint = null, this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
289
+ }, c.LEFT_UP);
290
+ }, this.line_moveEvent = () => {
291
+ var t;
292
+ (t = this.handler) == null || t.setInputAction((a) => {
293
+ const n = this.viewer.camera.getPickRay(a.endPosition);
294
+ if (n) {
295
+ const s = this.viewer.scene.globe.pick(n, this.viewer.scene);
296
+ l(s) && (h.DRAWABLE == super.getStatus() ? this.dashEndData = s : h.EDITABLE == super.getStatus() ? (this.dashLineEntity.show = !1, this.editMoveFun(a, s)) : h.DELETABLE == super.getStatus() && (this.dashLineEntity.show = !1, this.deleteMoveFun(a)));
297
+ }
298
+ }, c.MOUSE_MOVE);
299
+ }, this.createDashline = () => {
300
+ let t;
301
+ this.deshline ? t = this.deshline : t = {
302
+ positions: [
303
+ new r(),
304
+ new r()
305
+ ],
306
+ width: 2,
307
+ material: new M({
308
+ color: u.RED,
309
+ dashLength: 15
310
+ }),
311
+ show: !0,
312
+ clampToGround: !0
313
+ }, t.positions = new A(() => {
314
+ let a = this.mainData.length, n = this.mainData[a - 1];
315
+ return n || (n = this.mainData[a - 2]), this.dashEndData || console.log("发生错误了dashEndData"), [n, this.dashEndData];
316
+ }, !1), this.dashLineEntity = this.viewer.entities.add({
317
+ polyline: t,
318
+ properties: {
319
+ entityType: "DASHLINE"
320
+ }
321
+ });
322
+ }, i && (i.drawerMode && (this.drawerMode = i.drawerMode), this.point = i.point, this.polyline = i.polyline, this.deshline = i.deshline, this.polygon = i.polygon, this.delCallbackFun = i.delCallbackFun ? i.delCallbackFun : this.delCallback);
323
+ }
324
+ start() {
325
+ super.drawableStatus(), this.handler || (this.handler = new w(this.viewer.scene.canvas)), this.line_L_ClickEvent(), this.line_L_DownEvent(), this.line_L_UpEvent(), this.line_moveEvent();
326
+ }
327
+ getEntity() {
328
+ if (this.drawerMode === f.LINE)
329
+ return this.mainLineEntity;
330
+ if (this.drawerMode === f.POLYGON)
331
+ return this.mainPolygonEntity;
332
+ }
333
+ clearAll() {
334
+ this.clearAllData(), this.handler = null, this.mainLineEntity && this.viewer.entities.removeById(this.mainLineEntity.id), this.mainPolygonEntity && this.viewer.entities.removeById(this.mainPolygonEntity.id), this.dashLineEntity && this.viewer.entities.removeById(this.dashLineEntity.id);
335
+ }
336
+ //创建主线数据
337
+ createMainLine() {
338
+ let e;
339
+ this.polyline ? e = this.polyline : e = {
340
+ positions: [new r(), new r()],
341
+ // 宽度
342
+ width: 2,
343
+ // 线的颜色
344
+ material: u.RED,
345
+ // 是否显示
346
+ show: !0,
347
+ clampToGround: !0
348
+ }, e.positions = new A(() => this.mainData, !1), this.mainLineEntity = this.viewer.entities.add({
349
+ polyline: e,
350
+ properties: {
351
+ entityType: "LINE"
352
+ }
353
+ });
354
+ }
355
+ //创建主面数据
356
+ createMainPolygon() {
357
+ let e;
358
+ this.polygon ? e = this.polygon : e = {
359
+ hierarchy: [new r(), new r(), new r()],
360
+ material: u.RED.withAlpha(0.4),
361
+ outline: !1
362
+ }, e.hierarchy = new A(() => new m(this.mainData), !1), this.mainPolygonEntity = this.viewer.entities.add({
363
+ polygon: e,
364
+ properties: {
365
+ entityType: "POLYGON"
366
+ }
367
+ });
368
+ }
369
+ }
370
+ class x extends L {
371
+ //主面对象
372
+ constructor(e, i = null) {
373
+ super(e), this.handler = null, this.firstPoint = null, this.endPoint = null, this.lineEntity = null, this.polygonEntity = null, this.rect_L_ClickEvent = () => {
374
+ var t;
375
+ (t = this.handler) == null || t.setInputAction((a) => {
376
+ if (h.DRAWABLE == super.getStatus()) {
377
+ let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
378
+ l(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()));
379
+ }
380
+ }, c.LEFT_CLICK);
381
+ }, this.rect_L_DownEvent = () => {
382
+ var t;
383
+ (t = this.handler) == null || t.setInputAction(() => {
384
+ h.EDITABLE == super.getStatus() && o.DRAG_ENABLED == super.getEditStatus() && (super.editDraging(), this.getEntityIndex(), this.viewer.scene.screenSpaceCameraController.enableRotate = !1);
385
+ }, c.LEFT_DOWN);
386
+ }, this.rect_L_UpEvent = () => {
387
+ var t;
388
+ (t = this.handler) == null || t.setInputAction(() => {
389
+ o.DRAGING == super.getEditStatus() && (this.editDragUnable(), this.currentDragPoint = null, this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
390
+ }, c.LEFT_UP);
391
+ }, this.rect_moveEvent = () => {
392
+ var t;
393
+ (t = this.handler) == null || t.setInputAction((a) => {
394
+ const n = this.viewer.camera.getPickRay(a.endPosition);
395
+ if (n) {
396
+ const s = this.viewer.scene.globe.pick(n, this.viewer.scene);
397
+ l(s) && (h.DRAWABLE == super.getStatus() ? this.firstPoint && (this.endPoint = s, this.initMainData()) : h.EDITABLE == super.getStatus() && this.rectMove(a, s));
398
+ }
399
+ }, c.MOUSE_MOVE);
400
+ }, i && (this.point = i.point, this.polyline = i.polyline, this.polygon = i.polygon);
401
+ }
402
+ start() {
403
+ super.drawableStatus(), this.handler || (this.handler = new w(this.viewer.scene.canvas)), this.rect_L_ClickEvent(), this.rect_L_DownEvent(), this.rect_L_UpEvent(), this.rect_moveEvent();
404
+ }
405
+ getEntity() {
406
+ this.polygonEntity;
407
+ }
408
+ clearAll() {
409
+ this.clearAllData(), this.firstPoint = new r(), this.endPoint = new r(), this.handler && (this.handler = null), this.polygonEntity && this.viewer.entities.removeById(this.polygonEntity.id), this.lineEntity && this.viewer.entities.removeById(this.lineEntity.id);
410
+ }
411
+ rectMove(e, i) {
412
+ if (o.DRAG_UNABLED == super.getEditStatus()) {
413
+ const t = this.viewer.scene.pick(e.endPosition);
414
+ if (l(t) && l(t.id) && this.dataSource.entities.contains(d(t.id))) {
415
+ let a = d(t.id);
416
+ this.currentDragPoint = a, this.editDragEnable();
417
+ }
418
+ } else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(i), this.currentIndex === 0 ? this.firstPoint = i : this.endPoint = i, this.initMainData()) : this.editDragUnable();
419
+ }
420
+ initMainData() {
421
+ if (this.firstPoint && this.endPoint) {
422
+ const e = y.fromCartesian(this.firstPoint), i = e.longitude, t = e.latitude, a = y.fromCartesian(this.endPoint), n = a.longitude, s = a.latitude, v = r.fromRadians(i, s), b = r.fromRadians(n, t);
423
+ this.mainData[0] = this.firstPoint, this.mainData[1] = v, this.mainData[2] = this.endPoint, this.mainData[3] = b;
424
+ }
425
+ }
426
+ //创建主线数据
427
+ createLine() {
428
+ let e = null;
429
+ this.polyline ? e = this.polyline : e = {
430
+ positions: [new r(), new r()],
431
+ // 宽度
432
+ width: 2,
433
+ // 线的颜色
434
+ material: u.RED,
435
+ // 是否显示
436
+ show: !0,
437
+ clampToGround: !0
438
+ }, e.positions = new A(() => [...this.mainData, this.mainData[0]], !1), this.lineEntity = this.viewer.entities.add({
439
+ polyline: e,
440
+ properties: {
441
+ entityType: "LINE"
442
+ }
443
+ });
444
+ }
445
+ //创建主面数据
446
+ createPolygon() {
447
+ let e = null;
448
+ this.polygon ? e = this.polygon : e = {
449
+ hierarchy: [new r(), new r(), new r()],
450
+ material: u.RED.withAlpha(0.4),
451
+ outline: !1
452
+ }, e.hierarchy = new A(() => new m(this.mainData), !1), this.polygonEntity = this.viewer.entities.add({
453
+ polygon: e,
454
+ properties: {
455
+ entityType: "POLYGON"
456
+ }
457
+ });
458
+ }
459
+ }
460
+ class Q extends L {
461
+ //主线对象
462
+ constructor(e, i = null) {
463
+ 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 = () => {
464
+ var t;
465
+ (t = this.handler) == null || t.setInputAction((a) => {
466
+ if (h.DRAWABLE == super.getStatus()) {
467
+ let n = this.viewer.camera.getPickRay(a.position), s = this.viewer.scene.globe.pick(n, this.viewer.scene);
468
+ l(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.getAngle(), this.stopStatus()));
469
+ }
470
+ }, c.LEFT_CLICK);
471
+ }, this.circle_L_DownEvent = () => {
472
+ var t;
473
+ (t = this.handler) == null || t.setInputAction(() => {
474
+ h.EDITABLE == super.getStatus() && o.DRAG_ENABLED == super.getEditStatus() && (super.editDraging(), this.getEntityIndex(), this.viewer.scene.screenSpaceCameraController.enableRotate = !1);
475
+ }, c.LEFT_DOWN);
476
+ }, this.circle_L_UpEvent = () => {
477
+ var t;
478
+ (t = this.handler) == null || t.setInputAction(() => {
479
+ o.DRAGING == super.getEditStatus() && (this.editDragUnable(), this.currentDragPoint = null, this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
480
+ }, c.LEFT_UP);
481
+ }, this.circle_moveEvent = () => {
482
+ var t;
483
+ (t = this.handler) == null || t.setInputAction((a) => {
484
+ const n = this.viewer.camera.getPickRay(a.endPosition);
485
+ if (n) {
486
+ const s = this.viewer.scene.globe.pick(n, this.viewer.scene);
487
+ l(s) && (h.DRAWABLE == super.getStatus() ? this.mainData.length > 0 && (this.endPoint = s, this.countDistance()) : h.EDITABLE == super.getStatus() && this.circleMove(a, s));
488
+ }
489
+ }, c.MOUSE_MOVE);
490
+ }, i && (this.point = i.point, this.ellipse = i.ellipse);
491
+ }
492
+ start() {
493
+ super.drawableStatus(), this.handler || (this.handler = new w(this.viewer.scene.canvas)), this.circle_L_ClickEvent(), this.circle_L_DownEvent(), this.circle_L_UpEvent(), this.circle_moveEvent();
494
+ }
495
+ getEntity() {
496
+ return this.ellipse;
497
+ }
498
+ clearAll() {
499
+ this.clearAllData(), this.firstPoint = new r(), this.endPoint = new r(), this.handler && (this.handler = null), this.ellipseEntity && this.viewer.entities.removeById(this.ellipseEntity.id);
500
+ }
501
+ getAngle() {
502
+ const e = S.eastNorthUpToFixedFrame(this.firstPoint.clone()), i = g.inverse(e, new g()), t = g.multiplyByPoint(i, this.endPoint.clone(), new r());
503
+ this.angle = Math.atan2(t.x, t.y);
504
+ }
505
+ circleMove(e, i) {
506
+ if (o.DRAG_UNABLED == super.getEditStatus()) {
507
+ const t = this.viewer.scene.pick(e.endPosition);
508
+ if (l(t) && l(t.id) && this.dataSource.entities.contains(d(t.id))) {
509
+ let a = d(t.id);
510
+ this.currentDragPoint = a, this.editDragEnable();
511
+ }
512
+ } else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(i), this.currentIndex === 0 ? (this.firstPoint = i, this.ellipseEntity && (this.ellipseEntity.position = new E(this.firstPoint)), this.endPointEntity && (this.updateEndPoint(), this.endPointEntity.position = new E(this.endPoint))) : (this.endPoint = i, this.countDistance())) : this.editDragUnable();
513
+ }
514
+ updateEndPoint() {
515
+ var e = new r(
516
+ this.distance * Math.sin(this.angle),
517
+ this.distance * Math.cos(this.angle),
518
+ 0
519
+ // 保持水平,如果希望保持高度则设为 localEdge.z
520
+ ), i = S.eastNorthUpToFixedFrame(this.firstPoint), t = g.multiplyByPointAsVector(i, e, new r());
521
+ this.endPoint = r.add(this.firstPoint, t, new r());
522
+ }
523
+ countDistance() {
524
+ if (this.firstPoint && this.endPoint) {
525
+ const e = y.fromCartesian(this.firstPoint), i = y.fromCartesian(this.endPoint), t = new k(e, i);
526
+ this.distance = t.surfaceDistance;
527
+ }
528
+ }
529
+ //创建主面数据
530
+ createCircle() {
531
+ let e = null;
532
+ this.ellipse ? e = this.ellipse : e = {
533
+ semiMinorAxis: 1,
534
+ // 短半轴(米)
535
+ semiMajorAxis: 1,
536
+ // 长半轴(米)— 两者相等即为圆
537
+ material: u.RED.withAlpha(0.6),
538
+ // 填充颜色,半透明
539
+ height: 0,
540
+ // 椭圆所在高度(米),可选
541
+ extrudedHeight: 0,
542
+ // 拉伸高度,>0 会形成圆柱体,设为0则为平面
543
+ outline: !0,
544
+ // 是否显示边框
545
+ outlineColor: u.RED
546
+ }, e.semiMinorAxis = e.semiMajorAxis = new A(() => this.distance, !1), this.ellipseEntity = this.viewer.entities.add({
547
+ position: new E(this.firstPoint),
548
+ ellipse: e,
549
+ properties: {
550
+ entityType: "ELLIPSE"
551
+ }
552
+ });
553
+ }
554
+ }
555
+ export {
556
+ O as C,
557
+ h as D,
558
+ F as P,
559
+ x as R,
560
+ Q as a,
561
+ f as b
562
+ };
package/drawer.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { PointDrawer } from './src/drawer/PointDrawer.ts';
2
+ import { CP2dDrawer, CP2dOptions, DRAWER_MODE, DRAWER_MODE_TYPE } from './src/drawer/CP2dDrawer.ts';
3
+ import { RectDrawer, RectOptions } from './src/drawer/RectDrawer.ts';
4
+ import { CircleDrawer, CircleOptions } from './src/drawer/CircleDrawer.ts';
5
+ import { DelCallbackFn } from './src/drawer/DataCenter.ts';
6
+ import { DRAW_STATUS, DRAW_STATUS_TYPE } from './src/drawer/DrawerStatus.ts';
7
+ export { PointDrawer, CP2dDrawer, RectDrawer, CircleDrawer, DRAW_STATUS, type DRAW_STATUS_TYPE, DRAWER_MODE, type DRAWER_MODE_TYPE, type CircleOptions, type RectOptions, type CP2dOptions, type DelCallbackFn };
package/drawer.js ADDED
@@ -0,0 +1,9 @@
1
+ import { C as D, a as e, b as s, D as R, P as w, R as o } from "./CircleDrawer-1f9OEOcZ.js";
2
+ export {
3
+ D as CP2dDrawer,
4
+ e as CircleDrawer,
5
+ s as DRAWER_MODE,
6
+ R as DRAW_STATUS,
7
+ w as PointDrawer,
8
+ o as RectDrawer
9
+ };
package/index.d.ts CHANGED
@@ -12,4 +12,4 @@ export default _default;
12
12
  export { cpCompass, cpRuler, cpCoord, cpOverlay, cpPin, cpTianmap };
13
13
  export * from './pin.ts';
14
14
  export * from './tianmap.ts';
15
- export * from './measure.ts';
15
+ export * from './drawer.ts';
package/index.js CHANGED
@@ -3,7 +3,7 @@ import * as PA from "three";
3
3
  import { TrianglesDrawMode as tP, TriangleFanDrawMode as EA, TriangleStripDrawMode as SA, Loader as sP, LoaderUtils as F, FileLoader as qA, Color as S, LinearSRGBColorSpace as H, SpotLight as BP, PointLight as rP, DirectionalLight as vP, MeshBasicMaterial as W, SRGBColorSpace as R, MeshPhysicalMaterial as y, Vector2 as VA, Matrix4 as tA, Vector3 as K, Quaternion as hA, InstancedMesh as gP, InstancedBufferAttribute as CP, Object3D as JA, TextureLoader as DP, ImageBitmapLoader as wP, BufferAttribute as BA, InterleavedBuffer as QP, InterleavedBufferAttribute as cP, LinearMipmapLinearFilter as YA, NearestMipmapLinearFilter as IP, LinearMipmapNearestFilter as EP, NearestMipmapNearestFilter as zP, LinearFilter as zA, NearestFilter as NA, RepeatWrapping as TA, MirroredRepeatWrapping as TP, ClampToEdgeWrapping as lP, PointsMaterial as oP, Material as rA, LineBasicMaterial as aP, MeshStandardMaterial as KA, DoubleSide as MP, PropertyBinding as uP, BufferGeometry as pP, SkinnedMesh as bP, Mesh as iP, LineSegments as fP, Line as UP, LineLoop as yP, Points as dP, Group as vA, PerspectiveCamera as jP, MathUtils as HP, OrthographicCamera as mP, Skeleton as kP, AnimationClip as LP, Bone as OP, InterpolateDiscrete as SP, InterpolateLinear as XA, ColorManagement as MA, Texture as uA, VectorKeyframeTrack as pA, NumberKeyframeTrack as bA, QuaternionKeyframeTrack as iA, FrontSide as qP, Interpolant as VP, Box3 as hP, Sphere as JP } from "three";
4
4
  import { Viewer as h, Math as _, Cartesian2 as eA, Cartesian3 as L, Cartographic as ZA, SceneTransforms as YP, Ray as NP, Color as KP, ScreenSpaceEventType as gA, ScreenSpaceEventHandler as XP, createWorldTerrainAsync as ZP, EllipsoidTerrainProvider as GP, WebMapTileServiceImageryProvider as Y, Credit as N } from "cesium";
5
5
  import { P as G, a as fA, b as xP, c as WP, d as FP, C as UA } from "./index-CcaLwHv1.js";
6
- import { L as Mn, P as un, a as pn } from "./PolygonDrawer-cdggtCBL.js";
6
+ import { C as Mn, a as un, b as pn, D as bn, P as fn, R as Un } from "./CircleDrawer-1f9OEOcZ.js";
7
7
  function yA(D, A) {
8
8
  if (A === tP)
9
9
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), D;
@@ -2397,11 +2397,14 @@ const He = /* @__PURE__ */ q({
2397
2397
  D.component(A, P);
2398
2398
  }), D), ln = { install: cn };
2399
2399
  export {
2400
- Mn as LineDrawer,
2400
+ Mn as CP2dDrawer,
2401
+ un as CircleDrawer,
2402
+ pn as DRAWER_MODE,
2403
+ bn as DRAW_STATUS,
2401
2404
  fA as PIN_CATEGORY,
2402
2405
  G as PIN_MODE,
2403
- un as PointDrawer,
2404
- pn as PolygonDrawer,
2406
+ fn as PointDrawer,
2407
+ Un as RectDrawer,
2405
2408
  me as cpCompass,
2406
2409
  Ve as cpCoord,
2407
2410
  Fe as cpOverlay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cesium-pocket",
3
- "version": "0.2.1-alpha",
3
+ "version": "0.3.0-alpha",
4
4
  "description": "cesium的插件库;基于vue3的开发",
5
5
  "module": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -17,9 +17,9 @@
17
17
  "import": "./tianmap.js",
18
18
  "types": "./tianmap.d.ts"
19
19
  },
20
- "./measure": {
21
- "import": "./measure.js",
22
- "types": "./measure.d.ts"
20
+ "./drawer": {
21
+ "import": "./drawer.js",
22
+ "types": "./drawer.d.ts"
23
23
  },
24
24
  "./*": "./*"
25
25
  },