Paul Alexander
Paul Alexander

Reputation: 2748

Android - Google maps V2 - Removing a groundoverlay

My app uses google maps v2, I add a groundoverlay to my map. Does anyone know how I can remove this overlay?

Thanks

.remove() doesn't seem to available

enter image description here

Upvotes: 1

Views: 2157

Answers (1)

N Dorigatti
N Dorigatti

Reputation: 3540

there is the method remove(): https://developers.google.com/android/reference/com/google/android/gms/maps/model/GroundOverlay.html#remove()

You just have to keep a reference to the ground overlay when you create it:

 GroundOverlay groundOverlay = map.addGroundOverlay(new GroundOverlayOptions()
     .image(image)
     .positionFromBounds(bounds)
     .transparency(0.5));

then remove:

groundOverlay.remove();

Upvotes: 5

Related Questions