[mapguide-commits] r5929 - trunk/Tools/Maestro/Maestro.Base/Editor

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jun 16 07:39:27 EDT 2011


Author: jng
Date: 2011-06-16 04:39:27 -0700 (Thu, 16 Jun 2011)
New Revision: 5929

Modified:
   trunk/Tools/Maestro/Maestro.Base/Editor/ResourcePreviewEngine.cs
Log:
Add an extra viewer command under tools menu of generated web layout to display current map extents. Should prove useful when previewing data and needing to sample the map extents.


Modified: trunk/Tools/Maestro/Maestro.Base/Editor/ResourcePreviewEngine.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/ResourcePreviewEngine.cs	2011-06-14 13:02:53 UTC (rev 5928)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/ResourcePreviewEngine.cs	2011-06-16 11:39:27 UTC (rev 5929)
@@ -147,11 +147,28 @@
             cmd2.ImageURL = "../stdicons/icon_invokescript.gif";
 
             wl.CommandSet.AddCommand(cmd2);
+
+            var cmd3 = wl.CreateInvokeScriptCommand();
+            cmd3.Name = "GetExtents";
+            cmd3.Label = "Get Extents";
+            cmd3.Description = "Gets the current map as a KML document";
+            cmd3.Tooltip = "Gets the current map as a KML document";
+
+            cmd3.Script = @"
+                var map = parent.parent.GetMapFrame();
+                alert('Map Extents\n\nLower Left: ' + map.extX1 + ', ' + map.extY2 + '\nUpper Right: ' + map.extX2 + ', ' + map.extY1);
+                ";
+
+            cmd3.TargetViewer = TargetViewerType.Ajax;
+            cmd3.ImageURL = "../stdicons/icon_invokescript.gif";
+
+            wl.CommandSet.AddCommand(cmd3);
             
             var zoomScale = wl.CreateCommandItem(cmd.Name);
             var menu = wl.CreateFlyout("Tools", "Tools", "Extra tools", "", "", 
                 wl.CreateCommandItem("ZoomScale"),
-                wl.CreateCommandItem("GetMapKml")
+                wl.CreateCommandItem("GetMapKml"),
+                wl.CreateCommandItem("GetExtents")
             );
             wl.ToolBar.AddItem(menu);
         }



More information about the mapguide-commits mailing list