diff --git a/web/client/components/map/cesium/Layer.jsx b/web/client/components/map/cesium/Layer.jsx index 36ebb1626e..28f67b00ad 100644 --- a/web/client/components/map/cesium/Layer.jsx +++ b/web/client/components/map/cesium/Layer.jsx @@ -116,7 +116,7 @@ const CesiumLayer = React.createClass({ }, setLayerOpacity(opacity) { var oldOpacity = (this.props.options && this.props.options.opacity !== undefined) ? this.props.options.opacity : 1.0; - if (opacity !== oldOpacity && this.layer) { + if (opacity !== oldOpacity && this.layer && this.provider) { this.provider.alpha = opacity; } }, diff --git a/web/client/reducers/layers.js b/web/client/reducers/layers.js index cd65de591b..b94cf94cf7 100644 --- a/web/client/reducers/layers.js +++ b/web/client/reducers/layers.js @@ -160,11 +160,11 @@ function layers(state = [], action) { const selector = action.nodeType === 'groups' ? 'group' : 'id'; // const newGroups = action.options && action.options.group && action.options.group !== layer; - let sameGroup = false; + let sameGroup = action.options.hasOwnProperty("group") ? false : true; const newLayers = flatLayers.map((layer) => { - if (layer[selector] === action.node || layer[selector].indexOf(`{action.node}.`) === 0) { - if (!action.options.hasOwnProperty("group") || layer.group === (action.options.group || 'Default')) { + if (layer[selector] === action.node || layer[selector].indexOf(action.node + '.') === 0) { + if (layer.group === (action.options.group || 'Default')) { // If the layer didn't change group, raise a flag to prevent groups update sameGroup = true; }