Clear markers from Google Map in Android

Ashish Kasma picture Ashish Kasma · Mar 27, 2013 · Viewed 68.4k times · Source

I have added map on fragment activity and added several marker using addMarker function, but i am able to remove all markers , I am getting notification for different list of markers,

Now i wants to remove all markers and add new one.

one way to keep all markers in list and remove one by one, (marker.remove())

Is there any better way to clear all marker.

Answer

CommonsWare picture CommonsWare · Mar 27, 2013

If you want to clear "all markers, overlays, and polylines from the map", use clear() on your GoogleMap.