private static void downloadTiles(GeoCoord topLeft, GeoCoord bottomRight, int startScale, Theme theme, bool themeIsColor, bool andUp)
 {
     for (int scale = startScale; scale <= 16; scale++)
     {
         TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, theme, themeIsColor);
         layout.queryDisconnected();
         if (!andUp)
         {
             break;
         }
     }
 }
        /// <summary>
        /// lists tiles at all levels, starting with startScale and up
        /// </summary>
        /// <param name="topLeft"></param>
        /// <param name="bottomRight"></param>
        /// <param name="startScale"></param>
        public static int listTilesAtLevels(Hashtable list, GeoCoord topLeft, GeoCoord bottomRight, int startScale, bool andUp)
        {
            int   levels = 0;
            Theme theme;
            bool  themeIsColor;

            switch (Project.drawTerraserverMode)
            {
            default:
            case "aerial":
                theme        = Theme.Photo;
                themeIsColor = false;
                break;

            case "color aerial":
                theme        = Theme.Photo;
                themeIsColor = true;
                break;

            case "topo":
                theme        = Theme.Topo;
                themeIsColor = false;
                break;

            case "relief":
                theme        = Theme.Relief;
                themeIsColor = false;
                break;
            }

            for (int scale = startScale; scale <= 16; scale++)
            {
                TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, theme, themeIsColor);
                layout.listQueryDisconnected(list);
                levels++;
                if (!andUp)
                {
                    break;
                }
            }
            return(levels);
        }
        public static void listTilesAtLevelsWithType(Hashtable list, GeoCoord topLeft, GeoCoord bottomRight,
                                                     int startScale, bool andUp, bool doAerial, bool doColor, bool doTopo)
        {
            if (doAerial)
            {
                for (int scale = startScale; scale <= 16; scale++)
                {
                    TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, Theme.Photo, false);
                    layout.listQueryDisconnected(list);
                    if (!andUp)
                    {
                        break;
                    }
                }
            }

            if (doColor)
            {
                for (int scale = startScale; scale <= 16; scale++)
                {
                    TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, Theme.Photo, true);
                    layout.listQueryDisconnected(list);
                    if (!andUp)
                    {
                        break;
                    }
                }
            }

            if (doTopo)
            {
                for (int scale = startScale; scale <= 16; scale++)
                {
                    TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, Theme.Topo, false);
                    layout.listQueryDisconnected(list);
                    if (!andUp)
                    {
                        break;
                    }
                }
            }
        }
 private static void downloadTiles(GeoCoord topLeft, GeoCoord bottomRight, int startScale, Theme theme, bool themeIsColor, bool andUp)
 {
     for(int scale=startScale; scale <= 16 ;scale++)
     {
         TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, theme, themeIsColor);
         layout.queryDisconnected();
         if(!andUp)
         {
             break;
         }
     }
 }
        public static void listTilesAtLevelsWithType(Hashtable list, GeoCoord topLeft, GeoCoord bottomRight,
			int startScale, bool andUp, bool doAerial, bool doColor, bool doTopo)
        {
            if(doAerial)
            {
                for(int scale=startScale; scale <= 16 ;scale++)
                {
                    TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, Theme.Photo, false);
                    layout.listQueryDisconnected(list);
                    if(!andUp)
                    {
                        break;
                    }
                }
            }

            if(doColor)
            {
                for(int scale=startScale; scale <= 16 ;scale++)
                {
                    TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, Theme.Photo, true);
                    layout.listQueryDisconnected(list);
                    if(!andUp)
                    {
                        break;
                    }
                }
            }

            if(doTopo)
            {
                for(int scale=startScale; scale <= 16 ;scale++)
                {
                    TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, Theme.Topo, false);
                    layout.listQueryDisconnected(list);
                    if(!andUp)
                    {
                        break;
                    }
                }
            }
        }
        /// <summary>
        /// lists tiles at all levels, starting with startScale and up
        /// </summary>
        /// <param name="topLeft"></param>
        /// <param name="bottomRight"></param>
        /// <param name="startScale"></param>
        public static int listTilesAtLevels(Hashtable list, GeoCoord topLeft, GeoCoord bottomRight, int startScale, bool andUp)
        {
            int levels = 0;
            Theme theme;
            bool themeIsColor;

            switch(Project.drawTerraserverMode)
            {
                default:
                case "aerial":
                    theme = Theme.Photo;
                    themeIsColor = false;
                    break;
                case "color aerial":
                    theme = Theme.Photo;
                    themeIsColor = true;
                    break;
                case "topo":
                    theme = Theme.Topo;
                    themeIsColor = false;
                    break;
                case "relief":
                    theme = Theme.Relief;
                    themeIsColor = false;
                    break;
            }

            for(int scale=startScale; scale <= 16 ;scale++)
            {
                TileSetTerraLayout layout = new TileSetTerraLayout(topLeft, bottomRight, 0.0d, scale, theme, themeIsColor);
                layout.listQueryDisconnected(list);
                levels++;
                if(!andUp)
                {
                    break;
                }
            }
            return levels;
        }