예제 #1
0
 public void DeselectAnnotation(CKAnnotation annotation, bool animated)
 {
     if (annotation == this.SelectedAnnotation)
     {
         this.SelectAnnotation(null, animated);
     }
 }
예제 #2
0
        public void RemoveAnnotation(CKAnnotation annotation)
        {
            var _annotations = this.Annotations;

            _annotations.Remove(annotation);
            this.Annotations = _annotations;
        }
예제 #3
0
 public override void RemoveAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster == this)
     {
         base.RemoveAnnotation(annotation);
         this.SetCoordinate(this.CoordinateByRemovingAnnotation(annotation));
     }
 }
예제 #4
0
 public virtual void RemoveAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster == this)
     {
         this.Annotations.Remove(annotation);
         annotation.Cluster = null;
     }
 }
예제 #5
0
 public override void AddAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster != this)
     {
         var index = this.Annotations.IndexOf(annotation);
         this.Annotations.Insert(index, annotation);
         this.SetCoordinate(this.Annotations[0].Coordinate);
     }
 }
예제 #6
0
 public override void RemoveAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster == this)
     {
         this.Annotations.Remove(annotation);
         annotation.Cluster = null;
         this.SetCoordinate(this.Annotations[0].Coordinate);
     }
 }
예제 #7
0
        public bool AnnotationTree(ICKAnnotationTree annotationTree, CKAnnotation annotation)
        {
            if (annotation == this.SelectedAnnotation)
            {
                return(false);
            }

            return(this.Delegate?.ClusterManager(this, annotation) ?? true);
        }
예제 #8
0
 public override void AddAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster != this)
     {
         annotation.Cluster = this;
         this.Annotations.Add(annotation);
         this.center = this.CoordinateByAddingAnnotation(annotation);
         this.SetCoordinate(this.CoordinateByDistanceSort());
     }
 }
예제 #9
0
 public override void RemoveAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster == this)
     {
         this.Annotations.Remove(annotation);
         annotation.Cluster = null;
         this.center        = this.CoordinateByRemovingAnnotation(annotation);
         this.SetCoordinate(this.CoordinateByDistanceSort());
     }
 }
예제 #10
0
        protected CLLocationCoordinate2D CoordinateByRemovingAnnotation(CKAnnotation annotation)
        {
            if (this.Annotations.Count < 1)
            {
                return(new CLLocationCoordinate2D());
            }

            double lat = this.Coordinate.Latitude * (this.Annotations.Count + 1);
            double lon = this.Coordinate.Longitude * (this.Annotations.Count + 1);

            lat -= annotation.Coordinate.Latitude;
            lon -= annotation.Coordinate.Longitude;
            return(new CLLocationCoordinate2D(lat / this.Annotations.Count, lon / this.Annotations.Count));
        }
예제 #11
0
        protected CLLocationCoordinate2D CoordinateByAddingAnnotation(CKAnnotation annotation)
        {
            if (this.Annotations.Count < 2)
            {
                return(annotation.Coordinate);
            }

            double lat = this.Coordinate.Latitude * (this.Annotations.Count - 1);
            double lon = this.Coordinate.Longitude * (this.Annotations.Count - 1);

            lat += annotation.Coordinate.Latitude;
            lon += annotation.Coordinate.Longitude;
            return(new CLLocationCoordinate2D(lat / this.Annotations.Count, lon / this.Annotations.Count));
        }
예제 #12
0
 public void SelectAnnotation(CKAnnotation annotation, bool animated, CKCluster cluster = null)
 {
     if (annotation != null)
     {
         if (annotation.Cluster == null || annotation.Cluster.Annotations.Count > 1)
         {
             cluster = this.Algorithm.ClusterWithCoordinate(annotation.Coordinate);
             cluster.AddAnnotation(annotation);
             this.map.AddCluster(cluster);
         }
         else
         {
             cluster = annotation.Cluster;
         }
     }
     this.SetSelectedCluster(cluster, animated);
 }
예제 #13
0
 public void AddAnnotation(CKAnnotation annotation)
 {
     this.Annotations.Add(annotation);
     this.Annotations = this.Annotations;
 }
예제 #14
0
 public override void AddAnnotation(CKAnnotation annotation)
 {
     base.AddAnnotation(annotation);
     this.SetCoordinate(this.CoordinateByAddingAnnotation(annotation));
 }
예제 #15
0
 public virtual void AddAnnotation(CKAnnotation annotation)
 {
     annotation.Cluster = this;
     this.Annotations.Add(annotation);
 }