修改点时,去掉弹窗事件

tykong-cidian
dongjiajun 2024-07-08 09:22:57 +08:00
parent 43e6b9ac2a
commit 716dec950b
2 changed files with 13 additions and 17 deletions

View File

@ -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() {
cu.handleClick();
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: {

View File

@ -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;