修改点时,去掉弹窗事件
parent
43e6b9ac2a
commit
716dec950b
|
@ -138,7 +138,7 @@
|
|||
</div>
|
||||
<canvas v-show="checkRealityWait" id="scaleBar"></canvas>
|
||||
<div class="update-btns" v-show="updatePointVisible">
|
||||
<div><el-button type="primary" @click="selectPoint">选取点</el-button></div>
|
||||
<div><el-button type="primary" @click="selectPoint" :disabled="isSelectPointDisabled">选取点</el-button></div>
|
||||
<div><el-button type="primary" @click="savePoint">保存点</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -261,11 +261,15 @@ export default {
|
|||
updatePointVisible:false,
|
||||
currentSelectPoint: null, //当前选择修改的点对象
|
||||
updatedPoint:null, // 修改后的点对象
|
||||
isClickEventOpen:true,
|
||||
isSelectPointDisabled:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
cu.initCesium("cesiumView");
|
||||
cu.handleClick();
|
||||
// if(this.isClickEventOpen){
|
||||
// cu.handleClick();
|
||||
// }
|
||||
cu.addlayer(this.geoWorkSpace, this.geoLayerName);
|
||||
let gp = this.geoLayerPos;
|
||||
cu.flyToLayerRect(gp[0], gp[1], gp[2], gp[3]);
|
||||
|
@ -435,7 +439,9 @@ export default {
|
|||
}
|
||||
},
|
||||
pickValue() {
|
||||
if(this.isClickEventOpen){
|
||||
cu.handleClick();
|
||||
}
|
||||
},
|
||||
changeSampleFun(sfVal) {
|
||||
//保存样本抽样方法
|
||||
|
@ -606,7 +612,7 @@ export default {
|
|||
editSelected(index, simpleData) {
|
||||
//显示地图按钮
|
||||
this.updatePointVisible = true;
|
||||
|
||||
this.isClickEventOpen = false;//关闭弹窗事件
|
||||
cu.removePoint()
|
||||
//将当前选择要修改的点变为红色
|
||||
if (simpleData.length !== 0) {
|
||||
|
@ -620,13 +626,6 @@ export default {
|
|||
}
|
||||
//保存当前修改的点信息
|
||||
this.currentSelectPoint = simpleData[index];
|
||||
// this.$confirm(`确定修改该样本?`, "提示", {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning",
|
||||
// }).then(async () => {
|
||||
// simpleData.splice(index, 1);
|
||||
// });
|
||||
},
|
||||
//选择点
|
||||
selectPoint(){
|
||||
|
@ -638,6 +637,7 @@ export default {
|
|||
lat: point[1],
|
||||
}
|
||||
})
|
||||
this.isSelectPointDisabled = true;
|
||||
},
|
||||
// 保存点
|
||||
savePoint(){
|
||||
|
@ -657,6 +657,8 @@ export default {
|
|||
this.updatePointVisible = false;
|
||||
//销毁监听
|
||||
cu.destroyClickToAddPoint()
|
||||
this.isClickEventOpen = true;
|
||||
this.isSelectPointDisabled = false;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -181,14 +181,11 @@ class CesiumUtils {
|
|||
if (this.handler) {
|
||||
this.handler.destroy();
|
||||
}
|
||||
// return new Promise((resolve, reject) => {
|
||||
var scene = this.viewer.scene;
|
||||
this.handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
||||
const that = this;
|
||||
this.handler.setInputAction(function (movement) {
|
||||
// 清除历史单击点
|
||||
// handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
||||
// movement.position 像素的x、y坐标
|
||||
var cartesian = that.viewer.camera.pickEllipsoid(
|
||||
movement.position,
|
||||
scene.globe.ellipsoid
|
||||
|
@ -215,14 +212,11 @@ class CesiumUtils {
|
|||
callback(positions);
|
||||
}
|
||||
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
||||
// });
|
||||
}
|
||||
//销毁监听
|
||||
static destroyClickToAddPoint(){
|
||||
this.handler.destroy();
|
||||
}
|
||||
|
||||
|
||||
//鼠标点击
|
||||
static handleClick() {
|
||||
var scene = this.viewer.scene;
|
||||
|
|
Loading…
Reference in New Issue