[mapguide-commits] r8118 - in trunk/Tools/Maestro: Maestro.Editors/MapDefinition MgCooker MgCooker.Cmd OSGeo.MapGuide.MaestroAPI/Tile

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed May 7 01:13:21 PDT 2014


Author: jng
Date: 2014-05-07 01:13:21 -0700 (Wed, 07 May 2014)
New Revision: 8118

Modified:
   trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
   trunk/Tools/Maestro/MgCooker.Cmd/Program.cs
   trunk/Tools/Maestro/MgCooker/Program.cs
   trunk/Tools/Maestro/MgCooker/SetupRun.cs
   trunk/Tools/Maestro/MgCooker/SetupRun.designer.cs
   trunk/Tools/Maestro/MgCooker/SetupRun.resx
   trunk/Tools/Maestro/MgCooker/Strings.Designer.cs
   trunk/Tools/Maestro/MgCooker/Strings.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs
Log:
#2443: This submission includes the following changes:
 - Use provider/connectionstring instead of mapagent/username/password to identify a connection. This renders the following parameters obsolete and they have been removed
   - native-connection
   - mapagent
   - username
   - password
 - Remove the non-official (and non-working) tile generation method (eliminating #1999 and #1801).
 - Add extra mpu calculation method using IServerConnection.GetCalculator(). This method is imperfect and a warning will be shown if this method is employed.
 - Extra constant-ification of parameters

Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -32,6 +32,7 @@
 using Maestro.Editors.Generic;
 using OSGeo.MapGuide.MaestroAPI;
 using OSGeo.MapGuide.MaestroAPI.Resource;
+using OSGeo.MapGuide.MaestroAPI.Tile;
 
 namespace Maestro.Editors.MapDefinition
 {
@@ -1908,9 +1909,9 @@
             }
 
             _edSvc.RunProcess("MgCooker",
-                              "--provider=Maestro.Http",
-                              "--connection-params=\"Url=" + conn.GetCustomProperty("BaseUrl").ToString() + ";SessionId=" + conn.SessionID + "\"",
-                              "--mapdefinitions=" + _edSvc.ResourceID);
+                              "--" + TileRunParameters.PROVIDER + "=Maestro.Http",
+                              "--" + TileRunParameters.CONNECTIONPARAMS + "=\"Url=" + conn.GetCustomProperty("BaseUrl").ToString() + ";SessionId=" + conn.SessionID + "\"",
+                              "--" + TileRunParameters.MAPDEFINITIONS + "=" + _edSvc.ResourceID);
         }
 
         private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)

Modified: trunk/Tools/Maestro/MgCooker/Program.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/Program.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker/Program.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -70,9 +70,6 @@
 
             Boolean cmdLineMode = false;
             
-            string mapagent = "http://localhost/mapguide";
-            string username = "Anonymous";
-            string password = "";
             string mapdefinitions = "";
             string scaleindex = "";
             string basegroups = "";
@@ -90,12 +87,6 @@
             
             List<string> largs = new List<string>(args);
             Dictionary<string, string> opts = CommandLineParser.ExtractOptions(largs);
-            if (opts.ContainsKey(TileRunParameters.MAPAGENT))
-                mapagent = opts[TileRunParameters.MAPAGENT];
-            if (opts.ContainsKey(TileRunParameters.USERNAME))
-                username = opts[TileRunParameters.USERNAME];
-            if (opts.ContainsKey(TileRunParameters.PASSWORD))
-                password = opts[TileRunParameters.PASSWORD];
             if (opts.ContainsKey(TileRunParameters.MAPDEFINITIONS))
                 mapdefinitions = opts[TileRunParameters.MAPDEFINITIONS];
             if (opts.ContainsKey(TileRunParameters.SCALEINDEX))
@@ -160,64 +151,35 @@
 
             string[] maps = mapdefinitions.Split(',');
 
-            SetupRun sr = null;
-            if (!opts.ContainsKey(TileRunParameters.USERNAME) || (!opts.ContainsKey(TileRunParameters.MAPAGENT)))
+            if (opts.ContainsKey(TileRunParameters.PROVIDER) && opts.ContainsKey(TileRunParameters.CONNECTIONPARAMS))
             {
-                if (!cmdLineMode)
+                var initP = ConnectionProviderRegistry.ParseConnectionString(opts[TileRunParameters.CONNECTIONPARAMS]);
+                connection = ConnectionProviderRegistry.CreateConnection(opts[TileRunParameters.PROVIDER], initP);
+            }
+            else
+            {
+                if (cmdLineMode)
                 {
-                    if (opts.ContainsKey(TileRunParameters.PROVIDER) && opts.ContainsKey(TileRunParameters.CONNECTIONPARAMS))
-                    {
-                        var initP = ConnectionProviderRegistry.ParseConnectionString(opts[TileRunParameters.CONNECTIONPARAMS]);
-                        connection = ConnectionProviderRegistry.CreateConnection(opts[TileRunParameters.PROVIDER], initP);
-                        sr = new SetupRun(connection, maps, opts);
-                    }
-                    else
-                    {
-                        var frm = new LoginDialog();
-                        if (frm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
-                            return;
-
-                        connection = frm.Connection;
-                        sr = new SetupRun(frm.Username, frm.Password, connection, maps, opts);
-                    }
-                    try
-                    {
-                        mapagent = connection.GetCustomProperty("BaseUrl").ToString();
-                    }
-                    catch { }
-                    
+                    throw new ArgumentException(string.Format(Strings.MissingRequiredConnectionParameters, TileRunParameters.PROVIDER, TileRunParameters.CONNECTIONPARAMS));
                 }
+
+                var frm = new LoginDialog();
+                if (frm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
+                    return;
+
+                connection = frm.Connection;
             }
 
             if (connection == null)
             {
-                var initP = new NameValueCollection();
-                if (!opts.ContainsKey(TileRunParameters.NATIVECONNECTION))
+                if (opts.ContainsKey(TileRunParameters.PROVIDER) && opts.ContainsKey(TileRunParameters.CONNECTIONPARAMS))
                 {
-                    initP["Url"] = mapagent;
-                    initP["Username"] = username;
-                    initP["Password"] = password;
-                    initP["Locale"] = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
-                    initP["AllowUntestedVersion"] = "true";
-
-                    connection = ConnectionProviderRegistry.CreateConnection("Maestro.Http", initP);
-                }
-                else if (opts.ContainsKey(TileRunParameters.PROVIDER) && opts.ContainsKey(TileRunParameters.CONNECTIONPARAMS))
-                {
-                    initP = ConnectionProviderRegistry.ParseConnectionString(opts[TileRunParameters.CONNECTIONPARAMS]);
-
+                    var initP = ConnectionProviderRegistry.ParseConnectionString(opts[TileRunParameters.CONNECTIONPARAMS]);
                     connection = ConnectionProviderRegistry.CreateConnection(opts[TileRunParameters.PROVIDER], initP);
                 }
                 else
                 {
-                    string serverconfig = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "webconfig.ini");
-
-                    initP["ConfigFile"] = serverconfig;
-                    initP["Username"] = username;
-                    initP["Password"] = password;
-                    initP["Locale"] = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
-
-                    connection = ConnectionProviderRegistry.CreateConnection("Maestro.LocalNative", initP);
+                    throw new ArgumentException(string.Format(Strings.MissingRequiredConnectionParameters, TileRunParameters.PROVIDER, TileRunParameters.CONNECTIONPARAMS));
                 }
             }
 
@@ -225,11 +187,11 @@
 
             if (!cmdLineMode)
             {
-                if (sr == null)
-                    sr = new SetupRun(connection, maps, opts);
-
-                sr.ShowDialog();
-                return;
+                using (var sr = new SetupRun(connection, maps, opts))
+                {
+                    sr.ShowDialog();
+                    return;
+                }
             }
             
 
@@ -254,7 +216,6 @@
             if (!string.IsNullOrEmpty(metersPerUnit) && double.TryParse(metersPerUnit, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentCulture, out d))
             {
                 bx.Config.MetersPerUnit = d;
-                bx.Config.UseOfficialMethod = true;
             }
 
             if (opts.ContainsKey(TileRunParameters.RANDOMTILEORDER))

Modified: trunk/Tools/Maestro/MgCooker/SetupRun.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -53,48 +53,30 @@
             InitializeComponent();
             saveFileDialog.Filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickBat, "bat") + "|" + //NOXLATE
                                      OSGeo.MapGuide.MaestroAPI.StringConstants.AllFilesFilter; //NOXLATE
-            MapAgent.Text = "http://localhost/mapguide/mapagent/mapagent.fcgi"; //NOXLATE
-            Username.Text = "Anonymous"; //NOXLATE
         }
 
-        internal SetupRun(string userName, string password, IServerConnection connection, string[] maps, Dictionary<string, string> args)
-            : this(connection, maps, args)
-        {
-            Username.Text = userName;
-            Password.Text = password;
-        }
-
         public SetupRun(IServerConnection connection, string[] maps, Dictionary<string, string> args)
             : this()
         {
             m_connection = connection;
 
-            grpDifferentConnection.Enabled = chkUseDifferentConnection.Enabled = !m_connection.ProviderName.ToUpper().Equals("MAESTRO.LOCAL"); //NOXLATE
             m_commandlineargs = args;
             m_coordinateOverrides = new Dictionary<string, IEnvelope>();
             IEnvelope overrideExtents = null;
 
-            //HttpServerConnection hc = connection as HttpServerConnection;
-            try
-            {
-                var url = connection.GetCustomProperty("BaseUrl"); //NOXLATE
-                if (url != null)
-                    MapAgent.Text = url.ToString();
-            }
-            catch { }
-
             if (m_commandlineargs.ContainsKey(TileRunParameters.MAPDEFINITIONS)) //NOXLATE
                 m_commandlineargs.Remove(TileRunParameters.MAPDEFINITIONS); //NOXLATE
-            if (m_commandlineargs.ContainsKey(TileRunParameters.MAPAGENT)) //NOXLATE
-                MapAgent.Text = m_commandlineargs[TileRunParameters.MAPAGENT]; //NOXLATE
-            if (m_commandlineargs.ContainsKey(TileRunParameters.USERNAME)) //NOXLATE
-                Username.Text = m_commandlineargs[TileRunParameters.USERNAME]; //NOXLATE
-            if (m_commandlineargs.ContainsKey(TileRunParameters.PASSWORD)) //NOXLATE
-                Password.Text = m_commandlineargs[TileRunParameters.PASSWORD]; //NOXLATE
 
-            if (m_commandlineargs.ContainsKey(TileRunParameters.NATIVECONNECTION)) //NOXLATE
-                UseNativeAPI.Checked = true;
-
+            if (m_commandlineargs.ContainsKey(TileRunParameters.PROVIDER) && m_commandlineargs.ContainsKey(TileRunParameters.CONNECTIONPARAMS))
+            {
+                txtProvider.Text = m_commandlineargs[TileRunParameters.PROVIDER];
+                txtConnectionString.Text = m_commandlineargs[TileRunParameters.CONNECTIONPARAMS];
+            }
+            else
+            {
+                txtProvider.Text = connection.ProviderName;
+                txtConnectionString.Text = Utility.ToConnectionString(connection.CloneParameters);
+            }
             if (m_commandlineargs.ContainsKey(TileRunParameters.LIMITROWS)) //NOXLATE
             {
                 int i;
@@ -146,7 +128,6 @@
                     )
                     if (d >= (double)MetersPerUnit.Minimum && d <= (double)MetersPerUnit.Maximum)
                     {
-                        UseOfficialMethod.Checked = true;
                         MetersPerUnit.Value = (decimal)d;
                     }
             }
