РЕАГИРОВАТЬ, как я могу нарисовать маршрут с помощью Google-карты-реагировать? - PullRequest
0 голосов
/ 16 декабря 2018

как я могу нарисовать маршрут с помощью npm google-map-реакции?

это то, что у меня есть

this.map = (zoom, lat, lng) => {let DirectionsService= new window.google.maps.DirectionsService ();

  DirectionsService.route(
    {
      origin: new window.google.maps.LatLng(40.407749, -3.710138), //
      destination: new window.google.maps.LatLng(40.762341, -3.788512), //
      travelmode: window.google.maps.TravelMode.DRIVING
    },
    (result, status) => {
      if (status === window.google.maps.DirectionsStatus.OK) {
        this.setState({
          direction: result
        });
      } else {
        console.error(`error fetching directions ${result}`);
      }
    }
  );
...