【发布时间】:2015-09-24 14:19:03
【问题描述】:
【问题讨论】:
标签: android google-maps google-maps-android-api-2 gmsgroundoverlay
【问题讨论】:
标签: android google-maps google-maps-android-api-2 gmsgroundoverlay
有方法remove(): https://developers.google.com/android/reference/com/google/android/gms/maps/model/GroundOverlay.html#remove()
您只需要在创建地面叠加层时保留对它的引用:
GroundOverlay groundOverlay = map.addGroundOverlay(new GroundOverlayOptions()
.image(image)
.positionFromBounds(bounds)
.transparency(0.5));
然后删除:
groundOverlay.remove();
【讨论】:
GroundOverlayOptions 对象上调用 remove()。您需要在GroundOverlay 对象本身上调用remove(),当您调用addGroundOverlay() 方法时会返回该对象。