This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into document-supported-layer-sources
- Loading branch information
Showing
14 changed files
with
271 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import reducers from '../reducers/reducers'; | ||
import reducers from '../reducers/app'; | ||
|
||
export { | ||
MAP_RENDERED, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
import defaultState from '../defaultState'; | ||
import * as types from '../constants/actionTypes'; | ||
|
||
|
||
export default function FILTER(state = defaultState.FILTER, action) { | ||
switch (action.type) { | ||
case types.SAVE_FILTER_STATE: { | ||
return { | ||
...state, | ||
[action.layerId]: { | ||
...action.filterState, | ||
doUpdate: true, | ||
isClear: action.isClear || false, | ||
}, | ||
}; | ||
} | ||
case types.FILTERS_UPDATED: { | ||
if (!action.layerId) { | ||
return { | ||
...state, | ||
}; | ||
} | ||
return { | ||
...state, | ||
[action.layerId]: { | ||
...state[action.layerId], | ||
doUpdate: false, | ||
}, | ||
}; | ||
} | ||
default: | ||
return state; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import defaultState from '../defaultState'; | ||
import * as types from '../constants/actionTypes'; | ||
|
||
|
||
export default function LAYERS(state = defaultState.LAYERS, action) { | ||
switch (action.type) { | ||
case types.ADD_LAYERS_LIST: { | ||
return { | ||
...state, | ||
layers: [...state.layers, ...action.layers], | ||
}; | ||
} | ||
case types.ADD_LAYER_GROUP: { | ||
// parse action.group for urls | ||
const groupMapper = (layer) => { | ||
if (typeof layer === 'string') { | ||
if (layer.indexOf('http') === -1) { | ||
return layer; | ||
} | ||
const pathSplit = layer.split('/'); | ||
return pathSplit[pathSplit.length - 1]; | ||
} | ||
const subGroup = {}; | ||
Object.keys(layer).forEach((key) => { | ||
subGroup[key] = layer[key].map(groupMapper); | ||
}); | ||
return subGroup; | ||
}; | ||
const group = action.group.map(groupMapper); | ||
return { | ||
...state, | ||
groups: { | ||
...state.groups, | ||
[action.groupId]: group, | ||
}, | ||
}; | ||
} | ||
default: | ||
return state; | ||
} | ||
} |
Oops, something went wrong.