I have implemented google map in my android app. It is working fine and showing poly line too but i want to show instructions also like turn left or right.
-
You should share with us what you have tried so far in order to get proper help. – Alex M Aug 09 '16 at 10:35
1 Answers
Follow the Directions API documentation that calculates directions between locations using an HTTP request.
Sample request format:
https://maps.googleapis.com/maps/api/directions/outputFormat?parameters
where outputFormat
may be either of the following values:
json
(recommended) indicates output in JavaScript Object Notation (JSON)xml
indicates output as XML
Directions responses contain root elements like routes
which contains an array of routes from the origin to the destination. Routes consist of nested Legs and Steps.
A step is the most atomic unit of a direction's route, containing a single step describing a specific, single instruction on the journey. E.g. "Turn left at W. 4th St." The step not only describes the instruction but also contains distance and duration information relating to how this step relates to the following step. For example, a step denoted as "Merge onto I-80 West" may contain a duration of "37 miles" and "40 minutes," indicating that the next step is 37 miles/40 minutes from this step.
You can also check these SO questions:
- How to get google driving instruction using google map api on android?
- Directions API on Android
- Is there a way to show road directions in Google Map API v2?
Hope this helps!