var mapAnimateControl = false;//场景动画,是否执行
function refer(){
window.requestAnimationFrame(function(){
//整个场景动起来
if(mapAnimateControl==true){
map.setRotation((map.getRotation()+0.6)%360);
}
refer();
});
}
定义动画函数,通过mapAnimateControl控制是否进行动画渲染
调用
mapAnimateControl = true;
refer();