Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

#2357 make sure we aren't trying to snap layer dates to be within start/end dates when the end date is the build date

Jason Kent77bfd2098171
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index e21d9fff0..9dc4a7b15 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -141,11 +141,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
self.closestDate = function(def, options) {
const state = store.getState();
const activeDateStr = state.compare.isCompareA ? 'selected' : 'selectedB';
- const dateArray = def.availableDates || [];
let date = options.date || new Date(state.date[activeDateStr]);
- const zoomGreaterThanEqPeriod = (def.period === 'daily' && state.date.selectedZoom >= 3) ||
- (def.period === 'monthly' && state.date.selectedZoom >= 2) ||
- (def.period === 'yearly' && state.date.selectedZoom >= 1);
if (def.period === 'subdaily') {
date = nearestInterval(def, date);
@@ -155,22 +151,6 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
: util.clearTimeUTC(date);
}
- if (
- !options.precache &&
- state.animation.isPlaying === false &&
- state.date.selectedZoom !== 0 &&
- zoomGreaterThanEqPeriod
- ) {
- date = prevDateInDateRange(def, date, dateArray);
- // Is current "rounded" previous date in the array of available dates
- const dateInArray = dateArray.some((arrDate) => date.getTime() === arrDate.getTime());
-
- if (date && !dateInArray) {
- // Then, update layer object with new array of dates
- def.availableDates = datesinDateRanges(def, date);
- date = prevDateInDateRange(def, date, def.availableDates);
- }
- }
return date;
};