Example #1
0
        public List <Point> GetAreaTileList(RectLatLng rect, int zoom, int padding)
        {
            List <Point> ret = new List <Point>();

            Point topLeft     = FromPixelToTileXY(FromLatLngToPixel(rect.LocationTopLeft, zoom));
            Point rightBottom = FromPixelToTileXY(FromLatLngToPixel(rect.LocationRightBottom, zoom));

            for (int x = (topLeft.X - padding); x <= (rightBottom.X + padding); x++)
            {
                for (int y = (topLeft.Y - padding); y <= (rightBottom.Y + padding); y++)
                {
                    Point p = new Point(x, y);
                    if (!ret.Contains(p) && p.X >= 0 && p.Y >= 0)
                    {
                        ret.Add(p);
                    }
                }
            }
            ret.TrimExcess();

            return(ret);
        }
Example #2
0
 static RectLatLng()
 {
     Empty = new RectLatLng();
 }
Example #3
0
 public bool IntersectsWith(RectLatLng rect)
 {
     return((((rect.Lng < (this.Lng + this.WidthLng)) && (this.Lng < (rect.Lng + rect.WidthLng))) && (rect.Lat < (this.Lat + this.HeightLat))) && (this.Lat < (rect.Lat + rect.HeightLat)));
 }
Example #4
0
 public bool Contains(RectLatLng rect)
 {
     return((((this.Lng <= rect.Lng) && ((rect.Lng + rect.WidthLng) <= (this.Lng + this.WidthLng))) && (this.Lat >= rect.Lat)) && ((rect.Lat - rect.HeightLat) >= (this.Lat - this.HeightLat)));
 }