How to stop/disable an openlayers 3 animation?

المشرف العام

Administrator
طاقم الإدارة
I have the issue of overlap 2 animations if the previous is really long.

I'd like to stop the current animation for set a new animation with different parameters.

var anima = ol.animation.pan({ duration: 5000, source: map.getView().getCenter() }); map.beforeRender(anima);}map.getView().setCenter(ol.proj.transform([lng, lat], 'EPSG:4326', 'EPSG:3857'));How can I stop the current ol.animation with openlayers 3? I think with duration = 0, but I don't know to access that property :$

Thanks in advance!



أكثر...
 
أعلى