[mapguide-commits] r7196 - in trunk/Tools/Maestro: Maestro.Base/Commands Maestro.Base/Services Maestro.Base/UI OSGeo.MapGuide.MaestroAPI.Native

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Nov 6 21:28:58 PST 2012


Author: jng
Date: 2012-11-06 21:28:58 -0800 (Tue, 06 Nov 2012)
New Revision: 7196

Modified:
   trunk/Tools/Maestro/Maestro.Base/Commands/StartupCommand.cs
   trunk/Tools/Maestro/Maestro.Base/Services/ResourcePreviewerFactory.cs
   trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
Log:
This submission contains the following changes:
 - Fix incorrect MPU calculation in the LocalNative provider
 - Register a stub previewer for the LocalNative provider, meaning some resources can still be previewed via the new local map preview if the option is enabled.
 - Show the coordinate system WKT of the runtime map in the MapPreviewDialog

Modified: trunk/Tools/Maestro/Maestro.Base/Commands/StartupCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/StartupCommand.cs	2012-11-06 16:18:45 UTC (rev 7195)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/StartupCommand.cs	2012-11-07 05:28:58 UTC (rev 7196)
@@ -42,6 +42,9 @@
             ResourceService.RegisterNeutralStrings(Strings.ResourceManager);
 
             ResourcePreviewerFactory.RegisterPreviewer("Maestro.Http", new DefaultResourcePreviewer()); //NOXLATE
+            //A stub previewer does nothing, but will use local map previews for applicable resources if the configuration
+            //property is set
+            ResourcePreviewerFactory.RegisterPreviewer("Maestro.LocalNative", new StubPreviewer()); //NOXLATE
             
             Workbench.WorkbenchInitialized += (sender, e) =>
             {

Modified: trunk/Tools/Maestro/Maestro.Base/Services/ResourcePreviewerFactory.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/ResourcePreviewerFactory.cs	2012-11-06 16:18:45 UTC (rev 7195)
+++ trunk/Tools/Maestro/Maestro.Base/Services/ResourcePreviewerFactory.cs	2012-11-07 05:28:58 UTC (rev 7196)
@@ -71,6 +71,25 @@
         void Preview(IResource res, IEditorService edSvc, string locale);
     }
 
+    internal class StubPreviewer : IResourcePreviewer
+    {
+        public bool IsPreviewable(IResource res)
+        {
+            return false;
+        }
+
+        public void Preview(IResource res, IEditorService edSvc)
+        {
+            
+        }
+
+        public void Preview(IResource res, IEditorService edSvc, string locale)
+        {
+            
+        }
+    }
+
+
     public class LocalMapPreviewer : IResourcePreviewer
     {
         private IResourcePreviewer _inner;

Modified: trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.Designer.cs	2012-11-06 16:18:45 UTC (rev 7195)
+++ trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.Designer.cs	2012-11-07 05:28:58 UTC (rev 7196)
@@ -53,6 +53,8 @@
             this.label2 = new System.Windows.Forms.Label();
             this.txtMinX = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.txtCoordinateSystem = new System.Windows.Forms.TextBox();
             this.statusStrip1.SuspendLayout();
             this.splitContainer1.Panel1.SuspendLayout();
             this.splitContainer1.Panel2.SuspendLayout();
@@ -197,16 +199,16 @@
             this.grpOtherTools.Controls.Add(this.lnkZoomToScale);
             this.grpOtherTools.Controls.Add(this.numZoomToScale);
             this.grpOtherTools.Controls.Add(this.label5);
-            this.grpOtherTools.Location = new System.Drawing.Point(16, 222);
+            this.grpOtherTools.Location = new System.Drawing.Point(16, 367);
             this.grpOtherTools.Name = "grpOtherTools";
-            this.grpOtherTools.Size = new System.Drawing.Size(165, 260);
+            this.grpOtherTools.Size = new System.Drawing.Size(165, 115);
             this.grpOtherTools.TabIndex = 1;
             this.grpOtherTools.TabStop = false;
             this.grpOtherTools.Text = "Other Tools";
             // 
             // btnGetMapKml
             // 
-            this.btnGetMapKml.Location = new System.Drawing.Point(10, 108);
+            this.btnGetMapKml.Location = new System.Drawing.Point(10, 74);
             this.btnGetMapKml.Name = "btnGetMapKml";
             this.btnGetMapKml.Size = new System.Drawing.Size(94, 23);
             this.btnGetMapKml.TabIndex = 4;
@@ -245,6 +247,8 @@
             // 
             this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox1.Controls.Add(this.txtCoordinateSystem);
+            this.groupBox1.Controls.Add(this.label6);
             this.groupBox1.Controls.Add(this.txtMaxY);
             this.groupBox1.Controls.Add(this.label4);
             this.groupBox1.Controls.Add(this.txtMaxX);
@@ -255,7 +259,7 @@
             this.groupBox1.Controls.Add(this.label1);
             this.groupBox1.Location = new System.Drawing.Point(16, 10);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(165, 205);
+            this.groupBox1.Size = new System.Drawing.Size(165, 351);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "Current Extents";
@@ -336,6 +340,27 @@
             this.label1.TabIndex = 0;
             this.label1.Text = "Min X";
             // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(7, 190);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(95, 13);
+            this.label6.TabIndex = 8;
+            this.label6.Text = "Coordinate System";
+            // 
+            // txtCoordinateSystem
+            // 
+            this.txtCoordinateSystem.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtCoordinateSystem.Location = new System.Drawing.Point(10, 207);
+            this.txtCoordinateSystem.Multiline = true;
+            this.txtCoordinateSystem.Name = "txtCoordinateSystem";
+            this.txtCoordinateSystem.ReadOnly = true;
+            this.txtCoordinateSystem.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.txtCoordinateSystem.Size = new System.Drawing.Size(135, 123);
+            this.txtCoordinateSystem.TabIndex = 9;
+            // 
             // MapPreviewDialog
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -392,5 +417,7 @@
         private System.Windows.Forms.TextBox txtMinX;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Button btnGetMapKml;
+        private System.Windows.Forms.TextBox txtCoordinateSystem;
+        private System.Windows.Forms.Label label6;
     }
 }
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.cs	2012-11-06 16:18:45 UTC (rev 7195)
+++ trunk/Tools/Maestro/Maestro.Base/UI/MapPreviewDialog.cs	2012-11-07 05:28:58 UTC (rev 7196)
@@ -45,6 +45,7 @@
             if (!string.IsNullOrEmpty(resourceId))
                 this.Text += " - " + resourceId;
 
+            txtCoordinateSystem.Text = map.CoordinateSystem;
             numZoomToScale.Minimum = 1;
             numZoomToScale.Maximum = Int32.MaxValue;
             _launcher = urlLauncher;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-11-06 16:18:45 UTC (rev 7195)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-11-07 05:28:58 UTC (rev 7196)
@@ -170,7 +170,7 @@
             {
                 MgCoordinateSystemFactory csFact = new MgCoordinateSystemFactory();
                 MgCoordinateSystem cs = csFact.Create(csWkt);
-                return cs.ConvertMetersToCoordinateSystemUnits(units);
+                return cs.ConvertCoordinateSystemUnitsToMeters(units);
             }
             catch (MgException ex) //Not implemented due to wrapping Proj.4?
             {



More information about the mapguide-commits mailing list