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); }
static RectLatLng() { Empty = new RectLatLng(); }
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))); }
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))); }