Skip to content

Instantly share code, notes, and snippets.

@elijahzarlin
Created September 14, 2018 18:42
Show Gist options
  • Select an option

  • Save elijahzarlin/2fac0cc392bb94c6dd2ba8d0a7752d14 to your computer and use it in GitHub Desktop.

Select an option

Save elijahzarlin/2fac0cc392bb94c6dd2ba8d0a7752d14 to your computer and use it in GitHub Desktop.
rock n roll turn
var nearest = turf.nearestPoint(user, locations);
var bearing = turf.bearingToAzimuth(turf.bearing(user, nearest));
var distance = turf.distance(user, nearest, { units: meters });
if (distance < 50) {
// Unlock Emerald Star
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment