1

I'm developing a small application to search a nearby location from current location.

I type something like "New york" in the textbox then the listview with filled with the list of matched nearby query "New york". I made this done by using Google Place Nearby search API. But I need one thing more is how to get a distance between my current location to every found nearby location. I can do this by calling DistanceMatrix API but it also means that I have to call DistanceMatrixAPI xxx times according to the found nearby location list

Text: "New york"

Distance | Name

0.1km    | Place 01

0.5km    | Place 02

...      | ...

I can absolutely get the distance by using Foursquare API...but anyway I need to work with Google

Any idea?

Thank you alot,

Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
Bac Clunky
  • 353
  • 3
  • 6
  • 18
  • 3
    each Nearby result contains a lat/lng property, so you can use that to easily calculate a distance (direct path, not driving) from your current location using some simple trig. Or, it appears that DistanceMatrix allows you to specify multiple locations in a single request. – Jason Nov 10 '15 at 05:03
  • @Jason thank you Jason. About the calculating by latlng is just about the flying path and it is useless for me. Anyway, I forgot that DistanceMatrix provides this!!!! One to many places – Bac Clunky Nov 10 '15 at 07:37

0 Answers0