Add layerswitcher
This commit is contained in:
@@ -53,7 +53,8 @@ export interface State {
|
||||
projection: string,
|
||||
selectedBaseLayer: IItemLayer,
|
||||
selectedOverlayLayer: IItemLayer,
|
||||
styles:IStyles
|
||||
styles:IStyles,
|
||||
showLayerSwitcher:boolean
|
||||
}
|
||||
|
||||
export const initialState: State = {
|
||||
@@ -87,7 +88,8 @@ export const initialState: State = {
|
||||
selectedBaseLayer: null,
|
||||
selectedOverlayLayer: null,
|
||||
selectedItemLayer: null,
|
||||
styles: {}
|
||||
styles: {},
|
||||
showLayerSwitcher: false
|
||||
}
|
||||
|
||||
export function reducer(state = initialState, action: mapActions.Actions | commonActions.Actions | RouterNavigationAction): State {
|
||||
@@ -307,7 +309,8 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
searchCollapsed: true,
|
||||
searchMinified: false,
|
||||
features: [],
|
||||
query:initialState.query
|
||||
query:initialState.query,
|
||||
showLayerSwitcher: false
|
||||
});
|
||||
} else {
|
||||
return tassign(state, {});
|
||||
@@ -319,6 +322,10 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
styles[a.itemType] = a.style;
|
||||
return tassign(state,{styles:styles});
|
||||
}
|
||||
case mapActions.SHOWLAYERSWITCHER:{
|
||||
let a = action as mapActions.ShowLayerSwitcher;
|
||||
return tassign(state,{showLayerSwitcher:a.show});
|
||||
}
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
@@ -346,6 +353,7 @@ export const getQuery = (state: State) => state.query;
|
||||
export const getSelectedItemLayer = (state: State) => state.selectedItemLayer;
|
||||
export const getPeriod = (state:State) => state.period;
|
||||
export const getStyles = (state:State) => state.styles;
|
||||
export const getShowLayerSwitcher = (state:State) => state.showLayerSwitcher;
|
||||
|
||||
export const selectMapState = createFeatureSelector<State>(MODULE_NAME);
|
||||
export const selectGetMapState= createSelector(selectMapState, getMapState);
|
||||
@@ -369,5 +377,6 @@ export const selectGetQuery = createSelector(selectMapState, getQuery);
|
||||
export const selectGetSelectedItemLayer = createSelector(selectMapState, getSelectedItemLayer);
|
||||
export const selectGetPeriod = createSelector(selectMapState, getPeriod);
|
||||
export const selectGetStyles = createSelector(selectMapState, getStyles);
|
||||
export const selectGetShowLayerSwitcher = createSelector(selectMapState,getShowLayerSwitcher);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user