Clear markers from Google Map in Android

百般思念 提交于 2019-11-27 12:36:54

问题


I have added map on fragment activity and added several marker using addMarker function, but i am able to remove all markers , I am getting notification for different list of markers,

Now i wants to remove all markers and add new one.

one way to keep all markers in list and remove one by one, (marker.remove())

Is there any better way to clear all marker.


回答1:


If you want to clear "all markers, overlays, and polylines from the map", use clear() on your GoogleMap.



来源:https://stackoverflow.com/questions/15663793/clear-markers-from-google-map-in-android

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