Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix layer ordering when new layer added

Jason Kent35466b092ce8
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index 32f770e0b..3b7780e83 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -158,7 +158,7 @@ export function addLayer(id, spec = {}, layersParam, layerConfig, overlayLength,
if (def.group === 'overlays') {
// TODO assuming first group in the array again here
const groupIdx = layers.findIndex(({ layergroup }) => layergroup === def.layergroup);
- if (groupOverlays && groupIdx) {
+ if (groupOverlays && groupIdx >= 0) {
layers.splice(groupIdx, 0, def);
} else {
layers.unshift(def);