Let's run our application.
Here we go.
We have this error.
Dagger missing.
Binding can't be provided.
String can't be provided without inject constructor or provides annotation.
So the only thing that we provide as a string here is the maps API key.
And if we open the directions repository no need for the API key.
If we go to directions repository implementation we need this API key for the response.
So let me change this code because we didn't use this map.
Provide maps API key.
Let me remove this and call provide app maps API key function.
Run it again and here we go.
This is our map.
You can click on the map to display this marker.
And if you click on the marker you'll get selected location with the coordinates.
Now let's get the route between the current position and the selected marker.
Open expandable fab here.
When I click Draw root button, I need to display the current location that the root between the current
location and the selected location.
So in order to do that here inside the extended floating action button, we need to call the Ondraw
route.
This is passed as a parameter inside this expandable fab.
So on draw route it's a lambda expression returning nothing.
Then let's move to the Uber clone map.
Here in expandable fabs we need to pass the parameter.
So here on draw route this is a lambda expression checking if marker position is not null.
What we need to do.
Call the ViewModel dot fetch route from current position to the marker and pass the marker position
as the marker parameter.
Okay, let me run the application.
Go to the current position, scroll to here and you can select any place I need to go to Santa Rosa.
Select the fab.
Click on Draw Route, select the marker and then click Draw Route.
Nothing drawn on the map.
Maybe because we didn't define the polyline or there is an error in our request.
So let me check the map.
If we go back to the map here we have the marker position markers and user location.
Those are the shapes that we drawn on the marker.
So on the map.
So here we need to draw the route for this.
Use the route points dot.
Let.
If it is not null, go and create this lambda using the route points and draw polyline.
Having the points equals to the route points.
The color would be red and width is eight.
Run again and if the polyline or the route is not visible on the map, so there is an error in the request
and response.
Again this is the current position and this is the marker Santa Rosa selected.
And click on draw route.
This is the selected location.
And this is the drone a polyline.
Congratulations guys.
This is the route displayed between the current position and the selected marker.