| | |
| | | } |
| | | const that = this |
| | | graphicLayer.activate(type, (lastEventData) => { |
| | | console.log('数据更新', lastEventData) |
| | | console.log('数据更新') |
| | | this.drawInfo = lastEventData |
| | | this.isDrawed = true |
| | | this.getRegionList(type, JSON.stringify(lastEventData)) |
| | |
| | | // 修改范围 |
| | | setRegion (range) { |
| | | graphicLayer.addPolyLineGon(range, (lastEventData) => { |
| | | // console.log('数据更新', JSON.stringify(lastEventData)) |
| | | console.log('数据更新', lastEventData) |
| | | console.log('数据更新') |
| | | this.drawInfo = lastEventData |
| | | this.getRegionList('polyline', JSON.stringify(lastEventData)) |
| | | }) |
| | |
| | | if (this.isDrawed == false) { |
| | | alert('请先绘制线或者面') |
| | | } else { |
| | | console.log(this.drawInfo, 222) |
| | | let drawPositionStr = '' |
| | | if (this.drawType == 1) { |
| | | this.drawInfo.forEach(item => { |
| | | drawPositionStr += item[0] + ' ' + item[1] + ',' |
| | | }) |
| | | drawPositionStr = drawPositionStr.slice(0, drawPositionStr.length - 1) |
| | | console.log(333, drawPositionStr) |
| | | } else { |
| | | this.drawInfo.forEach(item => { |
| | | drawPositionStr += item.lng + ' ' + item.lat + ',' |
| | | }) |
| | | drawPositionStr += this.drawInfo[0].lng + ' ' + this.drawInfo[0].lat |
| | | console.log(333, drawPositionStr) |
| | | |
| | | } |
| | | this.insertRegionSaveList(this.drawType, drawPositionStr, this.drawName) |
| | |
| | | |
| | | insertRegionSaveList (type, positions, name) { |
| | | insertRegionSaveList(type, positions, name).then(res => { |
| | | console.log(res) |
| | | |
| | | console.log('已保存') |
| | | }) |
| | | }, |
| | | }, |