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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jan 27 21:13:21 EST 2011


Author: liuar
Date: 2011-01-27 18:13:20 -0800 (Thu, 27 Jan 2011)
New Revision: 5509

Modified:
   trunk/MgDev/Web/src/viewerfiles/quickplot.js
Log:
For http://trac.osgeo.org/mapguide/ticket/1589

If there are base layers existing in a MapDefinition?, then the quick plot capture box cannot move or rotate in Ajax viewer.

The reason is like below: When quick plot capture box is active, to determine if the capture box should be dragged with the mouse move, there is code detecting if the mouse pointer is in the capture box area, it is a "if a point is in a rectangle" check. To do this check, the mouse pointer position will be converted to map units.

To convert mouse's position to map units, we need to consider the "offsetTop" of the "map". The code used map container div whose is with id "img1" to calculate the offsetTop recursively. While <div id="img1"> is a "relative positioned" element, its offsetTop will be affected by its previous sibling: <div id="tilePlanes">. When there are base layers, then <div id="tilePlanes"> will contain tiles which fulfill the screen. It makes the <div id="img1"> 's offsetTop is always the windown's height which is wrong.

The correct way is: instead of getting the offsetTop from <div id="img1"> recursively, I should get it from <img id="mapImage1"> which is the map image and always fulfill the viewer.


Modified: trunk/MgDev/Web/src/viewerfiles/quickplot.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplot.js	2011-01-27 11:11:10 UTC (rev 5508)
+++ trunk/MgDev/Web/src/viewerfiles/quickplot.js	2011-01-28 02:13:20 UTC (rev 5509)
@@ -641,7 +641,7 @@
     
     getScreenOffset : function()
     {
-        return this.getContentPosition(this.mapWindow.$("img1"));
+        return this.getContentPosition(this.mapWindow.$("mapImage1"));
     },
     
     getContentPosition: function(element)



More information about the mapguide-commits mailing list