How to remove marker from google map v2?

后端 未结 1 1423
眼角桃花
眼角桃花 2020-12-22 05:05

I have an alerdialog that pops up when tapping on the marker with two options, on of the options are to remove the marker. Now this works perfectly, except the user taps o

相关标签:
1条回答
  • 2020-12-22 05:16

    Your marker.remove() code does not work?

    Or say what is your actual problem?

    set All markder within a variable like

    HashMap<Integer, Marker> myMarkersHash = new HashMap<Integer, Marker>();
    

    and put marker value

    myMarkersHash.put(IndexValue, marker);
    

    and to show/Hide marker use this code

        myMarkersHash.get(IndexValue).setVisible(false);
    // or
       myMarkersHash.get(IndexValue).setVisible(true);
    
    0 讨论(0)
提交回复
热议问题