From f970b4835d680cbca57bb3bbce0a4b08dbfb0e8a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 15 Dec 2013 19:01:47 +0100 Subject: [PATCH] (iOS/OSX) Implement didUpdateToLocation and didUpdateLocations --- apple/common/RAGameView.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apple/common/RAGameView.m b/apple/common/RAGameView.m index 3941b3e4a8..00091a0093 100644 --- a/apple/common/RAGameView.m +++ b/apple/common/RAGameView.m @@ -320,7 +320,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; - locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; + locationManager.desiredAccuracy = kCLLocationAccuracyBest; // Set a movement threshold for new events. locationManager.distanceFilter = 500; // meters - TODO - make configurable @@ -340,6 +340,17 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer { } + +- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation +{ + NSLog(@"====latitude %f, longitude %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude); +} + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + NSLog(@"==latitude %f, longitude %f", [[locations objectAtIndex:([locations count]-1)] coordinate].latitude , [[locations objectAtIndex:([locations count]-1)] coordinate].longitude); +} + @end static RAScreen* get_chosen_screen()