BUG 29970

This commit is contained in:
aixianling
2022-05-31 16:51:23 +08:00
parent f446104dda
commit a09048af63

View File

@@ -81,7 +81,6 @@ export default {
handleAdd() {
let {polyEditor} = this
polyEditor.close();
polyEditor.setTarget();
polyEditor.open();
},
initMap() {
@@ -115,8 +114,10 @@ export default {
})
})
this.polyEditor.on('end', ({target}) => {
this.overlays.push(target);
this.points.push(target.getPath().map((e) => ({lat: e.getLat(), lng: e.getLng()})))
if (target) {
this.overlays.push(target);
this.points.push(target.getPath().map((e) => ({lat: e.getLat(), lng: e.getLng()})))
}
});
if (this.value?.length > 0) {
let path = this.value.map(e => [e.lng, e.lat]);