| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | zoom: 15, |
| | | zoom: 11, |
| | | map: null, |
| | | contentRef: {}, |
| | | infoWin: {}, |
| | |
| | | //form表单中是否有坐标,有则定位到对应位置,没有则使用默认的 |
| | | // 104.65417 28.75572 测试数据 |
| | | // 四川省宜宾市翠屏区大观楼街道外南街71 |
| | | if (this.$props.mapList[0].addr) { |
| | | if (this.$props.mapList.length>0&&this.$props.mapList[0].addr) { |
| | | const { lng: lon, lat } = await this.getGeocode( |
| | | this.$props.mapList[0].addr |
| | | ); |
| | |
| | | makeAllMask(mapList) { |
| | | // 清除之前的标记 |
| | | this.map && this.map.clearOverLays(); |
| | | var minX = mapList[0].longitude; |
| | | var maxX = mapList[0].longitude; |
| | | var minY = mapList[0].latitude; |
| | | var maxY = mapList[0].latitude; |
| | | var minX = 180; |
| | | var maxX = -180; |
| | | var minY = 90; |
| | | var maxY = -90; |
| | | var _this = this; |
| | | mapList.map((item) => { |
| | | const config = { |
| | |
| | | projectAddr: item.projectAddress, |
| | | projectStatus: item.usedStatus, |
| | | }; |
| | | |
| | | _this.makeMask(item.longitude, item.latitude, config); |
| | | |
| | | if (item.longitude && item.longitude > maxX) { |
| | | maxX = item.longitude; |
| | | } |
| | |
| | | minY = item.latitude; |
| | | } |
| | | }); |
| | | |
| | | this.moveTo( |
| | | (parseFloat(maxX) + parseFloat(minX)) / 2, |
| | | (parseFloat(maxY) + parseFloat(minY)) / 2 |