Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-3174 Provide ability to set default number of granules to display on a per layer basis (#5202)

Patrick Moulden79f0326df1f7
diff --git a/doc/config/layers.md b/doc/config/layers.md
index 13d32794d..afbafc78c 100644
--- a/doc/config/layers.md
+++ b/doc/config/layers.md
@@ -111,6 +111,7 @@ Example:
* endDate - `YYYY-MM-DDTHH:MM:SSZ`
* dateInterval - Number of days (or minutes for subdaily layers)
* **temporal**: Used to override the layer temporal availability declared in the capabilities document. Note: Changing the temporal availability can cause missing layer coverage within the interface for layers tiles that aren't available from the source at the revised temporal range. This option can be added as a string with the new availability range. For example, `"1981-10-13/2019-10-11/P1M"`.
+* **count**: Used to override the default number of granules displayed on the map and in the granule count slider component for granule layers.
## Full Example
@@ -161,7 +162,8 @@ Granule layers will require specific configuration options within the `config/wv
],
"ongoing": true,
"type": "granule",
- "period": "subdaily"
+ "period": "subdaily",
+ "count": 1
}
}
}
diff --git a/web/js/map/granule/granule-layer-builder.js b/web/js/map/granule/granule-layer-builder.js
index b27aabf21..8f1d1a97d 100644
--- a/web/js/map/granule/granule-layer-builder.js
+++ b/web/js/map/granule/granule-layer-builder.js
@@ -250,7 +250,7 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
const { proj: { selected: { crs } } } = state;
const { granuleCount, date, group } = options;
const { count: currentCount } = getGranuleLayer(state, def.id) || {};
- const count = currentCount || granuleCount || DEFAULT_NUM_GRANULES;
+ const count = currentCount || granuleCount || def.count || DEFAULT_NUM_GRANULES;
// get granule dates waiting for CMR query and filtering (if necessary)
const availableGranules = await getQueriedGranuleDates(def, date, group);
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index 7c0b0fc80..f0c2dd6c5 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -41,7 +41,7 @@ export function addLayer(id, spec = {}, layersParam, layerConfig, overlayLength,
def.max = spec.max || undefined;
def.squash = spec.squash || undefined;
def.disabled = spec.disabled || undefined;
- def.count = spec.count || undefined;
+ def.count = spec.count || def.count || undefined;
if (Array.isArray(spec.bandCombo)) {
def.bandCombo = {