コード例 #1
0
 public override string MapClusterTitleForAnnotation(CCHMapClusterController mapClusterController, CCHMapClusterAnnotation mapClusterAnnotation)
 {
     return string.Format("{0} annotations", mapClusterAnnotation.Annotations.Count);
 }
コード例 #2
0
        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));
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        public string TitleForMapClusterAnnotation(CCHMapClusterController mapClusterController, CCHMapClusterAnnotation mapClusterAnnotation)
        {
            var annotationsCount = mapClusterAnnotation.Annotations.Count;
            var unit             = annotationsCount > 1 ? "annotations" : "annotation";

            return($"{annotationsCount} {unit}");
        }