How to use the viewport-mercator-project.flyToViewport function in viewport-mercator-project

To help you get started, we’ve selected a few viewport-mercator-project examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / react-map-gl / src / utils / transition / viewport-fly-to-interpolator.js View on Github external
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;
  }
github uber-archive / viewport-mercator-project / test / spec / fly-to-viewport.spec.js View on Github external
.forEach(testCase => {
    const propsInTransition = flyToViewport(
      testCase.startProps, testCase.endProps, testCase.t);
    t.deepEqual(toLowPrecision(propsInTransition, 7), testCase.expect, 'interpolated correctly');
  });