public override string MapClusterTitleForAnnotation(CCHMapClusterController mapClusterController, CCHMapClusterAnnotation mapClusterAnnotation) { return string.Format("{0} annotations", mapClusterAnnotation.Annotations.Count); }
public string SubtitleForMapClusterAnnotation(CCHMapClusterController mapClusterController, CCHMapClusterAnnotation mapClusterAnnotation) { System.Diagnostics.Debug.WriteLine($"clusterAnnotation.Annotations.Count: {mapClusterAnnotation.Annotations.Count}"); var numAnnotations = (int)Math.Min(mapClusterAnnotation.Annotations.Count, 5); var titleKey = new NSString("title"); var annotations = mapClusterAnnotation.Annotations.Skip(0).Take(numAnnotations) .Select(x => x.ValueForKey(titleKey)); return(string.Join(", ", annotations)); }
public void WillReuseMapClusterAnnotation(CCHMapClusterController mapClusterController, CCHMapClusterAnnotation mapClusterAnnotation) { var clusterAnnotationView = (ClusterAnnotationView)mapView.ViewForAnnotation(mapClusterAnnotation); if (clusterAnnotationView == null) { return; } System.Diagnostics.Debug.WriteLine($"WillReuseMapClusterAnnotation: {mapClusterAnnotation.Annotations.Count}"); clusterAnnotationView.Count = (uint)mapClusterAnnotation.Annotations.Count; clusterAnnotationView.UniqueLocation = mapClusterAnnotation.IsUniqueLocation; }
public string TitleForMapClusterAnnotation(CCHMapClusterController mapClusterController, CCHMapClusterAnnotation mapClusterAnnotation) { var annotationsCount = mapClusterAnnotation.Annotations.Count; var unit = annotationsCount > 1 ? "annotations" : "annotation"; return($"{annotationsCount} {unit}"); }