How to GET different distances from Google Map API

HI. i have a list of restaurants to be compared the distance between all the restaurants to my current location using googlemap api.

For example i have 4 restaurants, so when the screen list the 4 restaurants, each restaurant showing different distance.

how can i call google api in each of the restaurants to be able to GET different distances.

current im hardcoding the origins and destinations address, how can i call google api each time the restaurant is listed in the list.

1 Like

I am getting the same distance for all the 4 restaurants. how can i query API everytime the restaurant is listed?

1 Like