Use requestAnimationFrame where available.

For kinetic panning, let the device determine the animation frame rate.
This commit is contained in:
Tim Schaub
2012-01-02 20:40:29 -07:00
parent c7c11757ae
commit 5c2af142b6
2 changed files with 11 additions and 19 deletions

View File

@@ -16,9 +16,11 @@
var originalGetTime = Date.prototype.getTime;
Date.prototype.getTime = function() { return 0 };
var interval = 10; // arbitrary value for tests
var originalSetInterval = window.setInterval;
window.setInterval = function(callback, interval) {
var originalLoopAnimation = OpenLayers.Util.loopAnimation;
OpenLayers.Util.loopAnimation = function(callback) {
while (!finish) {
var time = new Date().getTime();
Date.prototype.getTime = function() { return time+interval };
@@ -49,7 +51,7 @@
});
Date.prototype.getTime = originalGetTime;
window.setInterval = originalSetInterval;
OpenLayers.Util.loopAnimation = originalLoopAnimation;
}
function test_Angle (t) {