[Mapbender-commits] r8464 - tags/2.7.3/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Aug 22 02:28:12 PDT 2012


Author: verenadiewald
Date: 2012-08-22 02:28:12 -0700 (Wed, 22 Aug 2012)
New Revision: 8464

Modified:
   tags/2.7.3/http/javascripts/map_obj.js
Log:
http://trac.osgeo.org/mapbender/ticket/884

Modified: tags/2.7.3/http/javascripts/map_obj.js
===================================================================
--- tags/2.7.3/http/javascripts/map_obj.js	2012-08-22 06:20:01 UTC (rev 8463)
+++ tags/2.7.3/http/javascripts/map_obj.js	2012-08-22 09:28:12 UTC (rev 8464)
@@ -775,6 +775,7 @@
      * Convert real world coordinates to pixel coordinates
      */
     this.convertRealToPixel = function(aPoint, referenceExtent){
+    	
     	var arrayBBox;
 		if (arguments.length === 2) {
     		arrayBBox = referenceExtent.toString().split(",");
@@ -782,11 +783,16 @@
     	else {
 	        arrayBBox = this.getExtent().split(",");
     	}
+		
         var minX = parseFloat(arrayBBox[0]);
         var minY = parseFloat(arrayBBox[1]);
         var maxX = parseFloat(arrayBBox[2]);
         var maxY = parseFloat(arrayBBox[3]);
-        return new Point(Math.round((aPoint.x - minX) * this.getWidth() / (maxX - minX)), Math.round((maxY - aPoint.y) * this.getHeight() / (maxY - minY)));
+        
+        var newX = (aPoint.x - minX) * this.getWidth() / (maxX - minX);
+        var newY = (maxY - aPoint.y) * this.getHeight() / (maxY - minY);
+        
+        return new Point(newX, newY);
     };
     
     /**



More information about the Mapbender_commits mailing list