3

Is it possible to make the infowindow of a marker not clickable? I was able to make the Marker not clickable or make the infowindow dissapear with a click

OnInfoWindowClickListener InfoWindowListener = new OnInfoWindowClickListener(){ 
    @Override
    public void onInfoWindowClick(Marker marker) {
        marker.hideInfoWindow();
    }};

but none of them is really what I want. I can image that creating a custom Infowindow can be the solution, but I'm wondering if there is a faster/easier way to achieve this.

Community
  • 1
  • 1
AlvaroSantisteban
  • 5,256
  • 4
  • 41
  • 62

1 Answers1

0

You can do the following: Just create a HashMap with the marker.getId() and the "clickable" or not "clickable" as the second value.

So whenever you add a mapper in your map just insert:

clickableMarkers.put(currentMarker.getId(), CLICKABLE);

and in your InfoWindowClick method do the following check:

if (clickableMarkers.get(marker.getId()).equals(CLICKABLE)){
    //Do whatever you want with clickable info windows
}else{
    //Do whatever you want with non clickable info windows
}
arniotaki
  • 2,175
  • 2
  • 23
  • 26