Skip to content

Commit 231e718

Browse files
committed
Remove extra props in GeolocateControl callback (#1480)
1 parent a43b84c commit 231e718

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/components/geolocate-control.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@ import {document} from '../utils/globals';
66
import mapboxgl from '../utils/mapboxgl';
77

88
import MapState from '../utils/map-state';
9-
import TransitionManager from '../utils/transition-manager';
9+
import {LINEAR_TRANSITION_PROPS} from '../utils/map-controller';
1010
import {isGeolocationSupported} from '../utils/geolocate-utils';
1111

1212
import useMapControl, {mapControlDefaultProps, mapControlPropTypes} from './use-map-control';
1313

14-
const LINEAR_TRANSITION_PROPS = Object.assign({}, TransitionManager.defaultProps, {
15-
transitionDuration: 500
16-
});
17-
1814
const noop = () => {};
1915

2016
const propTypes = Object.assign({}, mapControlPropTypes, {

src/utils/transition-manager.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export type ViewportProps = MapStateProps & {
55
onTransitionStart: Function,
66
onTransitionInterrupt: Function,
77
onTransitionEnd: Function,
8-
onViewportChange: Function,
9-
onStateChange: Function
8+
onViewportChange?: Function,
9+
onStateChange?: Function
1010
};
1111

1212
type TransitionState = {

src/utils/transition-manager.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ const DEFAULT_PROPS = {
2626
transitionInterruption: TRANSITION_EVENTS.BREAK,
2727
onTransitionStart: noop,
2828
onTransitionInterrupt: noop,
29-
onTransitionEnd: noop,
30-
onViewportChange: noop,
31-
onStateChange: noop
29+
onTransitionEnd: noop
3230
};
3331

3432
export default class TransitionManager {

0 commit comments

Comments
 (0)