Remove all Overlays

烂漫一生 提交于 2019-12-12 07:37:50

问题


I have the following code to add an Overlay

myMapView.getOverlays().add(sites);
myMapView.invalidate();

I also have the following remove code where sites is a global variable.

if (sites != null) {
                // myMapView.getOverlays().clear();
                myMapView.getOverlays().remove(sites);
                myMapView.invalidate();
                sites = null;
            }

Sometimes I am left with duplicates so would like a way to remove all overlays from a map, is this possible?


回答1:


Looks like I did have the answer all along!

myMapView.getOverlays().clear()



来源:https://stackoverflow.com/questions/3696415/remove-all-overlays

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!