How to hide/show groups of markers by category with Google Maps in Android?

后端 未结 3 877
说谎
说谎 2021-01-12 19:46

I\'m looking to do something like what is done right here in Android. What I need to do is group markers into different groups and have checkboxes to each group.

W

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 19:58

    You have to take array list of marker depend on category,

     ArrayList category1=new ArrayList<>();
     ArrayList category2=new ArrayList<>();
    

    than add your maker on this array list, after remove on click event plz write this

    for (int i=0; i< category1.size(); i++){
            category1.get(i).setVisibility(false);
        }
    

    i think this is helpfull

提交回复
热议问题