@@ -237,55 +218,6 @@
         private void btnBuild_Click(object sender, EventArgs e)
         {
             IServerConnection con = m_connection;
-            if (chkUseDifferentConnection.Checked)
-            {
-                if (UseNativeAPI.Checked)
-                {
-                    string webconfig = System.IO.Path.Combine(Application.StartupPath, "webconfig.ini"); //NOXLATE
-                    if (!System.IO.File.Exists(webconfig))
-                    {
-                        MessageBox.Show(this, string.Format(Strings.MissingWebConfigFile, webconfig), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        return;
-                    }
-
-                    try
-                    {
-                        var initP = new NameValueCollection();
-
-                        initP["ConfigFile"] = webconfig; //NOXLATE
-                        initP["Username"] = Username.Text; //NOXLATE
-                        initP["Password"] = Password.Text; //NOXLATE
-
-                        con = ConnectionProviderRegistry.CreateConnection("Maestro.LocalNative", initP); //NOXLATE
-                    }
-                    catch (Exception ex)
-                    {
-                        string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
-                        MessageBox.Show(this, string.Format(Strings.ConnectionError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        return;
-                    }
-                }
-                else
-                {
-                    try
-                    {
-                        var initP = new NameValueCollection();
-
-                        initP["Url"] = MapAgent.Text; //NOXLATE
-                        initP["Username"] = Username.Text; //NOXLATE
-                        initP["Password"] = Password.Text; //NOXLATE
-                        initP["AllowUntestedVersion"] = "true"; //NOXLATE
-
-                        con = ConnectionProviderRegistry.CreateConnection("Maestro.Http", initP); //NOXLATE
-                    }
-                    catch (Exception ex)
-                    {
-                        string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
-                        MessageBox.Show(this, string.Format(Strings.ConnectionError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        return;
-                    }
-                }
-            }
             try
             {
                 TilingRunCollection bx = new TilingRunCollection(con);
@@ -298,11 +230,7 @@
                         bx.LimitCols((int)MaxColLimit.Value);
                 }
 
-                if (UseOfficialMethod.Checked)
-                {
-                    bx.Config.MetersPerUnit = (double)MetersPerUnit.Value;
-                    bx.Config.UseOfficialMethod = true;
-                }
+                bx.Config.MetersPerUnit = (double)MetersPerUnit.Value;
 
                 bx.Config.ThreadCount = (int)ThreadCount.Value;
                 bx.Config.RandomizeTileSequence = RandomTileOrder.Checked;
@@ -381,10 +309,10 @@
             {
                 //Common args for all map defintions to be tiled
                 List<string> args = new List<string>();
-                args.Add("--" + TileRunParameters.MAPAGENT + "=\"" + MapAgent.Text + "\""); //NOXLATE
-                args.Add("--" + TileRunParameters.USERNAME + "=\"" + Username.Text + "\""); //NOXLATE
-                args.Add("--" + TileRunParameters.PASSWORD + "=\"" + Password.Text + "\""); //NOXLATE
 
+                args.Add("--" + TileRunParameters.PROVIDER + "=\"" + txtProvider.Text + "\""); //NOXLATE
+                args.Add("--" + TileRunParameters.CONNECTIONPARAMS + "=\"" + txtConnectionString.Text + "\""); //NOXLATE
+
                 if (LimitTileset.Checked)
                 {
                     if (MaxRowLimit.Value > 0)
@@ -393,10 +321,7 @@
                         args.Add("--" + TileRunParameters.LIMITCOLS + "=\"" + ((int)MaxColLimit.Value).ToString() + "\""); //NOXLATE
                 }
 
-                if (UseNativeAPI.Checked)
-                    args.Add("--" + TileRunParameters.NATIVECONNECTION + ""); //NOXLATE
-                if (UseOfficialMethod.Checked)
-                    args.Add("--" + TileRunParameters.METERSPERUNIT + "=" + ((double)MetersPerUnit.Value).ToString(System.Globalization.CultureInfo.InvariantCulture)); //NOXLATE
+                args.Add("--" + TileRunParameters.METERSPERUNIT + "=" + ((double)MetersPerUnit.Value).ToString(System.Globalization.CultureInfo.InvariantCulture)); //NOXLATE
 
                 args.Add("--" + TileRunParameters.THREADCOUNT + "=" + ((int)ThreadCount.Value).ToString()); //NOXLATE
                 if (RandomTileOrder.Checked)
@@ -545,12 +470,6 @@
             TilesetLimitPanel.Enabled = LimitTileset.Checked;
         }
 
-        private void UseOfficialMethod_CheckedChanged(object sender, EventArgs e)
-        {
-            OfficialMethodPanel.Enabled = lnkCalcMpu.Enabled = UseOfficialMethod.Checked;
-            MapTree_AfterSelect(null, null);
-        }
-
         private void MapTree_AfterSelect(object sender, TreeViewEventArgs e)
         {
             if (m_isUpdating)
@@ -652,6 +571,19 @@
             }
         }
 
+        enum MpuMethod
+        {
+            CreateRuntimeMap,
+            MpuCalcExe,
+            BuiltIn
+        }
+
+        class MpuCalcResult
+        {
+            public MpuMethod Method;
+            public decimal Result;
+        }
+
         private void TryCalcMpu(string mapDef)
         {
             BusyWaitDialog.Run(Strings.CalculatingMpu, () => {
@@ -662,7 +594,13 @@
                     int[] cmdTypes = m_connection.Capabilities.SupportedCommands;
                     if (Array.IndexOf(cmdTypes, (int)OSGeo.MapGuide.MaestroAPI.Commands.CommandType.CreateRuntimeMap) < 0)
                     {
-                        return Strings.NoMethodToCalculateMpu;
+                        IMapDefinition mdf = (IMapDefinition)m_connection.ResourceService.GetResource(mapDef);
+                        var calc = m_connection.GetCalculator();
+                        return new MpuCalcResult()
+                        {
+                            Method = MpuMethod.BuiltIn,
+                            Result = Convert.ToDecimal(calc.Calculate(mdf.CoordinateSystem, 1.0))
+                        };
                     }
                     else
                     {
@@ -670,7 +608,11 @@
                         create.MapDefinition = mapDef;
                         create.RequestedFeatures = (int)RuntimeMapRequestedFeatures.None;
                         var info = create.Execute();
-                        return Convert.ToDecimal(info.CoordinateSystem.MetersPerUnit);
+                        return new MpuCalcResult()
+                        {
+                            Method = MpuMethod.CreateRuntimeMap,
+                            Result = Convert.ToDecimal(info.CoordinateSystem.MetersPerUnit)
+                        };
                     }
                 }
                 else
@@ -698,7 +640,7 @@
                     string output = sb.ToString();
                     double mpu;
                     if (double.TryParse(output, out mpu))
-                        return Convert.ToDecimal(mpu);
+                        return new MpuCalcResult() { Method = MpuMethod.MpuCalcExe, Result = Convert.ToDecimal(mpu) };
                     else
                         return string.Format(Strings.FailedToCalculateMpu, output);
                 }
@@ -709,10 +651,19 @@
                 }
                 else
                 {
-                    if (res is decimal)
-                        MetersPerUnit.Value = (decimal)res;
+                    var mres = res as MpuCalcResult;
+                    if (mres != null)
+                    {
+                        MetersPerUnit.Value = mres.Result;
+                        if (mres.Method == MpuMethod.BuiltIn)
+                        {
+                            MessageBox.Show(Strings.ImperfectMpuCalculation);
+                        }
+                    }
                     else
+                    {
                         MessageBox.Show(res.ToString());
+                    }
                 }
             });
         }

Modified: trunk/Tools/Maestro/MgCooker/SetupRun.designer.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.designer.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.designer.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -49,36 +49,31 @@
             this.label10 = new System.Windows.Forms.Label();
             this.txtLowerX = new System.Windows.Forms.TextBox();
             this.label11 = new System.Windows.Forms.Label();
-            this.grpDifferentConnection = new System.Windows.Forms.GroupBox();
-            this.chkUseDifferentConnection = new System.Windows.Forms.CheckBox();
-            this.UseNativeAPI = new System.Windows.Forms.CheckBox();
-            this.Password = new System.Windows.Forms.TextBox();
-            this.Username = new System.Windows.Forms.TextBox();
-            this.MapAgent = new System.Windows.Forms.TextBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
+            this.grpGlobalSettings = new System.Windows.Forms.GroupBox();
+            this.txtConnectionString = new System.Windows.Forms.TextBox();
+            this.txtProvider = new System.Windows.Forms.TextBox();
             this.grpThreading = new System.Windows.Forms.GroupBox();
             this.RandomTileOrder = new System.Windows.Forms.CheckBox();
             this.ThreadCount = new System.Windows.Forms.NumericUpDown();
             this.label9 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
             this.grpTileSettings = new System.Windows.Forms.GroupBox();
             this.lnkCalcMpu = new System.Windows.Forms.LinkLabel();
             this.OfficialMethodPanel = new System.Windows.Forms.Panel();
             this.MetersPerUnit = new System.Windows.Forms.NumericUpDown();
             this.label8 = new System.Windows.Forms.Label();
             this.LimitTileset = new System.Windows.Forms.CheckBox();
-            this.UseOfficialMethod = new System.Windows.Forms.CheckBox();
             this.TilesetLimitPanel = new System.Windows.Forms.Panel();
             this.MaxRowLimit = new System.Windows.Forms.NumericUpDown();
             this.label6 = new System.Windows.Forms.Label();
             this.MaxColLimit = new System.Windows.Forms.NumericUpDown();
             this.label7 = new System.Windows.Forms.Label();
-            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+            this.toolTip = new System.Windows.Forms.ToolTip(this.components);
             this.panel1.SuspendLayout();
             this.panel2.SuspendLayout();
             this.BoundsOverride.SuspendLayout();
-            this.grpDifferentConnection.SuspendLayout();
+            this.grpGlobalSettings.SuspendLayout();
             this.grpThreading.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.ThreadCount)).BeginInit();
             this.grpTileSettings.SuspendLayout();
@@ -143,8 +138,7 @@
             // panel2
             // 
             this.panel2.Controls.Add(this.BoundsOverride);
-            this.panel2.Controls.Add(this.grpDifferentConnection);
-            this.panel2.Controls.Add(this.grpThreading);
+            this.panel2.Controls.Add(this.grpGlobalSettings);
             this.panel2.Controls.Add(this.grpTileSettings);
             resources.ApplyResources(this.panel2, "panel2");
             this.panel2.Name = "panel2";
@@ -168,6 +162,7 @@
             // ModfiedOverrideWarning
             // 
             resources.ApplyResources(this.ModfiedOverrideWarning, "ModfiedOverrideWarning");
+            this.ModfiedOverrideWarning.ForeColor = System.Drawing.Color.DarkRed;
             this.ModfiedOverrideWarning.Name = "ModfiedOverrideWarning";
             // 
             // ResetBounds
@@ -225,67 +220,28 @@
             resources.ApplyResources(this.label11, "label11");
             this.label11.Name = "label11";
             // 
-            // grpDifferentConnection
+            // grpGlobalSettings
             // 
-            resources.ApplyResources(this.grpDifferentConnection, "grpDifferentConnection");
-            this.grpDifferentConnection.Controls.Add(this.chkUseDifferentConnection);
-            this.grpDifferentConnection.Controls.Add(this.UseNativeAPI);
-            this.grpDifferentConnection.Controls.Add(this.Password);
-            this.grpDifferentConnection.Controls.Add(this.Username);
-            this.grpDifferentConnection.Controls.Add(this.MapAgent);
-            this.grpDifferentConnection.Controls.Add(this.label3);
-            this.grpDifferentConnection.Controls.Add(this.label2);
-            this.grpDifferentConnection.Controls.Add(this.label1);
-            this.grpDifferentConnection.Name = "grpDifferentConnection";
-            this.grpDifferentConnection.TabStop = false;
+            resources.ApplyResources(this.grpGlobalSettings, "grpGlobalSettings");
+            this.grpGlobalSettings.Controls.Add(this.txtConnectionString);
+            this.grpGlobalSettings.Controls.Add(this.txtProvider);
+            this.grpGlobalSettings.Controls.Add(this.grpThreading);
+            this.grpGlobalSettings.Controls.Add(this.label2);
+            this.grpGlobalSettings.Controls.Add(this.label1);
+            this.grpGlobalSettings.Name = "grpGlobalSettings";
+            this.grpGlobalSettings.TabStop = false;
+            this.toolTip.SetToolTip(this.grpGlobalSettings, resources.GetString("grpGlobalSettings.ToolTip"));
             // 
-            // chkUseDifferentConnection
+            // txtConnectionString
             // 
-            resources.ApplyResources(this.chkUseDifferentConnection, "chkUseDifferentConnection");
-            this.chkUseDifferentConnection.Name = "chkUseDifferentConnection";
-            this.chkUseDifferentConnection.UseVisualStyleBackColor = true;
+            resources.ApplyResources(this.txtConnectionString, "txtConnectionString");
+            this.txtConnectionString.Name = "txtConnectionString";
             // 
