[Mapbender-commits] r3611 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Mar 2 03:23:50 EST 2009


Author: verenadiewald
Date: 2009-03-02 03:23:49 -0500 (Mon, 02 Mar 2009)
New Revision: 3611

Modified:
   trunk/mapbender/http/javascripts/map_obj.js
Log:
added function getMousePosition to get valid x and y from mapframe1 without iframe

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-03-02 08:22:26 UTC (rev 3610)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-03-02 08:23:49 UTC (rev 3611)
@@ -74,6 +74,25 @@
 		domElement.style.height = this.height;
 	};
 	
+	this.getMousePosition = function (e) {
+		mb_getMousePos(e, this.frameName);
+		var currentPos = null;
+		if (this.type == "DIV") {
+			var mapDomElement = this.getDomElement();
+			currentPos = new Point(
+				clickX - parseInt(mapDomElement.style.left), 
+				clickY - parseInt(mapDomElement.style.top)
+			);
+		}
+		else {
+			currentPos = new Point(
+				clickX, 
+				clickY
+			);
+		}
+		return currentPos;
+	}
+	
 	/**
 	 * converts the extent of the mapobject so that the maximum	extent will be displayed
 	 */



More information about the Mapbender_commits mailing list