Skip to content

Instantly share code, notes, and snippets.


espritm/MainActivity.cs Secret

Created Apr 6, 2017
What would you like to do?
public class MainActivity : AppCompatActivity, IOnMapReadyCallback, ClusterManager.IOnClusterItemInfoWindowClickListener
private ClusterRenderer m_ClusterRenderer;
public void OnMapReady(GoogleMap map)
m_map = map;
//Initialize cluster manager. Setting the CameraIdleListener is mandatory
m_ClusterManager = new ClusterManager(this, m_map);
//Initialize cluster renderer, and keep a reference that will be usefull for the info window's click event
m_ClusterRenderer = new ClusterRenderer(this, m_map, m_ClusterManager);
m_ClusterManager.Renderer = m_ClusterRenderer;
//Custom info window : single markers only (a click on a cluster marker should not show info window)
m_ClusterManager.MarkerCollection.SetOnInfoWindowAdapter(new CustomGoogleMapInfoWindow(this));
//Handle Info Window's click event
public void OnClusterItemInfoWindowClick(Java.Lang.Object p0)
//You can retrieve the ClusterItem clicked with a cast
ClusterItem itemClicked = (ClusterItem)p0;
Toast.MakeText(this, "Info Window clicked !", ToastLength.Short).Show();
//Dismiss the info window clicked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.