Interactive interface for browsing global, full-resolution satellite imagery
layer-row enhancements
PatchesMaps708f99dc6020
diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.jsindex 68dd51f7a..7e9f99942 100644--- a/web/js/containers/sidebar/layer-row.js+++ b/web/js/containers/sidebar/layer-row.js@@ -148,11 +148,16 @@ function LayerRow (props) {}return maxExtent[i];});- 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`);+ 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);if (!olderRes.ok || !newerRes.ok) return;- const olderGranules = await olderRes.json();- const newerGranules = await newerRes.json();+ const jsonRequests = [olderRes.json(), newerRes.json()];+ const jsonResponses = await Promise.allSettled(jsonRequests);+ const [olderGranules, newerGranules] = jsonResponses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value);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.jsindex 9bc726721..4e4b1d628 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) {