Authored by Justin R. Miller

fixes #150: properly clear up user location annotations on mode toggle

... ... @@ -2915,18 +2915,11 @@
[self setUserTrackingMode:RMUserTrackingModeNone animated:YES];
NSMutableArray *annotationsToRemove = [NSMutableArray array];
for (RMAnnotation *annotation in [NSArray arrayWithObjects:_trackingHaloAnnotation, _accuracyCircleAnnotation, self.userLocation, nil])
[self removeAnnotation:annotation];
for (RMAnnotation *annotation in _annotations)
{
if (annotation.isUserLocationAnnotation)
[annotationsToRemove addObject:annotation];
}
for (RMAnnotation *annotationToRemove in annotationsToRemove)
{
[self removeAnnotation:annotationToRemove];
}
[_trackingHaloAnnotation release]; _trackingHaloAnnotation = nil;
[_accuracyCircleAnnotation release]; _accuracyCircleAnnotation = nil;
self.userLocation = nil;
}
... ...