qui classe CLLocationManager
fornire diversi campo di posizione come, Latitudine, Longitudine, precisione e velocità.
io uso CoreLocationController
così per l'aggiornamento posizione Io chiamo questo metodo di muggito è possibile ottenere velocità attuale in - (void) locationUpdate: (CLLocation *) metodo di localizzazione come muggito
- (void)locationUpdate:(CLLocation *)location
{
NSString *currentspeed = [NSString stringWithFormat:@"SPEED: %f", [location speed]];
}
o in altro modo Bellow è metodo delegato
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"in update to location");
NSString *currentspeed = [NSString stringWithFormat:@"SPEED: %f", [newLocation speed]];
}
anche si può ottenere ad esempio da questo link ... http://www.vellios.com/2010/08/16/core-location-gps-tutorial/
Spero che questo aiuto ... :)
fonte
2012-08-24 09:54:39
Signore, ho letto quel link e l'ho provato, ma non sta completando il mio scopo (non ottenendo una velocità accurata o quasi accurata) ... –
ok provatelo http://mobileorchard.com/hello -there-a-corelocation-tutorial/ –
anche questo esempio di sdk per iOS lo uso a mio modo come CoreLoactionController ... usa anche questo .... https://developer.apple.com/library/ios/#samplecode /LocateMe/Introduction/Intro.html –