Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get exact coordinates using iPhone CLLocationManager
    primarykey
    data
    text
    <p>I am using CLLocationManager *locationManager and getting coordinates but these coordinates are not exact as google map coordinates.</p> <p>iPhone coordinates are the following &lt;+26.86126232,+75.75962328>+/-100.00m(speed -1.00 mps/course-1.00)</p> <p>google map coordinates for same device's location place coordinates are following &lt;+26.860524,+75.761569></p> <p>Google map coordinates are right but iPhone coordinates are wrong these are 100 meter away from google map's exact coordinates.</p> <p>How do I get the exact coordinates.</p> <pre><code> // MyCLController.h // mapCurrentLocation // // Created by mac on 18/11/11. // Copyright 2011 __MyCompanyName__. All rights reserved. </code></pre> <p>//</p> <pre><code> #import &lt;Foundation/Foundation.h&gt; @protocol MyCLControllerDelegate @required - (void)locationUpdate:(CLLocation *)location; - (void)locationError:(NSError *)error; @end @interface MyCLController : NSObject&lt;CLLocationManagerDelegate&gt; { IBOutlet UILabel *locationLabel; CLLocationManager *locationManager; id delegate; } @property (nonatomic, retain) CLLocationManager *locationManager; @property (nonatomic, assign) id delegate; - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation; - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error; @end // // MyCLController.m // mapCurrentLocation // // Created by mac on 18/11/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import "MyCLController.h" @implementation MyCLController @synthesize locationManager; @synthesize delegate; - (id) init { self = [super init]; if (self != nil) { self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; // send loc updates to myself } return self; } - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { // NSLog(@"Location: %@", [newLocation description]); [self.delegate locationUpdate:newLocation]; } - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { //NSLog(@"Error: %@", [error description]); [self.delegate locationError:error]; } - (void)dealloc { [self.locationManager release]; [super dealloc]; } @end and here i am using this class-- #import "mapCurrentLocationViewController.h" @implementation mapCurrentLocationViewController /* // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } */ - (void)viewDidLoad { locationController = [[MyCLController alloc] init]; locationController.delegate = self; [locationController.locationManager startUpdatingLocation]; } - (void)locationUpdate:(CLLocation *)location { locationLabel.text = [location description]; } - (void)locationError:(NSError *)error { locationLabel.text = [error description]; } - (void)dealloc { [locationController release]; [super dealloc]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload