Commit a3ec92dd authored by lixy's avatar lixy

地图优化

parent af0cbcce
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
}, // 经纬度 }, // 经纬度
zoom: 4, // 地图展示级别 zoom: 4, // 地图展示级别
pointList: [], pointList: [],
map: null,
pickPoint: null, pickPoint: null,
listQuery: { listQuery: {
page: 1, page: 1,
...@@ -43,10 +44,10 @@ ...@@ -43,10 +44,10 @@
}, },
watch: { watch: {
provinceName(newValue, oldValue) { provinceName(newValue, oldValue) {
console.log(this.toSonData);
console.log(this.provinceName); console.log(this.provinceName);
// var map = new BMap.Map("map"); //创建Map实例 if(this.map){
// map.centerAndZoom(this.provinceName,6); this.map.centerAndZoom(this.provinceName,6);
}
}, },
}, },
methods: { methods: {
...@@ -74,6 +75,7 @@ ...@@ -74,6 +75,7 @@
}) })
}, },
handler({map}) { handler({map}) {
this.map = map;
let list = this.toSonData; let list = this.toSonData;
// 定位 // 定位
this.geolocation(map); this.geolocation(map);
...@@ -105,7 +107,6 @@ ...@@ -105,7 +107,6 @@
}, },
addressDetail(point){ //获取地理位置 addressDetail(point){ //获取地理位置
let mydata = getSonRegionByCodes(1); let mydata = getSonRegionByCodes(1);
console.log(mydata);
var self = this; var self = this;
var myGeo = new BMap.Geocoder(); var myGeo = new BMap.Geocoder();
myGeo.getLocation(new BMap.Point(point.lng, point.lat), function(result){ myGeo.getLocation(new BMap.Point(point.lng, point.lat), function(result){
......
...@@ -283,7 +283,14 @@ ...@@ -283,7 +283,14 @@
this.getList(); this.getList();
}, },
getValue(e){ getValue(e){
let that = this;
this.listQuery.addrCity = undefined; this.listQuery.addrCity = undefined;
this.provinceRegions.map(function(item){
if(item.id == that.listQuery.addrProvince){
that.provinceName = item.name;
}
});
this.getList();
}, },
headCall: function (msg) { //回调方法,接收子组件传的参数 headCall: function (msg) { //回调方法,接收子组件传的参数
this.listQuery.addrProvince = 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