javascript - Baidu Map sets the center point at the beginning, how to use the button to transfer to the corresponding center point? ? ? ?
三叔
三叔 2017-07-05 11:06:47
0
2
1020


To achieve this, click the Qingdao or Xiamen buttons to transfer to the coordinate point location of Qingdao (or the corresponding)
Currently, the initial map center point is set to Xinjiang


This is how to initialize the map

$(".btn-Qing").on('click', function () {

// 百度地图API功能
map = new BMap.Map("map-container", { minZoom: 5, maxZoom: 10 });
var initPoint1 = new BMap.Point(120.369461, 36.118473);
map.centerAndZoom(initPoint1, 8);
map.addOverlay(initPoint1)
InitBMap();

})
This is what I wrote simply, but when I add that method at the end, there is no way to transfer it to Qingdao. Can anyone teach me how to do it?

三叔
三叔

reply all(2)
巴扎黑

map.setCenter(new BMap.Point(116.304, 39.915))

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template