junh_eee(이준희)
2 years ago
4 changed files with 100 additions and 3 deletions
@ -0,0 +1,33 @@ |
|||||||
|
// draw 옵션 변경 Action
|
||||||
|
export const polylineChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'POLYLINE_CHANGE', value}); |
||||||
|
|
||||||
|
export const guidelineChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'GUIDELINE_CHANGE', value}); |
||||||
|
|
||||||
|
export const bufferpolylineChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'BUFFERPOLYLINE_CHANGE', value}); |
||||||
|
|
||||||
|
export const polygonChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'POLYGON_CHANGE', value}); |
||||||
|
|
||||||
|
export const circleChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'CIRCLE_CHANGE', value}); |
||||||
|
|
||||||
|
export const radiuslineChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'RADIUSLINE_CHANGE', value}); |
||||||
|
|
||||||
|
export const clickEveChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'CLICKEVE_CHANGE', value}); |
||||||
|
|
||||||
|
export const mousedownEveChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'MOUSEDOWNEVE_CHANGE', value}); |
||||||
|
|
||||||
|
export const rightclickEveChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'RIGHTCLICKEVE_CHANGE', value}); |
||||||
|
|
||||||
|
export const dragCircleChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'DRAGCIRCLE_CHANGE', value}); |
||||||
|
|
||||||
|
export const checkChangeAction = (value: any) => dispatch => |
||||||
|
dispatch({type: 'CHECK_CHANGE', value}); |
@ -0,0 +1,59 @@ |
|||||||
|
// ** Initial State
|
||||||
|
const initial = { |
||||||
|
polyline: '', |
||||||
|
guideline: '', |
||||||
|
bufferPolyline: '', |
||||||
|
|
||||||
|
polygon: '', |
||||||
|
|
||||||
|
circle: '', |
||||||
|
radiusline: '', |
||||||
|
|
||||||
|
clickEve: '', |
||||||
|
mousedownEve: '', |
||||||
|
rightclickEve: '', |
||||||
|
|
||||||
|
dragCircle: [], |
||||||
|
check: '' |
||||||
|
}; |
||||||
|
|
||||||
|
const drawReducerReducer = (state = initial, action) => { |
||||||
|
switch (action.type) { |
||||||
|
case 'POLYLINE_CHANGE': |
||||||
|
return {...state, polyline: action.value}; |
||||||
|
|
||||||
|
case 'GUIDELINE_CHANGE': |
||||||
|
return { ...state, guideline: action.value}; |
||||||
|
|
||||||
|
case 'BUFFERPOLYLINE_CHANGE': |
||||||
|
return {...state, bufferPolyline: action.value}; |
||||||
|
|
||||||
|
case 'POLYGON_CHANGE': |
||||||
|
return {...state, polygon: action.value}; |
||||||
|
|
||||||
|
case 'CIRCLE_CHANGE': |
||||||
|
return {...state, circle: action.value}; |
||||||
|
|
||||||
|
case 'RADIUSLINE_CHANGE': |
||||||
|
return {...state, radiusline: action.value}; |
||||||
|
|
||||||
|
case 'CLICKEVE_CHANGE': |
||||||
|
return {...state, clickEve: action.value}; |
||||||
|
|
||||||
|
case 'MOUSEDOWNEVE_CHANGE': |
||||||
|
return {...state, mousedownEve: action.value}; |
||||||
|
|
||||||
|
case 'RIGHTCLICKEVE_CHANGE': |
||||||
|
return {...state, rightclickEve: action.value}; |
||||||
|
|
||||||
|
case 'DRAGCIRCLE_CHANGE': |
||||||
|
return {...state, dragCircle: action.value}; |
||||||
|
|
||||||
|
case 'CHECK_CHANGE': |
||||||
|
return {...state, check: action.value}; |
||||||
|
default: |
||||||
|
return state; |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
export default drawReducerReducer; |
Loading…
Reference in new issue