How to use the react-map-gl.experimental.viewportFlyToInterpolator function in react-map-gl

To help you get started, we’ve selected a few react-map-gl 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 bsdavidson / trimetric / web / src / components / map.jsx View on Github external
};
    }

    if (newPos === null) {
      newPos = {
        lat: nextProps.locationClicked.lat,
        lng: nextProps.locationClicked.lng,
        locationType: nextProps.locationClicked.locationType
      };
    }

    this.handleViewportChange({
      latitude: newPos.lat,
      longitude: newPos.lng,
      zoom: newPos.locationType === LocationTypes.HOME ? 17 : 18,
      transitionInterpolator: experimental.viewportFlyToInterpolator,
      transitionDuration: 1200
    });

    if (this.state.viewport.zoom < 15) {
      this.props.onClearLocation();
    }
  }