how can i draw a route with npm google-map-react ?
this is what i have
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}`);
}
}
);