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

            _annotations.Remove(annotation);
            this.Annotations = _annotations;
        }
Beispiel #3
0
 public override void RemoveAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster == this)
     {
         base.RemoveAnnotation(annotation);
         this.SetCoordinate(this.CoordinateByRemovingAnnotation(annotation));
     }
 }
Beispiel #4
0
 public virtual void RemoveAnnotation(CKAnnotation annotation)
 {
     if (annotation.Cluster == this)
     {
         this.Annotations.Remove(annotation);
         annotation.Cluster = null;
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #7
0
        public bool AnnotationTree(ICKAnnotationTree annotationTree, CKAnnotation annotation)
        {
            if (annotation == this.SelectedAnnotation)
            {
                return(false);
            }

            return(this.Delegate?.ClusterManager(this, annotation) ?? true);
        }
Beispiel #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());
     }
 }
Beispiel #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());
     }
 }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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);
 }
Beispiel #13
0
 public void AddAnnotation(CKAnnotation annotation)
 {
     this.Annotations.Add(annotation);
     this.Annotations = this.Annotations;
 }
Beispiel #14
0
 public override void AddAnnotation(CKAnnotation annotation)
 {
     base.AddAnnotation(annotation);
     this.SetCoordinate(this.CoordinateByAddingAnnotation(annotation));
 }
Beispiel #15
0
 public virtual void AddAnnotation(CKAnnotation annotation)
 {
     annotation.Cluster = this;
     this.Annotations.Add(annotation);
 }