add clearlayers action
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -328,7 +328,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
case mapActions.SETEXTENT: {
|
||||
let a = action as mapActions.SetExtent;
|
||||
return tassign(state, { extent: a.extent });
|
||||
}
|
||||
}
|
||||
case mapActions.ADDLAYER: {
|
||||
let a = action as mapActions.AddLayer;
|
||||
let itemLayers = state.overlayLayers.slice(0);
|
||||
@@ -355,6 +355,9 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
newLayers.splice(i, 1);
|
||||
return tassign(state, { overlayLayers: newLayers, selectedOverlayLayer: selectedOverlayLayer });
|
||||
}
|
||||
case mapActions.CLEARLAYERS: {
|
||||
return tassign(state, {overlayLayers: [], selectedOverlayLayer: null});
|
||||
}
|
||||
case mapActions.SETVISIBILITY: {
|
||||
let a = action as mapActions.SetVisibility;
|
||||
let newLayers = state.overlayLayers.slice(0);
|
||||
@@ -448,7 +451,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
let a = action as mapActions.SelectOverlayLayer;
|
||||
return tassign(state, { selectedOverlayLayer: a.itemLayer });
|
||||
}
|
||||
|
||||
|
||||
case mapActions.CLEAR: {
|
||||
let newQueryState = tassign(state.queryState, { query: null, tags: null, itemCode: null, parentCode: null, itemType: null });
|
||||
return tassign(state, {
|
||||
@@ -480,7 +483,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
case mapActions.SETREPLACEURL: {
|
||||
let a= action as mapActions.SetReplaceUrl;
|
||||
return tassign(state,{replaceUrl:a.replaceUrl});
|
||||
}
|
||||
}
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user