-            // UseNativeAPI
+            // txtProvider
             // 
-            resources.ApplyResources(this.UseNativeAPI, "UseNativeAPI");
-            this.UseNativeAPI.Name = "UseNativeAPI";
-            this.toolTip1.SetToolTip(this.UseNativeAPI, resources.GetString("UseNativeAPI.ToolTip"));
-            this.UseNativeAPI.UseVisualStyleBackColor = true;
+            resources.ApplyResources(this.txtProvider, "txtProvider");
+            this.txtProvider.Name = "txtProvider";
             // 
-            // Password
-            // 
-            resources.ApplyResources(this.Password, "Password");
-            this.Password.Name = "Password";
-            this.toolTip1.SetToolTip(this.Password, resources.GetString("Password.ToolTip"));
-            this.Password.UseSystemPasswordChar = true;
-            // 
-            // Username
-            // 
-            resources.ApplyResources(this.Username, "Username");
-            this.Username.Name = "Username";
-            this.toolTip1.SetToolTip(this.Username, resources.GetString("Username.ToolTip"));
-            // 
-            // MapAgent
-            // 
-            resources.ApplyResources(this.MapAgent, "MapAgent");
-            this.MapAgent.Name = "MapAgent";
-            this.toolTip1.SetToolTip(this.MapAgent, resources.GetString("MapAgent.ToolTip"));
-            // 
-            // label3
-            // 
-            resources.ApplyResources(this.label3, "label3");
-            this.label3.Name = "label3";
-            // 
-            // label2
-            // 
-            resources.ApplyResources(this.label2, "label2");
-            this.label2.Name = "label2";
-            // 
-            // label1
-            // 
-            resources.ApplyResources(this.label1, "label1");
-            this.label1.Name = "label1";
-            // 
             // grpThreading
             // 
             resources.ApplyResources(this.grpThreading, "grpThreading");
@@ -299,7 +255,7 @@
             // 
             resources.ApplyResources(this.RandomTileOrder, "RandomTileOrder");
             this.RandomTileOrder.Name = "RandomTileOrder";
-            this.toolTip1.SetToolTip(this.RandomTileOrder, resources.GetString("RandomTileOrder.ToolTip"));
+            this.toolTip.SetToolTip(this.RandomTileOrder, resources.GetString("RandomTileOrder.ToolTip"));
             this.RandomTileOrder.UseVisualStyleBackColor = true;
             // 
             // ThreadCount
@@ -316,7 +272,7 @@
             0,
             0});
             this.ThreadCount.Name = "ThreadCount";
-            this.toolTip1.SetToolTip(this.ThreadCount, resources.GetString("ThreadCount.ToolTip"));
+            this.toolTip.SetToolTip(this.ThreadCount, resources.GetString("ThreadCount.ToolTip"));
             this.ThreadCount.Value = new decimal(new int[] {
             1,
             0,
@@ -328,13 +284,22 @@
             resources.ApplyResources(this.label9, "label9");
             this.label9.Name = "label9";
             // 
+            // label2
+            // 
+            resources.ApplyResources(this.label2, "label2");
+            this.label2.Name = "label2";
+            // 
+            // label1
+            // 
+            resources.ApplyResources(this.label1, "label1");
+            this.label1.Name = "label1";
+            // 
             // grpTileSettings
             // 
             resources.ApplyResources(this.grpTileSettings, "grpTileSettings");
             this.grpTileSettings.Controls.Add(this.lnkCalcMpu);
             this.grpTileSettings.Controls.Add(this.OfficialMethodPanel);
             this.grpTileSettings.Controls.Add(this.LimitTileset);
-            this.grpTileSettings.Controls.Add(this.UseOfficialMethod);
             this.grpTileSettings.Controls.Add(this.TilesetLimitPanel);
             this.grpTileSettings.Name = "grpTileSettings";
             this.grpTileSettings.TabStop = false;
@@ -368,7 +333,7 @@
             0,
             0});
             this.MetersPerUnit.Name = "MetersPerUnit";
-            this.toolTip1.SetToolTip(this.MetersPerUnit, resources.GetString("MetersPerUnit.ToolTip"));
+            this.toolTip.SetToolTip(this.MetersPerUnit, resources.GetString("MetersPerUnit.ToolTip"));
             this.MetersPerUnit.Value = new decimal(new int[] {
             1,
             0,
@@ -384,18 +349,10 @@
             // 
             resources.ApplyResources(this.LimitTileset, "LimitTileset");
             this.LimitTileset.Name = "LimitTileset";
-            this.toolTip1.SetToolTip(this.LimitTileset, resources.GetString("LimitTileset.ToolTip"));
+            this.toolTip.SetToolTip(this.LimitTileset, resources.GetString("LimitTileset.ToolTip"));
             this.LimitTileset.UseVisualStyleBackColor = true;
             this.LimitTileset.CheckedChanged += new System.EventHandler(this.LimitTileset_CheckedChanged);
             // 
-            // UseOfficialMethod
-            // 
-            resources.ApplyResources(this.UseOfficialMethod, "UseOfficialMethod");
-            this.UseOfficialMethod.Name = "UseOfficialMethod";
-            this.toolTip1.SetToolTip(this.UseOfficialMethod, resources.GetString("UseOfficialMethod.ToolTip"));
-            this.UseOfficialMethod.UseVisualStyleBackColor = true;
-            this.UseOfficialMethod.CheckedChanged += new System.EventHandler(this.UseOfficialMethod_CheckedChanged);
-            // 
             // TilesetLimitPanel
             // 
             this.TilesetLimitPanel.Controls.Add(this.MaxRowLimit);
@@ -409,7 +366,7 @@
             // 
             resources.ApplyResources(this.MaxRowLimit, "MaxRowLimit");
             this.MaxRowLimit.Name = "MaxRowLimit";
-            this.toolTip1.SetToolTip(this.MaxRowLimit, resources.GetString("MaxRowLimit.ToolTip"));
+            this.toolTip.SetToolTip(this.MaxRowLimit, resources.GetString("MaxRowLimit.ToolTip"));
             // 
             // label6
             // 
@@ -420,7 +377,7 @@
             // 
             resources.ApplyResources(this.MaxColLimit, "MaxColLimit");
             this.MaxColLimit.Name = "MaxColLimit";
-            this.toolTip1.SetToolTip(this.MaxColLimit, resources.GetString("MaxColLimit.ToolTip"));
+            this.toolTip.SetToolTip(this.MaxColLimit, resources.GetString("MaxColLimit.ToolTip"));
             // 
             // label7
             // 
@@ -439,8 +396,8 @@
             this.panel2.ResumeLayout(false);
             this.BoundsOverride.ResumeLayout(false);
             this.BoundsOverride.PerformLayout();
-            this.grpDifferentConnection.ResumeLayout(false);
-            this.grpDifferentConnection.PerformLayout();
+            this.grpGlobalSettings.ResumeLayout(false);
+            this.grpGlobalSettings.PerformLayout();
             this.grpThreading.ResumeLayout(false);
             this.grpThreading.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.ThreadCount)).EndInit();
@@ -467,19 +424,12 @@
         private System.Windows.Forms.SaveFileDialog saveFileDialog;
         private System.Windows.Forms.ImageList imageList;
         private System.Windows.Forms.Panel panel2;
-        private System.Windows.Forms.GroupBox grpDifferentConnection;
-        private System.Windows.Forms.CheckBox UseNativeAPI;
-        private System.Windows.Forms.TextBox Password;
-        private System.Windows.Forms.TextBox MapAgent;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.GroupBox grpGlobalSettings;
         private System.Windows.Forms.GroupBox grpThreading;
         private System.Windows.Forms.NumericUpDown ThreadCount;
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.GroupBox grpTileSettings;
         private System.Windows.Forms.CheckBox LimitTileset;
-        private System.Windows.Forms.CheckBox UseOfficialMethod;
         private System.Windows.Forms.NumericUpDown MetersPerUnit;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.NumericUpDown MaxColLimit;
@@ -488,7 +438,7 @@
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Panel OfficialMethodPanel;
         private System.Windows.Forms.Panel TilesetLimitPanel;
-        private System.Windows.Forms.ToolTip toolTip1;
+        private System.Windows.Forms.ToolTip toolTip;
         private System.Windows.Forms.CheckBox RandomTileOrder;
         private System.Windows.Forms.GroupBox BoundsOverride;
         private System.Windows.Forms.TextBox txtUpperY;
@@ -501,8 +451,10 @@
         private System.Windows.Forms.Label label11;
         private System.Windows.Forms.Button ResetBounds;
         private System.Windows.Forms.Label ModfiedOverrideWarning;
-        private System.Windows.Forms.CheckBox chkUseDifferentConnection;
-        private System.Windows.Forms.TextBox Username;
         private System.Windows.Forms.LinkLabel lnkCalcMpu;
+        private System.Windows.Forms.TextBox txtConnectionString;
+        private System.Windows.Forms.TextBox txtProvider;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
     }
 }
\ No newline at end of file

Modified: trunk/Tools/Maestro/MgCooker/SetupRun.resx
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.resx	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.resx	2014-05-07 08:13:21 UTC (rev 8118)
@@ -275,54 +275,54 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6
-        DAAAAk1TRnQBSQFMAgEBBAEAAXQBAAF0AQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
+        DAAAAk1TRnQBSQFMAgEBBAEAAYQBAAGEAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
         AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AKgADHAEoAyQBNgMk
         ATYDJAE2AyQBNgMkATYDJAE2AyQBNgMkATYDJAE2AyQBNgMkATYDGwEmHAADFgEeAVsCWAHGAx0BKgMC
-        AQOgAAP9Af8D/QH/A/0B/wP9Af8D/QH/A/0B/wP9Af8D/QH/A/0B/wP9Af8D/QH/A/0B/wMbASYcAAGC
-        Am0B9wH0AeYB4QH/Ab0BtgG1Af0BiAGAAX8B+QFNAkwBkQMRAReYAAP9Af8B9QHoAeQB/wH0AeUB4AH/
+        AQOgAAP9Af8D/QH/A/0B/wP9Af8D/QH/A/0B/wP9Af8D/QH/A/0B/wP9Af8D/QH/A/0B/wMbASYcAAGA
+        Am0B9wH0AeYB4QH/AbsBtAGzAf0BhgF9AXoB+QFNAkwBkQMRAReYAAP9Af8B9QHoAeQB/wH0AeUB4AH/
         AfIB4gHdAf8B8QHgAdkB/wHwAd0B1gH/Ae8B2wHTAf8B7gHZAdEB/wHuAdgB0AH/Ae4B2AHQAf8B7gHY
         AdAB/wP9Af8DGwEmGAABLAIrAUMB9QHoAeMB/wH0AeYB4QH/AfMB5AHfAf8B8gHjAd0B/wHyAeEB2wH/
-        AZ4BjQGJAfoBYwJaAfABNgI1AVgDCwEPDAADHQEqAx0BKiAAAwUBBwMdASoDHQEqTAAD/QH/AfcB7QHp
-        Af8B9gHqAeYB/wH0AecB4wH/Ad0BtQGwAf8BvQFmAWEB/wG+AWoBZQH/AeMBwgG8Af8B7wHaAdIB/wHu
-        AdgB0AH/Ae4B2AHQAf8D/QH/AxsBJhgAAYICdgH4AfUB6AHjAf8B9AHmAeEB/wHzAeQB3wH/AfIB4wHd
-        Af8B8gHhAdsB/wHxAd8B2QH/AfAB3QHXAf8B7wHcAdUB/wGSAX0BewH6AVkCVwHCCwAB/ygAAzABTAMA
-        Af9MAAP9Af8B+AHwAe0B/wHtAdcB0gH/AbkBiQFkAf8BVAGTASQB/wHqAbEBLAH/AegBrgEjAf8B6wHB
-        AVcB/wGxAU4BSQH/Ae4B2QHSAf8B7gHZAdIB/wP9Af8DGwEmFAADQAFwAfUB6QHlAf8B9QHoAeMB/wH0
+        AZoBhwGDAfoBXwJaAfABNgI1AVgDCwEPDAADHQEqAx0BKiAAAwUBBwMdASoDHQEqTAAD/QH/AfcB7QHp
+        Af8B9gHqAeYB/wH0AecB4wH/Ad0BtQGwAf8BvQFkAV8B/wG+AWgBYwH/AeMBwgG8Af8B7wHaAdIB/wHu
+        AdgB0AH/Ae4B2AHQAf8D/QH/AxsBJhgAAX4CdAH4AfUB6AHjAf8B9AHmAeEB/wHzAeQB3wH/AfIB4wHd
+        Af8B8gHhAdsB/wHxAd8B2QH/AfAB3QHXAf8B7wHcAdUB/wGMAXsBeQH6AVkCVwHCCwAB/ygAAzABTAMA
+        Af9MAAP9Af8B+AHwAe0B/wHtAdcB0gH/AbkBiQFiAf8BUgGTASIB/wHqAbEBKgH/AegBrgEhAf8B6wHB
+        AVUB/wGxAUwBRwH/Ae4B2QHSAf8B7gHZAdIB/wP9Af8DGwEmFAADQAFwAfUB6QHlAf8B9QHoAeMB/wH0
         AeYB4QH/AfMB5AHfAf8B8gHjAd0B/wHyAeEB2wH/AfEB3wHZAf8B8AHdAdcB/wHvAdwB1QH/Ae8B2gHT
         Af8DOAFcCwAB/wgAAUYCRQF/AwAEAQECA0UBfQQAAygBPAMlATcEAAMvAUoDAAH/DAADEQEXA1gB0QMA
