I have MKMapView with MKUserTrackingBarButtonItem . The user's current location should only be displayed in Follow or FollowWithHeading . The implementation is as follows:
- (void)mapView:(MKMapView *)mapView didChangeUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated { [mapView setShowsUserLocation:(mode != MKUserTrackingModeNone)]; }
This is the only place in my code where setShowsUserLocation is setShowsUserLocation and works as expected when MKUserTrackingBarButtonItem .
My problem arises when the UserTrackingMode changed by dragging the map: in this case the blue dot annotation disappears as intended, but in about 20% of cases it appears when the dragging is completed.
If you then check the map showsUserLocation property, it will always be NO, even though the blue dot annotation is visible.
I would be very grateful for the help if you know how to solve this.
source share