Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

memoize layer selection to some degree

Jason Kent3090be4258e2
diff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.js
index fcc9c27d0..a8aac0efa 100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@ -40,8 +40,8 @@ import {
} from '../modules/animation/util';
import {
hasSubDaily as hasSubDailySelector,
- getLayers,
getActiveLayers,
+ getAllActiveLayers,
dateRange as getDateRange,
} from '../modules/layers/selectors';
import getSelectedDate from '../modules/date/selectors';
@@ -629,7 +629,6 @@ function mapStateToProps(state) {
palettes,
config,
map,
- proj,
browser,
} = state;
const {
@@ -648,11 +647,7 @@ function mapStateToProps(state) {
} = date;
const activeLayers = getActiveLayers(state);
const hasSubdailyLayers = hasSubDailySelector(activeLayers);
- const activeLayersForProj = getLayers(
- activeLayers,
- { proj: proj.id },
- state,
- );
+ const activeLayersForProj = getAllActiveLayers(state);
const hasFutureLayers = activeLayersForProj.filter((layer) => layer.futureTime).length > 0;
const layerDateRange = getDateRange({}, activeLayersForProj);
const activePalettes = palettes[compare.activeString];
@@ -711,7 +706,7 @@ function mapStateToProps(state) {
customInterval: customInterval || 3,
numberOfFrames,
sliderLabel: 'Frames Per Second',
- layers: getLayers(activeLayers, {}, state),
+ layers: getAllActiveLayers(state),
speed,
isPlaying,
looping: loop,
diff --git a/web/js/containers/image-download.js b/web/js/containers/image-download.js
index 2f77e5a3a..bcfc0f153 100644
--- a/web/js/containers/image-download.js
+++ b/web/js/containers/image-download.js
@@ -191,12 +191,11 @@ function mapStateToProps(state) {
markerCoordinates,
date: getSelectedDate(state),
getLayers: () => getLayers(
- getActiveLayers(state),
+ state,
{
reverse: true,
renderable: true,
},
- state,
),
};
}
diff --git a/web/js/containers/sidebar/compare.js b/web/js/containers/sidebar/compare.js
index 4899b8a07..bbc5f9429 100644
--- a/web/js/containers/sidebar/compare.js
+++ b/web/js/containers/sidebar/compare.js
@@ -5,7 +5,6 @@ import {
Nav, NavItem, NavLink, TabContent, TabPane,
} from 'reactstrap';
import LayersContainer from './layers-container';
-import { getLayers } from '../../modules/layers/selectors';
import { toggleActiveCompareState as toggleActiveCompareStateAction } from '../../modules/compare/actions';
import util from '../../util/util';
@@ -19,8 +18,6 @@ const CompareCase = (props) => {
toggleActiveCompareState,
isCompareA,
height,
- layersA,
- layersB,
} = props;
const outerClass = 'layer-container sidebar-panel';
@@ -61,7 +58,6 @@ const CompareCase = (props) => {
<TabPane tabId="1">
<LayersContainer
isActive={isCompareA}
- activeOverlays={layersA}
compareState="active"
height={height - tabHeight}
/>
@@ -69,7 +65,6 @@ const CompareCase = (props) => {
<TabPane tabId="2">
<LayersContainer
isActive={!isCompareA}
- activeOverlays={layersB}
compareState="activeB"
height={height - tabHeight}
/>
@@ -87,15 +82,11 @@ const mapDispatchToProps = (dispatch) => ({
},
});
-const mapStateToProps = (state) => {
- const {
- layers, compare, date,
- } = state;
+const mapStateToProps = (state, ownProps) => {
+ const { compare, date } = state;
return {
isCompareA: compare.isCompareA,
- layersA: getLayers(layers.active.layers, { group: 'all', proj: 'all' }, state),
- layersB: getLayers(layers.activeB.layers, { group: 'all', proj: 'all' }, state),
dateStringA: util.toISOStringDate(date.selected),
dateStringB: util.toISOStringDate(date.selectedB),
isActive: compare.active,
@@ -108,8 +99,6 @@ CompareCase.propTypes = {
height: PropTypes.number,
isActive: PropTypes.bool,
isCompareA: PropTypes.bool,
- layersA: PropTypes.object,
- layersB: PropTypes.object,
toggleActiveCompareState: PropTypes.func,
};
diff --git a/web/js/containers/sidebar/data.js b/web/js/containers/sidebar/data.js
index dd4800bd5..59aa6d051 100644
--- a/web/js/containers/sidebar/data.js
+++ b/web/js/containers/sidebar/data.js
@@ -11,7 +11,7 @@ import {
} from '../../modules/data/selectors';
import { selectProduct } from '../../modules/data/actions';
import { openCustomContent } from '../../modules/modal/actions';
-import { getLayers, getActiveLayers } from '../../modules/layers/selectors';
+import { getAllActiveLayers } from '../../modules/layers/selectors';
const CustomBodyModalContent = () => (
<>
@@ -132,10 +132,7 @@ function mapStateToProps(state, ownProps) {
proj, data, config, sidebar,
} = state;
const { selectedProduct, selectedGranules } = data;
- const activeLayers = getLayers(
- getActiveLayers(state),
- { proj: proj.id },
- );
+ const activeLayers = getAllActiveLayers(state);
const counts = getSelectionCounts(activeLayers, selectedGranules);
const products = getDataProductsFromActiveLayers(
activeLayers,
diff --git a/web/js/containers/sidebar/layers-container.js b/web/js/containers/sidebar/layers-container.js
index 72ef1f338..bd3b869c6 100644
--- a/web/js/containers/sidebar/layers-container.js
+++ b/web/js/containers/sidebar/layers-container.js
@@ -5,7 +5,7 @@ import { Draggable, Droppable, DragDropContext } from 'react-beautiful-dnd';
import PropTypes from 'prop-types';
import LayerList from './layer-list';
import {
- getLayers, getActiveLayers, getActiveOverlayGroups, getActiveLayersMap,
+ getAllActiveOverlaysBaselayers, getActiveOverlayGroups, getActiveLayersMap,
} from '../../modules/layers/selectors';
import {
reorderLayerGroups as reorderLayerGroupsAction,
@@ -133,10 +133,9 @@ function LayersContainer (props) {
const mapStateToProps = (state, ownProps) => {
const { compareState } = ownProps;
- const { proj, layers } = state;
+ const { layers } = state;
const { groupOverlays } = layers[compareState];
- const activeLayers = getActiveLayers(state);
- const { baselayers, overlays } = getLayers(activeLayers, { proj: proj.id, group: 'all' });
+ const { baselayers, overlays } = getAllActiveOverlaysBaselayers(state);
const overlayGroups = groupOverlays ? getActiveOverlayGroups(state) : [];
return {
diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.js
index a29b6e85b..e92c2f151 100644
--- a/web/js/containers/sidebar/sidebar.js
+++ b/web/js/containers/sidebar/sidebar.js
@@ -15,7 +15,7 @@ import {
loadCustom as loadCustomPalette,
} from '../../modules/palettes/util';
import { loadedCustomPalettes } from '../../modules/palettes/actions';
-import { getLayers, getActiveLayers } from '../../modules/layers/selectors';
+import { getAllActiveLayers } from '../../modules/layers/selectors';
import ErrorBoundary from '../error-boundary';
import util from '../../util/util';
import {
@@ -275,7 +275,7 @@ function mapStateToProps(state) {
const { isDistractionFreeModeActive } = ui;
const { activeTab, isCollapsed, mobileCollapsed } = sidebar;
const { activeString } = compare;
- const numberOfLayers = getLayers(getActiveLayers(state), {}, state).length;
+ const numberOfLayers = getAllActiveLayers(state).length;
const tabTypes = getActiveTabs(config);
const snapshotModalOpen = modal.isOpen && modal.id === 'TOOLBAR_SNAPSHOT';
const isMobile = browser.lessThan.medium;
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index 5a27015ff..e30560c6a 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -31,7 +31,7 @@ import Notify from '../components/image-download/notify';
import { hasCustomPaletteInActiveProjection } from '../modules/palettes/util';
import Geosearch from '../components/geosearch/geosearch';
import { toggleShowGeosearch, toggleDialogVisible } from '../modules/geosearch/actions';
-import { getLayers, getActiveLayers } from '../modules/layers/selectors';
+import { getAllActiveLayers } from '../modules/layers/selectors';
Promise.config({ cancellation: true });
@@ -339,17 +339,12 @@ class toolbarContainer extends Component {
const mapStateToProps = (state) => {
const {
- animation, browser, notifications, palettes, compare, map, measure, modal, proj, data, ui, geosearch,
+ animation, browser, notifications, palettes, compare, map, measure, modal, data, ui, geosearch,
} = state;
const { isDistractionFreeModeActive } = ui;
const { number, type } = notifications;
const { activeString } = compare;
- const activeLayers = getActiveLayers(state);
- const activeLayersForProj = getLayers(
- activeLayers,
- { proj: proj.id },
- state,
- );
+ const activeLayersForProj = getAllActiveLayers(state);
const isMobile = browser.lessThan.medium;
const faSize = isMobile ? '2x' : '1x';
const isCompareActive = compare.active;
@@ -384,7 +379,7 @@ const mapStateToProps = (state) => {
isRotated: Boolean(map.rotation !== 0),
hasGraticule: Boolean(
lodashGet(
- lodashFind(activeLayers, { id: 'Graticule' }) || {},
+ lodashFind(activeLayersForProj, { id: 'Graticule' }) || {},
'visible',
),
),
diff --git a/web/js/map/data/ui.js b/web/js/map/data/ui.js
index a73c21371..91f75412c 100644
--- a/web/js/map/data/ui.js
+++ b/web/js/map/data/ui.js
@@ -16,7 +16,7 @@ import { CHANGE_TAB as CHANGE_SIDEBAR_TAB } from '../../modules/sidebar/constant
import { toggleGranule } from '../../modules/data/actions';
import { SELECT_DATE } from '../../modules/date/constants';
import { LOCATION_POP_ACTION } from '../../redux-location-state-customs';
-import { getLayers, getActiveLayers } from '../../modules/layers/selectors';
+import { getActiveLayers, getAllActiveLayers } from '../../modules/layers/selectors';
import { getDataProductsFromActiveLayers, doesSelectedExist } from '../../modules/data/selectors';
import * as LAYER_CONSTANTS from '../../modules/layers/constants';
import { CHANGE_PROJECTION } from '../../modules/projection/constants';
@@ -84,7 +84,7 @@ export default function dataUi(store, ui, config) {
const updateLayers = function() {
const state = store.getState();
const { proj, data } = state;
- const activeLayers = getLayers(getActiveLayers(state), { proj: proj.id }, state);
+ const activeLayers = getAllActiveLayers(state);
// If a layer was removed and the product no longer exists,
// remove any selected items in that product
@@ -102,7 +102,7 @@ export default function dataUi(store, ui, config) {
const state = store.getState();
const dataState = state.data;
const { proj } = state;
- const activeLayers = getLayers(getActiveLayers(state), { proj: proj.id });
+ const activeLayers = getAllActiveLayers(state);
if (state.sidebar.activeTab !== 'download') {
return;
}
diff --git a/web/js/map/ui.js b/web/js/map/ui.js
index 038b308f0..5cee2aaa4 100644
--- a/web/js/map/ui.js
+++ b/web/js/map/ui.js
@@ -53,6 +53,7 @@ import {
getActiveLayers,
isRenderable as isRenderableLayer,
getMaxZoomLevelLayerCollection,
+ getAllActiveLayers,
} from '../modules/layers/selectors';
import getSelectedDate from '../modules/date/selectors';
import { EXIT_ANIMATION, STOP_ANIMATION } from '../modules/animation/constants';
@@ -567,21 +568,17 @@ export default function mapui(models, config, store, ui) {
* @returns {void}
*/
const reloadLayers = self.reloadLayers = function(map) {
+ console.log('reload layers');
map = map || self.selected;
const state = store.getState();
-
- const { layers, proj, compare } = state;
+ const { compare } = state;
if (!config.features.compare || !compare.active) {
const compareMapDestroyed = !compare.active && compareMapUi.active;
if (compareMapDestroyed) {
compareMapUi.destroy();
}
clearLayers(map);
- const defs = getLayers(
- getActiveLayers(state),
- { reverse: true },
- state,
- );
+ const defs = getLayers(state, { reverse: true });
lodashEach(defs, (def) => {
map.addLayer(createLayer(def));
});
@@ -600,7 +597,7 @@ export default function mapui(models, config, store, ui) {
stateArray.reverse(); // Set Layer order based on active A|B group
}
lodashEach(stateArray, (arr) => {
- map.addLayer(getCompareLayerGroup(arr, layers, proj.id, state));
+ map.addLayer(getCompareLayerGroup(arr, state));
});
compareMapUi.create(map, compare.mode);
// add active map marker back in compare mode post createLayer
@@ -614,12 +611,12 @@ export default function mapui(models, config, store, ui) {
/**
* Create a Layergroup given the date and layerGroups
*/
- function getCompareLayerGroup([compareActiveString, compareDateString], layersState, projId, state) {
- const activeLayers = layersState[compareActiveString].layers;
- const layers = getLayers(activeLayers, { reverse: true }, state)
+ function getCompareLayerGroup([compareActiveString, compareDateString], state) {
+ const compareSideLayers = getActiveLayers(state, compareActiveString);
+ const layers = getLayers(state, { reverse: true }, compareSideLayers)
.filter(() => true)
.map((def) => createLayer(def, {
- date: state.date[compareDateString],
+ date: getSelectedDate(state, compareDateString),
group: compareActiveString,
}));
return new OlLayerGroup({
@@ -642,6 +639,7 @@ export default function mapui(models, config, store, ui) {
let renderable;
const state = store.getState();
const layers = self.selected.getLayers();
+ console.log('updatevisibilities');
layers.forEach((layer) => {
const compareActiveString = layer.get('group');
@@ -664,8 +662,8 @@ export default function mapui(models, config, store, ui) {
const compareDateString = layer.get('date');
renderable = isRenderableLayer(
subLayer.wv.id,
- state.layers[compareActiveString].layers,
- state.date[compareDateString],
+ getActiveLayers(state, compareActiveString),
+ getSelectedDate(state, compareDateString),
state,
);
subLayer.setVisible(renderable);
@@ -775,11 +773,7 @@ export default function mapui(models, config, store, ui) {
const updateDate = self.updateDate = function() {
const state = store.getState();
const { compare } = state;
- const activeLayers = getLayers(
- getActiveLayers(state),
- {},
- state,
- ).reverse();
+ const activeLayers = getAllActiveLayers(state);
let layerGroups;
let layerGroup;
if (compare && compare.active) {
@@ -816,7 +810,9 @@ export default function mapui(models, config, store, ui) {
} else {
const index = findLayerIndex(def);
const layerValue = self.selected.getLayers().getArray()[index];
- self.selected.getLayers().setAt(index, createLayer(def, { previousLayer: layerValue ? layerValue.wv : null }));
+ self.selected
+ .getLayers()
+ .setAt(index, createLayer(def, { previousLayer: layerValue ? layerValue.wv : null }));
}
if (config.vectorStyles && def.vectorStyle && def.vectorStyle.id) {
const { vectorStyles } = config;
diff --git a/web/js/modules/animation/selectors.js b/web/js/modules/animation/selectors.js
index 91f4b5a64..cfa0f6aae 100644
--- a/web/js/modules/animation/selectors.js
+++ b/web/js/modules/animation/selectors.js
@@ -53,7 +53,7 @@ export default function getImageArray(
} else {
strDate = util.toISOStringDate(current);
}
- products = getProducts(getActiveLayers(state), current, state);
+ products = getProducts(current, state);
const lonlats = imageUtilGetCoordsFromPixelValues(boundaries, map.ui.selected);
const dlURL = getDownloadUrl(url, proj, products, lonlats, dimensions, current, false, false, markerCoordinates);
@@ -81,16 +81,15 @@ export default function getImageArray(
* @returns {array} array of layer objects
*
*/
-function getProducts(layers, date, state) {
+function getProducts(date, state) {
const layersArray = [];
const products = getLayers(
- layers,
+ state,
{
reverse: true,
renderable: true,
date,
},
- state,
);
lodashEach(products, (layer) => {
const layerDate = new Date(date);
diff --git a/web/js/modules/date/selectors.js b/web/js/modules/date/selectors.js
index 16abdc544..0adb194eb 100644
--- a/web/js/modules/date/selectors.js
+++ b/web/js/modules/date/selectors.js
@@ -1,5 +1,7 @@
-export default function getSelectedDate ({ date, compare }) {
- return date[
- compare.isCompareA ? 'selected' : 'selectedB'
- ];
+export default function getSelectedDate (state, compareDateString) {
+ const { date, compare } = state;
+ if (compareDateString) {
+ return date[compareDateString];
+ }
+ return date[compare.isCompareA ? 'selected' : 'selectedB'];
}
diff --git a/web/js/modules/layers/actions.js b/web/js/modules/layers/actions.js
index df3893235..d04881ca5 100644
--- a/web/js/modules/layers/actions.js
+++ b/web/js/modules/layers/actions.js
@@ -6,8 +6,8 @@ import {
resetLayers as resetLayersSelector,
getLayers as getLayersSelector,
getActiveLayers as getActiveLayersSelector,
- activateLayersForEventCategory as activateLayersForEventCategorySelector,
getActiveLayersMap,
+ activateLayersForEventCategory as activateLayersForEventCategorySelector,
} from './selectors';
import {
RESET_LAYERS,
@@ -69,7 +69,7 @@ export function toggleOverlayGroups() {
const { activeString } = state.compare;
const { groupOverlays, layers, overlayGroups } = state.layers[activeString];
const getLayersFromGroups = (groups) => {
- const baselayers = getLayersSelector(layers, { group: 'baselayers' }, state);
+ const baselayers = getLayersSelector(state, { group: 'baselayers' });
const activeLayersMap = getActiveLayersMap(state);
return groups
? groups.flatMap((g) => g.layers)
@@ -115,7 +115,7 @@ export function addLayer(id, spec = {}) {
const layerObj = layers.layerConfig[id];
const { groupOverlays } = layers[compare.activeString];
const activeLayers = getActiveLayersSelector(state);
- const overlays = getLayersSelector(activeLayers, { group: 'overlays' }, state);
+ const overlays = getLayersSelector(state, { group: 'overlays' });
const newLayers = addLayerSelector(
id,
spec,
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index e3015c734..081d68689 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -15,18 +15,32 @@ import { getLayerNoticesForLayer } from '../notifications/util';
import getSelectedDate from '../date/selectors';
const getConfigParameters = ({ config }) => (config ? config.parameters : {});
+const getProjState = ({ proj }) => proj;
+const getCompareState = ({ compare }) => compare;
+const getLayerState = ({ layers }) => layers;
/**
* Return a list of layers for the currently active compare state
+ * regardless of projection
*/
-export const getActiveLayers = (state) => {
+export const getActiveLayers = (state, activeString) => {
const { compare, layers } = state;
- return compare.isCompareA ? layers.active.layers : layers.activeB.layers;
+ return layers[activeString || compare.activeString].layers;
};
+/**
+ * Return an array of overlay groups for the currently active compare state
+ * that are available for the currently active projection
+ */
export const getActiveOverlayGroups = (state) => {
- const { compare, layers } = state;
- return compare.isCompareA ? layers.active.overlayGroups : layers.activeB.overlayGroups;
+ const { compare, layers, proj } = state;
+ const { overlayGroups } = compare.isCompareA ? layers.active : layers.activeB;
+ const activeLayersMap = getActiveLayersMap(state);
+ return overlayGroups.filter(
+ (group) => group.layers.filter(
+ (id) => !!activeLayersMap[id].projections[proj.id],
+ ).length,
+ );
};
/**
@@ -41,6 +55,16 @@ export const getActiveLayersMap = createSelector(
},
);
+export const getAllActiveLayers = createSelector(
+ [getProjState, getCompareState, getLayerState],
+ (proj, compare, layers) => getLayers({ proj, compare, layers }, {}),
+);
+
+export const getAllActiveOverlaysBaselayers = createSelector(
+ [getProjState, getCompareState, getLayerState],
+ (proj, compare, layers) => getLayers({ proj, compare, layers }, { group: 'all' }),
+);
+
export function hasMeasurementSource(current, config, projId) {
let hasSource;
Object.values(current.sources).forEach((source) => {
@@ -199,10 +223,10 @@ export function getTitles(config, layerId, projId) {
* @param {*} spec
* @param {*} state
*/
-export function getLayers(layers, spec = {}, state) {
+export function getLayers(state, spec = {}, layersParam) {
+ const layers = layersParam || getActiveLayers(state);
const baselayers = forGroup('baselayers', spec, layers, state);
const overlays = forGroup('overlays', spec, layers, state);
-
if (spec.group === 'baselayers') {
return baselayers;
}
@@ -219,27 +243,16 @@ export function getLayers(layers, spec = {}, state) {
}
function forGroup(group, spec = {}, activeLayers, state) {
- const projId = spec.proj || state.proj.id;
+ const projId = state.proj.id;
let results = [];
const defs = lodashFilter(activeLayers, { group });
lodashEach(defs, (def) => {
- // Skip if this layer isn't available for the selected projection
- if (!def.projections[projId] && projId !== 'all') {
- return;
- }
- if (
- spec.dynamic
- && !['subdaily', 'daily', 'monthly', 'yearly'].includes(def.period)
- ) {
- return;
- }
- if (
- spec.renderable
- && !isRenderable(def.id, activeLayers, spec.date, state)
- ) {
- return;
- }
- if (spec.visible && !def.visible) {
+ const notInProj = !def.projections[projId];
+ const dynamic = spec.dynamic
+ && !['subdaily', 'daily', 'monthly', 'yearly'].includes(def.period);
+ const notRenderable = spec.renderable
+ && !isRenderable(def.id, activeLayers, spec.date, state);
+ if (notInProj || dynamic || notRenderable) {
return;
}
results.push(def);
@@ -385,11 +398,11 @@ export const memoizedAvailable = createSelector(
* @param {*} date
* @param {*} state
*/
-export function isRenderable(id, activeLayers, date, state) {
+export function isRenderable(id, layers, date, state) {
const { parameters } = state.config || {};
date = date || getSelectedDate(state);
- const def = lodashFind(activeLayers, { id });
- const notAvailable = !available(id, date, activeLayers, parameters);
+ const def = lodashFind(layers, { id });
+ const notAvailable = !available(id, date, layers, parameters);
if (!def || notAvailable || !def.visible || def.opacity === 0) {
return false;
@@ -398,8 +411,9 @@ export function isRenderable(id, activeLayers, date, state) {
return true;
}
let obscured = false;
+ const baselayers = getLayers(state, { group: 'baselayers' }, layers);
lodashEach(
- getLayers(activeLayers, { group: 'baselayers' }, state),
+ baselayers,
(otherDef) => {
if (otherDef.id === def.id) {
return false;
@@ -407,7 +421,7 @@ export function isRenderable(id, activeLayers, date, state) {
if (
otherDef.visible
&& otherDef.opacity === 1.0
- && available(otherDef.id, date, activeLayers, parameters)
+ && available(otherDef.id, date, layers, parameters)
) {
obscured = true;
return false;
@@ -441,7 +455,7 @@ export function activateLayersForEventCategory(activeLayers, state) {
{ visible },
newLayers,
layerConfig,
- getLayers(newLayers, { group: 'all' }, state).overlays.length,
+ getLayers(newLayers, { group: 'overlays' }, state).length,
);
}
});
diff --git a/web/js/modules/vector-styles/selectors.js b/web/js/modules/vector-styles/selectors.js
index d7dc5c577..04fc1bd7c 100644
--- a/web/js/modules/vector-styles/selectors.js
+++ b/web/js/modules/vector-styles/selectors.js
@@ -10,8 +10,7 @@ import { containsCoordinate } from 'ol/extent';
import stylefunction from 'ol-mapbox-style/dist/stylefunction';
import { getMinValue, getMaxValue, selectedStyleFunction } from './util';
import {
- getActiveLayers,
- getLayers,
+ getAllActiveLayers,
} from '../layers/selectors';
/**
@@ -87,11 +86,7 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state)
const glStyle = vectorStyles[styleId];
const olMap = lodashGet(state, 'map.ui.selected');
const { selected } = state.vectorStyles;
- const activeLayers = getLayers(
- getActiveLayers(state),
- {},
- state,
- ).reverse();
+ const activeLayers = getAllActiveLayers(state).reverse();
let layerGroups;
let layerGroup;