I have a weird issue (concerning the displaying of my current location) with the call of the method of MKMapView
:
- (void)setUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated
My map well display my location with the blue dot, but there is an issue occuring "sometimes" with the center and zooming features of this method :
- Sometimes the view start zooming and then it quickly come back to it's start position, so the view is not centered and zoomed on my current location.
- The other times it works : the view is centered and zoomed on my current location.
Note that this issue has not the same occurence between Simulator/iPhone(5). On my iPhone, this issue only happen when I launch the view for the 1st time. And sometimes, at the 1st time, it works…
See the screen when it works, it's well centered :
And when the trouble occurs :
In the viewDidLoad of my MKMapView, I placed :
[map setUserTrackingMode:MKUserTrackingModeFollowWithHeading animated:YES];
NOTE: map
has been synthesized.
I also checked in the method :
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
NSLog(@"didUpdateUserLocation : lat : %f, long : %f", userLocation.location.coordinate.latitude,
userLocation.location.coordinate.longitude);
}
And the coordinates are the good ones (thoses of my current location).
I searched and searched on the site, but I couldn't find my answer.
Anyone experienced the same issue ?
I wanted to know if it's a bug or an error from me.
Thanks for ideas and help.
EDIT : A new behaviour just appeared : after have quickly moved back to the starting display location (my issue), the view centered and zoomed on my current position as soon as it moved back !..
And sometimes i get the interference message like there : http://hillcrestlabs.com/makingmotion/wp-content/uploads/2012/06/compass-interference-v2.png.
Maybe my theses issues have a link with this interference problem ?
I tried to get away with my iPhone from computers and working room but the issue is still here… Should I go farther ?