Refactor map for menu removal
Some checks failed
FarmMaps.Develop/FarmMapsLib/develop There was a failure building this commit

This commit is contained in:
Willem Dantuma
2020-01-07 22:27:46 +01:00
parent 73550b3201
commit bf0dc15a00
8 changed files with 437 additions and 474 deletions

View File

@@ -44,8 +44,7 @@ export interface State {
selectedItem:IItem,
clearEnabled: boolean,
searchCollapsed: boolean,
searchMinified: boolean,
menuVisible: boolean,
searchMinified: boolean,
extent: number[],
baseLayers: Array<IItemLayer>
overlayLayers: Array<IItemLayer>,
@@ -79,7 +78,6 @@ export const initialState: State = {
clearEnabled: false,
searchCollapsed: true,
searchMinified:false,
menuVisible: true,
extent: null,
baseLayers: [],
overlayLayers: [],
@@ -165,8 +163,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
selectedItemLayer:null,
queryState: tassign(a.queryState),
searchCollapsed: false,
searchMinified: true,
menuVisible:false
searchMinified: true
});
}
case mapActions.DOQUERY: {
@@ -181,7 +178,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
return tassign(state, {
panelVisible: true,
selectedFeature: a.feature,
menuVisible: false,
extent: a.feature.getGeometry().getExtent(),
searchCollapsed: false,
clearEnabled:true,
@@ -207,9 +203,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
case mapActions.COLLAPSESEARCH: {
return tassign(state, { searchCollapsed: state.panelVisible ? false: true});
}
case mapActions.TOGGLEMENU: {
return tassign(state, { menuVisible: !state.menuVisible });
}
case mapActions.SETEXTENT: {
let a = action as mapActions.SetExtent;
return tassign(state, { extent: a.extent });
@@ -310,7 +303,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
clearEnabled: false,
searchCollapsed: true,
searchMinified: false,
menuVisible:false,
features: [],
query:initialState.query
});
@@ -335,7 +327,6 @@ export const getQueryState = (state: State) => state.queryState;
export const getClearEnabled = (state: State) => state.clearEnabled;
export const getSearchCollapsed = (state: State) => state.searchCollapsed;
export const getSearchMinified = (state: State) => state.searchMinified;
export const getMenuVisible = (state: State) => state.menuVisible;
export const getExtent = (state: State) => state.extent;
export const getOverlayLayers = (state: State) => state.overlayLayers;
export const getBaseLayers = (state: State) => state.baseLayers;
@@ -358,7 +349,6 @@ export const selectGetQueryState = createSelector(selectMapState, getQueryState)
export const selectGetClearEnabled = createSelector(selectMapState, getClearEnabled);
export const selectGetSearchCollapsed = createSelector(selectMapState, getSearchCollapsed);
export const selectGetSearchMinified = createSelector(selectMapState, getSearchMinified);
export const selectGetMenuVisible = createSelector(selectMapState, getMenuVisible);
export const selectGetExtent = createSelector(selectMapState, getExtent);
export const selectGetOverlayLayers = createSelector(selectMapState, getOverlayLayers);
export const selectGetBaseLayers = createSelector(selectMapState, getBaseLayers);