Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to show road directions in Google Map API v2? [duplicate]

I was looking for an answer using Google and here, and the only relevant posts I have found are:

Google Maps Android V2 and Direction API

Get driving directions using Google Maps API v2

but there is no answer there. So I have already mentioned it but I will say that again. I am looking for a solution for the Google Map API v2 using FragmentActivity and a SupportMagFragment and LatLng objects and not using MapView ,MapActivity and GeoPoint.

In addition I don't have the Overlay object to use so I can't paint the direction on the map, is there an alternative for that?

So is there a way to do that?

like image 804
Emil Adz Avatar asked Jan 28 '13 00:01

Emil Adz


People also ask

How do I get Google Maps API directions?

Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.

How do I get directions from Google Maps using the API?

For direction calculations that respond in real time to user input (for example, within a user interface element), you can use the Directions API or, if you're using the Maps JavaScript API, use the Directions service . For server-side use, you can use Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

Is the roads API still available for Google Maps?

For Google Maps Platform Premium Plan customers who transitioned to pay-as-you-go pricing, the feature remains active. The Roads API is available with the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

How do I get a Google Maps API key?

Next, while still logged into the GCP Console, go to the project you just created and enable the Directions API. Once that's done, go to the Google Maps Platform > Credentials page and generate a new API key (see this video for a step by step walkthrough).

What happens if the directions API cannot create directions through a point?

This interpretation may result in severe detours on the route or ZERO_RESULTS in the response status code if the Directions API is unable to create directions through that point. The following URL requests waypoints using latitude/longitude coordinates:


1 Answers

Try this solution here. You can get driving or walking direction on V2.

like image 81
Akexorcist Avatar answered Sep 18 '22 20:09

Akexorcist