KarunaKaran,
GetMarkers method count the markers in the feature you pass in, if you use the markerOverlay.Features, that means all features in your map.
Please have a look at the code below, but it still exist a problem that we can't get the right feature contains many markers.
protected void Map1_Click(object sender, MapClickedEventArgs e)
{
InMemoryMarkerOverlay staticOverlay = (InMemoryMarkerOverlay)Map1.CustomOverlays["MarkerOverlay"];
staticOverlay.FeatureSource.Open();
Collection<Feature> selectedFeatures = staticOverlay.FeatureSource.GetFeaturesNearestTo(e.Position, GeographyUnit.DecimalDegree, 1, ReturningColumnsType.AllColumns);
staticOverlay.FeatureSource.Close();
ClusterMarkerStyle clusterMarkerStyle = new ClusterMarkerStyle();
clusterMarkerStyle.MarkerStyle = new PointMarkerStyle();
CloudPopup popup;
if (Map1.Popups.Count == 0)
{
popup = new CloudPopup("Popup", e.Position, string.Empty, 260, 60);
popup.IsVisible = true;
Map1.Popups.Add(popup);
}
else
{
popup = (CloudPopup)Map1.Popups["Popup"];
popup.Position = e.Position;
}
popup.ContentHtml = clusterMarkerStyle.GetMarkers(selectedFeatures).Count.ToString();
}
I think we can't achieve your requirement just easy use GetMarkers. I will working on this and find a workaround.
Regards,
Gary