I'm getting strange readings when using CLLocationManager. The Lat/Long reported are spot on, but the distance traveled is WAY off. I've implemented the following delegate method as so:
.h:
CLLocationManager *mLocationManager;
CLLocation *mStartDistance;
And
.m:
- (void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"%g", newLocation.coordinate.latitude);
NSLog(@"%g", newLocation.coordinate.longitude);
NSLog(@"%g", newLocation.altitude);
NSLog(@"%g", newLocation.verticalAccuracy);
if (mStartDistance == nil)
{ mStartDistance = newLocation; }
CLLocationDistance dist = [newLocation getDistanceFrom:mStartDistance];
NSLog(@"%gm", dist);
}
And when I run this on my device I get the following (lat/long masked to protect the guilty heh):
] xx.xxxx
] -yy.yyyy
] 0
] -1
] 0m
] xx.xxxx
] -yy.yyyy
] 0
] -1
] 0m
] xx.xxxx
] -yy.yyyy
] 0
] -1
] 376.133m <-- wat?
I don't understand why its saying I've moved +376m..that's like +1200ft!