I am planning to use the google maps marker clustering available in the utils library, but the google example app only shows marker clusters without any infoWindow. I am won
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
mClusterManager = new ClusterManager<>(this, mMap);
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(51.503186, -0.126446), 10));
mMap.setOnCameraChangeListener(mClusterManager);
mMap.setInfoWindowAdapter(new InfoWindowAdapter() {
/**
* View for displaying marker popup, if null default framework view would be used
*/
@Override
public View getInfoWindow(Marker marker) {
return null;
}
/**
* For changing the content of infowindow
* Called when showMarkerInfo method is called
*/
@Override
public View getInfoContents(Marker marker) {
View v = getLayoutInflater().inflate(R.layout.view_to_inflate, null);
//code for initializing view part
return v;
}
});
readItems();
}