Beispiel #1
0
        /// <summary>
        /// gets all tiles in rect at specific zoom
        /// </summary>
        public List <GPoint> GetAreaTileList(RectLatLng rect, int zoom, int padding)
        {
            List <GPoint> ret = new List <GPoint>();

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

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

            return(ret);
        }