2

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.

Naveen Kumar M
  • 7,497
  • 7
  • 60
  • 74
Azhar
  • 101
  • 2
  • 7

1 Answers1

0

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:

Hope this helps!

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59