开发者

Find nearest transit station / stopover (bus, train etc) in Google Maps

Is it possible to find the nearest bus, train, or other public transit?

The 'nearest' is a separate case, but is it just possible 开发者_开发问答to find them?

They are tagged, but I want to know how to access/find them.


I don't think that this is supported in Google Maps yet, finding the nearby public transport locations of a spot.

The only workaround I could think of is to use the location you want to get the nearest public transportation as a starting point of a directions calculation. As the destination, you choose any random location that's a little away but far enough so the route would require a public transportation (not just walking). Then you could fetch the first public transportation from the resulting data.

For example: if you have calculated a route like this:

http://maps.google.com/maps?f=d&source=s_d&saddr=15+Vanderbilt+Avenue,+New+York,+NY+10017+(Grand+Central+Terminal)&daddr=central+park&hl=en&geocode=CUdYBSaiyFjNFWbXbQIdIDOX-yFZWQrti_yyniknhhaRAVnCiTHFY7RT82_HCg%3BFT0ebgIdVT6X-yn1xwsBmljCiTG2GSD9L5ZZwQ&mra=pe&mrcr=0&dirflg=r&ttype=dep&date=06%2F22%2F10&time=10:34am&noexp=0&noal=0&sort=&sll=40.764379,-73.974187&sspn=0.093872,0.154324&ie=UTF8&z=15&start=0

you would just add the parameter &output=json to the url and could fetch the data as json format.

http://maps.google.com/maps?f=d&source=s_d&saddr=15+Vanderbilt+Avenue,+New+York,+NY+10017+(Grand+Central+Terminal)&daddr=central+park&hl=en&geocode=CUdYBSaiyFjNFWbXbQIdIDOX-yFZWQrti_yyniknhhaRAVnCiTHFY7RT82_HCg%3BFT0ebgIdVT6X-yn1xwsBmljCiTG2GSD9L5ZZwQ&mra=pe&mrcr=0&dirflg=r&ttype=dep&date=06%2F22%2F10&time=10:34am&noexp=0&noal=0&sort=&sll=40.764379,-73.974187&sspn=0.093872,0.154324&ie=UTF8&z=15&start=0&output=json

In this sample you would get "Bus M02" as the first public transportation.

But this is really a very bad workaround. I think gotta wait until Google opens the API for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