Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ALL google maps Directions web service API requests with mode=transit return INVALID_REQUEST

Here are a few URLs that return results with walking or driving but not with transit (i.e., change mode to walking or driving and you will see results)

http://maps.googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit

http://maps.googleapis.com/maps/api/directions/json?origin=Toledo&destination=Madrid&region=es&sensor=false&mode=transit

I cant get a single response with mode=transit. Notice that the second URL is straight from API documentation

Anyone else noticing the same thing?

like image 896
user1552987 Avatar asked Jan 15 '23 23:01

user1552987


1 Answers

Sorry. Its not the global thing

E.g, this doesnt work: http://maps.googleapis.com/maps/api/directions/json?origin=san+francisco&destination=seattle&sensor=false&mode=transit

But, this does again: http://maps.googleapis.com/maps/api/directions/json?origin=san+francisco&destination=seattle&sensor=false&mode=transit&departure_time=1343376768

Its not the global issue. Its that google made departure_time or arrival_time as a mandatory field. This is a recent change to their API.

Thanks for all your help

like image 182
user1552987 Avatar answered May 25 '23 20:05

user1552987