-        Af8DKAE8EAADOAFcAwAB/xgAA/0B/wH2AeoB5gH/AegBvwGcAf8B+wHLAVcB/wExAa0BPgH/AUkBnQEf
-        Af8B/gHEATcB/wH+Ab4BIgH/AfYBtgEYAf8BlwFnAUQB/wHwAd0B1gH/A/0B/wMbASYUAAGNAnwB+AH1
+        Af8DKAE8EAADOAFcAwAB/xgAA/0B/wH2AeoB5gH/AegBvwGcAf8B+wHLAVUB/wEvAa0BPAH/AUcBnQEd
+        Af8B/gHEATUB/wH+Ab4BIAH/AfYBtgEWAf8BlwFlAUIB/wHwAd0B1gH/A/0B/wMbASYUAAGHAnoB+AH1
         AekB5QH/AfUB6AHjAf8B9AHmAeEB/wHzAeQB3wH/AfIB4wHdAf8B8gHhAdsB/wHxAd8B2QH/AfAB3QHX
-        Af8B7wHcAdUB/wFuAmIB9gMEAQYLAAH/CwAB/wNFAX0DSAGFAwAB/wcAAf8DAAH/BAADLwFKAwAB/xAA
-        A0IBdAMAAf8UAAMNAREDWgHVGAAD/QH/AbkBVAE/Af8B+gHOAWMB/wGkAbYBSwH/ATEBrQE/Af8BMAGt
-        AT4B/wHJAb8BTQH/Af4BxAE2Af8B/gHAAScB/wEvAaUBNgH/AbwBZgFjAf8D/QH/AxsBJhAAA1ABngH2
+        Af8B7wHcAdUB/wFoAmIB9gMEAQYLAAH/CwAB/wNFAX0DSAGFAwAB/wcAAf8DAAH/BAADLwFKAwAB/xAA
+        A0IBdAMAAf8UAAMNAREDWgHVGAAD/QH/AbkBUgE9Af8B+gHOAWEB/wGkAbYBSQH/AS8BrQE9Af8BLgGt
+        ATwB/wHJAb8BSwH/Af4BxAE0Af8B/gHAASUB/wEtAaUBNAH/AbwBZAFhAf8D/QH/AxsBJhAAA1ABngH2
         AesB5wH/AfUB6QHlAf8B9QHoAeMB/wH0AeYB4QH/AfMB5AHfAf8B8gHjAd0B/wHyAeEB2wH/AfEB3wHZ
-        Af8B8AHdAdcB/wGzAakBowH8AygBPA8AAf8oAAMvAUoDAAH/EAADQgF0AwAB/zQAA/0B/wHqAcMBoQH/
-        Af0B1gGEAf8BmwG2AVEB/wEvAZ8BJAH/AfEB2AGRAf8B/QHRAWcB/wGcAbABOAH/ATEBrQE/Af8BMQGt
-        AT8B/wGYAWIBQQH/A/0B/wMbASYQAAGLAYQBgwH3AfYB6wHnAf8B9QHpAeUB/wH1AegB4wH/AfQB5gHh
-        Af8B8wHkAd8B/wHyAeMB3QH/AfIB4QHbAf8B8QHfAdkB/wHwAd0B1wH/AWMCWQHrAwEBAg8AAf8oAAMv
-        AUoDAAH/EAADQgF0AwAB/xQAAwIBAwNRAaEYAAP9Af8B+gHiAbkB/wEyAZoBGwH/AtQBmwH/Af0B4wG1
-        Af8B/QHdAZ0B/wH9AdQBcAH/AeQByAFVAf8BMAGsAT0B/wFHAZwBHAH/AZ4BigFSAf8D/QH/AxsBJgwA
+        Af8B8AHdAdcB/wGvAaMBnQH8AygBPA8AAf8oAAMvAUoDAAH/EAADQgF0AwAB/zQAA/0B/wHqAcMBoQH/
+        Af0B1gGEAf8BmwG2AU8B/wEtAZ8BIgH/AfEB2AGRAf8B/QHRAWUB/wGcAbABNgH/AS8BrQE9Af8BLwGt
+        AT0B/wGYAWABPwH/A/0B/wMbASYQAAGIAYIBgQH3AfYB6wHnAf8B9QHpAeUB/wH1AegB4wH/AfQB5gHh
+        Af8B8wHkAd8B/wHyAeMB3QH/AfIB4QHbAf8B8QHfAdkB/wHwAd0B1wH/AWECWQHrAwEBAg8AAf8oAAMv
+        AUoDAAH/EAADQgF0AwAB/xQAAwIBAwNRAaEYAAP9Af8B+gHiAbkB/wEwAZoBGQH/AtQBmwH/Af0B4wG1
+        Af8B/QHdAZ0B/wH9AdQBbgH/AeQByAFTAf8BLgGsATsB/wFFAZwBGgH/AZ4BigFQAf8D/QH/AxsBJgwA
         AVwCWQHJAfcB7QHpAf8B9gHrAecB/wH1AekB5QH/AfUB6AHjAf8B9AHmAeEB/wHzAeQB3wH/AfIB4wHd
-        Af8B8gHhAdsB/wHxAd8B2QH/AaABkAGMAfoDGwEmEwAB/ygAAy8BSgMAAf8QAANCAXQDAAH/FAADPgFr
-        AwAB/xgAA/0B/wFkAZABLAH/ATEBrQE/Af8BMQGtAT8B/wGvAcEBawH/Af0B2wGVAf8B/QHTAWsB/wH+
-        AcoBSQH/ATkBmgEbAf8BLwGXARYB/wGcAWQBQgH/A/0B/wMbASYIAAMEAQUBogGYAZYB+gH3Ae0B6QH/
+        Af8B8gHhAdsB/wHxAd8B2QH/AZwBigGGAfoDGwEmEwAB/ygAAy8BSgMAAf8QAANCAXQDAAH/FAADPgFr
+        AwAB/xgAA/0B/wFiAZABKgH/AS8BrQE9Af8BLwGtAT0B/wGvAcEBaQH/Af0B2wGVAf8B/QHTAWkB/wH+
+        AcoBRwH/ATcBmgEZAf8BLQGXARQB/wGcAWIBQAH/A/0B/wMbASYIAAMEAQUBngGSAZAB+gH3Ae0B6QH/
         AfYB6wHnAf8B9QHpAeUB/wH1AegB4wH/AfQB5gHhAf8B8wHkAd8B/wHyAeMB3QH/AfIB4QHbAf8B8QHf
-        AdkB/wFdAlkB0hcAAf8oAAMvAUoDAAH/EAADQgF2AwAB/zQAA/0B/wG+AWYBRgH/ATEBrQE/Af8BMAGj
-        AS0B/wEwAa0BPgH/AcABwgFeAf8B/gHOAVkB/wH+AcYBOwH/AVABlAENAf8BwgG6AT0B/wHFAYEBbwH/
+        AdkB/wFdAlkB0hcAAf8oAAMvAUoDAAH/EAADQgF2AwAB/zQAA/0B/wG+AWQBRAH/AS8BrQE9Af8BLgGj
+        ASsB/wEuAa0BPAH/AcABwgFcAf8B/gHOAVcB/wH+AcYBOQH/AU4BlAELAf8BwgG6ATsB/wHFAYEBbQH/
         A/0B/wMbASYIAAFkAlwB5wH4Ae4B6wH/AfcB7QHpAf8B9gHrAecB/wH1AekB5QH/AfUB6AHjAf8B9AHm
-        AeEB/wHzAeQB3wH/AfIB4wHdAf8B8gHhAdsB/wGRAX4BfQH4AxMBGhcAAf8oAAMvAUoDAAH/DAADCAEL
-        A1oB3gMAAf80AAP9Af8B9wHtAekB/wFsAZABMAH/AacBtQFFAf8BMQGTAQ8B/wGqAbcBRwH/AUQBngEg
-        Af8B8gHCATgB/wH+Ab0BHQH/AcUBbwFbAf8B+QHxAe4B/wP9Af8DGwEmBAADEgEZAaMCmgH6AfgB7gHr
+        AeEB/wHzAeQB3wH/AfIB4wHdAf8B8gHhAdsB/wGLAXwBewH4AxMBGhcAAf8oAAMvAUoDAAH/DAADCAEL
+        A1oB3gMAAf80AAP9Af8B9wHtAekB/wFqAZABLgH/AacBtQFDAf8BLwGTAQ0B/wGqAbcBRQH/AUIBngEe
+        Af8B8gHCATYB/wH+Ab0BGwH/AcUBbQFZAf8B+QHxAe4B/wP9Af8DGwEmBAADEgEZAZ8ClQH6AfgB7gHr
         Af8B9wHtAekB/wH2AesB5wH/AfUB6QHlAf8B9QHoAeMB/wH0AeYB4QH/AfMB5AHfAf8B8gHjAd0B/wHy
         AeEB2wH/A1QBrxgAA1cB3wFJAkgBhyAAAwsBDwNVAbcDVwHfTAAD/QH/AfkB8QHuAf8B8gHhAdsB/wGt
-        AYYBTAH/Ae4B2AGLAf8BRQGeASAB/wEwAa0BPgH/ATYBlAESAf8BuwFZAUUB/wH4AfAB7QH/AfkB8QHu
-        Af8D/QH/AxsBJggAAwEBAgFSAlEBpwGMAoUB+QH2AesB5wH/AfUB6QHlAf8B9QHoAeMB/wH0AeYB4QH/
-        AfMB5AHfAf8B8gHjAd0B/wGNAXsBeQH4Aw4BE5gAA/0B/wH5AfEB7gH/AfkB8QHuAf8B+QHxAe4B/wHs
+        AYYBSgH/Ae4B2AGLAf8BQwGeAR4B/wEuAa0BPAH/ATQBlAEQAf8BuwFXAUMB/wH4AfAB7QH/AfkB8QHu
+        Af8D/QH/AxsBJggAAwEBAgFSAlEBpwGKAoMB+QH2AesB5wH/AfUB6QHlAf8B9QHoAeMB/wH0AeYB4QH/
+        AfMB5AHfAf8B8gHjAd0B/wGHAXkBdwH4Aw4BE5gAA/0B/wH5AfEB7gH/AfkB8QHuAf8B+QHxAe4B/wHs
         AdIByQH/AdIBlQGCAf8B1AGaAYkB/wHyAeEB3AH/AfkB8QHuAf8B+QHxAe4B/wH5AfEB7gH/A/0B/wMb
-        ASYUAAMdASkBYQJaAeQBkAGJAYgB+QH0AeYB4QH/AfMB5AHfAf8B8gHjAd0B/wFJAkgBiJwAA/0B/wH6
+        ASYUAAMdASkBYQJaAeQBjQGHAYYB+QH0AeYB4QH/AfMB5AHfAf8B8gHjAd0B/wFJAkgBiJwAA/0B/wH6
         AfYB9AH/AfoB9gH0Af8B+gH2AfQB/wH6AfYB9AH/AfoB9gH0Af8B+gH2AfQB/wH6AfYB9AH/AfoB9gH0
