Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

update opacity logic (#4348)

Ryan Weiler6b40322bf1f8
diff --git a/web/js/mapUI/components/update-opacity/updateOpacity.js b/web/js/mapUI/components/update-opacity/updateOpacity.js
index 04d1592e0..4803cfafc 100644
--- a/web/js/mapUI/components/update-opacity/updateOpacity.js
+++ b/web/js/mapUI/components/update-opacity/updateOpacity.js
@@ -69,15 +69,8 @@ function UpdateOpacity(props) {
if (def.type === 'granule') {
updateGranuleLayerOpacity(def, activeString, opacity, compare);
} else {
- // find the layer in each projection
- const layerGroup = findLayer(def, activeString);
- // get an array of layers from each projection
- const layerGroupLayers = layerGroup.getLayersArray();
- // need to set opacity for layerGroup and each individual layer
- layerGroup.setOpacity(opacity);
- layerGroupLayers.forEach((l) => {
- l.setOpacity(opacity);
- });
+ const layer = findLayer(def, activeString);
+ layer.setOpacity(opacity);
}
updateLayerVisibilities();
};