Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Revert "layer-row enhancements"

PatchesMaps7ea758e25061
diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.js
index 7e9f99942..68dd51f7a 100644
--- a/web/js/containers/sidebar/layer-row.js
+++ b/web/js/containers/sidebar/layer-row.js
@@ -148,16 +148,11 @@ function LayerRow (props) {
}
return maxExtent[i];
});
- const olderUrl = `https://cmr.earthdata.nasa.gov/search/granules.json?collection_concept_id=${conceptID}&bounding_box=${extent.join(',')}&temporal=P0Y0M0DT0H0M/${zeroedDate}&sort_key=-start_date&pageSize=1`;
- const newerUrl = `https://cmr.earthdata.nasa.gov/search/granules.json?collection_concept_id=${conceptID}&bounding_box=${extent.join(',')}&temporal=${zeroedDate}/P0Y0M1DT0H0M&sort_key=-start_date&pageSize=1`;
- const headers = { 'Client-Id': 'Worldview' };
- const requests = [fetch(olderUrl, { headers }), fetch(newerUrl, { headers })];
- const responses = await Promise.allSettled(requests);
- const [olderRes, newerRes] = responses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value);
+ const olderRes = await fetch(`https://cmr.earthdata.nasa.gov/search/granules.json?collection_concept_id=${conceptID}&bounding_box=${extent.join(',')}&temporal=P0Y0M0DT0H0M/${zeroedDate}&sort_key=-start_date&pageSize=1`);
+ const newerRes = await fetch(`https://cmr.earthdata.nasa.gov/search/granules.json?collection_concept_id=${conceptID}&bounding_box=${extent.join(',')}&temporal=${zeroedDate}/P0Y0M1DT0H0M&sort_key=-start_date&pageSize=1`);
if (!olderRes.ok || !newerRes.ok) return;
- const jsonRequests = [olderRes.json(), newerRes.json()];
- const jsonResponses = await Promise.allSettled(jsonRequests);
- const [olderGranules, newerGranules] = jsonResponses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value);
+ const olderGranules = await olderRes.json();
+ const newerGranules = await newerRes.json();
const olderEntries = olderGranules?.feed?.entry || [];
const newerEntries = newerGranules?.feed?.entry || [];
const granules = [...olderEntries, ...newerEntries];
diff --git a/web/js/map/granule/granule-layer-builder.js b/web/js/map/granule/granule-layer-builder.js
index 4e4b1d628..9bc726721 100644
--- a/web/js/map/granule/granule-layer-builder.js
+++ b/web/js/map/granule/granule-layer-builder.js
@@ -85,7 +85,7 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
const [response, nrtResponse] = fulfilledResponses;
const jsonRequests = [response.json(), nrtResponse.json()];
const jsonResponses = await Promise.allSettled(jsonRequests);
- const [responseJson, nrtResponseJson] = jsonResponses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value);
+ const [responseJson, nrtResponseJson] = jsonResponses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value)
data = responseJson.feed.entry;
nrtData = nrtResponseJson.feed.entry;
} catch (e) {