Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Check timeSpanSelection before determining number of requests needed (#6597)

Tom Cariello631f941863a8
diff --git a/web/js/components/sidebar/charting-mode-options.js b/web/js/components/sidebar/charting-mode-options.js
index ba9f64311..fd3d68af0 100644
--- a/web/js/components/sidebar/charting-mode-options.js
+++ b/web/js/components/sidebar/charting-mode-options.js
@@ -549,9 +549,9 @@ function ChartingModeOptions(props) {
});
const requestedLayerSource = layerInfo.projections.geographic.source;
if (requestedLayerSource === 'GIBS:geographic') {
- const numDaysRequested = Math.floor(
- (initialEndDate - initialStartDate) / (1000 * 60 * 60 * 24),
- ) + 1;
+ const numDaysRequested = timeSpanSelection === 'range'
+ ? Math.floor((initialEndDate - initialStartDate) / (1000 * 60 * 60 * 24)) + 1
+ : 1;
const requestsNeeded = Math.ceil(Math.min(MAX_DAYS, numDaysRequested) / STEP_NUM);
const requestsSize = Math.ceil(numDaysRequested / requestsNeeded);
const promises = [];