[mapguide-commits] r5351 - trunk/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Oct 28 07:41:01 EDT 2010


Author: jng
Date: 2010-10-28 04:41:01 -0700 (Thu, 28 Oct 2010)
New Revision: 5351

Modified:
   trunk/MgDev/Web/src/viewerfiles/mainframe.templ
Log:
Fix #1510: Update GettingStartedURL() to handle initial urls with querystring parameters

Modified: trunk/MgDev/Web/src/viewerfiles/mainframe.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/mainframe.templ	2010-10-28 11:15:53 UTC (rev 5350)
+++ trunk/MgDev/Web/src/viewerfiles/mainframe.templ	2010-10-28 11:41:01 UTC (rev 5351)
@@ -258,11 +258,21 @@
 }
 
 function GettingStartedURL ()
-{
+{    
     if(defHome)
         return homePage + "?WEBLAYOUT=" + encodeURIComponent(webLayout) + "&SESSION=" + GetMapFrame().GetSessionId() + "&LOCALE=" + locale + "&DWF=" + dwf;
     else
-        return homePage + "?SESSION=" + GetMapFrame().GetSessionId() + "&LOCALE=" + locale + "&MAPNAME=" + encodeURIComponent(GetMapFrame().GetMapName());
+    {
+        var baseUrl = homePage;
+        var query = "";
+        var index = homePage.indexOf("?");
+        if (index > 0)
+        {
+            baseUrl = homePage.substring(0, index);
+            query = "&" + homePage.substring(index+1);
+        }
+        return baseUrl + "?SESSION=" + GetMapFrame().GetSessionId() + "&LOCALE=" + locale + "&MAPNAME=" + encodeURIComponent(GetMapFrame().GetMapName()) + query;
+    }
 }
 
 function SetSelectionXML(xmlSet)
@@ -711,24 +721,8 @@
 {
     if(inMeasure)
         EndMeasure();
-    var mapFrame = GetMapFrame();
-    var center = mapFrame.GetCenter();
-
-    var vpath = "%s";
-    mapFrame.LoadJxLib(function()
-    {
-        if (typeof mapFrame.MapCapturer == "undefined")
-        {
-            mapFrame.LoadJsFile("../viewerfiles/quickplot.js", function()
-            {
-                OpenUrl(vpath + "?TARGETTYPE=" + commands[index].targetType, index);
-            });
-        }
-        else
-        {
-            OpenUrl(vpath + "?TARGETTYPE=" + commands[index].targetType, index);
-        }
-    });
+    var center = GetMapFrame().GetCenter();
+    OpenUrl("%s?SCALE=" + curScale + "&DPI=" + GetMapFrame().GetDPI() + "&CENTERX=" + center.X + "&CENTERY=" + center.Y, index);
 }
 
 function ExecuteMeasureCommand(index)



More information about the mapguide-commits mailing list