Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

filter layers adding by projection

Ed Plato99b64e4df25a
diff --git a/web/js/modules/layers/actions.js b/web/js/modules/layers/actions.js
index b8cb35942..416b6dfb1 100644
--- a/web/js/modules/layers/actions.js
+++ b/web/js/modules/layers/actions.js
@@ -53,7 +53,7 @@ export function addLayer(id, spec) {
spec = spec || {};
return (dispatch, getState) => {
const state = getState();
- const { layers, compare } = state;
+ const { layers, compare, proj } = state;
const activeString = compare.activeString;
const layerObj = getLayersSelector(
@@ -66,7 +66,8 @@ export function addLayer(id, spec) {
spec,
layers[activeString],
layers.layerConfig,
- layerObj.overlays.length || 0
+ layerObj.overlays.length || 0,
+ proj.id
);
dispatch({
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index 756de7725..5731e01ea 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -103,8 +103,11 @@ export function hasSubDaily(layers) {
return false;
}
-export function addLayer(id, spec, layers, layerConfig, overlayLength) {
+export function addLayer(id, spec, layers, layerConfig, overlayLength, projection) {
layers = lodashCloneDeep(layers);
+ if (projection) {
+ layers = layers.filter(layer => layer.projections[projection]);
+ }
if (
lodashFind(layers, {
id: id