| | |
| | | <script> |
| | | |
| | | export default { |
| | | props:["longitude","latitude"], |
| | | data () { |
| | | return { |
| | | map: "", |
| | |
| | | }, |
| | | mounted () { |
| | | let that = this |
| | | this.lng = 115.89886924863 |
| | | this.lat = 28.6780931500551 |
| | | |
| | | // this.lng = 115.89886924863 |
| | | // this.lat = 28.6780931500551 |
| | | this.lng = this.longitude |
| | | this.lat = this.latitude |
| | | this.initDate() |
| | | |
| | | this.map.pm.addControls({ |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 地图初始化 |
| | | */ |
| | | initDate () { |
| | | this.map = this.$L.map("map", { |
| | | center: [this.lat, this.lng], // 地图中心 |
| | | zoom: 10, //缩放比列 |
| | | zoom: 15, //缩放比列 |
| | | zoomControl: false, //禁用 + - 按钮 |
| | | doubleClickZoom: false, // 禁用双击放大 |
| | | attributionControl: false // 移除右下角leaflet标识 |
| | |
| | | height: 100vh; |
| | | z-index: 1; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | --> |
| | | <template> |
| | | <div class="container" v-wechat-title="title"> |
| | | <clickMap ref="ClickMap" /> |
| | | <clickMap ref="ClickMap" :longitude="longitude" :latitude="latitude" /> |
| | | |
| | | <div class="current-header"> |
| | | <div class="hasOutline"> |
| | |
| | | isShowLandDetails: false, |
| | | isShowFooter: true, |
| | | farmId: null, |
| | | longitude:"", |
| | | latitude:"", |
| | | currentPlot: null |
| | | } |
| | | }, |
| | | created () { |
| | | this.farmId = this.getQueryString('farmId') |
| | | this.longitude = this.getQueryString("longitude") |
| | | this.latitude = this.getQueryString("latitude") |
| | | // 获取有无轮廓地块数量 |
| | | this.getLandIsAreaStatistic() |
| | | // 获取农产品列表 |
| | |
| | | brr.push(it.split(' ')) |
| | | }) |
| | | |
| | | const center = this.getCenter(brr) |
| | | |
| | | // const center = this.getCenter(brr) |
| | | const center = [this.longitude,this.latitude] |
| | | item.positionCenter = center |
| | | |
| | | that.$refs.ClickMap.addPolygon(brr, item) |
| | |
| | | } |
| | | </style>> |
| | | |
| | | d |
| | | d |