Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix layer opacity (#4205)

Ryan Weilerd7ba17156d47
diff --git a/web/js/mapUI/components/update-opacity/updateOpacity.js b/web/js/mapUI/components/update-opacity/updateOpacity.js
index 6cfe44c90..04d1592e0 100644
--- a/web/js/mapUI/components/update-opacity/updateOpacity.js
+++ b/web/js/mapUI/components/update-opacity/updateOpacity.js
@@ -69,8 +69,13 @@ function UpdateOpacity(props) {
if (def.type === 'granule') {
updateGranuleLayerOpacity(def, activeString, opacity, compare);
} else {
+ // find the layer in each projection
const layerGroup = findLayer(def, activeString);
- layerGroup.getLayersArray().forEach((l) => {
+ // 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);
});
}