Add onDrag event

This commit is contained in:
cybice 2015-10-12 21:24:31 +03:00
parent 1603ebd139
commit d99c9f4b22

View File

@ -19,6 +19,7 @@ import isPlainObject from './utils/is_plain_object';
import pick from './utils/pick';
import raf from './utils/raf';
// TODO move to "import blabla from 'lodash/bla/blabla';"
import assign from 'lodash.assign';
import isNumber from 'lodash.isnumber';
@ -84,6 +85,7 @@ export default class GoogleMap extends Component {
onChildMouseLeave: PropTypes.func,
onZoomAnimationStart: PropTypes.func,
onZoomAnimationEnd: PropTypes.func,
onDrag: PropTypes.func,
options: PropTypes.any,
distanceToMouse: PropTypes.func,
hoverDistance: PropTypes.number,
@ -473,6 +475,7 @@ export default class GoogleMap extends Component {
maps.event.addListener(map, 'drag', () => {
this_.dragTime_ = (new Date()).getTime();
this_._onDrag();
});
if (this.props.onGoogleApiLoaded) {
@ -494,6 +497,9 @@ export default class GoogleMap extends Component {
});
}
_onDrag = (...args) => this.props.onDrag &&
this.props.onDrag(...args);
_onZoomAnimationStart = (...args) => this.props.onZoomAnimationStart &&
this.props.onZoomAnimationStart(...args)