DanielX2010
DanielX2010

Reputation: 1908

Route navigation info from Google Maps API

I am currently able to use the Google Maps API to get a route from point A to point B by using the google.maps.DirectionsService. But one thing I cannot seem to get is the actual navigation information (like the one you get when you are on the navigation mode in your cell phone). Is there any way to get data for things like "turn right in 500 feet on 5th Avenue" ?

Thank you

Upvotes: 1

Views: 190

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117364

you may print these instructions by defining the panel-option of the DirectionsRenderer(expects to be a HTML-element where to print the instructions).

Demo: https://developers.google.com/maps/documentation/javascript/examples/directions-panel


To get single instructions you must iterate over the steps of a route and access the instructions-property.

Upvotes: 2

Related Questions