Commit a3ec92dd authored by lixy's avatar lixy

地图优化

parent af0cbcce
......@@ -29,6 +29,7 @@
}, // 经纬度
zoom: 4, // 地图展示级别
pointList: [],
map: null,
pickPoint: null,
listQuery: {
page: 1,
......@@ -43,10 +44,10 @@
},
watch: {
provinceName(newValue, oldValue) {
console.log(this.toSonData);
console.log(this.provinceName);
// var map = new BMap.Map("map"); //创建Map实例
// map.centerAndZoom(this.provinceName,6);
if(this.map){
this.map.centerAndZoom(this.provinceName,6);
}
},
},
methods: {
......@@ -74,6 +75,7 @@
})
},
handler({map}) {
this.map = map;
let list = this.toSonData;
// 定位
this.geolocation(map);
......@@ -105,7 +107,6 @@
},
addressDetail(point){ //获取地理位置
let mydata = getSonRegionByCodes(1);
console.log(mydata);
var self = this;
var myGeo = new BMap.Geocoder();
myGeo.getLocation(new BMap.Point(point.lng, point.lat), function(result){
......
......@@ -283,7 +283,14 @@
this.getList();
},
getValue(e){
let that = this;
this.listQuery.addrCity = undefined;
this.provinceRegions.map(function(item){
if(item.id == that.listQuery.addrProvince){
that.provinceName = item.name;
}
});
this.getList();
},
headCall: function (msg) { //回调方法,接收子组件传的参数
this.listQuery.addrProvince = msg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment