Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

use "best" concept id

Jason Kent3d24f7b3aaf0
diff --git a/web/js/components/smart-handoffs/util.js b/web/js/components/smart-handoffs/util.js
index 8780915bc..7a0c54cdb 100644
--- a/web/js/components/smart-handoffs/util.js
+++ b/web/js/components/smart-handoffs/util.js
@@ -23,8 +23,9 @@ export default function openEarthDataSearch(proj, selectedDate, selectedLayer, e
const { southWest, northEast } = extentCoords;
const startDate = `${selectedDate}T00:00:00.000Z`;
const endDate = `${selectedDate}T23:59:59.999Z`;
+ const bestConceptId = conceptIds.reduce((prev, curr) => (curr.type === 'NRT' ? curr : prev)).value;
const params = {
- p: conceptIds[0],
+ p: bestConceptId,
'[qt]': `${startDate},${endDate}`,
m: PROJ_CODES[proj],
'pg[0][dnf]': daynight !== undefined ? daynight : undefined,
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index d364e0f00..d1e31cebd 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -259,11 +259,13 @@ class SmartHandoff extends Component {
const startDate = `${selectedDate}T00:00:00.000Z`;
const endDate = `${selectedDate}T23:59:59.999Z`;
+ // Use an NRT collection if one is present, otherwise use STD
+ const bestConceptId = selectedLayer.conceptIds.reduce((prev, curr) => (curr.type === 'NRT' ? curr : prev)).value;
const dateRange = `${startDate},${endDate}`;
const { daynight } = selectedLayer;
const params = {
temporal: dateRange,
- collection_concept_id: selectedLayer.conceptIds[0],
+ collection_concept_id: bestConceptId,
include_facets: 'v2',
page_size: 0,
day_night_flag: daynight || undefined,
@@ -307,7 +309,6 @@ class SmartHandoff extends Component {
<input
id={inputId}
type="radio"
- value={layer.conceptIds[0]}
name="smart-handoff-layer-radio"
checked={selectedId === layer.id}
onChange={() => this.onLayerChange(layer, currentExtent)}