mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
1.4 KiB
1.4 KiB
FlyToInterpolator
Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap.
This interpolator offers similar behavior to Mapbox's flyTo method.
import ReactMapGL, {FlyToInterpolator} from 'react-map-gl';
<ReactMapGL
...
transitionDuration={1000}
transitionInterpolator={new FlyToInterpolator()} />
Constructor
new FlyToInterpolator([options])
Parameters:
options{Object} (optional)curve(Number, optional, default: 1.414) - The zooming "curve" that will occur along the flight path.
speed(Number, optional, default: 1.2) - The average speed of the animation defined in relation tooptions.curve, it linearly affects the duration, higher speed returns smaller durations and vice versa.screenSpeed(Number, optional) - The average speed of the animation measured in screenfuls per second. Similar toopts.speedit linearly affects the duration, when specifiedopts.speedis ignored.maxDuration(Number, optional) - Maximum duration in milliseconds, if calculated duration exceeds this value,0is returned.