This commit is contained in:
姚宇浩 2024-08-27 11:18:12 +08:00
parent 09dc8f40f5
commit 7134f082a3
1 changed files with 22 additions and 11 deletions

View File

@ -922,6 +922,9 @@ const getCssj = async () => {
}
});
};
/**
* 地块编辑
*/
//
const movemode = () => {
drawing.value = true;
@ -959,23 +962,21 @@ const setActiveStyle = (overlay) => {
};
//
const clickHandler = (e) => {
console.log(5555,e);
console.log(5555, e);
let target = polyLayer.pickOverlays(e.target);
if (target && target[0]) {
selectedOverlay = target[0];
console.log("5-1", selectedOverlay);
// setActiveStyle(selectedOverlay);
movepoy.open(selectedOverlay,call());
movepoy.open(selectedOverlay, call());
} else {
console.log("5-2");
polyLayer.resetStyle();
}
};
const call=()=>{
console.log('执行');
}
const call = () => {
console.log("执行");
};
//
const moveEdit = () => {
console.log(11111, cs_choose_arr.value[0]);
@ -1002,8 +1003,12 @@ const moveEdit = () => {
};
//
const moveCancel = () => {
movepoy.close();
movepoy.close();
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
//
polyLayer.removeOverlay(cs_choose_arr.value[0]);
map.removeGeoJSONLayer(polyLayer);
//-------
cs_choose_arr.value.forEach((item, index) => {
map.removeOverlay(cs_choose_arr.value[index]);
});
@ -1012,8 +1017,10 @@ const moveCancel = () => {
//
const moveSave = () => {
arrJWD = [[[]]];
movepoy.close();
movepoy.close();
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
polyLayer.removeOverlay(cs_choose_arr.value[0]);
map.removeGeoJSONLayer(polyLayer);
cs_choose_arr.value[0].points.forEach((item, index) => {
let arr1 = [];
arr1.push(item?.latLng.lng);
@ -1027,9 +1034,10 @@ const moveSave = () => {
//退
const moveBack = () => {
// select.close();
movepoy.close();
movepoy.close();
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
// polyLayer.resetStyle();
polyLayer.removeOverlay(cs_choose_arr.value[0]);
map.removeGeoJSONLayer(polyLayer);
cs_choose_arr.value.forEach((item, index) => {
map.removeOverlay(cs_choose_arr.value[index]);
});
@ -1370,6 +1378,9 @@ const addBack = () => {
map.removeOverlay(currentMarker);
}
};
/**
* 地图编辑结束
*/
//
const csh = () => {
clear();