Detect the nearest transit stop from the given location

Well, you could use the places-API to find the nearest transit-stops, it works fine for me for the given location.

Just do a request with the parameters:

  • location (latlng-object of the given location)
  • radius(radius to search for in meters)
  • types(array of valid types, e.g. ['bus_station','subway_station'])

Checkout the fiddle: http://jsfiddle.net/doktormolle/aZrvs/

For retrieving further details(bus service No, bus stop ID) I don’t have any good idea right now.

There should be a way, those data on maps.google.com will be retrieved by using AJAX, so there is a ressource. But as long as there is no public API to fetch those results it would not be legal to use this ressource.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)