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?
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.