4
votes

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?

2
someone else posted this same finding a day or two ago, I'm trying to find it to see if they got a resolution. EDIT(they haven't): stackoverflow.com/questions/11656445/…Robot Woods
I was enjoying my new navigation app when I suddenly sucked by that. T_TSlavik

2 Answers

9
votes

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

0
votes

Transit directions don't work globally. For example, this request works:

http://maps.googleapis.com/maps/api/directions/json?origin=san+francisco&destination=seattle&sensor=false

On the other hand if you go to maps.google.com and attempt to get transit directions via the UI from Toledo to Madrid, it notes the request is outside the coverage area. The way the API returns this information is via the INVALID_REQUEST status.