This commit is contained in:
parent
09dc8f40f5
commit
7134f082a3
|
@ -922,6 +922,9 @@ const getCssj = async () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 地块编辑
|
||||||
|
*/
|
||||||
//移动模式
|
//移动模式
|
||||||
const movemode = () => {
|
const movemode = () => {
|
||||||
drawing.value = true;
|
drawing.value = true;
|
||||||
|
@ -959,23 +962,21 @@ const setActiveStyle = (overlay) => {
|
||||||
};
|
};
|
||||||
//监听事件
|
//监听事件
|
||||||
const clickHandler = (e) => {
|
const clickHandler = (e) => {
|
||||||
console.log(5555,e);
|
console.log(5555, e);
|
||||||
let target = polyLayer.pickOverlays(e.target);
|
let target = polyLayer.pickOverlays(e.target);
|
||||||
if (target && target[0]) {
|
if (target && target[0]) {
|
||||||
selectedOverlay = target[0];
|
selectedOverlay = target[0];
|
||||||
console.log("5-1", selectedOverlay);
|
console.log("5-1", selectedOverlay);
|
||||||
// setActiveStyle(selectedOverlay);
|
// setActiveStyle(selectedOverlay);
|
||||||
movepoy.open(selectedOverlay,call());
|
movepoy.open(selectedOverlay, call());
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
console.log("5-2");
|
console.log("5-2");
|
||||||
polyLayer.resetStyle();
|
polyLayer.resetStyle();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const call=()=>{
|
const call = () => {
|
||||||
console.log('执行');
|
console.log("执行");
|
||||||
|
};
|
||||||
}
|
|
||||||
//开始平移
|
//开始平移
|
||||||
const moveEdit = () => {
|
const moveEdit = () => {
|
||||||
console.log(11111, cs_choose_arr.value[0]);
|
console.log(11111, cs_choose_arr.value[0]);
|
||||||
|
@ -1004,6 +1005,10 @@ const moveEdit = () => {
|
||||||
const moveCancel = () => {
|
const moveCancel = () => {
|
||||||
movepoy.close();
|
movepoy.close();
|
||||||
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
||||||
|
//取消第二次点击时,移动问题
|
||||||
|
polyLayer.removeOverlay(cs_choose_arr.value[0]);
|
||||||
|
map.removeGeoJSONLayer(polyLayer);
|
||||||
|
//-------
|
||||||
cs_choose_arr.value.forEach((item, index) => {
|
cs_choose_arr.value.forEach((item, index) => {
|
||||||
map.removeOverlay(cs_choose_arr.value[index]);
|
map.removeOverlay(cs_choose_arr.value[index]);
|
||||||
});
|
});
|
||||||
|
@ -1014,6 +1019,8 @@ const moveSave = () => {
|
||||||
arrJWD = [[[]]];
|
arrJWD = [[[]]];
|
||||||
movepoy.close();
|
movepoy.close();
|
||||||
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
||||||
|
polyLayer.removeOverlay(cs_choose_arr.value[0]);
|
||||||
|
map.removeGeoJSONLayer(polyLayer);
|
||||||
cs_choose_arr.value[0].points.forEach((item, index) => {
|
cs_choose_arr.value[0].points.forEach((item, index) => {
|
||||||
let arr1 = [];
|
let arr1 = [];
|
||||||
arr1.push(item?.latLng.lng);
|
arr1.push(item?.latLng.lng);
|
||||||
|
@ -1029,7 +1036,8 @@ const moveBack = () => {
|
||||||
// select.close();
|
// select.close();
|
||||||
movepoy.close();
|
movepoy.close();
|
||||||
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
||||||
// polyLayer.resetStyle();
|
polyLayer.removeOverlay(cs_choose_arr.value[0]);
|
||||||
|
map.removeGeoJSONLayer(polyLayer);
|
||||||
cs_choose_arr.value.forEach((item, index) => {
|
cs_choose_arr.value.forEach((item, index) => {
|
||||||
map.removeOverlay(cs_choose_arr.value[index]);
|
map.removeOverlay(cs_choose_arr.value[index]);
|
||||||
});
|
});
|
||||||
|
@ -1370,6 +1378,9 @@ const addBack = () => {
|
||||||
map.removeOverlay(currentMarker);
|
map.removeOverlay(currentMarker);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 地图编辑结束
|
||||||
|
*/
|
||||||
//点击龙游县初始化
|
//点击龙游县初始化
|
||||||
const csh = () => {
|
const csh = () => {
|
||||||
clear();
|
clear();
|
||||||
|
|
Loading…
Reference in New Issue