代码
var map = new BMap.Map('map');
var point = new BMap.Point(116.404, 39.915);
map.centerAndZoom(point, 15);
map.enableScrollWheelZoom(true);
function enable() {
// 开启地图旋转
map.enableRotate();
// 开启地图倾斜
map.enableTilt();
}
function disable() {
// 关闭地图旋转
map.disableRotate();
// 关闭地图倾斜
map.disableTilt();
}
通过 map.enableRotate 和 map.disableRotate 方法打开和关闭地图旋转;map.enableTilt 和 map.disableTilt 方法打开和关闭地图倾斜
预览