问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/8735938/google-maps-directions-in-xml-or-json-with-other-travel-modes