Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/NachoMan/phonegap into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
sintaxi committed Apr 24, 2009
2 parents 537c4a2 + f9277dd commit 3274681
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iphone/Classes/Location.m
Expand Up @@ -74,13 +74,19 @@ - (void)locationManager:(CLLocationManager *)manager
fromLocation:(CLLocation *)oldLocation
{
int epoch = [newLocation.timestamp timeIntervalSince1970];
float course = -1.0f;
float speed = -1.0f;
#ifdef __IPHONE_2_2
course = newLocation.course;
speed = newLocation.speed;
#endif
NSString * jsCallBack = [NSString stringWithFormat:@"navigator.geolocation.setLocation({timestamp: %d, latitude: %f, longitude: %f, altitude: %f, course: %f, speed: %f, accuracy: {horizontal: %f, vertical: %f}});",
epoch,
newLocation.coordinate.latitude,
newLocation.coordinate.longitude,
newLocation.altitude,
newLocation.course,
newLocation.speed,
course,
speed,
newLocation.horizontalAccuracy,
newLocation.verticalAccuracy
];
Expand Down

0 comments on commit 3274681

Please sign in to comment.