A collection of utility functions for executing methods that repaint a portion of the browser window. These methods take advantage of the browser’s scheduled repaints where requestAnimationFrame is available.
OpenLayers. | A collection of utility functions for executing methods that repaint a portion of the browser window. |
Properties | |
isNative | {Boolean} true if a native requestAnimationFrame function is available |
Functions | |
requestFrame | Schedule a function to be called at the next available animation frame. |
start | Executes a method with requestFrame in series for some duration. |
stop | Terminates an animation loop started with start. |
Schedule a function to be called at the next available animation frame. Uses the native method where available. Where requestAnimationFrame is not available, setTimeout will be called with a 16ms delay.
callback | {Function} The function to be called at the next animation frame. |
element | {DOMElement} Optional element that visually bounds the animation. |
function start( callback, duration, element )
Executes a method with requestFrame in series for some duration.
callback | {Function} The function to be called at the next animation frame. |
duration | {Number} Optional duration for the loop. If not provided, the animation loop will execute indefinitely. |
element | {DOMElement} Optional element that visually bounds the animation. |
{Number} Identifier for the animation loop. Used to stop animations with stop.
Executes a method with requestFrame in series for some duration.
function start( callback, duration, element )
Terminates an animation loop started with start.
function stop( id )