-        Af8B+gH2AfQB/wH6AfYB9AH/A/0B/wMbASYgAAM+AWsBhAJ2AfoBggJ1AfgDBwEKnAABpQKgAf8BpAGg
+        Af8B+gH2AfQB/wH6AfYB9AH/A/0B/wMbASYgAAM+AWsBfgJ0AfoBfgJzAfgDBwEKnAABpQKgAf8BpAGg
         AZ8B/wGkAp8B/wGjAp4B/wGiAp0B/wGhApwB/wGgApsB/wGfApoB/wGdApkB/wGcAZgBlwH/AZsClgH/
         AZkClQH/yAABQgFNAT4HAAE+AwABKAMAAUADAAEgAwABAQEAAQEGAAEBFgAD/4EAAcABAQH8AT8E/wHA
         AQEB/AEPBP8BwAEBAfgBAQHPAfEC/wHAAQEB+AEAAd8B+QL/AcABAQHwAQAB2AFJAcMBzwHAAQEB8AEA
@@ -361,78 +361,6 @@
   <data name="saveFileDialog.Title" xml:space="preserve">
     <value>Select file to save script to</value>
   </data>
-  <data name=">>BoundsOverride.Name" xml:space="preserve">
-    <value>BoundsOverride</value>
-  </data>
-  <data name=">>BoundsOverride.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>BoundsOverride.Parent" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>BoundsOverride.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name=">>grpDifferentConnection.Name" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>grpDifferentConnection.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>grpDifferentConnection.Parent" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>grpDifferentConnection.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name=">>grpThreading.Name" xml:space="preserve">
-    <value>grpThreading</value>
-  </data>
-  <data name=">>grpThreading.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>grpThreading.Parent" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>grpThreading.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
-  <data name=">>grpTileSettings.Name" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>grpTileSettings.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>grpTileSettings.Parent" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>grpTileSettings.ZOrder" xml:space="preserve">
-    <value>3</value>
-  </data>
-  <data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Right</value>
-  </data>
-  <data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>293, 0</value>
-  </data>
-  <data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>272, 537</value>
-  </data>
-  <data name="panel2.TabIndex" type="System.Int32, mscorlib">
-    <value>2</value>
-  </data>
-  <data name=">>panel2.Name" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>panel2.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>panel2.Parent" xml:space="preserve">
-    <value>$this</value>
-  </data>
-  <data name=">>panel2.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
   <data name="BoundsOverride.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
@@ -560,7 +488,7 @@
     <value>False</value>
   </data>
   <data name="BoundsOverride.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 424</value>
+    <value>12, 411</value>
   </data>
   <data name="BoundsOverride.Size" type="System.Drawing.Size, System.Drawing">
     <value>248, 120</value>
@@ -583,6 +511,351 @@
   <data name=">>BoundsOverride.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>250, 17</value>
+  </metadata>
+  <data name="grpGlobalSettings.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name=">>txtConnectionString.Name" xml:space="preserve">
+    <value>txtConnectionString</value>
+  </data>
+  <data name=">>txtConnectionString.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>txtConnectionString.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
+  </data>
+  <data name=">>txtConnectionString.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name=">>txtProvider.Name" xml:space="preserve">
+    <value>txtProvider</value>
+  </data>
+  <data name=">>txtProvider.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>txtProvider.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
+  </data>
+  <data name=">>txtProvider.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name=">>grpThreading.Name" xml:space="preserve">
+    <value>grpThreading</value>
+  </data>
+  <data name=">>grpThreading.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>grpThreading.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
+  </data>
+  <data name=">>grpThreading.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name=">>label2.Name" xml:space="preserve">
+    <value>label2</value>
+  </data>
+  <data name=">>label2.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>label2.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
+  </data>
+  <data name=">>label2.ZOrder" xml:space="preserve">
+    <value>3</value>
+  </data>
+  <data name=">>label1.Name" xml:space="preserve">
+    <value>label1</value>
+  </data>
+  <data name=">>label1.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>label1.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
+  </data>
+  <data name=">>label1.ZOrder" xml:space="preserve">
+    <value>4</value>
+  </data>
+  <data name="grpGlobalSettings.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 8</value>
+  </data>
+  <data name="grpGlobalSettings.Size" type="System.Drawing.Size, System.Drawing">
+    <value>248, 223</value>
+  </data>
+  <data name="grpGlobalSettings.TabIndex" type="System.Int32, mscorlib">
+    <value>5</value>
+  </data>
+  <data name="grpGlobalSettings.Text" xml:space="preserve">
+    <value>Global Settings</value>
+  </data>
+  <data name="grpGlobalSettings.ToolTip" xml:space="preserve">
+    <value>Global settings for this tile run set</value>
+  </data>
+  <data name=">>grpGlobalSettings.Name" xml:space="preserve">
+    <value>grpGlobalSettings</value>
+  </data>
+  <data name=">>grpGlobalSettings.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>grpGlobalSettings.Parent" xml:space="preserve">
+    <value>panel2</value>
+  </data>
+  <data name=">>grpGlobalSettings.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="grpTileSettings.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name="lnkCalcMpu.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="lnkCalcMpu.Location" type="System.Drawing.Point, System.Drawing">
+    <value>13, 134</value>
+  </data>
+  <data name="lnkCalcMpu.Size" type="System.Drawing.Size, System.Drawing">
+    <value>123, 13</value>
+  </data>
+  <data name="lnkCalcMpu.TabIndex" type="System.Int32, mscorlib">
+    <value>14</value>
+  </data>
+  <data name="lnkCalcMpu.Text" xml:space="preserve">
+    <value>Calculate meters-per-unit</value>
+  </data>
+  <data name=">>lnkCalcMpu.Name" xml:space="preserve">
+    <value>lnkCalcMpu</value>
+  </data>
+  <data name=">>lnkCalcMpu.Type" xml:space="preserve">
+    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>lnkCalcMpu.Parent" xml:space="preserve">
+    <value>grpTileSettings</value>
+  </data>
+  <data name=">>lnkCalcMpu.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name="MetersPerUnit.Location" type="System.Drawing.Point, System.Drawing">
+    <value>104, 0</value>
+  </data>
+  <data name="MetersPerUnit.Size" type="System.Drawing.Size, System.Drawing">
+    <value>104, 20</value>
+  </data>
+  <data name="MetersPerUnit.TabIndex" type="System.Int32, mscorlib">
+    <value>9</value>
+  </data>
+  <data name="MetersPerUnit.ToolTip" xml:space="preserve">
+    <value>The number of meters pr. map unit</value>
+  </data>
+  <data name=">>MetersPerUnit.Name" xml:space="preserve">
+    <value>MetersPerUnit</value>
+  </data>
+  <data name=">>MetersPerUnit.Type" xml:space="preserve">
+    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>MetersPerUnit.Parent" xml:space="preserve">
+    <value>OfficialMethodPanel</value>
+  </data>
+  <data name=">>MetersPerUnit.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name="label8.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="label8.Location" type="System.Drawing.Point, System.Drawing">
+    <value>16, 0</value>
+  </data>
+  <data name="label8.Size" type="System.Drawing.Size, System.Drawing">
+    <value>74, 13</value>
+  </data>
+  <data name="label8.TabIndex" type="System.Int32, mscorlib">
+    <value>8</value>
+  </data>
+  <data name="label8.Text" xml:space="preserve">
+    <value>Meters pr. unit</value>
+  </data>
+  <data name=">>label8.Name" xml:space="preserve">
+    <value>label8</value>
+  </data>
+  <data name=">>label8.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>label8.Parent" xml:space="preserve">
+    <value>OfficialMethodPanel</value>
+  </data>
+  <data name=">>label8.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="OfficialMethodPanel.Location" type="System.Drawing.Point, System.Drawing">
+    <value>14, 97</value>
+  </data>
+  <data name="OfficialMethodPanel.Size" type="System.Drawing.Size, System.Drawing">
+    <value>216, 24</value>
+  </data>
+  <data name="OfficialMethodPanel.TabIndex" type="System.Int32, mscorlib">
+    <value>13</value>
+  </data>
+  <data name=">>OfficialMethodPanel.Name" xml:space="preserve">
+    <value>OfficialMethodPanel</value>
+  </data>
+  <data name=">>OfficialMethodPanel.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>OfficialMethodPanel.Parent" xml:space="preserve">
+    <value>grpTileSettings</value>
+  </data>
+  <data name=">>OfficialMethodPanel.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="LimitTileset.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="LimitTileset.Location" type="System.Drawing.Point, System.Drawing">
+    <value>14, 19</value>
+  </data>
+  <data name="LimitTileset.Size" type="System.Drawing.Size, System.Drawing">
+    <value>118, 17</value>
+  </data>
+  <data name="LimitTileset.TabIndex" type="System.Int32, mscorlib">
+    <value>11</value>
+  </data>
+  <data name="LimitTileset.Text" xml:space="preserve">
+    <value>Limit number of tiles</value>
+  </data>
+  <data name="LimitTileset.ToolTip" xml:space="preserve">
+    <value>Set a limit on the number of tiles generated, note that this may prevent all tiles from being created</value>
+  </data>
+  <data name=">>LimitTileset.Name" xml:space="preserve">
+    <value>LimitTileset</value>
+  </data>
+  <data name=">>LimitTileset.Type" xml:space="preserve">
+    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>LimitTileset.Parent" xml:space="preserve">
+    <value>grpTileSettings</value>
+  </data>
+  <data name=">>LimitTileset.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name=">>MaxRowLimit.Name" xml:space="preserve">
+    <value>MaxRowLimit</value>
+  </data>
+  <data name=">>MaxRowLimit.Type" xml:space="preserve">
+    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>MaxRowLimit.Parent" xml:space="preserve">
+    <value>TilesetLimitPanel</value>
+  </data>
+  <data name=">>MaxRowLimit.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name=">>label6.Name" xml:space="preserve">
+    <value>label6</value>
+  </data>
+  <data name=">>label6.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>label6.Parent" xml:space="preserve">
+    <value>TilesetLimitPanel</value>
+  </data>
+  <data name=">>label6.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name=">>MaxColLimit.Name" xml:space="preserve">
+    <value>MaxColLimit</value>
+  </data>
+  <data name=">>MaxColLimit.Type" xml:space="preserve">
+    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>MaxColLimit.Parent" xml:space="preserve">
+    <value>TilesetLimitPanel</value>
+  </data>
+  <data name=">>MaxColLimit.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name=">>label7.Name" xml:space="preserve">
+    <value>label7</value>
+  </data>
+  <data name=">>label7.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>label7.Parent" xml:space="preserve">
+    <value>TilesetLimitPanel</value>
+  </data>
+  <data name=">>label7.ZOrder" xml:space="preserve">
+    <value>3</value>
+  </data>
+  <data name="TilesetLimitPanel.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="TilesetLimitPanel.Location" type="System.Drawing.Point, System.Drawing">
+    <value>14, 43</value>
+  </data>
+  <data name="TilesetLimitPanel.Size" type="System.Drawing.Size, System.Drawing">
+    <value>216, 48</value>
+  </data>
+  <data name="TilesetLimitPanel.TabIndex" type="System.Int32, mscorlib">
+    <value>12</value>
+  </data>
+  <data name=">>TilesetLimitPanel.Name" xml:space="preserve">
+    <value>TilesetLimitPanel</value>
+  </data>
+  <data name=">>TilesetLimitPanel.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>TilesetLimitPanel.Parent" xml:space="preserve">
+    <value>grpTileSettings</value>
+  </data>
+  <data name=">>TilesetLimitPanel.ZOrder" xml:space="preserve">
+    <value>3</value>
+  </data>
+  <data name="grpTileSettings.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 237</value>
+  </data>
+  <data name="grpTileSettings.Size" type="System.Drawing.Size, System.Drawing">
+    <value>248, 168</value>
+  </data>
+  <data name="grpTileSettings.TabIndex" type="System.Int32, mscorlib">
+    <value>6</value>
+  </data>
+  <data name="grpTileSettings.Text" xml:space="preserve">
+    <value>Tile Settings</value>
+  </data>
+  <data name=">>grpTileSettings.Name" xml:space="preserve">
+    <value>grpTileSettings</value>
+  </data>
+  <data name=">>grpTileSettings.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>grpTileSettings.Parent" xml:space="preserve">
+    <value>panel2</value>
+  </data>
+  <data name=">>grpTileSettings.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+    <value>Right</value>
+  </data>
+  <data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
+    <value>293, 0</value>
+  </data>
+  <data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
+    <value>272, 537</value>
+  </data>
+  <data name="panel2.TabIndex" type="System.Int32, mscorlib">
+    <value>2</value>
+  </data>
+  <data name=">>panel2.Name" xml:space="preserve">
+    <value>panel2</value>
+  </data>
+  <data name=">>panel2.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>panel2.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name=">>panel2.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
   <data name="ModfiedOverrideWarning.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
