Tell me more ×  I have a MKMapView with a MKOverlay over it
showing the location history of the user. On a button press, how
can I discard this overlay and remove it from view?  I have
tried [map removeOverlay:overlay]; but that doesn't work - it
still shows.  share|improve this question How is the overlay
variable set or obtained? If you log map.overlays.count before
and after the remove, what does it show? –  Anna Nov 3 '11 at
20:59 add comment  2 Answers  up vote 5 down vote accepted  This
will work  NSArray *pointsArray = [mapView overlays];  [mapView
removeOverlays:pointsArray]; share|improve this answer Worked!
Thank you! –  James Nov 4 '11 at 17:07 add comment  Just to add
that, for my iPad application, I needed to add an extra line to
the solution shown above:    NSArray *pointsArray =
[self.mapView overlays];   [self.mapView
removeOverlays:pointsArray];    self.mapOverlayView = nil;
Without setting mapOverlayView to nil, the "removeOverlays" call
didn't seem to do much (?)  share|improve this answer