GeoCoordinateWatcher doesnt fire the event at given intervals
Posted
by
krrishna
on Stack Overflow
See other posts from Stack Overflow
or by krrishna
Published on 2012-11-08T04:57:14Z
Indexed on
2012/11/08
5:01 UTC
Read the original article
Hit count: 150
I have the below code which fires the GeoCoordinateWatcher PositionChanged event for every 0.5 meteres .It might be less.But thats my requirement.
The issue is when i am walking with phone doesnt fire the event at every 0.5 meters instead it fires the event after 0.5 meters randomly.And sometimes when i move fast it fires few events one after another immediately.
Can anybody help me with how to ensure it fires the positionchanged event for every 0.5 meters accurately .
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);
if (watcher.Permission == GeoPositionPermission.Granted)
{
watcher.MovementThreshold = 0.5;//in meters
}
watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged); // PositionChanged events occur whenever your position changes
watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_OnStatusChanged);
watcher.Start();
© Stack Overflow or respective owner