FS.O
FS.O

Reputation: 401

Get Google Maps walking directions JSON instead of driving

I'm using this URL to get JSON directions (and showing in on map using GMSPolyLine):

https://maps.googleapis.com/maps/api/directions/json?&origin=%@&destination=%@&sensor=false

But the result it returns me is for driving and I want the user to choose between walking and driving.

Can anyone give me the URL for walking/choosing from walking or driving?

Thank you very much!

Upvotes: 0

Views: 1737

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117324

Set a URL-parameter mode to the value walking

https://maps.googleapis.com/maps/api/directions/json?&origin=%@&destination=%@&mode=walking

https://developers.google.com/maps/documentation/directions/intro#TravelModes

Upvotes: 3

Related Questions