Commit 1c22a49a authored by fengruiyu's avatar fengruiyu

js两次

parent 37c15098
...@@ -211,12 +211,13 @@ var vm = new Vue({ ...@@ -211,12 +211,13 @@ var vm = new Vue({
}, },
B_initmap: function (point, zoomLevel) { B_initmap: function (point, zoomLevel) {
this.NOWUSEBAIDU = true; this.NOWUSEBAIDU = true;
console.log("initB==>", point, zoomLevel)
// setTimeout(function () { // setTimeout(function () {
if (zoomLevel == undefined || zoomLevel == null) if (zoomLevel == undefined || zoomLevel == null)
zoomLevel = 6; zoomLevel = 6;
var th = vm; var th = vm;
if (th.B_MAPINITED == false) { if (th.B_MAPINITED == false) {
console.log(">>>>>>>initB==>", point, zoomLevel)
th.B_MAPINITED = true; th.B_MAPINITED = true;
// 百度地图API功能 // 百度地图API功能
// $("#map").hide(); // $("#map").hide();
...@@ -247,7 +248,14 @@ var vm = new Vue({ ...@@ -247,7 +248,14 @@ var vm = new Vue({
} else { } else {
B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别 B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别
console.log(">>>>>>>", point, B_MAP.getCenter()) setTimeout(function(){
B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别
},500)
//console.log(">>>>>>>", point, B_MAP.getCenter())
console.log(">>>>>>>cB==>", B_MAP.getCenter().lat, B_MAP.getCenter().lng, zoomLevel)
} }
// },500) // },500)
}, },
...@@ -285,11 +293,11 @@ var vm = new Vue({ ...@@ -285,11 +293,11 @@ var vm = new Vue({
G_MAP.setCenter(point) G_MAP.setCenter(point)
} }
if (!this.NOWUSEBAIDU && this.B_MAPINITED) { // if (!this.NOWUSEBAIDU && this.B_MAPINITED) {
var bpoint = toBPoint(point) // var bpoint = toBPoint(point)
console.log("同步百度中心") // console.log("同步百度中心")
B_MAP.setCenter(bpoint) // B_MAP.setCenter(bpoint)
} // }
} }
} }
}) })
......
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