1

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

Paul Alexander
  • 2,686
  • 4
  • 33
  • 69

1 Answers1

5

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();
N Dorigatti
  • 3,482
  • 2
  • 22
  • 33