修改电子围栏

master
夜笙歌 2 years ago
parent b2a22d7cff
commit 3dc23a0bb5

@ -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) {
// //

Loading…
Cancel
Save