Remove extra props in GeolocateControl callback (#1480)

This commit is contained in:
Xiaoji Chen 2021-06-04 13:43:52 -07:00 committed by GitHub
parent f359e986dd
commit 520a4991d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 10 deletions

View File

@ -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, {

View File

@ -5,8 +5,8 @@ export type ViewportProps = MapStateProps & {
onTransitionStart: Function,
onTransitionInterrupt: Function,
onTransitionEnd: Function,
onViewportChange: Function,
onStateChange: Function
onViewportChange?: Function,
onStateChange?: Function
};
type TransitionState = {

View File

@ -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 {