1.实现OnMarkerClickListener重写onMarkerClick保存当前marker
public boolean onMarkerClick(Marker paramMarker) {
currentMarker=paramMarker;
return false;
}
2实现OnMapClickListener重写
@Override
public void onMapClick(LatLng arg0) {
if(currentMarker.isInfoWindowShown()){
currentMarker.hideInfoWindow();//这个是隐藏infowindow窗口的方法
}
}