I have an object containing lat and lng objects of my company. I also have an object containing lat and lng of the user's current location. What I would like to do is iterate over the object with the site location data and calculate the closest to the user's location. I would like to get the kilometers between them, as well as the time spent on the distance.
I was looking at the Google Geometry API , but can't figure out how to use this in React Native, if possible.
My question is what should I do to achieve this? Can I use the Google Geometry API somehow?
Edit: I do not need to do this in the application, preferably, I would like to do this, but if this is not possible, I could just make a selection for my PHP API if it is the best solution for PHP.
source
share