[mapguide-commits] r4555 - sandbox/adsk/2.2gp/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 29 04:00:13 EST 2010


Author: leaf
Date: 2010-01-29 04:00:11 -0500 (Fri, 29 Jan 2010)
New Revision: 4555

Modified:
   sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ
Log:
Submit on behalf of Arthur Liu.

Port ajaxmappane.templ from trunk to branch. 
Fix ticket http://trac.osgeo.org/mapguide/ticket/1237.
Error dialog of ajax viewer should be refined.

Modified: sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ	2010-01-28 21:16:47 UTC (rev 4554)
+++ sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ	2010-01-29 09:00:11 UTC (rev 4555)
@@ -1815,11 +1815,17 @@
     mapLoading = false;
 
     var text = this.req.responseText;
+    
+    var message = text;
 
     var startPos = text.indexOf("<h2>");
-    startPos = startPos + 4;
-    var endPos = text.indexOf("</h2>", startPos);
-    var message = text.substring(startPos, endPos);
+    if(startPos != -1)
+    {
+        startPos = startPos + 4;
+        var endPos = text.indexOf("</h2>", startPos);
+        if(endPos != -1)
+            message = text.substring(startPos, endPos);
+    }
 
     alert(message);
 
@@ -1878,12 +1884,19 @@
 {
     var text = this.req.responseText;
     
+    var messageErr = "";
     var startPos = text.indexOf("<h2>");
-    startPos = startPos + 4;
-    var endPos = text.indexOf("</h2>", startPos);
-    var message = text.substring(startPos, endPos);
+    if(startPos != -1)
+    {
+        startPos = startPos + 4;
+        var endPos = text.indexOf("</h2>", startPos);
+        if(endPos != -1)
+            messageErr = text.substring(startPos, endPos);
+    }
+    if(messageErr == "")
+        messageErr = "No feature available.";
 
-    alert(message);
+    alert(messageErr);
 
     return false;
 }
@@ -1924,11 +1937,15 @@
 
 function RequestFailed(text)
 {
+    var message = text;
     var startPos = text.indexOf("<h2>");
-    startPos = startPos + 4;
-    var endPos = text.indexOf("</h2>", startPos);
-    var message = text.substring(startPos, endPos);
-    
+    if(startPos != -1)
+    {
+        startPos = startPos + 4;
+        var endPos = text.indexOf("</h2>", startPos);
+        if(endPos != -1)
+            message = text.substring(startPos, endPos);
+    }
     alert(message);
 }
 
@@ -2760,7 +2777,12 @@
         ProcessFeatureInfo(selRequest.responseXML.documentElement, append, which);
     }
     else
-        RequestFailed("No response");
+    {
+        if(selRequest.responseText != "")
+            RequestFailed(selRequest.responseText);
+        else
+            RequestFailed("No response");
+    }
 }
 
 function CompareProperties(p1, p2)



More information about the mapguide-commits mailing list