| | |
| | | <template> |
| | | <div ref="imageWrapper"> |
| | | <div class="btn-grounp"> |
| | | <button v-if="addShow" class="draw" @click="draw()">重新绘制</button> |
| | | <button v-if="addShow&&rewrite" class="draw" @click="draw()">重新绘制</button> |
| | | <button v-if="!addShow" class="repeal" @click="repeal()">撤销</button> |
| | | <button v-if="regionFull" class="save" @click="save()">保存</button> |
| | | </div> |
| | |
| | | imgUrl: "", |
| | | file: "", |
| | | regionFull: false, |
| | | rewrite:false, |
| | | tempBounds:"" |
| | | } |
| | | }, |
| | |
| | | // 用户编辑 |
| | | this.addShow = true |
| | | this.regionFull = true |
| | | this.rewrite = true |
| | | } else { |
| | | // 单纯展示 |
| | | this.addShow = false |
| | |
| | | } |
| | | |
| | | this.regionFull = false |
| | | |
| | | this.rewrite = false |
| | | this.getlatLngs() |
| | | |
| | | this.map.pm.enableDraw("Polygon", { |
| | |
| | | |
| | | this.regionFull = false |
| | | |
| | | |
| | | this.rewrite = true |
| | | |
| | | // Object.values(this.map._layers).forEach(item => { |
| | | // if (item._leaflet_id == this.rectangleLayer._leaflet_id) { |
| | |
| | | var parmasObj = this.getUrlParams(str) |
| | | |
| | | if(parmasObj.status){//后台镜头移动 |
| | | this.rewrite = false |
| | | this.regionFull = false |
| | | if(this.polygonLayer){//编辑层 |
| | | if(this.polygonLayer.getBounds() != this.tempBounds){ |
| | | if(this.map.getZoom()>16){ |
| | |
| | | console.error('oops, something went wrong!', error) |
| | | }) |
| | | } |
| | | }, 1100); |
| | | }, 1000); |
| | | |
| | | |
| | | |
| | |
| | | this.map.on('pm:drawstart', ({ workingLayer }) => { |
| | | |
| | | this.addShow = false |
| | | |
| | | this.rewrite = false |
| | | that.rectangleLayer = workingLayer |
| | | |
| | | workingLayer.on('pm:vertexadded', e => { |
| | |
| | | |
| | | that.addShow = true |
| | | that.regionFull = true |
| | | |
| | | that.rewrite = true |
| | | // 绘制坐标 |
| | | that.polygons = e.layer._latlngs[0] |
| | | |