Remove all GMSMarker from GMSMapView?

user3021529 picture user3021529 · Nov 22, 2013 · Viewed 14.6k times · Source

I placed 100 GMSMarkers on GMSMapView. How to remove all the GMSMarkers?

In Google Sdk Version 1.6 for iOS.

Marker array(in GMSMapView (Overlays) file) which will be holding the GMSMarkers list is deprecated. By using this i was removing all GMSMarker from GMSMapView.

Is there any other way to remove all GMSMarker from GMSMapView in iOS?

Answer

Waleed Mahmood picture Waleed Mahmood · Dec 5, 2013

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

Update:

Swift:

mapView.clear()