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