cesium-pocket 0.1.43-alpha → 0.2.1-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/{PolygonDrawer-BQKTaCvg.js → PolygonDrawer-cdggtCBL.js} +122 -114
- package/README.md +1 -1
- package/index.css +1 -1
- package/index.js +3 -3
- package/measure.js +1 -1
- package/package.json +1 -1
- package/src/measure/LineDrawer.d.ts +5 -3
- package/src/measure/PointDrawer.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityCollection as
|
|
1
|
+
import { EntityCollection as L, defined as d, ScreenSpaceEventType as c, CallbackPositionProperty as w, Color as l, ScreenSpaceEventHandler as R, Cartographic as E, Math as y, VerticalOrigin as x, Cartesian2 as B, LabelStyle as v, Cartesian3 as u, JulianDate as k, EllipsoidGeodesic as M, BoundingSphere as P, Transforms as G, Matrix4 as A, CallbackProperty as g, PolylineDashMaterialProperty as T, HeightReference as O, PolygonHierarchy as N } from "cesium";
|
|
2
2
|
const n = {
|
|
3
3
|
STOPED: Symbol("STOPED"),
|
|
4
4
|
//未开启
|
|
@@ -12,9 +12,9 @@ const n = {
|
|
|
12
12
|
DRAGING: Symbol("DRAGING"),
|
|
13
13
|
DONE: Symbol("DONE")
|
|
14
14
|
};
|
|
15
|
-
class
|
|
16
|
-
constructor(
|
|
17
|
-
this.status = n.STOPED, this.cesiumDom =
|
|
15
|
+
class F {
|
|
16
|
+
constructor(e) {
|
|
17
|
+
this.status = n.STOPED, this.cesiumDom = e;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* 开始绘制
|
|
@@ -67,54 +67,54 @@ class Q {
|
|
|
67
67
|
return this.status;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
class W extends
|
|
72
|
-
constructor(
|
|
73
|
-
super(i), this.pointsCollection = new
|
|
74
|
-
var
|
|
75
|
-
(
|
|
70
|
+
const Q = "data:image/png;base64,i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FZhMTgZjl+7xoq7XGJ0Cp75032HtAc5FN75jsG2VABGKU7n7BkF8b6TdBY8PmaFpa4QyIQAqneHiA5ral/yKLz1Pf2j4fz20dl2ODDIhADJI9MFQY8g17p2e+A92xniHZtcGACMQG61tiNieXlxGBRRLN8D6PRQfyyxwDfSKJQPqQYmNopbbEf4KyQLEX4n3alWabARGI7Qr0xMcg2M+9Z0h2LTMQWI4v4XsYWBlf+CL3niHZtcyACMRyASR8uRkQgZS7PoLOMgO6BGI5DQkvDBTDgAikGF7Fa0UYEIFUpJCSRjEMiECK4VW8VoQBEUhFCilpFMOAAwIpJnHxKgykYUAEkoYlsfGWARGIt6WXxNMwIAJJw5LYeMuACMTb0kviaRjwWyBpGBIbrxkQgXhdfkk+iQERSBJDMu81AyIQr8svyScxIAJJYkjmvWZABFJQ+cVtNRj4OQAAAP//gm46zwAAAAZJREFUAwB1f5TcL2bFTAAAAABJRU5ErkJggg==";
|
|
71
|
+
class W extends F {
|
|
72
|
+
constructor(e, i) {
|
|
73
|
+
super(i), this.pointsCollection = new L(), this.currentDragPoint = null, this.mainData = [], this.textDom = null, this.point_L_ClickEvent = () => {
|
|
74
|
+
var t;
|
|
75
|
+
(t = this.handler) == null || t.setInputAction((s) => {
|
|
76
76
|
let r = this.viewer.camera.getPickRay(s.position), o = this.viewer.scene.globe.pick(r, this.viewer.scene);
|
|
77
|
-
|
|
77
|
+
d(o) && n.DRAWABLE == super.getStatus() && this.createBillboard(o);
|
|
78
78
|
}, c.LEFT_CLICK);
|
|
79
79
|
}, this.point_L_MIDDLE_ClickEvent = () => {
|
|
80
|
-
var
|
|
81
|
-
(
|
|
80
|
+
var t;
|
|
81
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
82
82
|
n.DRAGABLE == super.getStatus() && this.currentDragPoint && (this.viewer.scene.screenSpaceCameraController.enableRotate = !1, confirm("确定要删除吗?") ? (this.viewer.entities.remove(this.currentDragPoint), this.pointsCollection.remove(this.currentDragPoint), this.billboardBackEdit(), this.setMainData(), this.viewer.scene.screenSpaceCameraController.enableRotate = !0) : (this.billboardBackEdit(), this.viewer.scene.screenSpaceCameraController.enableRotate = !0));
|
|
83
83
|
}, c.MIDDLE_CLICK);
|
|
84
84
|
}, this.point_R_ClickEvent = () => {
|
|
85
|
-
var
|
|
86
|
-
(
|
|
85
|
+
var t;
|
|
86
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
87
87
|
n.DRAWABLE == super.getStatus() ? (this.textDom && this.viewer.container.removeChild(this.textDom), super.editStatus(), this.setMainData()) : n.EDITING == super.getStatus() || n.DRAGABLE == super.getStatus() ? super.doneStatus() : n.DONE == super.getStatus() && (super.stopStatus(), this.pointsReset());
|
|
88
88
|
}, c.RIGHT_CLICK);
|
|
89
89
|
}, this.point_L_DownEvent = () => {
|
|
90
|
-
var
|
|
91
|
-
(
|
|
90
|
+
var t;
|
|
91
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
92
92
|
n.DRAGABLE == super.getStatus() && (super.dragingStatus(), this.viewer.scene.screenSpaceCameraController.enableRotate = !1);
|
|
93
93
|
}, c.LEFT_DOWN);
|
|
94
94
|
}, this.point_L_UpEvent = () => {
|
|
95
|
-
var
|
|
96
|
-
(
|
|
95
|
+
var t;
|
|
96
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
97
97
|
n.DRAGING == super.getStatus() && (this.billboardBackEdit(), this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
|
|
98
98
|
}, c.LEFT_UP);
|
|
99
99
|
}, this.point_moveEvent = () => {
|
|
100
|
-
var
|
|
101
|
-
(
|
|
100
|
+
var t;
|
|
101
|
+
(t = this.handler) == null || t.setInputAction((s) => {
|
|
102
102
|
const r = this.viewer.camera.getPickRay(s.endPosition);
|
|
103
103
|
if (r) {
|
|
104
104
|
const o = this.viewer.scene.globe.pick(r, this.viewer.scene);
|
|
105
|
-
|
|
105
|
+
d(o) && (n.DRAWABLE == super.getStatus() ? this.showPosition(s.endPosition) : n.EDITING == super.getStatus() ? this.pickLocation(s.endPosition) : n.DRAGABLE == super.getStatus() ? this.billboardBackEdit() : n.DRAGING == super.getStatus() && this.currentDragPoint && (this.currentDragPoint.position = new w(() => {
|
|
106
106
|
let h = this.getLonLatStr(o);
|
|
107
107
|
return this.currentDragPoint.label.text = h, o;
|
|
108
108
|
}, !1)));
|
|
109
109
|
}
|
|
110
110
|
}, c.MOUSE_MOVE);
|
|
111
|
-
}, this.
|
|
112
|
-
let s = this.viewer.scene.pick(
|
|
113
|
-
s && s.id && s.id.properties.getValue().entityType == "
|
|
114
|
-
}, this.viewer =
|
|
111
|
+
}, this.pickLocation = (t) => {
|
|
112
|
+
let s = this.viewer.scene.pick(t);
|
|
113
|
+
s && s.id && s.id.properties.getValue().entityType == "LOCATION" && (s.id.label.backgroundColor = l.YELLOW, super.dragStatus(), this.currentDragPoint = s.id);
|
|
114
|
+
}, this.viewer = e, this.viewer.entities.add(this.pointsCollection), this.textDom = document.createElement("div"), this.textDom.style.position = "absolute", this.textDom.style.zIndex = " 10", this.textDom.style.color = "white", this.textDom.style.backgroundColor = "rgba(0, 0, 0, 0.9)", this.textDom.style.padding = "2px 6px", this.viewer.container.appendChild(this.textDom);
|
|
115
115
|
}
|
|
116
116
|
start() {
|
|
117
|
-
super.startStatus(), this.handler || (this.handler = new
|
|
117
|
+
super.startStatus(), this.handler || (this.handler = new R(this.viewer.scene.canvas)), this.point_L_ClickEvent(), this.point_L_MIDDLE_ClickEvent(), this.point_R_ClickEvent(), this.point_L_DownEvent(), this.point_L_UpEvent(), this.point_moveEvent();
|
|
118
118
|
}
|
|
119
119
|
getEntityCollection() {
|
|
120
120
|
return this.pointsCollection;
|
|
@@ -126,29 +126,29 @@ class W extends Q {
|
|
|
126
126
|
this.currentDragPoint && (this.currentDragPoint.label.fillColor = l.WHITE, this.currentDragPoint.label.backgroundColor = new l(0, 0, 0, 0.7), super.editStatus());
|
|
127
127
|
}
|
|
128
128
|
pointsReset() {
|
|
129
|
-
for (let
|
|
130
|
-
const
|
|
131
|
-
this.viewer.entities.removeById(
|
|
129
|
+
for (let e = 0, i = this.pointsCollection.values.length; e < i; e++) {
|
|
130
|
+
const t = this.pointsCollection.values[e];
|
|
131
|
+
this.viewer.entities.removeById(t.id);
|
|
132
132
|
}
|
|
133
133
|
this.pointsCollection.removeAll(), this.viewer.entities.removeById(this.pointsCollection.id);
|
|
134
134
|
}
|
|
135
|
-
showPosition(
|
|
136
|
-
const i = this.viewer.camera.getPickRay(
|
|
135
|
+
showPosition(e) {
|
|
136
|
+
const i = this.viewer.camera.getPickRay(e);
|
|
137
137
|
if (this.textDom && i) {
|
|
138
|
-
const
|
|
139
|
-
let s = this.getLonLatStr(
|
|
140
|
-
this.textDom.style.left =
|
|
138
|
+
const t = this.viewer.scene.globe.pick(i, this.viewer.scene);
|
|
139
|
+
let s = this.getLonLatStr(t);
|
|
140
|
+
this.textDom.style.left = e.x + 4 + "px", this.textDom.style.top = e.y - 30 + "px", this.textDom.innerText = s;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
getLonLatStr(
|
|
144
|
-
const i = E.fromCartesian(
|
|
145
|
-
return `${
|
|
143
|
+
getLonLatStr(e) {
|
|
144
|
+
const i = E.fromCartesian(e), t = y.toDegrees(i.longitude), s = y.toDegrees(i.latitude);
|
|
145
|
+
return `${t.toFixed(4)}, ${s.toFixed(4)}`;
|
|
146
146
|
}
|
|
147
|
-
createBillboard(
|
|
148
|
-
let i = this.getLonLatStr(
|
|
149
|
-
const
|
|
147
|
+
createBillboard(e) {
|
|
148
|
+
let i = this.getLonLatStr(e);
|
|
149
|
+
const t = this.viewer.entities.add({
|
|
150
150
|
// 设置经纬度位置 (经度, 纬度, 海拔高度)
|
|
151
|
-
position:
|
|
151
|
+
position: e,
|
|
152
152
|
label: {
|
|
153
153
|
text: i,
|
|
154
154
|
font: "500 14px Helvetica",
|
|
@@ -160,38 +160,38 @@ class W extends Q {
|
|
|
160
160
|
backgroundColor: new l(0, 0, 0, 0.7)
|
|
161
161
|
},
|
|
162
162
|
billboard: {
|
|
163
|
-
image:
|
|
163
|
+
image: Q,
|
|
164
164
|
// 设置图片显示的宽度和高度 (像素)
|
|
165
165
|
width: 40,
|
|
166
166
|
height: 40,
|
|
167
167
|
// 可选项:缩放倍数
|
|
168
168
|
scale: 1,
|
|
169
|
-
verticalOrigin:
|
|
169
|
+
verticalOrigin: x.BOTTOM
|
|
170
170
|
},
|
|
171
171
|
properties: {
|
|
172
|
-
entityType: "
|
|
172
|
+
entityType: "LOCATION"
|
|
173
173
|
},
|
|
174
174
|
show: !0
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
t && (this.mainData.push(e), this.pointsCollection.add(t));
|
|
177
177
|
}
|
|
178
178
|
setMainData() {
|
|
179
|
-
this.mainData = [], this.pointsCollection.values.forEach((
|
|
179
|
+
this.mainData = [], this.pointsCollection.values.forEach((e) => {
|
|
180
180
|
var i;
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
(i =
|
|
181
|
+
if (e.point) {
|
|
182
|
+
const t = new u();
|
|
183
|
+
(i = e.position) == null || i.getValue(k.now(), t), this.mainData.push(t);
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
const U = (a,
|
|
189
|
-
const i = E.fromCartesian(a),
|
|
190
|
-
return new
|
|
191
|
-
}, K = (a,
|
|
188
|
+
const U = (a, e) => {
|
|
189
|
+
const i = E.fromCartesian(a), t = E.fromCartesian(e);
|
|
190
|
+
return new M(i, t).surfaceDistance;
|
|
191
|
+
}, K = (a, e) => {
|
|
192
192
|
const i = new u();
|
|
193
|
-
return u.add(a,
|
|
194
|
-
}, D = (a,
|
|
193
|
+
return u.add(a, e, i), u.divideByScalar(i, 2, i), i;
|
|
194
|
+
}, D = (a, e, i, t = null) => {
|
|
195
195
|
let r = { ...{
|
|
196
196
|
text: i,
|
|
197
197
|
font: "16px sans-serif",
|
|
@@ -201,32 +201,32 @@ const U = (a, t) => {
|
|
|
201
201
|
showBackground: !0,
|
|
202
202
|
backgroundColor: l.BLACK,
|
|
203
203
|
style: v.FILL_AND_OUTLINE
|
|
204
|
-
}, ...
|
|
205
|
-
position:
|
|
204
|
+
}, ...t }, o = {
|
|
205
|
+
position: e,
|
|
206
206
|
label: r
|
|
207
207
|
};
|
|
208
208
|
return a.entities.add(o);
|
|
209
209
|
}, m = (a) => {
|
|
210
|
-
let
|
|
211
|
-
return a > 1e3 ?
|
|
210
|
+
let e = "";
|
|
211
|
+
return a > 1e3 ? e = (a / 1e3).toFixed(2) + " 公里" : e = a.toFixed(2) + " 米", e;
|
|
212
212
|
}, j = (a) => {
|
|
213
|
-
let
|
|
214
|
-
return a > 1e3 * 1e3 * 1e4 ?
|
|
213
|
+
let e = "";
|
|
214
|
+
return a > 1e3 * 1e3 * 1e4 ? e = (a / (1e3 * 1e3 * 1e4)).toFixed(2) + " 万平方公里" : a > 1e3 * 1e3 ? e = (a / (1e3 * 1e3)).toFixed(2) + " 平方公里" : e = a.toFixed(2) + " 平方米", e;
|
|
215
215
|
}, Y = (a) => {
|
|
216
216
|
if (!a || a.length === 0) return null;
|
|
217
|
-
let
|
|
217
|
+
let e = 0, i = 0, t = 0;
|
|
218
218
|
const s = a.length;
|
|
219
219
|
return a.forEach((o) => {
|
|
220
|
-
|
|
220
|
+
e += o.x, i += o.y, t += o.z;
|
|
221
221
|
}), new u(
|
|
222
|
-
|
|
222
|
+
e / s,
|
|
223
223
|
i / s,
|
|
224
|
-
|
|
224
|
+
t / s
|
|
225
225
|
);
|
|
226
226
|
}, Z = (a) => {
|
|
227
227
|
if (a.length < 3) return 0;
|
|
228
|
-
const i = P.fromPoints(a).center,
|
|
229
|
-
(h) =>
|
|
228
|
+
const i = P.fromPoints(a).center, t = G.eastNorthUpToFixedFrame(i), s = A.inverse(t, new A()), r = a.map(
|
|
229
|
+
(h) => A.multiplyByPoint(s, h, new u())
|
|
230
230
|
);
|
|
231
231
|
let o = 0;
|
|
232
232
|
for (let h = 0; h < r.length; h++) {
|
|
@@ -236,32 +236,40 @@ const U = (a, t) => {
|
|
|
236
236
|
return Math.abs(o) / 2;
|
|
237
237
|
};
|
|
238
238
|
class V extends W {
|
|
239
|
-
constructor(
|
|
240
|
-
super(
|
|
241
|
-
var
|
|
242
|
-
(
|
|
239
|
+
constructor(e, i) {
|
|
240
|
+
super(e, i), this.mainLineEntity = null, this.dashLineEntity = null, this.dashEndData = new u(), this.currentIndex = -1, this.labelsCollection = new L(), this.line_L_ClickEvent = () => {
|
|
241
|
+
var t;
|
|
242
|
+
(t = this.handler) == null || t.setInputAction((s) => {
|
|
243
243
|
let r = this.viewer.camera.getPickRay(s.position), o = this.viewer.scene.globe.pick(r, this.viewer.scene);
|
|
244
|
-
|
|
244
|
+
d(o) && n.DRAWABLE == super.getStatus() && (this.createPoint(o), this.mainData.length > 0 && (this.mainLineEntity || this.createMainLine(), this.dashLineEntity || this.createDashLine()));
|
|
245
245
|
}, c.LEFT_CLICK);
|
|
246
246
|
}, this.line_R_ClickEvent = () => {
|
|
247
|
-
var
|
|
248
|
-
(
|
|
247
|
+
var t;
|
|
248
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
249
249
|
n.DRAWABLE == super.getStatus() ? (super.editStatus(), this.dashLineEntity && (this.dashLineEntity.show = !1), this.pointsCollection.show = !0) : n.EDITING == super.getStatus() || n.DRAGABLE == super.getStatus() ? (super.doneStatus(), this.showDistance(), this.pointsCollection.show = !1, this.labelsCollection.show = !0) : n.DONE == super.getStatus() && (super.stopStatus(), this.pointsReset(), this.lineReset());
|
|
250
250
|
}, c.RIGHT_CLICK);
|
|
251
251
|
}, this.line_L_DownEvent = () => {
|
|
252
|
-
var
|
|
253
|
-
(
|
|
252
|
+
var t;
|
|
253
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
254
254
|
n.DRAGABLE == super.getStatus() && (super.dragingStatus(), this.getEntityIndex(), this.viewer.scene.screenSpaceCameraController.enableRotate = !1);
|
|
255
255
|
}, c.LEFT_DOWN);
|
|
256
|
+
}, this.line_L_UpEvent = () => {
|
|
257
|
+
var t;
|
|
258
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
259
|
+
n.DRAGING == super.getStatus() && (this.pointBackEdit(), this.viewer.scene.screenSpaceCameraController.enableRotate = !0);
|
|
260
|
+
}, c.LEFT_UP);
|
|
256
261
|
}, this.line_moveEvent = () => {
|
|
257
|
-
var
|
|
258
|
-
(
|
|
262
|
+
var t;
|
|
263
|
+
(t = this.handler) == null || t.setInputAction((s) => {
|
|
259
264
|
const r = this.viewer.camera.getPickRay(s.endPosition);
|
|
260
265
|
if (r) {
|
|
261
266
|
const o = this.viewer.scene.globe.pick(r, this.viewer.scene);
|
|
262
|
-
|
|
267
|
+
d(o) && (n.DRAWABLE == super.getStatus() ? this.mainData.length > 0 && (this.dashEndData = o) : n.EDITING == super.getStatus() ? this.pickPoint(s.endPosition) : n.DRAGABLE == super.getStatus() ? (this.pointBackEdit(), this.currentIndex = -1) : n.DRAGING == super.getStatus() && this.moveLine(o));
|
|
263
268
|
}
|
|
264
269
|
}, c.MOUSE_MOVE);
|
|
270
|
+
}, this.pickPoint = (t) => {
|
|
271
|
+
let s = this.viewer.scene.pick(t);
|
|
272
|
+
s && s.id && s.id.properties.getValue().entityType == "POINT" && (console.log(s.id.point.color), s.id.point.color = l.YELLOW, super.dragStatus(), this.currentDragPoint = s.id);
|
|
265
273
|
}, this.createMainLine = () => {
|
|
266
274
|
this.mainLineEntity = this.viewer.entities.add({
|
|
267
275
|
polyline: {
|
|
@@ -281,15 +289,15 @@ class V extends W {
|
|
|
281
289
|
};
|
|
282
290
|
}
|
|
283
291
|
start() {
|
|
284
|
-
super.start(), this.viewer.entities.add(this.labelsCollection), this.pointsCollection.show = !1, this.line_L_ClickEvent(), this.line_R_ClickEvent(), this.line_L_DownEvent(), this.line_moveEvent();
|
|
292
|
+
super.start(), this.viewer.entities.add(this.labelsCollection), this.pointsCollection.show = !1, this.line_L_ClickEvent(), this.line_R_ClickEvent(), this.line_L_DownEvent(), this.line_L_UpEvent(), this.line_moveEvent();
|
|
285
293
|
}
|
|
286
|
-
moveLine(
|
|
287
|
-
this.currentDragPoint && (this.currentDragPoint.position = new
|
|
294
|
+
moveLine(e) {
|
|
295
|
+
this.currentDragPoint && (this.currentDragPoint.position = new w(() => e, !1), this.currentIndex > -1 && (this.mainData[this.currentIndex] = e));
|
|
288
296
|
}
|
|
289
297
|
getEntityIndex() {
|
|
290
|
-
for (let
|
|
291
|
-
if (this.pointsCollection.values[
|
|
292
|
-
this.currentIndex =
|
|
298
|
+
for (let e = 0, i = this.pointsCollection.values.length; e < i; e++)
|
|
299
|
+
if (this.pointsCollection.values[e].id == this.currentDragPoint.id) {
|
|
300
|
+
this.currentIndex = e;
|
|
293
301
|
break;
|
|
294
302
|
}
|
|
295
303
|
}
|
|
@@ -298,8 +306,8 @@ class V extends W {
|
|
|
298
306
|
this.dashLineEntity = this.viewer.entities.add({
|
|
299
307
|
polyline: {
|
|
300
308
|
positions: new g(() => {
|
|
301
|
-
const
|
|
302
|
-
let i = this.mainData[
|
|
309
|
+
const e = this.mainData.length;
|
|
310
|
+
let i = this.mainData[e - 1];
|
|
303
311
|
return this.dashEndData.x == 0 && this.dashEndData.y == 0 && this.dashEndData.z == 0 && (this.dashEndData = i), [i, this.dashEndData];
|
|
304
312
|
}, !1),
|
|
305
313
|
// 宽度
|
|
@@ -319,15 +327,15 @@ class V extends W {
|
|
|
319
327
|
}
|
|
320
328
|
lineReset() {
|
|
321
329
|
this.labelsCollection.show = !1, this.mainLineEntity && this.viewer.entities.remove(this.mainLineEntity), this.dashLineEntity && this.viewer.entities.remove(this.dashLineEntity), this.mainLineEntity = null, this.dashLineEntity = null;
|
|
322
|
-
for (let
|
|
323
|
-
const
|
|
324
|
-
this.viewer.entities.removeById(
|
|
330
|
+
for (let e = 0, i = this.labelsCollection.values.length; e < i; e++) {
|
|
331
|
+
const t = this.labelsCollection.values[e];
|
|
332
|
+
this.viewer.entities.removeById(t.id);
|
|
325
333
|
}
|
|
326
334
|
this.labelsCollection.removeAll(), this.viewer.entities.removeById(this.labelsCollection.id);
|
|
327
335
|
}
|
|
328
|
-
createPoint(
|
|
336
|
+
createPoint(e) {
|
|
329
337
|
const i = this.viewer.entities.add({
|
|
330
|
-
position:
|
|
338
|
+
position: e,
|
|
331
339
|
point: {
|
|
332
340
|
pixelSize: 6,
|
|
333
341
|
color: l.TRANSPARENT,
|
|
@@ -342,34 +350,34 @@ class V extends W {
|
|
|
342
350
|
},
|
|
343
351
|
show: !0
|
|
344
352
|
});
|
|
345
|
-
i && (this.mainData.push(
|
|
353
|
+
i && (this.mainData.push(e), this.pointsCollection.add(i));
|
|
346
354
|
}
|
|
347
|
-
|
|
355
|
+
pointBackEdit() {
|
|
348
356
|
this.currentDragPoint && (this.currentDragPoint.point.color = l.TRANSPARENT, this.currentDragPoint = null, super.editStatus());
|
|
349
357
|
}
|
|
350
358
|
showDistance() {
|
|
351
|
-
let
|
|
359
|
+
let e = 0, i = this.mainData.length;
|
|
352
360
|
for (let h = 1; h < i; h++) {
|
|
353
|
-
const p = this.mainData[h - 1], f = this.mainData[h], I = K(p, f),
|
|
354
|
-
|
|
355
|
-
let
|
|
356
|
-
this.labelsCollection.add(
|
|
361
|
+
const p = this.mainData[h - 1], f = this.mainData[h], I = K(p, f), C = U(p, f);
|
|
362
|
+
e += C;
|
|
363
|
+
let S = m(C), b = D(this.viewer, I, S);
|
|
364
|
+
this.labelsCollection.add(b);
|
|
357
365
|
}
|
|
358
|
-
let
|
|
366
|
+
let t = { font: "20px", fillColor: l.WHITE, outlineWidth: 0 }, s = this.mainData[i - 1], r = "共: " + m(e), o = D(this.viewer, s, r, t);
|
|
359
367
|
this.labelsCollection.add(o);
|
|
360
368
|
}
|
|
361
369
|
}
|
|
362
370
|
class H extends V {
|
|
363
|
-
constructor(
|
|
364
|
-
super(
|
|
365
|
-
var
|
|
366
|
-
(
|
|
371
|
+
constructor(e, i) {
|
|
372
|
+
super(e, i), this.polygonEntity = null, this.areaText = null, this.polygon_L_ClickEvent = () => {
|
|
373
|
+
var t;
|
|
374
|
+
(t = this.handler) == null || t.setInputAction((s) => {
|
|
367
375
|
let r = this.viewer.camera.getPickRay(s.position), o = this.viewer.scene.globe.pick(r, this.viewer.scene);
|
|
368
|
-
|
|
376
|
+
d(o) && n.DRAWABLE == super.getStatus() && (super.createPoint(o), this.mainData.length > 0 && (this.mainLineEntity || this.createMainLine(), this.dashLineEntity || this.createDashLine(), !this.polygonEntity && this.mainData.length > 2 && this.createPolygon()));
|
|
369
377
|
}, c.LEFT_CLICK);
|
|
370
378
|
}, this.polygon_R_ClickEvent = () => {
|
|
371
|
-
var
|
|
372
|
-
(
|
|
379
|
+
var t;
|
|
380
|
+
(t = this.handler) == null || t.setInputAction(() => {
|
|
373
381
|
n.DRAWABLE == super.getStatus() ? (super.editStatus(), this.dashLineEntity && (this.dashLineEntity.show = !1), this.pointsCollection.show = !0) : n.EDITING == super.getStatus() ? (super.doneStatus(), this.showArea(), this.pointsCollection.show = !1) : n.DRAGABLE == super.getStatus() ? (super.doneStatus(), this.showArea(), this.pointsCollection.show = !1) : n.DONE == super.getStatus() && (super.stopStatus(), this.pointsReset(), this.lineReset(), this.polygonReset());
|
|
374
382
|
}, c.RIGHT_CLICK);
|
|
375
383
|
}, this.createPolygon = () => {
|
|
@@ -382,18 +390,18 @@ class H extends V {
|
|
|
382
390
|
properties: {
|
|
383
391
|
entityType: "POLYGON"
|
|
384
392
|
}
|
|
385
|
-
})
|
|
393
|
+
});
|
|
386
394
|
};
|
|
387
395
|
}
|
|
388
396
|
start() {
|
|
389
|
-
super.start(), this.polygon_L_ClickEvent(), this.polygon_R_ClickEvent();
|
|
397
|
+
super.start(), this.polygon_L_ClickEvent(), this.polygon_R_ClickEvent(), this.line_L_DownEvent(), this.line_L_UpEvent();
|
|
390
398
|
}
|
|
391
399
|
showArea() {
|
|
392
|
-
let
|
|
393
|
-
if (
|
|
400
|
+
let e = Y(this.mainData);
|
|
401
|
+
if (e) {
|
|
394
402
|
let i = Z(this.mainData);
|
|
395
|
-
const
|
|
396
|
-
this.areaText = D(this.viewer,
|
|
403
|
+
const t = j(i);
|
|
404
|
+
this.areaText = D(this.viewer, e, t);
|
|
397
405
|
}
|
|
398
406
|
}
|
|
399
407
|
polygonReset() {
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
# <img src="
|
|
2
|
+
# <img src="/logo.svg" width="28px" alt="示例图"/>cesium-pocket
|
|
3
3
|
Cesium + Vue3 + Vite 的口袋式轻量级组件工具库。服务于webGIS开发人员,面向三维数字孪生,可视化大屏业务场景。
|
|
4
4
|
作者联系方式 微信:brilliant201306
|
|
5
5
|
官方网站:<a href="https://cesium-pocket.com">cesium-pocket官网</a>
|
package/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cp-porket-compass[data-v-f7da7154]{position:absolute;z-index:1000;width:100px;height:100px;cursor:pointer}.cp-porket-ruler[data-v-8e93d8ff]{z-index:1000;width:100px;height:20px;text-align:center;padding-top:2px;font-size:12px;color:#ebebeb}.cp-porket-ruler-line[data-v-8e93d8ff]{width:100px;height:5px;border-bottom:1px solid #eeeeee;border-left:2px solid #eeeeee;border-right:2px solid #eeeeee;margin-top:-2px}.cp-porket-coord[data-v-064db41e]{z-index:1000;width:200px;height:26px;text-align:center;font-size:12px;display:flex;justify-content:space-around;color:#eee}.cp-overlay[data-v-2b05e7d5]{position:absolute;z-index:100;font-size:12px}.cp-overlay-close[data-v-2b05e7d5]{position:absolute;right:0;top:0;z-index:10;width:30px;height:30px;line-height:30px;text-align:center;cursor:pointer}.cp-overlay-close-img[data-v-2b05e7d5]{width:30px;height:30px;color:#fff}.cesium-html-marker[data-v-
|
|
1
|
+
.cp-porket-compass[data-v-f7da7154]{position:absolute;z-index:1000;width:100px;height:100px;cursor:pointer}.cp-porket-ruler[data-v-8e93d8ff]{z-index:1000;width:100px;height:20px;text-align:center;padding-top:2px;font-size:12px;color:#ebebeb}.cp-porket-ruler-line[data-v-8e93d8ff]{width:100px;height:5px;border-bottom:1px solid #eeeeee;border-left:2px solid #eeeeee;border-right:2px solid #eeeeee;margin-top:-2px}.cp-porket-coord[data-v-064db41e]{z-index:1000;width:200px;height:26px;text-align:center;font-size:12px;display:flex;justify-content:space-around;color:#eee}.cp-overlay[data-v-2b05e7d5]{position:absolute;z-index:100;font-size:12px}.cp-overlay-close[data-v-2b05e7d5]{position:absolute;right:0;top:0;z-index:10;width:30px;height:30px;line-height:30px;text-align:center;cursor:pointer}.cp-overlay-close-img[data-v-2b05e7d5]{width:30px;height:30px;color:#fff}.cesium-html-marker[data-v-da185123]{pointer-events:auto;z-index:1000}.pin-container[data-v-da185123]{position:absolute;z-index:20;color:#eee;font-size:12px;text-shadow:-1px -1px 0 #06012c,1px -1px 0 #06012c,-1px 1px 0 #06012c,1px 1px 0 #06012c;margin:0;padding:5px;border-radius:4px}.cp-layersmap[data-v-3c9f5494]{position:absolute;z-index:10;color:#eee;background-color:#000c;border:1px solid rgb(61,64,105);border-radius:4px}.cp-layersmap-header[data-v-3c9f5494]{height:24px;line-height:20px;font-size:12px;background-color:#000c;display:flex;justify-content:space-around;align-items:center}.cp-layersmap-main[data-v-3c9f5494]{display:flex;justify-content:space-around;padding-right:2px}.cp-layersmap-layer[data-v-3c9f5494]{width:60px;height:60px;position:relative;margin-left:2px;margin-top:2px;margin-bottom:2px;cursor:pointer}.cp-layersmap-layer-header[data-v-3c9f5494]{position:absolute;z-index:1;width:100%;height:16px;line-height:16px;text-align:center;font-size:12px;background-color:#4449}.cp-layersmap-layer-image[data-v-3c9f5494]{width:60px;height:60px}.cp-layersmap-layer-footer[data-v-3c9f5494]{position:absolute;z-index:1;width:100%;height:16px;line-height:16px;text-align:center;font-size:12px;background-color:#4449}.cp-layersmap-active[data-v-3c9f5494]{background-color:#0047e0cc}.cp-tianmap[data-v-014b2f5e]{position:absolute;z-index:10;color:#eee;background-color:#000c;border:1px solid rgb(61,64,105);border-radius:4px}.cp-tianmap-header[data-v-014b2f5e]{height:24px;line-height:20px;font-size:12px;background-color:#000c;display:flex;justify-content:space-around;align-items:center}.cp-tianmap-main[data-v-014b2f5e]{display:flex;justify-content:space-around;padding-right:4px}.cp-tianmap-layer[data-v-014b2f5e]{width:60px;height:60px;position:relative;margin-left:4px;margin-top:4px;margin-bottom:4px;cursor:pointer}.cp-tianmap-layer-header[data-v-014b2f5e]{position:absolute;z-index:1;width:100%;height:16px;line-height:16px;text-align:center;font-size:12px;background-color:#4449}.cp-tianmap-layer-image[data-v-014b2f5e]{width:60px;height:60px}.cp-tianmap-layer-footer[data-v-014b2f5e]{position:absolute;z-index:1;width:100%;height:16px;line-height:16px;text-align:center;font-size:12px;background-color:#4449}.cp-tianmap-active[data-v-014b2f5e]{background-color:#00c6e0cc}
|
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-
|
|
6
|
+
import { L as Mn, P as un, a as pn } from "./PolygonDrawer-cdggtCBL.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;
|
|
@@ -2064,7 +2064,7 @@ const He = /* @__PURE__ */ q({
|
|
|
2064
2064
|
});
|
|
2065
2065
|
const v = () => {
|
|
2066
2066
|
let Q = A.viewer;
|
|
2067
|
-
if (
|
|
2067
|
+
if (G.DEFAULT == A.pinMode) {
|
|
2068
2068
|
const E = A.pinCategory;
|
|
2069
2069
|
xP(Q, A.position, E, A.fontSize).then((I) => {
|
|
2070
2070
|
r.value = I.id;
|
|
@@ -2124,7 +2124,7 @@ const He = /* @__PURE__ */ q({
|
|
|
2124
2124
|
LA(Q.$slots, "default", { style: "margin-top:-5px" }, void 0, !0)
|
|
2125
2125
|
], 4)) : OA("", !0);
|
|
2126
2126
|
}
|
|
2127
|
-
}), _e = /* @__PURE__ */ J(Re, [["__scopeId", "data-v-
|
|
2127
|
+
}), _e = /* @__PURE__ */ J(Re, [["__scopeId", "data-v-da185123"]]), $e = { class: "cp-layersmap-header" }, An = { class: "cp-layersmap-main" }, Pn = ["onClick"], en = ["src"], nn = /* @__PURE__ */ q({
|
|
2128
2128
|
__name: "Index",
|
|
2129
2129
|
props: {
|
|
2130
2130
|
viewer: {
|
package/measure.js
CHANGED
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cartesian3, Viewer, Entity } from 'cesium';
|
|
1
|
+
import { Cartesian3, Viewer, Entity, Cartesian2 } from 'cesium';
|
|
2
2
|
import { PointDrawer } from './PointDrawer.ts';
|
|
3
3
|
export declare class LineDrawer extends PointDrawer {
|
|
4
4
|
protected mainLineEntity: Entity | null;
|
|
@@ -13,14 +13,16 @@ export declare class LineDrawer extends PointDrawer {
|
|
|
13
13
|
*/
|
|
14
14
|
private line_L_ClickEvent;
|
|
15
15
|
private line_R_ClickEvent;
|
|
16
|
-
|
|
16
|
+
protected line_L_DownEvent: () => void;
|
|
17
|
+
protected line_L_UpEvent: () => void;
|
|
17
18
|
private line_moveEvent;
|
|
19
|
+
protected pickPoint: (endPosition: Cartesian2) => void;
|
|
18
20
|
private moveLine;
|
|
19
21
|
private getEntityIndex;
|
|
20
22
|
protected createMainLine: () => void;
|
|
21
23
|
protected createDashLine(): void;
|
|
22
24
|
protected lineReset(): void;
|
|
23
25
|
protected createPoint(cartesian: Cartesian3): void;
|
|
24
|
-
private
|
|
26
|
+
private pointBackEdit;
|
|
25
27
|
private showDistance;
|
|
26
28
|
}
|
|
@@ -24,7 +24,7 @@ export declare class PointDrawer extends DrawerStatus {
|
|
|
24
24
|
private point_moveEvent;
|
|
25
25
|
private billboardBackEdit;
|
|
26
26
|
protected pointsReset(): void;
|
|
27
|
-
protected
|
|
27
|
+
protected pickLocation: (endPosition: Cartesian2) => void;
|
|
28
28
|
private showPosition;
|
|
29
29
|
private getLonLatStr;
|
|
30
30
|
private createBillboard;
|