开发者

Remove all Overlays

开发者 https://www.devze.com 2023-01-16 01:33 出处:网络
I have the following code to add a开发者_C百科n Overlay myMapView.getOverlays().add(sites); myMapView.invalidate();

I have the following code to add a开发者_C百科n 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?


Looks like I did have the answer all along!

myMapView.getOverlays().clear()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号