title: Calculate distance between two lat+lng coordinates in React Native?
body: <p>I've got an object containing the lat and lng of my companys facilities. I've also got an object containing the lat and lng of the user's current location. What I'd like to do is iterate through the object with the location data of the sites, and calculate the closest one to the user's location. I'd like to get the kilometers between the two as well as the time it would take to drive the distance.</p>
  
  <p>I've been looking at <a href="https://developers.google.com/maps/documentation/javascript/geometry" rel="noreferrer">Google's Geometry API</a> but can not figure out how to use this in React Native, if it's possible.</p>
  
  <p>My question is what I should do to best achieve this? Can I somehow use the Google Geometry API?</p>
  
  <p><strong>Edit:</strong> I don't have to do this in the app, preferably I'd like to do so, but if it's not possible I could simply make a fetch to my PHP API if there is a better solution for PHP.</p>