import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { SetViewControl } from './set_view_control' ; import { setGotoWithCenter } from '../../../actions' ; import { getMapZoom , getMapCenter , getMapSettings } from '../../../selectors/map_selectors' ; import { MapStoreState } from '../../../reducers/store' ; function mapStateToProps ( state ) { return { settings : getMapSettings ( state ) , zoom : getMapZoom ( state ) , center : getMapCenter ( state ) , } ; } function mapDispatchToProps ( dispatch ) { return { onSubmit : ( { lat , lon , zoom } ) => { dispatch ( setGotoWithCenter ( { lat , lon , zoom } ) ) ; } , } ; } const connectedSetViewControl = connect ( mapStateToProps , mapDispatchToProps ) ( SetViewControl ) ; export { connectedSetViewControl as SetViewControl } ;