Reputation: 217
I am able to display markers using google map v2. Now I want to remove a single marker but unable to do it. I tried using clear method but it removes all the markers.
Upvotes: 1
Views: 123
Reputation: 1244
trythis
List<Overlay> mapOverlays = mapView.getOverlays();
.....
.....
mapOverlays.remove(position);
Upvotes: 0
Reputation: 18978
if you are using
Marker _marker = map.addMarker(new MarkerOptions()
.position(new LatLng(37.7750, 122.4183))
.title("San Francisco")
.snippet("Population: 776733"));
for remove marker
_marker.remove();
Removes this marker from the map. After a marker has been removed, the behavior of all its methods is undefined.
Upvotes: 1