Remove all GMSMarker from GMSMapView? Remove all GMSMarker from GMSMapView? ios ios

Remove all GMSMarker from GMSMapView?


Use [mapView clear] to achieve required functionality. :-)

Update:

Swift:

mapView.clear()


They deprecated those methods but you can use [mapView clear] to remove all overlays from the map. This includes all markers, polylines and groundOverlays.

Hope it helps!


Add all markers into NSMutableArray, as you add them to the map. Then when you need to remove them, iterate through the array and set each marker's .map property to nil.