|
|
|
@ -2,8 +2,9 @@ import {
|
|
|
|
|
GEO_LOCATION_SUCCESS, GEO_LOCATION_FAILURE, |
|
|
|
|
GEO_MARKER_ADD, GEO_MARKER_RESET, GEO_MARKER_UPDATE, |
|
|
|
|
GEO_POLYGON_ADD, GEO_POLYGON_RESET, GEO_POLYGON_UPDATE, |
|
|
|
|
GEO_MAPCENTER_UPDATE, GEO_LASTCENTER_UPDATE, GEO_STOPMARKER_TOGGLE, |
|
|
|
|
GEO_MAPCENTER_UPDATE, GEO_LASTCENTER_UPDATE, |
|
|
|
|
GEO_DRAGMARKER_CHANGE, GEO_DRAGMARKER_DISABLE, GEO_DRAGMARKER_ENABLE, |
|
|
|
|
GEO_STOPMARKER_TOGGLE, GEO_STOP_AURA_TOGGLE, |
|
|
|
|
} from '../constants/ActionTypes' |
|
|
|
|
|
|
|
|
|
const initialState = { |
|
|
|
@ -16,17 +17,23 @@ const initialState = {
|
|
|
|
|
mapCenter: [13.84626739, 100.538], |
|
|
|
|
zoom: 13, |
|
|
|
|
showStopMarker: false, |
|
|
|
|
showStopAura: false, |
|
|
|
|
draggableMarker: false, |
|
|
|
|
draggableMarkerLatlon: [13.8462745, 100.5382592], |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const geo = (state = initialState, action) => { |
|
|
|
|
switch (action.type) { |
|
|
|
|
case GEO_STOPMARKER_TOGGLE: |
|
|
|
|
case GEO_STOP_AURA_TOGGLE: |
|
|
|
|
return { |
|
|
|
|
...state, |
|
|
|
|
showStopMarker: !state.showStopMarker, |
|
|
|
|
showStopAura: !state.showStopAura, |
|
|
|
|
} |
|
|
|
|
case GEO_STOPMARKER_TOGGLE: |
|
|
|
|
return { |
|
|
|
|
...state, |
|
|
|
|
showStopMarker: !state.showStopMarker, |
|
|
|
|
} |
|
|
|
|
case GEO_DRAGMARKER_ENABLE: |
|
|
|
|
return { |
|
|
|
|
...state, |
|
|
|
|