@@ -638,7 +911,7 @@
     <value>1</value>
   </data>
   <data name="txtUpperY.Location" type="System.Drawing.Point, System.Drawing">
-    <value>144, 56</value>
+    <value>144, 50</value>
   </data>
   <data name="txtUpperY.Size" type="System.Drawing.Size, System.Drawing">
     <value>80, 20</value>
@@ -659,7 +932,7 @@
     <value>2</value>
   </data>
   <data name="label4.Location" type="System.Drawing.Point, System.Drawing">
-    <value>120, 56</value>
+    <value>120, 50</value>
   </data>
   <data name="label4.Size" type="System.Drawing.Size, System.Drawing">
     <value>16, 16</value>
@@ -683,7 +956,7 @@
     <value>3</value>
   </data>
   <data name="txtUpperX.Location" type="System.Drawing.Point, System.Drawing">
-    <value>32, 56</value>
+    <value>32, 50</value>
   </data>
   <data name="txtUpperX.Size" type="System.Drawing.Size, System.Drawing">
     <value>72, 20</value>
@@ -704,7 +977,7 @@
     <value>4</value>
   </data>
   <data name="label5.Location" type="System.Drawing.Point, System.Drawing">
-    <value>8, 56</value>
+    <value>8, 50</value>
   </data>
   <data name="label5.Size" type="System.Drawing.Size, System.Drawing">
     <value>16, 16</value>
@@ -817,339 +1090,54 @@
   <data name=">>label11.ZOrder" xml:space="preserve">
     <value>9</value>
   </data>
-  <data name="grpDifferentConnection.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
+  <data name="txtConnectionString.Location" type="System.Drawing.Point, System.Drawing">
+    <value>14, 87</value>
   </data>
-  <data name=">>chkUseDifferentConnection.Name" xml:space="preserve">
-    <value>chkUseDifferentConnection</value>
+  <data name="txtConnectionString.Multiline" type="System.Boolean, mscorlib">
+    <value>True</value>
   </data>
-  <data name=">>chkUseDifferentConnection.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  <data name="txtConnectionString.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
+    <value>Vertical</value>
   </data>
-  <data name=">>chkUseDifferentConnection.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
+  <data name="txtConnectionString.Size" type="System.Drawing.Size, System.Drawing">
+    <value>218, 44</value>
   </data>
-  <data name=">>chkUseDifferentConnection.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name=">>UseNativeAPI.Name" xml:space="preserve">
-    <value>UseNativeAPI</value>
-  </data>
-  <data name=">>UseNativeAPI.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>UseNativeAPI.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>UseNativeAPI.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name=">>Password.Name" xml:space="preserve">
-    <value>Password</value>
-  </data>
-  <data name=">>Password.Type" xml:space="preserve">
-    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>Password.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>Password.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
-  <data name=">>Username.Name" xml:space="preserve">
-    <value>Username</value>
-  </data>
-  <data name=">>Username.Type" xml:space="preserve">
-    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>Username.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>Username.ZOrder" xml:space="preserve">
+  <data name="txtConnectionString.TabIndex" type="System.Int32, mscorlib">
     <value>3</value>
   </data>
-  <data name=">>MapAgent.Name" xml:space="preserve">
-    <value>MapAgent</value>
+  <data name=">>txtConnectionString.Name" xml:space="preserve">
+    <value>txtConnectionString</value>
   </data>
-  <data name=">>MapAgent.Type" xml:space="preserve">
+  <data name=">>txtConnectionString.Type" xml:space="preserve">
     <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>MapAgent.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
+  <data name=">>txtConnectionString.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
   </data>
-  <data name=">>MapAgent.ZOrder" xml:space="preserve">
-    <value>4</value>
-  </data>
-  <data name=">>label3.Name" xml:space="preserve">
-    <value>label3</value>
-  </data>
-  <data name=">>label3.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label3.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>label3.ZOrder" xml:space="preserve">
-    <value>5</value>
-  </data>
-  <data name=">>label2.Name" xml:space="preserve">
-    <value>label2</value>
-  </data>
-  <data name=">>label2.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label2.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>label2.ZOrder" xml:space="preserve">
-    <value>6</value>
-  </data>
-  <data name=">>label1.Name" xml:space="preserve">
-    <value>label1</value>
-  </data>
-  <data name=">>label1.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label1.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>label1.ZOrder" xml:space="preserve">
-    <value>7</value>
-  </data>
-  <data name="grpDifferentConnection.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 8</value>
-  </data>
-  <data name="grpDifferentConnection.Size" type="System.Drawing.Size, System.Drawing">
-    <value>248, 128</value>
-  </data>
-  <data name="grpDifferentConnection.TabIndex" type="System.Int32, mscorlib">
-    <value>5</value>
-  </data>
-  <data name=">>grpDifferentConnection.Name" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>grpDifferentConnection.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>grpDifferentConnection.Parent" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>grpDifferentConnection.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name="chkUseDifferentConnection.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="chkUseDifferentConnection.Location" type="System.Drawing.Point, System.Drawing">
-    <value>11, 0</value>
-  </data>
-  <data name="chkUseDifferentConnection.Size" type="System.Drawing.Size, System.Drawing">
-    <value>142, 17</value>
-  </data>
-  <data name="chkUseDifferentConnection.TabIndex" type="System.Int32, mscorlib">
-    <value>7</value>
-  </data>
-  <data name="chkUseDifferentConnection.Text" xml:space="preserve">
-    <value>Use different connection</value>
-  </data>
-  <data name=">>chkUseDifferentConnection.Name" xml:space="preserve">
-    <value>chkUseDifferentConnection</value>
-  </data>
-  <data name=">>chkUseDifferentConnection.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>chkUseDifferentConnection.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>chkUseDifferentConnection.ZOrder" xml:space="preserve">
+  <data name=">>txtConnectionString.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>250, 17</value>
-  </metadata>
-  <data name="UseNativeAPI.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
+  <data name="txtProvider.Location" type="System.Drawing.Point, System.Drawing">
+    <value>14, 42</value>
   </data>
-  <data name="UseNativeAPI.Location" type="System.Drawing.Point, System.Drawing">
-    <value>88, 104</value>
+  <data name="txtProvider.Size" type="System.Drawing.Size, System.Drawing">
+    <value>218, 20</value>
   </data>
-  <data name="UseNativeAPI.Size" type="System.Drawing.Size, System.Drawing">
-    <value>146, 17</value>
-  </data>
-  <data name="UseNativeAPI.TabIndex" type="System.Int32, mscorlib">
-    <value>6</value>
-  </data>
-  <data name="UseNativeAPI.Text" xml:space="preserve">
-    <value>Connect using native API</value>
-  </data>
-  <data name="UseNativeAPI.ToolTip" xml:space="preserve">
-    <value>Using the Native API is potentially faster, but requires binary files, open ports and a webconfig.ini file</value>
-  </data>
-  <data name=">>UseNativeAPI.Name" xml:space="preserve">
-    <value>UseNativeAPI</value>
-  </data>
-  <data name=">>UseNativeAPI.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>UseNativeAPI.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>UseNativeAPI.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name="Password.Location" type="System.Drawing.Point, System.Drawing">
-    <value>88, 72</value>
-  </data>
-  <data name="Password.Size" type="System.Drawing.Size, System.Drawing">
-    <value>144, 20</value>
-  </data>
-  <data name="Password.TabIndex" type="System.Int32, mscorlib">
-    <value>5</value>
-  </data>
-  <data name="Password.ToolTip" xml:space="preserve">
-    <value>Password used to connect to the server</value>
-  </data>
-  <data name=">>Password.Name" xml:space="preserve">
-    <value>Password</value>
-  </data>
-  <data name=">>Password.Type" xml:space="preserve">
-    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>Password.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>Password.ZOrder" xml:space="preserve">
+  <data name="txtProvider.TabIndex" type="System.Int32, mscorlib">
     <value>2</value>
   </data>
-  <data name="Username.Location" type="System.Drawing.Point, System.Drawing">
-    <value>88, 48</value>
+  <data name=">>txtProvider.Name" xml:space="preserve">
+    <value>txtProvider</value>
   </data>
-  <data name="Username.Size" type="System.Drawing.Size, System.Drawing">
-    <value>144, 20</value>
-  </data>
-  <data name="Username.TabIndex" type="System.Int32, mscorlib">
-    <value>4</value>
-  </data>
-  <data name="Username.ToolTip" xml:space="preserve">
-    <value>Username used to connect to the server</value>
-  </data>
-  <data name=">>Username.Name" xml:space="preserve">
-    <value>Username</value>
-  </data>
-  <data name=">>Username.Type" xml:space="preserve">
+  <data name=">>txtProvider.Type" xml:space="preserve">
     <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>Username.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
+  <data name=">>txtProvider.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
   </data>
-  <data name=">>Username.ZOrder" xml:space="preserve">
-    <value>3</value>
-  </data>
-  <data name="MapAgent.Location" type="System.Drawing.Point, System.Drawing">
-    <value>88, 24</value>
-  </data>
-  <data name="MapAgent.Size" type="System.Drawing.Size, System.Drawing">
-    <value>144, 20</value>
-  </data>
-  <data name="MapAgent.TabIndex" type="System.Int32, mscorlib">
-    <value>3</value>
-  </data>
-  <data name="MapAgent.ToolTip" xml:space="preserve">
-    <value>Enter the URL for the MapAgent</value>
-  </data>
-  <data name=">>MapAgent.Name" xml:space="preserve">
-    <value>MapAgent</value>
-  </data>
-  <data name=">>MapAgent.Type" xml:space="preserve">
-    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>MapAgent.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>MapAgent.ZOrder" xml:space="preserve">
-    <value>4</value>
-  </data>
-  <data name="label3.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
-    <value>16, 72</value>
-  </data>
-  <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
-    <value>53, 13</value>
-  </data>
-  <data name="label3.TabIndex" type="System.Int32, mscorlib">
-    <value>2</value>
-  </data>
-  <data name="label3.Text" xml:space="preserve">
-    <value>Password</value>
-  </data>
-  <data name=">>label3.Name" xml:space="preserve">
-    <value>label3</value>
-  </data>
-  <data name=">>label3.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label3.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>label3.ZOrder" xml:space="preserve">
-    <value>5</value>
-  </data>
-  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>16, 48</value>
-  </data>
-  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>55, 13</value>
-  </data>
-  <data name="label2.TabIndex" type="System.Int32, mscorlib">
+  <data name=">>txtProvider.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
-  <data name="label2.Text" xml:space="preserve">
-    <value>Username</value>
-  </data>
-  <data name=">>label2.Name" xml:space="preserve">
-    <value>label2</value>
-  </data>
-  <data name=">>label2.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label2.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>label2.ZOrder" xml:space="preserve">
-    <value>6</value>
-  </data>
-  <data name="label1.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
-    <value>16, 24</value>
-  </data>
-  <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
-    <value>56, 13</value>
-  </data>
-  <data name="label1.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="label1.Text" xml:space="preserve">
-    <value>MapAgent</value>
-  </data>
-  <data name=">>label1.Name" xml:space="preserve">
-    <value>label1</value>
-  </data>
-  <data name=">>label1.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label1.Parent" xml:space="preserve">
-    <value>grpDifferentConnection</value>
-  </data>
-  <data name=">>label1.ZOrder" xml:space="preserve">
-    <value>7</value>
-  </data>
   <data name="grpThreading.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
@@ -1190,10 +1178,10 @@
     <value>2</value>
   </data>
   <data name="grpThreading.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 328</value>
+    <value>11, 137</value>
   </data>
   <data name="grpThreading.Size" type="System.Drawing.Size, System.Drawing">
