Skip to content

Commit

Permalink
Remove extra props in GeolocateControl callback (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Jun 4, 2021
1 parent 1158d99 commit 18a3d71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/components/geolocate-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import {document} from '../utils/globals';
import mapboxgl from '../utils/mapboxgl';

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

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

const LINEAR_TRANSITION_PROPS = Object.assign({}, TransitionManager.defaultProps, {
transitionDuration: 500
});

const noop = () => {};

const propTypes = Object.assign({}, mapControlPropTypes, {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/transition-manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export type ViewportProps = MapStateProps & {
onTransitionStart: Function,
onTransitionInterrupt: Function,
onTransitionEnd: Function,
onViewportChange: Function,
onStateChange: Function
onViewportChange?: Function,
onStateChange?: Function
};

type TransitionState = {
Expand Down
4 changes: 1 addition & 3 deletions src/utils/transition-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const DEFAULT_PROPS = {
transitionInterruption: TRANSITION_EVENTS.BREAK,
onTransitionStart: noop,
onTransitionInterrupt: noop,
onTransitionEnd: noop,
onViewportChange: noop,
onStateChange: noop
onTransitionEnd: noop
};

export default class TransitionManager {
Expand Down

0 comments on commit 18a3d71

Please sign in to comment.