cesium-pocket 0.3.0-alpha → 0.3.2-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-1f9OEOcZ.js → CircleDrawer-RdBslwFS.js} +132 -129
- package/drawer.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/drawer/PointDrawer.d.ts +3 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomDataSource as C, Cartesian3 as r, JulianDate as I, defined as l, ConstantPositionProperty as E, HeightReference as
|
|
1
|
+
import { CustomDataSource as C, Cartesian3 as r, JulianDate as I, defined as l, ConstantPositionProperty as E, HeightReference as S, Color as u, EntityCollection as B, ScreenSpaceEventType as c, ScreenSpaceEventHandler as w, VerticalOrigin as R, PolylineDashMaterialProperty as M, CallbackProperty as A, PolygonHierarchy as P, Cartographic as y, Transforms as b, Matrix4 as g, EllipsoidGeodesic as k } from "cesium";
|
|
2
2
|
import { toRaw as d } from "vue";
|
|
3
3
|
const h = {
|
|
4
4
|
STOPED: Symbol("STOPED"),
|
|
@@ -25,8 +25,8 @@ const h = {
|
|
|
25
25
|
//可拖拽
|
|
26
26
|
};
|
|
27
27
|
class G {
|
|
28
|
-
constructor(
|
|
29
|
-
this.status = h.STOPED, this.editStatus = o.DRAG_UNABLED, this.delStatus = p.DEL_UNABLED, this.viewer =
|
|
28
|
+
constructor(i) {
|
|
29
|
+
this.status = h.STOPED, this.editStatus = o.DRAG_UNABLED, this.delStatus = p.DEL_UNABLED, this.viewer = i;
|
|
30
30
|
}
|
|
31
31
|
getStatus() {
|
|
32
32
|
return this.status;
|
|
@@ -84,8 +84,8 @@ class G {
|
|
|
84
84
|
}
|
|
85
85
|
const U = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAQAElEQVR4AexdfYwkR3V/r3dnb884wUd03O1HTrZj4p09/CFMSBwpkqX8Ayjkj6ALQY6ixHIc8REJ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e+A92xniHZtcGACMQG61tiNieXlxGBRRLN8D6PRQfyyxwDfSKJQPqQYmNopbbEf4KyQLEX4n3alWabARGI7Qr0xMcg2M+9Z0h2LTMQWI4v4XsYWBlf+CL3niHZtcyACMRyASR8uRkQgZS7PoLOMgO6BGI5DQkvDBTDgAikGF7Fa0UYEIFUpJCSRjEMiECK4VW8VoQBEUhFCilpFMOAAwIpJnHxKgykYUAEkoYlsfGWARGIt6WXxNMwIAJJw5LYeMuACMTb0kviaRjwWyBpGBIbrxkQgXhdfkk+iQERSBJDMu81AyIQr8svyScxIAJJYkjmvWZABFJQ+cVtNRj4OQAAAP//gm46zwAAAAZJREFUAwB1f5TcL2bFTAAAAABJRU5ErkJggg==";
|
|
86
86
|
class L extends G {
|
|
87
|
-
constructor(
|
|
88
|
-
super(
|
|
87
|
+
constructor(i) {
|
|
88
|
+
super(i), this.mainData = [], this.dataSource = new C("drawerDataSource"), this.currentDragPoint = null, this.currentIndex = -1, this.delCallbackFun = this.delCallback, this.viewer.dataSources.add(this.dataSource);
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* 获取DataSource
|
|
@@ -99,51 +99,51 @@ class L extends G {
|
|
|
99
99
|
* @returns Cartesian3[]
|
|
100
100
|
*/
|
|
101
101
|
refreshPositionsData() {
|
|
102
|
-
return this.mainData = [], this.dataSource.entities.values.forEach((
|
|
102
|
+
return this.mainData = [], this.dataSource.entities.values.forEach((i) => {
|
|
103
103
|
var t;
|
|
104
|
-
const
|
|
105
|
-
(t =
|
|
104
|
+
const e = new r();
|
|
105
|
+
(t = i.position) == null || t.getValue(I.now(), e), this.mainData.push(e);
|
|
106
106
|
}), this.mainData;
|
|
107
107
|
}
|
|
108
108
|
clearAllData() {
|
|
109
109
|
this.mainData = [], this.currentDragPoint = null, this.currentIndex = -1, this.dataSource && this.viewer.dataSources.remove(this.dataSource, !0), super.stopStatus();
|
|
110
110
|
}
|
|
111
111
|
getEntityIndex() {
|
|
112
|
-
var
|
|
113
|
-
for (let
|
|
114
|
-
if (this.dataSource.entities.values[
|
|
115
|
-
this.currentIndex =
|
|
112
|
+
var i;
|
|
113
|
+
for (let e = 0, t = this.dataSource.entities.values.length; e < t; e++)
|
|
114
|
+
if (this.dataSource.entities.values[e].id == ((i = this.currentDragPoint) == null ? void 0 : i.id)) {
|
|
115
|
+
this.currentIndex = e;
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
editMoveFun(
|
|
119
|
+
editMoveFun(i, e) {
|
|
120
120
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
121
|
-
const t = this.viewer.scene.pick(
|
|
121
|
+
const t = this.viewer.scene.pick(i.endPosition);
|
|
122
122
|
if (l(t) && l(t.id) && this.dataSource.entities.contains(d(t.id))) {
|
|
123
123
|
let a = d(t.id);
|
|
124
124
|
this.currentDragPoint = a, this.editDragEnable();
|
|
125
125
|
}
|
|
126
|
-
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(
|
|
126
|
+
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(e), this.mainData[this.currentIndex] = e) : this.editDragUnable();
|
|
127
127
|
}
|
|
128
|
-
deleteMoveFun(
|
|
128
|
+
deleteMoveFun(i) {
|
|
129
129
|
if (p.DEL_UNABLED == super.getDelStatus()) {
|
|
130
|
-
const
|
|
131
|
-
l(
|
|
130
|
+
const e = this.viewer.scene.pick(i.endPosition);
|
|
131
|
+
l(e) && l(e.id) && this.dataSource.entities.contains(d(e.id)) && this.delEnable();
|
|
132
132
|
} else
|
|
133
133
|
this.delUnable();
|
|
134
134
|
}
|
|
135
|
-
addPoint(
|
|
136
|
-
let
|
|
137
|
-
return this.point ?
|
|
135
|
+
addPoint(i) {
|
|
136
|
+
let e = null;
|
|
137
|
+
return this.point ? e = this.point : e = {
|
|
138
138
|
pixelSize: 6,
|
|
139
139
|
color: u.TRANSPARENT,
|
|
140
140
|
outlineColor: u.YELLOW,
|
|
141
141
|
outlineWidth: 2,
|
|
142
|
-
heightReference:
|
|
142
|
+
heightReference: S.CLAMP_TO_GROUND
|
|
143
143
|
//贴地
|
|
144
144
|
}, this.dataSource.entities.add({
|
|
145
|
-
position:
|
|
146
|
-
point:
|
|
145
|
+
position: i,
|
|
146
|
+
point: e,
|
|
147
147
|
properties: {
|
|
148
148
|
entityType: "POINT"
|
|
149
149
|
},
|
|
@@ -151,34 +151,34 @@ class L extends G {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
//在删除状态下,删除节点
|
|
154
|
-
deletePoint(
|
|
155
|
-
this.delCallbackFun && this.delCallbackFun().then((
|
|
156
|
-
|
|
154
|
+
deletePoint(i) {
|
|
155
|
+
this.delCallbackFun && this.delCallbackFun().then((e) => {
|
|
156
|
+
e && (this.dataSource.entities.remove(i), this.refreshPositionsData());
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
delCallback() {
|
|
160
|
-
return new Promise((
|
|
161
|
-
const
|
|
162
|
-
e(!!
|
|
160
|
+
return new Promise((i) => {
|
|
161
|
+
const e = confirm("确定删除吗?");
|
|
162
|
+
console.log(e), i(!!e);
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
class
|
|
167
|
-
constructor(
|
|
168
|
-
super(
|
|
166
|
+
class T extends L {
|
|
167
|
+
constructor(i, e = null) {
|
|
168
|
+
super(i), this.handler = null, this.pointCollection = new B(), this.billboardCallbackFun = this.addBillboardCallback, this.point_L_ClickEvent = () => {
|
|
169
169
|
var t;
|
|
170
170
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
171
171
|
if (h.DRAWABLE == super.getStatus()) {
|
|
172
|
-
let
|
|
173
|
-
if (l(
|
|
174
|
-
let v = this.billboardCallbackFun(
|
|
175
|
-
this.mainData.push(
|
|
172
|
+
let s = this.viewer.camera.getPickRay(a.position), n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
173
|
+
if (l(n)) {
|
|
174
|
+
let v = this.billboardCallbackFun(n);
|
|
175
|
+
this.mainData.push(n), this.pointCollection.add(v);
|
|
176
176
|
}
|
|
177
177
|
} else if (h.DELETABLE == super.getStatus()) {
|
|
178
|
-
const
|
|
179
|
-
if (l(
|
|
180
|
-
const
|
|
181
|
-
this.pointCollection.contains(
|
|
178
|
+
const s = this.viewer.scene.pick(a.position);
|
|
179
|
+
if (l(s) && l(s.id)) {
|
|
180
|
+
const n = d(s.id);
|
|
181
|
+
this.pointCollection.contains(n) && p.DEL_ENABLED == super.getDelStatus() && this.deleteBillboard(n);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
}, c.LEFT_CLICK);
|
|
@@ -189,32 +189,35 @@ class F extends L {
|
|
|
189
189
|
}, c.LEFT_DOWN);
|
|
190
190
|
}, this.point_L_UpEvent = () => {
|
|
191
191
|
var t;
|
|
192
|
-
(t = this.handler) == null || t.setInputAction(() => {
|
|
193
|
-
o.DRAGING == super.getEditStatus()
|
|
192
|
+
(t = this.handler) == null || t.setInputAction((a) => {
|
|
193
|
+
if (o.DRAGING == super.getEditStatus()) {
|
|
194
|
+
const s = this.viewer.scene.pickPosition(a.position);
|
|
195
|
+
l(s) && this.editCallbackFun && this.editCallbackFun(s), this.editDragUnable(), this.currentDragPoint = null, this.viewer.scene.screenSpaceCameraController.enableRotate = !0;
|
|
196
|
+
}
|
|
194
197
|
}, c.LEFT_UP);
|
|
195
198
|
}, this.point_moveEvent = () => {
|
|
196
199
|
var t;
|
|
197
200
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
198
201
|
if (h.EDITABLE == super.getStatus())
|
|
199
202
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
200
|
-
const
|
|
201
|
-
if (l(
|
|
202
|
-
let
|
|
203
|
-
this.currentDragPoint =
|
|
203
|
+
const s = this.viewer.scene.pick(a.endPosition);
|
|
204
|
+
if (l(s) && l(s.id) && this.pointCollection.contains(d(s.id))) {
|
|
205
|
+
let n = d(s.id);
|
|
206
|
+
this.currentDragPoint = n, this.editDragEnable();
|
|
204
207
|
}
|
|
205
208
|
} else if (o.DRAGING == super.getEditStatus()) {
|
|
206
|
-
const
|
|
207
|
-
l(
|
|
209
|
+
const s = this.viewer.scene.pickPosition(a.endPosition);
|
|
210
|
+
l(s) && this.currentDragPoint && (this.currentDragPoint.position = new E(s));
|
|
208
211
|
} else
|
|
209
212
|
this.editDragUnable();
|
|
210
213
|
else if (h.DELETABLE == super.getStatus())
|
|
211
214
|
if (p.DEL_UNABLED == super.getDelStatus()) {
|
|
212
|
-
const
|
|
213
|
-
l(
|
|
215
|
+
const s = this.viewer.scene.pick(a.endPosition);
|
|
216
|
+
l(s) && l(s.id) && this.pointCollection.contains(d(s.id)) && this.delEnable();
|
|
214
217
|
} else
|
|
215
218
|
this.delUnable();
|
|
216
219
|
}, c.MOUSE_MOVE);
|
|
217
|
-
},
|
|
220
|
+
}, e && (this.billboardCallbackFun = e.billboardCallbackFun ? e.billboardCallbackFun : this.addBillboardCallback, this.delCallbackFun = e.delCallbackFun ? e.delCallbackFun : this.delCallback, e.editCallbackFun && (this.editCallbackFun = e.editCallbackFun));
|
|
218
221
|
}
|
|
219
222
|
start() {
|
|
220
223
|
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();
|
|
@@ -223,18 +226,18 @@ class F extends L {
|
|
|
223
226
|
return this.pointCollection;
|
|
224
227
|
}
|
|
225
228
|
clearAll() {
|
|
226
|
-
var
|
|
229
|
+
var i;
|
|
227
230
|
this.clearAllData(), this.billboardCallbackFun = this.addBillboardCallback;
|
|
228
|
-
for (let
|
|
229
|
-
const a = this.pointCollection.values[
|
|
231
|
+
for (let e = 0, t = this.pointCollection.values.length; e < t; e++) {
|
|
232
|
+
const a = this.pointCollection.values[e];
|
|
230
233
|
this.viewer.entities.removeById(a.id);
|
|
231
234
|
}
|
|
232
|
-
(
|
|
235
|
+
(i = this.handler) == null || i.destroy();
|
|
233
236
|
}
|
|
234
|
-
addBillboardCallback(
|
|
237
|
+
addBillboardCallback(i) {
|
|
235
238
|
return this.viewer.entities.add({
|
|
236
239
|
// 设置经纬度位置 (经度, 纬度, 海拔高度)
|
|
237
|
-
position:
|
|
240
|
+
position: i,
|
|
238
241
|
billboard: {
|
|
239
242
|
image: U,
|
|
240
243
|
// 设置图片显示的宽度和高度 (像素)
|
|
@@ -243,16 +246,16 @@ class F extends L {
|
|
|
243
246
|
// 可选项:缩放倍数
|
|
244
247
|
scale: 1,
|
|
245
248
|
verticalOrigin: R.BOTTOM,
|
|
246
|
-
heightReference:
|
|
249
|
+
heightReference: S.CLAMP_TO_GROUND
|
|
247
250
|
//贴地
|
|
248
251
|
},
|
|
249
252
|
show: !0
|
|
250
253
|
});
|
|
251
254
|
}
|
|
252
|
-
deleteBillboard(
|
|
253
|
-
this.delCallbackFun ? this.delCallbackFun().then((
|
|
254
|
-
|
|
255
|
-
}) : confirm("确定要删除吗?") && (this.viewer.entities.remove(
|
|
255
|
+
deleteBillboard(i) {
|
|
256
|
+
this.delCallbackFun ? this.delCallbackFun().then((e) => {
|
|
257
|
+
e && (this.viewer.entities.remove(i), this.refreshPositionsData());
|
|
258
|
+
}) : confirm("确定要删除吗?") && (this.viewer.entities.remove(i), this.refreshPositionsData());
|
|
256
259
|
}
|
|
257
260
|
}
|
|
258
261
|
const f = {
|
|
@@ -262,18 +265,18 @@ const f = {
|
|
|
262
265
|
//画面模式
|
|
263
266
|
};
|
|
264
267
|
class O extends L {
|
|
265
|
-
constructor(
|
|
266
|
-
super(
|
|
268
|
+
constructor(i, e = null) {
|
|
269
|
+
super(i), 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
270
|
var t;
|
|
268
271
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
269
272
|
if (h.DRAWABLE == super.getStatus()) {
|
|
270
|
-
let
|
|
271
|
-
l(
|
|
273
|
+
let s = this.viewer.camera.getPickRay(a.position), n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
274
|
+
l(n) && (this.addPoint(n), this.mainData.push(n), 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
275
|
} else if (h.DELETABLE == super.getStatus()) {
|
|
273
|
-
const
|
|
274
|
-
if (l(
|
|
275
|
-
const
|
|
276
|
-
this.dataSource.entities.contains(
|
|
276
|
+
const s = this.viewer.scene.pick(a.position);
|
|
277
|
+
if (l(s) && l(s.id)) {
|
|
278
|
+
const n = d(s.id);
|
|
279
|
+
this.dataSource.entities.contains(n) && p.DEL_ENABLED == super.getDelStatus() && this.deletePoint(n);
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
282
|
}, c.LEFT_CLICK);
|
|
@@ -290,10 +293,10 @@ class O extends L {
|
|
|
290
293
|
}, this.line_moveEvent = () => {
|
|
291
294
|
var t;
|
|
292
295
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
l(
|
|
296
|
+
const s = this.viewer.camera.getPickRay(a.endPosition);
|
|
297
|
+
if (s) {
|
|
298
|
+
const n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
299
|
+
l(n) && (h.DRAWABLE == super.getStatus() ? this.dashEndData = n : h.EDITABLE == super.getStatus() ? (this.dashLineEntity.show = !1, this.editMoveFun(a, n)) : h.DELETABLE == super.getStatus() && (this.dashLineEntity.show = !1, this.deleteMoveFun(a)));
|
|
297
300
|
}
|
|
298
301
|
}, c.MOUSE_MOVE);
|
|
299
302
|
}, this.createDashline = () => {
|
|
@@ -311,15 +314,15 @@ class O extends L {
|
|
|
311
314
|
show: !0,
|
|
312
315
|
clampToGround: !0
|
|
313
316
|
}, t.positions = new A(() => {
|
|
314
|
-
let a = this.mainData.length,
|
|
315
|
-
return
|
|
317
|
+
let a = this.mainData.length, s = this.mainData[a - 1];
|
|
318
|
+
return s || (s = this.mainData[a - 2]), this.dashEndData || console.log("发生错误了dashEndData"), [s, this.dashEndData];
|
|
316
319
|
}, !1), this.dashLineEntity = this.viewer.entities.add({
|
|
317
320
|
polyline: t,
|
|
318
321
|
properties: {
|
|
319
322
|
entityType: "DASHLINE"
|
|
320
323
|
}
|
|
321
324
|
});
|
|
322
|
-
},
|
|
325
|
+
}, e && (e.drawerMode && (this.drawerMode = e.drawerMode), this.point = e.point, this.polyline = e.polyline, this.deshline = e.deshline, this.polygon = e.polygon, this.delCallbackFun = e.delCallbackFun ? e.delCallbackFun : this.delCallback);
|
|
323
326
|
}
|
|
324
327
|
start() {
|
|
325
328
|
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();
|
|
@@ -335,8 +338,8 @@ class O extends L {
|
|
|
335
338
|
}
|
|
336
339
|
//创建主线数据
|
|
337
340
|
createMainLine() {
|
|
338
|
-
let
|
|
339
|
-
this.polyline ?
|
|
341
|
+
let i;
|
|
342
|
+
this.polyline ? i = this.polyline : i = {
|
|
340
343
|
positions: [new r(), new r()],
|
|
341
344
|
// 宽度
|
|
342
345
|
width: 2,
|
|
@@ -345,8 +348,8 @@ class O extends L {
|
|
|
345
348
|
// 是否显示
|
|
346
349
|
show: !0,
|
|
347
350
|
clampToGround: !0
|
|
348
|
-
},
|
|
349
|
-
polyline:
|
|
351
|
+
}, i.positions = new A(() => this.mainData, !1), this.mainLineEntity = this.viewer.entities.add({
|
|
352
|
+
polyline: i,
|
|
350
353
|
properties: {
|
|
351
354
|
entityType: "LINE"
|
|
352
355
|
}
|
|
@@ -354,13 +357,13 @@ class O extends L {
|
|
|
354
357
|
}
|
|
355
358
|
//创建主面数据
|
|
356
359
|
createMainPolygon() {
|
|
357
|
-
let
|
|
358
|
-
this.polygon ?
|
|
360
|
+
let i;
|
|
361
|
+
this.polygon ? i = this.polygon : i = {
|
|
359
362
|
hierarchy: [new r(), new r(), new r()],
|
|
360
363
|
material: u.RED.withAlpha(0.4),
|
|
361
364
|
outline: !1
|
|
362
|
-
},
|
|
363
|
-
polygon:
|
|
365
|
+
}, i.hierarchy = new A(() => new P(this.mainData), !1), this.mainPolygonEntity = this.viewer.entities.add({
|
|
366
|
+
polygon: i,
|
|
364
367
|
properties: {
|
|
365
368
|
entityType: "POLYGON"
|
|
366
369
|
}
|
|
@@ -369,13 +372,13 @@ class O extends L {
|
|
|
369
372
|
}
|
|
370
373
|
class x extends L {
|
|
371
374
|
//主面对象
|
|
372
|
-
constructor(
|
|
373
|
-
super(
|
|
375
|
+
constructor(i, e = null) {
|
|
376
|
+
super(i), this.handler = null, this.firstPoint = null, this.endPoint = null, this.lineEntity = null, this.polygonEntity = null, this.rect_L_ClickEvent = () => {
|
|
374
377
|
var t;
|
|
375
378
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
376
379
|
if (h.DRAWABLE == super.getStatus()) {
|
|
377
|
-
let
|
|
378
|
-
l(
|
|
380
|
+
let s = this.viewer.camera.getPickRay(a.position), n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
381
|
+
l(n) && (this.mainData.length === 0 ? (this.addPoint(n), this.firstPoint = n, this.mainData.push(n), this.createLine(), this.createPolygon()) : (this.addPoint(n), this.endPoint = n, this.stopStatus()));
|
|
379
382
|
}
|
|
380
383
|
}, c.LEFT_CLICK);
|
|
381
384
|
}, this.rect_L_DownEvent = () => {
|
|
@@ -391,13 +394,13 @@ class x extends L {
|
|
|
391
394
|
}, this.rect_moveEvent = () => {
|
|
392
395
|
var t;
|
|
393
396
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
394
|
-
const
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
l(
|
|
397
|
+
const s = this.viewer.camera.getPickRay(a.endPosition);
|
|
398
|
+
if (s) {
|
|
399
|
+
const n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
400
|
+
l(n) && (h.DRAWABLE == super.getStatus() ? this.firstPoint && (this.endPoint = n, this.initMainData()) : h.EDITABLE == super.getStatus() && this.rectMove(a, n));
|
|
398
401
|
}
|
|
399
402
|
}, c.MOUSE_MOVE);
|
|
400
|
-
},
|
|
403
|
+
}, e && (this.point = e.point, this.polyline = e.polyline, this.polygon = e.polygon);
|
|
401
404
|
}
|
|
402
405
|
start() {
|
|
403
406
|
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();
|
|
@@ -408,25 +411,25 @@ class x extends L {
|
|
|
408
411
|
clearAll() {
|
|
409
412
|
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
413
|
}
|
|
411
|
-
rectMove(
|
|
414
|
+
rectMove(i, e) {
|
|
412
415
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
413
|
-
const t = this.viewer.scene.pick(
|
|
416
|
+
const t = this.viewer.scene.pick(i.endPosition);
|
|
414
417
|
if (l(t) && l(t.id) && this.dataSource.entities.contains(d(t.id))) {
|
|
415
418
|
let a = d(t.id);
|
|
416
419
|
this.currentDragPoint = a, this.editDragEnable();
|
|
417
420
|
}
|
|
418
|
-
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(
|
|
421
|
+
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(e), this.currentIndex === 0 ? this.firstPoint = e : this.endPoint = e, this.initMainData()) : this.editDragUnable();
|
|
419
422
|
}
|
|
420
423
|
initMainData() {
|
|
421
424
|
if (this.firstPoint && this.endPoint) {
|
|
422
|
-
const
|
|
423
|
-
this.mainData[0] = this.firstPoint, this.mainData[1] = v, this.mainData[2] = this.endPoint, this.mainData[3] =
|
|
425
|
+
const i = y.fromCartesian(this.firstPoint), e = i.longitude, t = i.latitude, a = y.fromCartesian(this.endPoint), s = a.longitude, n = a.latitude, v = r.fromRadians(e, n), m = r.fromRadians(s, t);
|
|
426
|
+
this.mainData[0] = this.firstPoint, this.mainData[1] = v, this.mainData[2] = this.endPoint, this.mainData[3] = m;
|
|
424
427
|
}
|
|
425
428
|
}
|
|
426
429
|
//创建主线数据
|
|
427
430
|
createLine() {
|
|
428
|
-
let
|
|
429
|
-
this.polyline ?
|
|
431
|
+
let i = null;
|
|
432
|
+
this.polyline ? i = this.polyline : i = {
|
|
430
433
|
positions: [new r(), new r()],
|
|
431
434
|
// 宽度
|
|
432
435
|
width: 2,
|
|
@@ -435,8 +438,8 @@ class x extends L {
|
|
|
435
438
|
// 是否显示
|
|
436
439
|
show: !0,
|
|
437
440
|
clampToGround: !0
|
|
438
|
-
},
|
|
439
|
-
polyline:
|
|
441
|
+
}, i.positions = new A(() => [...this.mainData, this.mainData[0]], !1), this.lineEntity = this.viewer.entities.add({
|
|
442
|
+
polyline: i,
|
|
440
443
|
properties: {
|
|
441
444
|
entityType: "LINE"
|
|
442
445
|
}
|
|
@@ -444,13 +447,13 @@ class x extends L {
|
|
|
444
447
|
}
|
|
445
448
|
//创建主面数据
|
|
446
449
|
createPolygon() {
|
|
447
|
-
let
|
|
448
|
-
this.polygon ?
|
|
450
|
+
let i = null;
|
|
451
|
+
this.polygon ? i = this.polygon : i = {
|
|
449
452
|
hierarchy: [new r(), new r(), new r()],
|
|
450
453
|
material: u.RED.withAlpha(0.4),
|
|
451
454
|
outline: !1
|
|
452
|
-
},
|
|
453
|
-
polygon:
|
|
455
|
+
}, i.hierarchy = new A(() => new P(this.mainData), !1), this.polygonEntity = this.viewer.entities.add({
|
|
456
|
+
polygon: i,
|
|
454
457
|
properties: {
|
|
455
458
|
entityType: "POLYGON"
|
|
456
459
|
}
|
|
@@ -459,13 +462,13 @@ class x extends L {
|
|
|
459
462
|
}
|
|
460
463
|
class Q extends L {
|
|
461
464
|
//主线对象
|
|
462
|
-
constructor(
|
|
463
|
-
super(
|
|
465
|
+
constructor(i, e = null) {
|
|
466
|
+
super(i), 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
467
|
var t;
|
|
465
468
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
466
469
|
if (h.DRAWABLE == super.getStatus()) {
|
|
467
|
-
let
|
|
468
|
-
l(
|
|
470
|
+
let s = this.viewer.camera.getPickRay(a.position), n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
471
|
+
l(n) && (this.mainData.length === 0 ? (this.addPoint(n), this.mainData.push(n), this.firstPoint = n, this.createCircle()) : (this.endPoint = n, this.mainData.push(n), this.endPointEntity = this.addPoint(n), this.getAngle(), this.stopStatus()));
|
|
469
472
|
}
|
|
470
473
|
}, c.LEFT_CLICK);
|
|
471
474
|
}, this.circle_L_DownEvent = () => {
|
|
@@ -481,13 +484,13 @@ class Q extends L {
|
|
|
481
484
|
}, this.circle_moveEvent = () => {
|
|
482
485
|
var t;
|
|
483
486
|
(t = this.handler) == null || t.setInputAction((a) => {
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
486
|
-
const
|
|
487
|
-
l(
|
|
487
|
+
const s = this.viewer.camera.getPickRay(a.endPosition);
|
|
488
|
+
if (s) {
|
|
489
|
+
const n = this.viewer.scene.globe.pick(s, this.viewer.scene);
|
|
490
|
+
l(n) && (h.DRAWABLE == super.getStatus() ? this.mainData.length > 0 && (this.endPoint = n, this.countDistance()) : h.EDITABLE == super.getStatus() && this.circleMove(a, n));
|
|
488
491
|
}
|
|
489
492
|
}, c.MOUSE_MOVE);
|
|
490
|
-
},
|
|
493
|
+
}, e && (this.point = e.point, this.ellipse = e.ellipse);
|
|
491
494
|
}
|
|
492
495
|
start() {
|
|
493
496
|
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();
|
|
@@ -499,37 +502,37 @@ class Q extends L {
|
|
|
499
502
|
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
503
|
}
|
|
501
504
|
getAngle() {
|
|
502
|
-
const
|
|
505
|
+
const i = b.eastNorthUpToFixedFrame(this.firstPoint.clone()), e = g.inverse(i, new g()), t = g.multiplyByPoint(e, this.endPoint.clone(), new r());
|
|
503
506
|
this.angle = Math.atan2(t.x, t.y);
|
|
504
507
|
}
|
|
505
|
-
circleMove(
|
|
508
|
+
circleMove(i, e) {
|
|
506
509
|
if (o.DRAG_UNABLED == super.getEditStatus()) {
|
|
507
|
-
const t = this.viewer.scene.pick(
|
|
510
|
+
const t = this.viewer.scene.pick(i.endPosition);
|
|
508
511
|
if (l(t) && l(t.id) && this.dataSource.entities.contains(d(t.id))) {
|
|
509
512
|
let a = d(t.id);
|
|
510
513
|
this.currentDragPoint = a, this.editDragEnable();
|
|
511
514
|
}
|
|
512
|
-
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(
|
|
515
|
+
} else o.DRAGING == super.getEditStatus() ? this.currentDragPoint && (this.currentDragPoint.position = new E(e), this.currentIndex === 0 ? (this.firstPoint = e, this.ellipseEntity && (this.ellipseEntity.position = new E(this.firstPoint)), this.endPointEntity && (this.updateEndPoint(), this.endPointEntity.position = new E(this.endPoint))) : (this.endPoint = e, this.countDistance())) : this.editDragUnable();
|
|
513
516
|
}
|
|
514
517
|
updateEndPoint() {
|
|
515
|
-
var
|
|
518
|
+
var i = new r(
|
|
516
519
|
this.distance * Math.sin(this.angle),
|
|
517
520
|
this.distance * Math.cos(this.angle),
|
|
518
521
|
0
|
|
519
522
|
// 保持水平,如果希望保持高度则设为 localEdge.z
|
|
520
|
-
),
|
|
523
|
+
), e = b.eastNorthUpToFixedFrame(this.firstPoint), t = g.multiplyByPointAsVector(e, i, new r());
|
|
521
524
|
this.endPoint = r.add(this.firstPoint, t, new r());
|
|
522
525
|
}
|
|
523
526
|
countDistance() {
|
|
524
527
|
if (this.firstPoint && this.endPoint) {
|
|
525
|
-
const
|
|
528
|
+
const i = y.fromCartesian(this.firstPoint), e = y.fromCartesian(this.endPoint), t = new k(i, e);
|
|
526
529
|
this.distance = t.surfaceDistance;
|
|
527
530
|
}
|
|
528
531
|
}
|
|
529
532
|
//创建主面数据
|
|
530
533
|
createCircle() {
|
|
531
|
-
let
|
|
532
|
-
this.ellipse ?
|
|
534
|
+
let i = null;
|
|
535
|
+
this.ellipse ? i = this.ellipse : i = {
|
|
533
536
|
semiMinorAxis: 1,
|
|
534
537
|
// 短半轴(米)
|
|
535
538
|
semiMajorAxis: 1,
|
|
@@ -543,9 +546,9 @@ class Q extends L {
|
|
|
543
546
|
outline: !0,
|
|
544
547
|
// 是否显示边框
|
|
545
548
|
outlineColor: u.RED
|
|
546
|
-
},
|
|
549
|
+
}, i.semiMinorAxis = i.semiMajorAxis = new A(() => this.distance, !1), this.ellipseEntity = this.viewer.entities.add({
|
|
547
550
|
position: new E(this.firstPoint),
|
|
548
|
-
ellipse:
|
|
551
|
+
ellipse: i,
|
|
549
552
|
properties: {
|
|
550
553
|
entityType: "ELLIPSE"
|
|
551
554
|
}
|
|
@@ -555,7 +558,7 @@ class Q extends L {
|
|
|
555
558
|
export {
|
|
556
559
|
O as C,
|
|
557
560
|
h as D,
|
|
558
|
-
|
|
561
|
+
T as P,
|
|
559
562
|
x as R,
|
|
560
563
|
Q as a,
|
|
561
564
|
f as b
|
package/drawer.js
CHANGED
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 { C as Mn, a as un, b as pn, D as bn, P as fn, R as Un } from "./CircleDrawer-
|
|
6
|
+
import { C as Mn, a as un, b as pn, D as bn, P as fn, R as Un } from "./CircleDrawer-RdBslwFS.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;
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Cartesian3, Viewer, Entity } from 'cesium';
|
|
2
2
|
import { DataCenter, DelCallbackFn } from './DataCenter.ts';
|
|
3
|
+
export type EditCallbackFn = (cartesian: Cartesian3) => void;
|
|
3
4
|
export type EntityCallbackFn = (cartesian: Cartesian3) => Entity;
|
|
4
5
|
export type PointOptions = {
|
|
5
6
|
billboardCallbackFun?: EntityCallbackFn;
|
|
7
|
+
editCallbackFun?: EditCallbackFn;
|
|
6
8
|
delCallbackFun?: DelCallbackFn;
|
|
7
9
|
} | null;
|
|
8
10
|
export declare class PointDrawer extends DataCenter {
|
|
9
11
|
private handler;
|
|
10
12
|
private pointCollection;
|
|
11
13
|
private billboardCallbackFun;
|
|
14
|
+
private editCallbackFun;
|
|
12
15
|
constructor(viewer: Viewer, options?: PointOptions);
|
|
13
16
|
start(): void;
|
|
14
17
|
getEntity(): EntityCollection;
|