Search code examples
iosgoogle-mapsdirections

Google Maps Directions in XML or JSON with other travel modes


I'm trying to get the directions for travel modes other than driving but the api doesn't seem to respect the dirflg parameter.

http://maps.googleapis.com/maps/api/directions/json?origin=111%20Davisville%20Avenue,Toronto,ON&destination=469%20King%20Street%20West,%20Toronto,%20ON&sensor=false&dirflg=w

Can anyone tell me what the correct url is? Thank you in advance.


Solution

  • the parameter is mode, as in mode=walking: http://maps.googleapis.com/maps/api/directions/json?origin=111%20Davisville%20Avenue,Toronto,ON&destination=469%20King%20Street%20West,%20Toronto,%20ON&sensor=false&mode=walking