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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 15 23:32:53 PDT 2012


Author: jng
Date: 2012-10-15 23:32:52 -0700 (Mon, 15 Oct 2012)
New Revision: 7117

Modified:
   trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ
Log:
AJAX Viewer: Externalize certain parameters that were previously hard-coded into mapagent request urls.

Modified: trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ	2012-10-16 06:13:50 UTC (rev 7116)
+++ trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ	2012-10-16 06:32:52 UTC (rev 7117)
@@ -344,6 +344,9 @@
 var featureRequestUrl = '%s';
 %s
 var isAlertShow = false;
+var mapImgFormat = "PNG";
+var selectionImgFormat = "PNG";
+var queryVariant = "INTERSECTS";
 
 var simulateCirclePoints = [];
 var simulateCircleHalfPointNumber = 40;
@@ -1862,7 +1865,7 @@
 
 function RequestMapImage(reqId, viewParams)
 {
-    url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=PNG&VERSION=2.1.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random() + "&CLIENTAGENT=" + encodeComponent(clientAgent) + "&BEHAVIOR=2";
+    url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=" + mapImgFormat + "&VERSION=2.1.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random() + "&CLIENTAGENT=" + encodeComponent(clientAgent) + "&BEHAVIOR=2";
     url += viewParams;
     if(safari || chrome || firefox)
     {
@@ -1879,7 +1882,7 @@
 
 function RequestSelectionImage(reqId, viewParams)
 {
-    url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=PNG&VERSION=2.1.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random() + "&CLIENTAGENT=" + encodeComponent(clientAgent) + "&BEHAVIOR=5&SELECTIONCOLOR=" + selectionColor;
+    url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=" + selectionImgFormat + "&VERSION=2.1.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random() + "&CLIENTAGENT=" + encodeComponent(clientAgent) + "&BEHAVIOR=5&SELECTIONCOLOR=" + selectionColor;
     url += viewParams;
     if(safari || chrome)
     {
@@ -3011,7 +3014,7 @@
     if(GetVisSelLayers() == "") return;
     if(moveType != NONE) return;
     var reqParams = "OPERATION=QUERYMAPFEATURES&VERSION=1.0.0&PERSIST=1&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SEQ=" + Math.random();
-    reqParams += "&LAYERNAMES=" + encodeURIComponent(GetVisSelLayers()) + "&GEOMETRY=" + geom + "&SELECTIONVARIANT=INTERSECTS" + "&CLIENTAGENT=" + encodeURIComponent(clientAgent);
+    reqParams += "&LAYERNAMES=" + encodeURIComponent(GetVisSelLayers()) + "&GEOMETRY=" + geom + "&SELECTIONVARIANT=" + queryVariant + "&CLIENTAGENT=" + encodeURIComponent(clientAgent);
     if(maxfeatures != 0)
     {
         reqParams += "&MAXFEATURES=" + maxfeatures;



More information about the mapguide-commits mailing list