CLLocationManager madeUpdateToLocation compared to MKMapView didUpdateUserLocation

I get the user location from CLLocationManager and MKMapView. Which one should be used to set the coordinates of the center of the map?

In addition, the two methods in the simulator differ in their answers. CLLocationManager returns the correct location, while MKMapview didUpdateUserLocation returns Apple's office in cupertino.

+5
source share
3 answers

I will use the MapKit location when working with the map.

; CoreLocation . MapKit , (didUpdateUserLocation , showUserLocation - MKUserTrackingModeFollowWithHeading). CoreLocation , .

, , . : MapKit, , CoreLocation , .

, iOS 5, ; Debug , fooobar.com/questions/60008/....

+2

CLLocationManager, - 1 . Dr. , startMonitoringSignificantChanges... ..

0

If you are dealing with locations in mainland China, I would recommend MapKit location. It handles the GPS offset calculation (which is added by law for national security purposes) for you. Read more about this release at https://en.wikipedia.org/wiki/Restrictions_on_geographic_data_in_China

0
source

All Articles