Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interpolateProps(startProps: MapStateProps, endProps: MapStateProps, t: number) {
const viewport = flyToViewport(startProps, endProps, t, this.props);
// Linearly interpolate 'bearing' and 'pitch' if exist.
for (const key of LINEARLY_INTERPOLATED_PROPS) {
viewport[key] = lerp(startProps[key], endProps[key], t);
}
return viewport;
}
.forEach(testCase => {
const propsInTransition = flyToViewport(
testCase.startProps, testCase.endProps, testCase.t);
t.deepEqual(toLowPrecision(propsInTransition, 7), testCase.expect, 'interpolated correctly');
});