-    <value>248, 80</value>
+    <value>226, 80</value>
   </data>
   <data name="grpThreading.TabIndex" type="System.Int32, mscorlib">
     <value>7</value>
@@ -1208,16 +1196,19 @@
     <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>grpThreading.Parent" xml:space="preserve">
-    <value>panel2</value>
+    <value>grpGlobalSettings</value>
   </data>
   <data name=">>grpThreading.ZOrder" xml:space="preserve">
     <value>2</value>
   </data>
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>250, 17</value>
+  </metadata>
   <data name="RandomTileOrder.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
   <data name="RandomTileOrder.Location" type="System.Drawing.Point, System.Drawing">
-    <value>24, 48</value>
+    <value>16, 50</value>
   </data>
   <data name="RandomTileOrder.Size" type="System.Drawing.Size, System.Drawing">
     <value>159, 17</value>
@@ -1247,7 +1238,7 @@
     <value>128, 24</value>
   </data>
   <data name="ThreadCount.Size" type="System.Drawing.Size, System.Drawing">
-    <value>104, 20</value>
+    <value>88, 20</value>
   </data>
   <data name="ThreadCount.TabIndex" type="System.Int32, mscorlib">
     <value>5</value>
@@ -1271,7 +1262,7 @@
     <value>True</value>
   </data>
   <data name="label9.Location" type="System.Drawing.Point, System.Drawing">
-    <value>24, 24</value>
+    <value>13, 26</value>
   </data>
   <data name="label9.Size" type="System.Drawing.Size, System.Drawing">
     <value>102, 13</value>
@@ -1294,352 +1285,58 @@
   <data name=">>label9.ZOrder" xml:space="preserve">
     <value>2</value>
   </data>
-  <data name="grpTileSettings.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
-  </data>
-  <data name=">>lnkCalcMpu.Name" xml:space="preserve">
-    <value>lnkCalcMpu</value>
-  </data>
-  <data name=">>lnkCalcMpu.Type" xml:space="preserve">
-    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>lnkCalcMpu.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>lnkCalcMpu.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name=">>OfficialMethodPanel.Name" xml:space="preserve">
-    <value>OfficialMethodPanel</value>
-  </data>
-  <data name=">>OfficialMethodPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>OfficialMethodPanel.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>OfficialMethodPanel.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name=">>LimitTileset.Name" xml:space="preserve">
-    <value>LimitTileset</value>
-  </data>
-  <data name=">>LimitTileset.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>LimitTileset.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>LimitTileset.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
-  <data name=">>UseOfficialMethod.Name" xml:space="preserve">
-    <value>UseOfficialMethod</value>
-  </data>
-  <data name=">>UseOfficialMethod.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>UseOfficialMethod.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>UseOfficialMethod.ZOrder" xml:space="preserve">
-    <value>3</value>
-  </data>
-  <data name=">>TilesetLimitPanel.Name" xml:space="preserve">
-    <value>TilesetLimitPanel</value>
-  </data>
-  <data name=">>TilesetLimitPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>TilesetLimitPanel.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>TilesetLimitPanel.ZOrder" xml:space="preserve">
-    <value>4</value>
-  </data>
-  <data name="grpTileSettings.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 144</value>
-  </data>
-  <data name="grpTileSettings.Size" type="System.Drawing.Size, System.Drawing">
-    <value>248, 168</value>
-  </data>
-  <data name="grpTileSettings.TabIndex" type="System.Int32, mscorlib">
-    <value>6</value>
-  </data>
-  <data name="grpTileSettings.Text" xml:space="preserve">
-    <value>Tile Settings</value>
-  </data>
-  <data name=">>grpTileSettings.Name" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>grpTileSettings.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>grpTileSettings.Parent" xml:space="preserve">
-    <value>panel2</value>
-  </data>
-  <data name=">>grpTileSettings.ZOrder" xml:space="preserve">
-    <value>3</value>
-  </data>
-  <data name="lnkCalcMpu.AutoSize" type="System.Boolean, mscorlib">
+  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
-  <data name="lnkCalcMpu.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
+  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
+    <value>11, 71</value>
   </data>
-  <data name="lnkCalcMpu.Location" type="System.Drawing.Point, System.Drawing">
-    <value>141, 105</value>
+  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
+    <value>91, 13</value>
   </data>
-  <data name="lnkCalcMpu.Size" type="System.Drawing.Size, System.Drawing">
-    <value>51, 13</value>
-  </data>
-  <data name="lnkCalcMpu.TabIndex" type="System.Int32, mscorlib">
-    <value>14</value>
-  </data>
-  <data name="lnkCalcMpu.Text" xml:space="preserve">
-    <value>Calculate</value>
-  </data>
-  <data name=">>lnkCalcMpu.Name" xml:space="preserve">
-    <value>lnkCalcMpu</value>
-  </data>
-  <data name=">>lnkCalcMpu.Type" xml:space="preserve">
-    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>lnkCalcMpu.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>lnkCalcMpu.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name=">>MetersPerUnit.Name" xml:space="preserve">
-    <value>MetersPerUnit</value>
-  </data>
-  <data name=">>MetersPerUnit.Type" xml:space="preserve">
-    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>MetersPerUnit.Parent" xml:space="preserve">
-    <value>OfficialMethodPanel</value>
-  </data>
-  <data name=">>MetersPerUnit.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name=">>label8.Name" xml:space="preserve">
-    <value>label8</value>
-  </data>
-  <data name=">>label8.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label8.Parent" xml:space="preserve">
-    <value>OfficialMethodPanel</value>
-  </data>
-  <data name=">>label8.ZOrder" xml:space="preserve">
+  <data name="label2.TabIndex" type="System.Int32, mscorlib">
     <value>1</value>
   </data>
-  <data name="OfficialMethodPanel.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
+  <data name="label2.Text" xml:space="preserve">
+    <value>Connection String</value>
   </data>
-  <data name="OfficialMethodPanel.Location" type="System.Drawing.Point, System.Drawing">
-    <value>24, 128</value>
+  <data name=">>label2.Name" xml:space="preserve">
+    <value>label2</value>
   </data>
-  <data name="OfficialMethodPanel.Size" type="System.Drawing.Size, System.Drawing">
-    <value>216, 24</value>
-  </data>
-  <data name="OfficialMethodPanel.TabIndex" type="System.Int32, mscorlib">
-    <value>13</value>
-  </data>
-  <data name=">>OfficialMethodPanel.Name" xml:space="preserve">
-    <value>OfficialMethodPanel</value>
-  </data>
-  <data name=">>OfficialMethodPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>OfficialMethodPanel.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>OfficialMethodPanel.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name="MetersPerUnit.Location" type="System.Drawing.Point, System.Drawing">
-    <value>104, 0</value>
-  </data>
-  <data name="MetersPerUnit.Size" type="System.Drawing.Size, System.Drawing">
-    <value>104, 20</value>
-  </data>
-  <data name="MetersPerUnit.TabIndex" type="System.Int32, mscorlib">
-    <value>9</value>
-  </data>
-  <data name="MetersPerUnit.ToolTip" xml:space="preserve">
-    <value>The number of meters pr. map unit</value>
-  </data>
-  <data name=">>MetersPerUnit.Name" xml:space="preserve">
-    <value>MetersPerUnit</value>
-  </data>
-  <data name=">>MetersPerUnit.Type" xml:space="preserve">
-    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>MetersPerUnit.Parent" xml:space="preserve">
-    <value>OfficialMethodPanel</value>
-  </data>
-  <data name=">>MetersPerUnit.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name="label8.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="label8.Location" type="System.Drawing.Point, System.Drawing">
-    <value>16, 0</value>
-  </data>
-  <data name="label8.Size" type="System.Drawing.Size, System.Drawing">
-    <value>74, 13</value>
-  </data>
-  <data name="label8.TabIndex" type="System.Int32, mscorlib">
-    <value>8</value>
-  </data>
-  <data name="label8.Text" xml:space="preserve">
-    <value>Meters pr. unit</value>
-  </data>
-  <data name=">>label8.Name" xml:space="preserve">
-    <value>label8</value>
-  </data>
-  <data name=">>label8.Type" xml:space="preserve">
+  <data name=">>label2.Type" xml:space="preserve">
     <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>label8.Parent" xml:space="preserve">
-    <value>OfficialMethodPanel</value>
+  <data name=">>label2.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
   </data>
-  <data name=">>label8.ZOrder" xml:space="preserve">
-    <value>1</value>
+  <data name=">>label2.ZOrder" xml:space="preserve">
+    <value>3</value>
   </data>
-  <data name="LimitTileset.AutoSize" type="System.Boolean, mscorlib">
+  <data name="label1.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
-  <data name="LimitTileset.Location" type="System.Drawing.Point, System.Drawing">
-    <value>24, 24</value>
+  <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
+    <value>11, 26</value>
   </data>
-  <data name="LimitTileset.Size" type="System.Drawing.Size, System.Drawing">
-    <value>118, 17</value>
+  <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
+    <value>46, 13</value>
   </data>
-  <data name="LimitTileset.TabIndex" type="System.Int32, mscorlib">
-    <value>11</value>
-  </data>
-  <data name="LimitTileset.Text" xml:space="preserve">
-    <value>Limit number of tiles</value>
-  </data>
-  <data name="LimitTileset.ToolTip" xml:space="preserve">
-    <value>Set a limit on the number of tiles generated, note that this may prevent all tiles from being created</value>
-  </data>
-  <data name=">>LimitTileset.Name" xml:space="preserve">
-    <value>LimitTileset</value>
-  </data>
-  <data name=">>LimitTileset.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>LimitTileset.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>LimitTileset.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
-  <data name="UseOfficialMethod.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="UseOfficialMethod.Location" type="System.Drawing.Point, System.Drawing">
-    <value>24, 104</value>
-  </data>
-  <data name="UseOfficialMethod.Size" type="System.Drawing.Size, System.Drawing">
-    <value>116, 17</value>
-  </data>
-  <data name="UseOfficialMethod.TabIndex" type="System.Int32, mscorlib">
-    <value>10</value>
-  </data>
-  <data name="UseOfficialMethod.Text" xml:space="preserve">
-    <value>Use official method</value>
-  </data>
-  <data name="UseOfficialMethod.ToolTip" xml:space="preserve">
-    <value>The official method is the most accurate, but requires that the meters per map unit is entered</value>
-  </data>
-  <data name=">>UseOfficialMethod.Name" xml:space="preserve">
-    <value>UseOfficialMethod</value>
-  </data>
-  <data name=">>UseOfficialMethod.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>UseOfficialMethod.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>UseOfficialMethod.ZOrder" xml:space="preserve">
-    <value>3</value>
-  </data>
-  <data name=">>MaxRowLimit.Name" xml:space="preserve">
-    <value>MaxRowLimit</value>
-  </data>
-  <data name=">>MaxRowLimit.Type" xml:space="preserve">
-    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>MaxRowLimit.Parent" xml:space="preserve">
-    <value>TilesetLimitPanel</value>
-  </data>
-  <data name=">>MaxRowLimit.ZOrder" xml:space="preserve">
+  <data name="label1.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
   </data>
-  <data name=">>label6.Name" xml:space="preserve">
-    <value>label6</value>
+  <data name="label1.Text" xml:space="preserve">
+    <value>Provider</value>
   </data>
-  <data name=">>label6.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  <data name=">>label1.Name" xml:space="preserve">
+    <value>label1</value>
   </data>
-  <data name=">>label6.Parent" xml:space="preserve">
-    <value>TilesetLimitPanel</value>
-  </data>
-  <data name=">>label6.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name=">>MaxColLimit.Name" xml:space="preserve">
-    <value>MaxColLimit</value>
-  </data>
-  <data name=">>MaxColLimit.Type" xml:space="preserve">
-    <value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>MaxColLimit.Parent" xml:space="preserve">
-    <value>TilesetLimitPanel</value>
-  </data>
-  <data name=">>MaxColLimit.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
-  <data name=">>label7.Name" xml:space="preserve">
-    <value>label7</value>
-  </data>
-  <data name=">>label7.Type" xml:space="preserve">
+  <data name=">>label1.Type" xml:space="preserve">
     <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>label7.Parent" xml:space="preserve">
-    <value>TilesetLimitPanel</value>
+  <data name=">>label1.Parent" xml:space="preserve">
+    <value>grpGlobalSettings</value>
   </data>
