I am using a customize InfoWindow in Google Map using InfoWindowAdapter. Every time I click on a marker, it moves to the center of the mobile screen and open the info window. I was wondering if it is possible to stop the marker movement from the current location to the center. I am using the following code:
googleMap.setInfoWindowAdapter(new UserInfoWindowAdapter(getLayoutInflater()));
googleMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
@Override
public void onInfoWindowClick(Marker marker) {
//other Code
}
});
Ok first the code:
mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
Marker mLastMarker;
@Override
public boolean onMarkerClick(Marker marker) {
if (marker.equals(mLastMarker)) {
// Same marker clicked twice - hide InfoWindow
mLastMarker = null;
marker.hideInfoWindow();
} else {
mLastMarker = marker;
marker.showInfoWindow();
}
return true;
}
});
Secondly the functionality that the above code provides:
return true;
)isInfoWindowShown
functionality as there is a known bug to that methodGood luck!