代码
const map = new BMap.Map('map');
map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
function setCenter(cityname) {
map.setCenter(cityname);
}
通过map.setCenter传入地点名设置中心点
预览