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