More refactoring, add thematic maps button
This commit is contained in:
@@ -57,7 +57,8 @@ export interface State {
|
||||
styles:IStyles,
|
||||
showLayerSwitcher:boolean,
|
||||
setStateCount:number,
|
||||
inSearch:boolean
|
||||
inSearch:boolean,
|
||||
replaceUrl:boolean
|
||||
}
|
||||
|
||||
export const initialState: State = {
|
||||
@@ -94,7 +95,8 @@ export const initialState: State = {
|
||||
styles: {},
|
||||
showLayerSwitcher: false,
|
||||
setStateCount: 0,
|
||||
inSearch:false
|
||||
inSearch:false,
|
||||
replaceUrl:true
|
||||
}
|
||||
|
||||
export function reducer(state = initialState, action: mapActions.Actions | commonActions.Actions | RouterNavigationAction): State {
|
||||
@@ -111,7 +113,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
}
|
||||
case mapActions.SETQUERYSTATE: {
|
||||
let a = action as mapActions.SetQueryState;
|
||||
return tassign(state, { queryState: tassign(a.queryState ),setStateCount: state.setStateCount+1});
|
||||
return tassign(state, { queryState: tassign(a.queryState ),setStateCount: state.setStateCount+1,replaceUrl:a.replaceUrl});
|
||||
}
|
||||
case mapActions.SETSTATE: {
|
||||
let a = action as mapActions.SetState;
|
||||
@@ -457,6 +459,10 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
let a = action as mapActions.ShowLayerSwitcher;
|
||||
return tassign(state,{showLayerSwitcher:a.show});
|
||||
}
|
||||
case mapActions.SETREPLACEURL: {
|
||||
let a= action as mapActions.SetReplaceUrl;
|
||||
return tassign(state,{replaceUrl:a.replaceUrl});
|
||||
}
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
@@ -487,7 +493,7 @@ export const getStyles = (state:State) => state.styles;
|
||||
export const getShowLayerSwitcher = (state:State) => state.showLayerSwitcher;
|
||||
export const getSetStateCount = (state:State) => state.setStateCount;
|
||||
export const getInSearch = (state:State) => state.inSearch;
|
||||
export const getState = (state:State) => {return {mapState:state.mapState,queryState:state.queryState,setStateCount:state.setStateCount};}
|
||||
export const getState = (state:State) => {return {mapState:state.mapState,queryState:state.queryState,setStateCount:state.setStateCount,replaceUrl:state.replaceUrl};}
|
||||
|
||||
export const selectMapState = createFeatureSelector<State>(MODULE_NAME);
|
||||
export const selectGetMapState= createSelector(selectMapState, getMapState);
|
||||
|
Reference in New Issue
Block a user