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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jan 12 21:23:48 EST 2010


Author: leaf
Date: 2010-01-12 21:23:48 -0500 (Tue, 12 Jan 2010)
New Revision: 4528

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

Fixed ticket #1242 Zoom with middle button does not work well with FireFox + Ajax View.
In ajaxmappane.templ line 3685, 

wheelZoomCursor = new Point(msie ? event.clientX - mapPosX : event.screenX - mapPosX,
        		msie ? event.clientY : event.screenY);

event.clientX returns the horizontal coordinate within the application's client area at which the event occurred 
event.screenX returns the horizontal coordinate of the event within the screen as a whole.
So, other browsers besides IE should also use event.clientX - mapPosX and event.clientY to indicate the cursor's position on map.

Modified: sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ	2010-01-13 02:23:26 UTC (rev 4527)
+++ sandbox/adsk/2.2gp/Web/src/viewerfiles/ajaxmappane.templ	2010-01-13 02:23:48 UTC (rev 4528)
@@ -895,7 +895,7 @@
     {
         HideHyperlinkTip();
 
-        // Ctrl + Click to open URL except MacOS, which using Command + Click
+	// Ctrl + Click to open URL except MacOS, which using Command + Click
         if(tool != 6 && ((e.ctrlKey && !macOS) || (e.metaKey && macOS )))
         {
             if(hlData.url != "")
@@ -927,10 +927,10 @@
                     StartToolFeedback(x, y, CIRCLE);
                     break;
                 case 6:
-                    if((e.ctrlKey && !macOS) || (e.metaKey && macOS))
-                    {
-                        EndPolygonSelection(x, y);
-                    }
+		    if((e.ctrlKey && !macOS) || (e.metaKey && macOS))
+		    {
+			EndPolygonSelection(x, y);
+		    }
                     else
                     {
                         if(polySel.xs.length == 0)
@@ -1815,17 +1815,11 @@
     mapLoading = false;
 
     var text = this.req.responseText;
-    
-    var message = text;
 
     var startPos = text.indexOf("<h2>");
-    if(startPos != -1)
-    {
-        startPos = startPos + 4;
-        var endPos = text.indexOf("</h2>", startPos);
-        if(endPos != -1)
-            message = text.substring(startPos, endPos);
-    }
+    startPos = startPos + 4;
+    var endPos = text.indexOf("</h2>", startPos);
+    var message = text.substring(startPos, endPos);
 
     alert(message);
 
@@ -1883,20 +1877,13 @@
 function OnSelectionOverlayImageLoadedError(e)
 {
     var text = this.req.responseText;
-
-    var messageErr = "";
+    
     var startPos = text.indexOf("<h2>");
-    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.";
+    startPos = startPos + 4;
+    var endPos = text.indexOf("</h2>", startPos);
+    var message = text.substring(startPos, endPos);
 
-    alert(messageErr);
+    alert(message);
 
     return false;
 }
@@ -1937,15 +1924,11 @@
 
 function RequestFailed(text)
 {
-    var message = text;
     var startPos = text.indexOf("<h2>");
-    if(startPos != -1)
-    {
-        startPos = startPos + 4;
-        var endPos = text.indexOf("</h2>", startPos);
-        if(endPos != -1)
-            message = text.substring(startPos, endPos);
-    }
+    startPos = startPos + 4;
+    var endPos = text.indexOf("</h2>", startPos);
+    var message = text.substring(startPos, endPos);
+    
     alert(message);
 }
 
@@ -2777,12 +2760,7 @@
         ProcessFeatureInfo(selRequest.responseXML.documentElement, append, which);
     }
     else
-    {
-        if(selRequest.responseText != "")
-            RequestFailed(selRequest.responseText);
-        else
-            RequestFailed("No response");
-    }
+        RequestFailed("No response");
 }
 
 function CompareProperties(p1, p2)
@@ -3704,8 +3682,7 @@
     if(wheelZoomDelta == null)
     {
         //Determine the cursor position
-        wheelZoomCursor = new Point(msie ? event.clientX - mapPosX : event.screenX - mapPosX,
-            msie ? event.clientY : event.screenY);
+        wheelZoomCursor = new Point(event.clientX - mapPosX, event.clientY);
         if(wheelZoomCursor.X < 0)
         {
             //Do not process wheel events in the property or legend area



More information about the mapguide-commits mailing list