var mapAnimateControl = false;//場景動畫,是否執行
function refer(){
window.requestAnimationFrame(function(){
//整個場景動起來
if(mapAnimateControl==true){
map.setRotation((map.getRotation()+0.6)%360);
}
refer();
});
}
定義動畫函數,通過mapAnimateControl控制是否進行動畫渲染
調用
mapAnimateControl = true;
refer();