Skip to content

Instantly share code, notes, and snippets.

@espritm
Last active April 11, 2017 16:16
Show Gist options
  • Save espritm/2f9d16bf4e82f6833282b155fec4d561 to your computer and use it in GitHub Desktop.
Save espritm/2f9d16bf4e82f6833282b155fec4d561 to your computer and use it in GitHub Desktop.
public class ClusterRenderer : DefaultClusterRenderer
{
public Dictionary<string, ClusterItem> m_dicAllMarkerOnMap;
public ClusterRenderer(Activity context, GoogleMap map, ClusterManager clusterManager, Dictionary<string, ClusterItem> dicAllMarkerOnMap)
: base(context, map, clusterManager)
{
m_dicAllMarkerOnMap = dicAllMarkerOnMap;
//...
}
//...
//After a cluster item have been rendered to a marker
protected override void OnClusterItemRendered(Object item, Marker marker)
{
base.OnClusterItemRendered(item, marker);
ClusterItem clusterItem = (ClusterItem)item;
if (!m_dicAllMarkerOnMap.ContainsKey(marker.Id))
m_dicAllMarkerOnMap.Add(marker.Id, clusterItem);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment