Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

stopped animation from running if only one frame is present #WV-1774

Benjaminbf37f7ce6160
diff --git a/web/js/animation/wv.anim.ui.js b/web/js/animation/wv.anim.ui.js
index 2a8e9e6d0..c0b1c8ece 100644
--- a/web/js/animation/wv.anim.ui.js
+++ b/web/js/animation/wv.anim.ui.js
@@ -406,6 +406,12 @@ wv.anim.ui = wv.anim.ui || function(models, ui) {
self.initialPreload = function(currentDate, startDate, endDate, lastToQueue) {
var day = currentDate;
queueLength = self.getQueueLength(startDate, endDate);
+ if(queueLength <= 1) { // if only one frame done play just move to that date
+ dateModel.select(startDate);
+ animModel.rangeState.playing = false;
+ setTimeout(function() {self.refreshState();}, 100);
+ return;
+ }
for(var i = 0; i < queueLength; i++) {
self.addDate(day);
day = self.getNextBufferDate(day, startDate, endDate);
@@ -442,7 +448,7 @@ wv.anim.ui = wv.anim.ui || function(models, ui) {
while(i < queueLength) {
i++;
day = self.nextDate(day);
- if(day >= endDate){
+ if(day > endDate){
return i;
}
}