开发者

How to remove the "result" overlays but not the "current position" overlay

开发者 https://www.devze.com 2023-04-08 06:12 出处:网络
I my application there is button \"show me\",and a spinner to choose radius ,and one button \"search\" to search results,,

I my application there is button "show me",and a spinner to choose radius ,and one button "search" to search results,, my problem i that when i tap on "show me" it shows the overlay at current location and when i search after choosing radius it shows the results in the map with overlays but my current position overlay removes..because i am using

List<Overlay>开发者_高级运维 mapOverlays_results;

mapOverlays_results =mapView.getOverlays();
mapOverlays_results.clear();

but if i dont use these above lines and i decrease the radius old results also seen in the map..

How to remove the result overlays but not the current position overlay.. How to solve this..?

Thanks


As you've got more than one overlay (I'm guessing two), then instead of mapOverlays_results.clear(), you should try mapOverlays_results.remove(int arg), where arg will be the index of the overlay that isn't your position.

0

精彩评论

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

关注公众号