mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Remove extra props in GeolocateControl callback (#1480)
This commit is contained in:
parent
f359e986dd
commit
520a4991d7
@ -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, {
|
||||
|
||||
4
src/utils/transition-manager.d.ts
vendored
4
src/utils/transition-manager.d.ts
vendored
@ -5,8 +5,8 @@ export type ViewportProps = MapStateProps & {
|
||||
onTransitionStart: Function,
|
||||
onTransitionInterrupt: Function,
|
||||
onTransitionEnd: Function,
|
||||
onViewportChange: Function,
|
||||
onStateChange: Function
|
||||
onViewportChange?: Function,
|
||||
onStateChange?: Function
|
||||
};
|
||||
|
||||
type TransitionState = {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user