0

Is there a way to determine if the phone is in a 200 radius of a fixed position?

for example, when the position is long 52.684694 lat 5.741550 i need to determine if i'm in a 200 meter range of the object

xvilo
  • 271
  • 1
  • 3
  • 12

1 Answers1

0

You can use the watchPosition method in PhoneGap's geolocation library to add an event listener for significant location changes. You could then do some fairly simple math in the callback to figure out distance. Don't forget to use geolocation.clearWatch to stop watching the current position when it's no longer needed — geolocation can drain a device's battery quickly.

OverlappingElvis
  • 621
  • 6
  • 20