-  <data name=">>label7.ZOrder" xml:space="preserve">
-    <value>3</value>
-  </data>
-  <data name="TilesetLimitPanel.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
-  </data>
-  <data name="TilesetLimitPanel.Location" type="System.Drawing.Point, System.Drawing">
-    <value>24, 48</value>
-  </data>
-  <data name="TilesetLimitPanel.Size" type="System.Drawing.Size, System.Drawing">
-    <value>216, 48</value>
-  </data>
-  <data name="TilesetLimitPanel.TabIndex" type="System.Int32, mscorlib">
-    <value>12</value>
-  </data>
-  <data name=">>TilesetLimitPanel.Name" xml:space="preserve">
-    <value>TilesetLimitPanel</value>
-  </data>
-  <data name=">>TilesetLimitPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>TilesetLimitPanel.Parent" xml:space="preserve">
-    <value>grpTileSettings</value>
-  </data>
-  <data name=">>TilesetLimitPanel.ZOrder" xml:space="preserve">
+  <data name=">>label1.ZOrder" xml:space="preserve">
     <value>4</value>
   </data>
   <data name="MaxRowLimit.Location" type="System.Drawing.Point, System.Drawing">
@@ -1744,7 +1441,7 @@
   <data name=">>label7.ZOrder" xml:space="preserve">
     <value>3</value>
   </data>
-  <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>250, 17</value>
   </metadata>
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -2274,10 +1971,10 @@
   <data name=">>saveFileDialog.Type" xml:space="preserve">
     <value>System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>toolTip1.Name" xml:space="preserve">
-    <value>toolTip1</value>
+  <data name=">>toolTip.Name" xml:space="preserve">
+    <value>toolTip</value>
   </data>
-  <data name=">>toolTip1.Type" xml:space="preserve">
+  <data name=">>toolTip.Type" xml:space="preserve">
     <value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>$this.Name" xml:space="preserve">

Modified: trunk/Tools/Maestro/MgCooker/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/Strings.Designer.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker/Strings.Designer.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -278,6 +278,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to WARNING: An imperfect method was used to calculate this number. This value may not be correct..
+        /// </summary>
+        internal static string ImperfectMpuCalculation {
+            get {
+                return ResourceManager.GetString("ImperfectMpuCalculation", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to < Inaccurate measure of remaining time >.
         /// </summary>
         internal static string InsufficientTimePassed {
@@ -296,6 +305,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Missing required connection parameters "{0}" and "{1}".
+        /// </summary>
+        internal static string MissingRequiredConnectionParameters {
+            get {
+                return ResourceManager.GetString("MissingRequiredConnectionParameters", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to The file {0} was not found, unable to use the Native connection method.
         ///Either copy in the file, or do not use the Native connection method.
         /// </summary>

Modified: trunk/Tools/Maestro/MgCooker/Strings.resx
===================================================================
--- trunk/Tools/Maestro/MgCooker/Strings.resx	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker/Strings.resx	2014-05-07 08:13:21 UTC (rev 8118)
@@ -211,6 +211,9 @@
     <value>Shell Script ({0})</value>
     <comment>The name displayed for the *.sh filetype when the user is prompted to save a file</comment>
   </data>
+  <data name="ImperfectMpuCalculation" xml:space="preserve">
+    <value>WARNING: An imperfect method was used to calculate this number. This value may not be correct.</value>
+  </data>
   <data name="InsufficientTimePassed" xml:space="preserve">
     <value>< Inaccurate measure of remaining time ></value>
     <comment>Text displayed when it is not possible to predict the remaning time</comment>
@@ -219,6 +222,9 @@
     <value>An internal error occured: {0}</value>
     <comment>An error message that is displayed if an internal error occurs</comment>
   </data>
+  <data name="MissingRequiredConnectionParameters" xml:space="preserve">
+    <value>Missing required connection parameters "{0}" and "{1}"</value>
+  </data>
   <data name="MissingWebConfigFile" xml:space="preserve">
     <value>The file {0} was not found, unable to use the Native connection method.
 Either copy in the file, or do not use the Native connection method</value>

Modified: trunk/Tools/Maestro/MgCooker.Cmd/Program.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker.Cmd/Program.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/MgCooker.Cmd/Program.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -31,6 +31,7 @@
             //Append the "/commandline" switch
             List<string> tmp = new List<string>(args);
             tmp.Add("/commandline");
+            System.Diagnostics.Debugger.Break();
             MgCooker.Program.Main(tmp.ToArray());
         }
     }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs	2014-05-07 07:11:09 UTC (rev 8117)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs	2014-05-07 08:13:21 UTC (rev 8118)
@@ -485,69 +485,49 @@
             {
                 long rows, cols, rowTileOffset = 0 , colTileOffset = 0;
                 double scale = m_mapdefinition.BaseMap.GetScaleAt(i);
-                
-                if (m_parent.Config.UseOfficialMethod)
-                {
-                    //This is the algorithm proposed by the MapGuide team:
-                    //http://www.nabble.com/Pre-Genererate--tiles-for-the-entire-map-at-all-pre-defined-zoom-scales-to6074037.html#a6078663
-                    //
-                    //Method description inline (in case nabble link disappears):
-                    //
-                    // The upper left corner of the extents of the map corresponds to tile (0,0). Then tile (1,0) is to the right of that and tile (0,1) is under tile (0,0).
-                    // So assuming you know the extents of your map, you can calculate how many tiles it spans at the given scale, using the following
-                    //
-                    // number of tiles x = map width in meters  / ( 0.079375 * map_scale)
-                    // number of tiles y = map height in meters / ( 0.079375 * map_scale)
-                    //
-                    // where 0.079375 = [inch to meter] / image DPI * tile size = 0.0254 / 96 * 300.
-                    //
-                    // This assumes you know the scale factor that converts your map width and height to meters. You can get this from the coordinate system of the map if you don't know it, but it's much easier to just plug in the number into this equation.
-                    // 
-                    // Also have in mind that you can also request tiles beyond the map extent (for example tile (-1, -1), however, there is probably no point to cache them unless you have valid data outside your initial map extents.
-                    
-                    //The tile extent in meters
-                    double tileWidth  =((INCH_TO_METER / m_parent.Config.DPI * m_parent.Config.TileWidth) * (scale));
-                    double tileHeight = ((INCH_TO_METER / m_parent.Config.DPI * m_parent.Config.TileHeight) * (scale));
 
-                    //Using this algorithm, yields a negative number of columns/rows, if the max scale is larger than the max extent of the map.
-                    rows = Math.Max(1, (int)Math.Ceiling((height_in_meters / tileHeight)));
-                    cols = Math.Max(1, (int)Math.Ceiling((width_in_meters / tileWidth)));
+                // This is the official method, and the only one MgCooker will ever use
 
-                    if (m_maxExtent != null)
-                    {
-                        //The extent is overridden, so we need to adjust the start offsets
-                        double offsetX = MaxExtent.MinX - m_mapdefinition.Extents.MinX;
-                        double offsetY = m_mapdefinition.Extents.MaxY - MaxExtent.MaxY ;
-                        rowTileOffset = (int)Math.Floor(offsetY / tileHeight);
-                        colTileOffset = (int)Math.Floor(offsetX / tileWidth);
+                // This is the algorithm proposed by the MapGuide team:
+                // http://www.nabble.com/Pre-Genererate--tiles-for-the-entire-map-at-all-pre-defined-zoom-scales-to6074037.html#a6078663
+                //
+                // Method description inline (in case nabble link disappears):
+                //
+                // The upper left corner of the extents of the map corresponds to tile (0,0). Then tile (1,0) is to the right of that and tile (0,1) is under tile (0,0).
+                // So assuming you know the extents of your map, you can calculate how many tiles it spans at the given scale, using the following
+                //
+                // number of tiles x = map width in meters  / ( 0.079375 * map_scale)
+                // number of tiles y = map height in meters / ( 0.079375 * map_scale)
+                //
+                // where 0.079375 = [inch to meter] / image DPI * tile size = 0.0254 / 96 * 300.
+                //
+                // This assumes you know the scale factor that converts your map width and height to meters. You can get this from the coordinate system of the map if you don't know it, but it's much easier to just plug in the number into this equation.
+                // 
+                // Also have in mind that you can also request tiles beyond the map extent (for example tile (-1, -1), however, there is probably no point to cache them unless you have valid data outside your initial map extents.
 
-                        double offsetMaxX = MaxExtent.MaxX - m_mapdefinition.Extents.MinX;
-                        double offsetMinY = m_mapdefinition.Extents.MaxY - MaxExtent.MinY;
-                        int rowMinTileOffset = (int)Math.Floor(offsetMinY / tileHeight);
-                        int colMaxTileOffset = (int)Math.Floor(offsetMaxX / tileWidth);
+                //The tile extent in meters
+                double tileWidth = ((INCH_TO_METER / m_parent.Config.DPI * m_parent.Config.TileWidth) * (scale));
+                double tileHeight = ((INCH_TO_METER / m_parent.Config.DPI * m_parent.Config.TileHeight) * (scale));
 
-                        cols += (colMaxTileOffset - colTileOffset);
-                        rows += (rowMinTileOffset - rowTileOffset);
-                    }
-                }
-                else
+                //Using this algorithm, yields a negative number of columns/rows, if the max scale is larger than the max extent of the map.
+                rows = Math.Max(1, (int)Math.Ceiling((height_in_meters / tileHeight)));
+                cols = Math.Max(1, (int)Math.Ceiling((width_in_meters / tileWidth)));
+
+                if (m_maxExtent != null)
                 {
-                    //This method assumes that the max scale is displayed on a screen with resolution 1920x1280.
-                    //This display width/height is then multiplied up to calculate the pixelwidth of all subsequent
-                    //scale ranges. Eg. if max scale range is 1:200, then scale range 1:100 is twice the size,
-                    //meaning the full map at 1:100 fills 3840x2560 pixels.
-                    //The width/height is then used to calculate the number of rows and columns of 300x300 pixel tiles.
-                    
-                    //The purpose of this method is to enabled tile generation without access to
-                    //coordinate system properties
+                    //The extent is overridden, so we need to adjust the start offsets
+                    double offsetX = MaxExtent.MinX - m_mapdefinition.Extents.MinX;
+                    double offsetY = m_mapdefinition.Extents.MaxY - MaxExtent.MaxY;
+                    rowTileOffset = (int)Math.Floor(offsetY / tileHeight);
+                    colTileOffset = (int)Math.Floor(offsetX / tileWidth);
 
-                    long pw = (long)(m_parent.Config.DisplayResolutionWidth * (1 / (scale / maxscale)));
-                    long ph = (long)(m_parent.Config.DisplayResolutionHeight * (1 / (scale / maxscale)));
+                    double offsetMaxX = MaxExtent.MaxX - m_mapdefinition.Extents.MinX;
+                    double offsetMinY = m_mapdefinition.Extents.MaxY - MaxExtent.MinY;
+                    int rowMinTileOffset = (int)Math.Floor(offsetMinY / tileHeight);
+                    int colMaxTileOffset = (int)Math.Floor(offsetMaxX / tileWidth);
 
-                    rows = (ph + (m_parent.Config.TileHeight - 1)) / m_parent.Config.TileHeight;
-                    cols = (pw + (m_parent.Config.TileWidth - 1)) / m_parent.Config.TileWidth;
-                    rows += rows % 2;
-                    cols += cols % 2;
+                    cols += (colMaxTileOffset - colTileOffset);
+                    rows += (rowMinTileOffset - rowTileOffset);
                 }
 
 
@@ -807,21 +787,6 @@
         public int RetryCount = 5;
 
         /// <summary>
-        /// The display resolution width
-        /// </summary>
-        public int DisplayResolutionWidth = 1920;
-
-        /// <summary>
-        /// The display resolution height
-        /// </summary>
-        public int DisplayResolutionHeight = 1280;
-
-        /// <summary>
-        /// Gets or sets whether to use the official method of tile generation. Requires an accurate meters per unit value to work
-        /// </summary>
-        public bool UseOfficialMethod = false;
-
-        /// <summary>
         /// Gets or sets whether to randomize the tile generation sequence
         /// </summary>
         public bool RandomizeTileSequence = false;



More information about the mapguide-commits mailing list