I need to clear all markers in v2 google map. And again need to add some markers. If anybody knows the answer kindly share your thoughts.
You can either use googleMap.clear(), or you can store your Markers in a collection of some kind and remove them in a loop:
private ArrayList<Marker> mMarkers;
...
private void removeMarkers() {
for (Marker marker: mMarkers) {
marker.remove();
}
mMarkers.clear();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With