|
|
|
@ -134,7 +134,14 @@ const setPolygon = (res) => {
|
|
|
|
|
})
|
|
|
|
|
setMarker(marketPath.value)
|
|
|
|
|
}
|
|
|
|
|
const removePolygon = () =>{
|
|
|
|
|
|
|
|
|
|
let polygons = map.getAllOverlays('polygon');
|
|
|
|
|
console.log('s',polygons)
|
|
|
|
|
polygons.forEach(e=>{
|
|
|
|
|
// e.close()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let createPolygon = () => {
|
|
|
|
|
let arr = []
|
|
|
|
|
map.add([new AMap.Polygon({path: arr})]);
|
|
|
|
@ -147,7 +154,8 @@ let createPolygon = () => {
|
|
|
|
|
areaPath.value.push(data.target._opts.path)
|
|
|
|
|
// polyEditor.close();
|
|
|
|
|
// map.clearMap()
|
|
|
|
|
setPolygon(areaPath.value)
|
|
|
|
|
// removePolygon()
|
|
|
|
|
// setPolygon([data.target._opts.path])
|
|
|
|
|
})
|
|
|
|
|
polyEditor.on('addnode', function (data) {
|
|
|
|
|
// 获取区域坐标
|
|
|
|
|