How to display distance from user to list of addresses

I’m building a mobile app to direct people to nearby restaurants bathrooms and I want to sort them by distance from the user’s phone, and show how many feet or miles away they are.

I’m storing the addresses in a geographic address field. There don’t seem to be other location fields available so that feels right.

How do I display the distance from the user to each location?

Is this theoretically the way? Because its returning blank.

i’m happy to use a paid plugin to get this to work its pretty key.

zeroqode’s? hard to know there’s not enough documentation.

What you have there is correct. The problem is that you are passing a number as an address from the GPS tracker. That will have to be passed in as a valid address.

One more thing to mention, the method you are using will give you direct distance. If you want driving distance you will have to use the google api.

Install the Toolit kit plugins which has an action to calculate distances without any 3rd party apis

@AliFarahat, does it calculate driving distance or as the crow flies?

Thanks for creating this. I could use your help though, I have no idea how to use it. I don’t know what it added and I can’t find any examples.

This just calculate a straight line. If you need driving distance then use the google maps extended plugin to get the distance and duration

1 Like

Ya sure. Book an appointment here