I use Google Maps API and I have a map with 20 points on it.
Can I find an API call to give me driving directions and draw lines between them?
I use Google Maps API and I have a map with 20 points on it.
Can I find an API call to give me driving directions and draw lines between them?
Yes, it can be done. The Google Maps API Documentation describes how to this very accurately:
"You can add the ability to calculate directions (using a variety of methods of transportation) by using the GDirections
object. The GDirections
object requests and receives direction results using either query strings (e.g. "New York, NY to Chicago, IL") or textual lat/lons.
The GDirections
object also supports multi-part directions using a series of waypoints. Directions may be displayed as either a polyline drawing the route on a map, as a series of textual description within a <div>
element (e.g. "Turn right onto the Williamsburg Bridge ramp") or both."
Unfortunately driving directions are not yet available for all countries. You may want to check the following spreadsheet to see if driving directions are available for a particular location: