示例#1
0
        public static void GetInRange(CKNode node, MKMapRect range, Action <IMKAnnotation> find)
        {
            if (node.Count != null)
            {
                if (MKMapRect.Intersects(node.Bound, range) == false)
                {
                    return;
                }

                CKPoint point = node.Points;
                while (point != null)
                {
                    if (range.Contains(point.Point))
                    {
                        find?.Invoke(point.Annotation);
                    }

                    point = point.Next;
                }
            }

            if (node.NW != null)
            {
                CKNode.GetInRange(node.NW, range, find);
                CKNode.GetInRange(node.NE, range, find);
                CKNode.GetInRange(node.SW, range, find);
                CKNode.GetInRange(node.SE, range, find);
            }
        }
示例#2
0
 public static void FindInRange(CKTree tree, MKMapRect range, Action <IMKAnnotation> find)
 {
     CKNode.GetInRange(tree.Root, range, find);
 }