Skip to content

Commit 3c063f9

Browse files
committed
【杨琨】【颜色修改】
1 parent 082637e commit 3c063f9

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

src/service/3DPlot/PlotLayer3D.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,16 @@ class PlotLayer3D extends Observable {
4040
//是否在绘制图元,绘制途中不触发pick事件
4141
this._isDrawing = false;
4242

43-
if (this._pickPlot) {
44-
const handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
45-
handler.setInputAction((event) => {
46-
if(!that._isDrawing){
47-
const pick = viewer.scene.pick(event.position);
48-
if(pick && pick.primitive && pick.primitive.pickedPrimitive){
49-
that._pickPlot(pick.primitive.pickedPrimitive)
50-
}
43+
//常驻点击事件,针对vue组件做出的修改
44+
const handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
45+
handler.setInputAction((event) => {
46+
if(!that._isDrawing && that._pickPlot){
47+
const pick = viewer.scene.pick(event.position);
48+
if(pick && pick.primitive && pick.primitive.pickedPrimitive){
49+
that._pickPlot(pick.primitive.pickedPrimitive)
5150
}
52-
}, this._pickEventType);
53-
}
51+
}
52+
}, this._pickEventType);
5453

5554
this._primitiveCollection._id = this._id;
5655
let scene = this._getScene();
@@ -320,6 +319,22 @@ Object.defineProperties(PlotLayer3D.prototype, {
320319
this._editTool.enable();
321320
}
322321
}
322+
},
323+
pickPlot: {
324+
get: function () {
325+
return this._pickPlot;
326+
},
327+
set: function (value) {
328+
this._pickPlot = value;
329+
}
330+
},
331+
pickEventType: {
332+
get: function () {
333+
return this._pickEventType;
334+
},
335+
set: function (value) {
336+
this._pickEventType = value;
337+
}
323338
}
324339
});
325340

0 commit comments

Comments
 (0)