Re-introducing tileLoadingDelay.

Only use it if no native requestAnimationFrame function is available. This should improve performance on mobile devices.
This commit is contained in:
ahocevar
2012-01-29 15:15:57 +01:00
parent 8efce71271
commit 720c49c040
5 changed files with 89 additions and 6 deletions

View File

@@ -15,6 +15,16 @@
*/
OpenLayers.Animation = (function(window) {
/**
* Property: isNative
* {Boolean} true if a native requestAnimationFrame function is available
*/
var isNative = !!(window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame);
/**
* Function: requestFrame
* Schedule a function to be called at the next available animation frame.
@@ -89,6 +99,7 @@ OpenLayers.Animation = (function(window) {
}
return {
isNative: isNative,
requestFrame: requestFrame,
start: start,
stop: stop