Skip to content

Instantly share code, notes, and snippets.

@jamigibbs
Last active June 19, 2018 18:20
Show Gist options
  • Save jamigibbs/44e1c74789efdba01334a80499f20e1c to your computer and use it in GitHub Desktop.
Save jamigibbs/44e1c74789efdba01334a80499f20e1c to your computer and use it in GitHub Desktop.
// User's current location
const current = {lat, lng}
const closest = data.results.map((station) => {
const coord = station.geometry.location
return { coord, dist: geolib.getDistance(current, coord) }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment