Sandip
Sandip

Reputation: 43

how to remove all markers and polyline from google map in android?

I had already try to use googleMap.remove() and route.remove() it will remove everything but when I recreate it it will show double markers. How can I remove all markers and polyline and recreate markers and polyline in Android?

Upvotes: 0

Views: 1001

Answers (2)

Geekfreak
Geekfreak

Reputation: 13

Just do one thing polyline.setMap(null), which will remove the lines from the google map and please find the below documentation for more clarification:

Upvotes: 0

Cuong Nguyen
Cuong Nguyen

Reputation: 1018

You clear googleMap and old data list, Example

googleMap.clear();
markerList.clear();

Upvotes: 2

Related Questions