function centerFunc() { var pan = ol.animation.pan({ duration: 1000, //动画持续时间,默认是1000 source: map.getView().getCenter(), easing: ol.easing.easeOut, // 要使用的动画功能,能够是ol.easing自定义函数 }); map.beforeRender(pan); map.getView().setZoom(8); map.getView().setCenter([12335101.876548603, 2129841.356138151]); }