From 9c16681b58fef2ffea6eb9516b38c885dfbc2450 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Thu, 26 Mar 2020 10:38:39 +0100 Subject: [PATCH] AW-1079 Only add one item to overlay. --- projects/common-map/src/fm-map/reducers/map.reducer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/common-map/src/fm-map/reducers/map.reducer.ts b/projects/common-map/src/fm-map/reducers/map.reducer.ts index 57d4914..68b6404 100644 --- a/projects/common-map/src/fm-map/reducers/map.reducer.ts +++ b/projects/common-map/src/fm-map/reducers/map.reducer.ts @@ -316,6 +316,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo let itemLayers = state.overlayLayers.slice(0); let itemLayer = new ItemLayer(a.item); itemLayer.layerIndex = a.layerIndex == -1 ? 0 : a.layerIndex; + itemLayers = itemLayers.filter(item => item.layerIndex !== itemLayer.layerIndex); itemLayers.push(itemLayer); return tassign(state, { overlayLayers: itemLayers, selectedOverlayLayer: itemLayer }); }