By default marker's infoWindow is closed when map is clicked. Does anyone know how I can disable this behavior?
I tried to override onMapClicked
but it doesn't work...
mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng arg0) {
//do nothing
}
});
One way to do it would be to keep a class variable that specifies the marker currently selected. You would set it in the onMarkerClick() method. Call it, say, currentMarker. Putting
currentMarker.showInfoWindow();
in the onMapClick() method should then do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With