0
votes

I have a google maps directions link shown in XML:

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

Even though it has the drection flag dirflg=r at the end to swich to public transit directions, its still showing the driving directions. Is there any fix to this?

Thanks in advance. I searched around but couldn't find anything that answers exactly this.

1
The Google Maps API do not currently let you query for public transit directions. See code.google.com/p/gmaps-api-issues/issues/detail?id=713#c76 for the reason from Google.Jeow Li Huan
Is there anyway to fetch this data then? Maybe using Bing or MapQuest? Or perhaps using Google's json object api instead of xml?C0D3
Did you find a way to query the Google Maps for transit data and use it in Android and iOS mobile applications?Alex Bitek
Unfortunately Google doesn't let you query for transit data. But I found this: nextbus.com/homepage . They also provide an xml web service. This might also help: stackoverflow.com/questions/8735938/…C0D3

1 Answers

0
votes

You can't get a direct web feed but you can get a json file.

use the output=json property/value at the end of your url.

eg: https://maps.google.com/?saddr=546+6th+Avenue,+New+York,+NY+10011+(Sixth+Avenue,+New+York)&daddr=W+103rd+St,+New+York,+NY+&dirflg=r&output=json