Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

anim speed update on-the-fly

Benjamin6f82d1f30968
diff --git a/web/js/animation/wv.anim.ui.js b/web/js/animation/wv.anim.ui.js
index 7b6566b47..74dc612c2 100644
--- a/web/js/animation/wv.anim.ui.js
+++ b/web/js/animation/wv.anim.ui.js
@@ -17,7 +17,7 @@ wv.anim.ui = wv.anim.ui || function(models, ui) {
var animateArray;
var map = ui.map.selected;
var zooms = ['year', 'month', 'day'];
- var queue = new Queue(5, queueLength);
+ var queue = new Queue(5, 20);
var preloadedArray;
var dateArray;
self.delay = 500;
@@ -151,10 +151,9 @@ wv.anim.ui = wv.anim.ui || function(models, ui) {
var interval;
var len = arra.length;
var playIndex = self.state.playIndex;
-
- interval = setInterval(function() {
+ var player = function() {
if(playIndex >= len) {
- clearInterval(interval);
+ // clearInterval(interval);
self.state.playIndex = 0;
self.checkShouldLoop(arra);
return;
@@ -167,7 +166,9 @@ wv.anim.ui = wv.anim.ui || function(models, ui) {
dateModel.select(arra[playIndex]);
self.checkQueue(queueLength, playIndex);
playIndex++;
- }, fps);
+ interval = setTimeout(player, 1000 / animModel.rangeState.speed);
+ };
+ interval = setTimeout(player, fps);
};
self.forward = function() {