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