| | |
| | | }, |
| | | |
| | | initDate () { |
| | | var str = window.location.search.substring(1) |
| | | var obj = this.getUrlParams(str) |
| | | if(obj.latitude&&obj.longitude){ |
| | | this.lat = obj.latitude |
| | | this.lng = obj.longitude |
| | | } |
| | | this.map = this.$L.map("map", { |
| | | center: [this.lat, this.lng], // 地图中心 |
| | | zoom: 14, //缩放比列 |
| | |
| | | |
| | | var str = window.location.search.substring(1) |
| | | var parmasObj = this.getUrlParams(str) |
| | | if(parmasObj.status!=""){//后台截图 |
| | | if(parmasObj.status){//后台截图 |
| | | domtoimage.toPng(document.getElementById('map'), { width: 970, height: 400 }) |
| | | .then( (dataUrl) => { |
| | | |
| | |
| | | |
| | | wx.miniProgram.navigateBack() |
| | | |
| | | |
| | | |
| | | |
| | | }) |
| | | .catch(function (error) { |
| | |
| | | e.layer.on('pm:vertexadded', e => { |
| | | console.log(e, "添加顶点") |
| | | }) |
| | | |
| | | var arr = [] |
| | | |
| | | this.polygons.forEach(item => { |
| | | arr.push([item.lng, item.lat]) |
| | | }) |
| | | |
| | | arr.push([this.polygons[0].lng, this.polygons[0].lat]) |
| | | |
| | | let area = this.$turf.area(this.$turf.polygon([arr])) |
| | | |
| | | window.parent.postMessage(area,"*") |
| | | |
| | | this.map.flyToBounds(this.rectangleLayer.getBounds()); |
| | | |
| | | }) |
| | | }, |
| | | |