[Mapbender-commits] r7589 - branches/2.7/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Feb 14 04:00:13 EST 2011


Author: verenadiewald
Date: 2011-02-14 01:00:13 -0800 (Mon, 14 Feb 2011)
New Revision: 7589

Modified:
   branches/2.7/http/javascripts/mod_measure.php
Log:
use correct pos values to calculate dist for measuring

Modified: branches/2.7/http/javascripts/mod_measure.php
===================================================================
--- branches/2.7/http/javascripts/mod_measure.php	2011-02-14 08:59:02 UTC (rev 7588)
+++ branches/2.7/http/javascripts/mod_measure.php	2011-02-14 09:00:13 UTC (rev 7589)
@@ -224,15 +224,15 @@
 	var dist;
 	if(mod_measure_epsg=="EPSG:4326"){
 		//convert coordinates to radian
-		var lon_from=(pos.x*Math.PI)/180;
-		var lat_from=(pos.y*Math.PI)/180;
+		var lon_from=(pos[0]*Math.PI)/180;
+		var lat_from=(pos[1]*Math.PI)/180;
 		var lon_to=(mod_measure_RX[mod_measure_RX.length-1]*Math.PI)/180;
 		var lat_to=(mod_measure_RY[mod_measure_RY.length-1]*Math.PI)/180;
 		dist=6371229*Math.acos(Math.sin(lat_from)*Math.sin(lat_to)+Math.cos(lat_from)*Math.cos(lat_to)*Math.cos(lon_from-lon_to));
 	}
 	else{
-		var dist_x = Math.abs(mod_measure_RX[mod_measure_RX.length-1] - pos.x);
-		var dist_y = Math.abs(mod_measure_RY[mod_measure_RY.length-1] - pos.y);
+		var dist_x = Math.abs(mod_measure_RX[mod_measure_RX.length-1] - pos[0]);
+		var dist_y = Math.abs(mod_measure_RY[mod_measure_RY.length-1] - pos[1]);
 		dist=Math.sqrt(dist_x*dist_x+dist_y*dist_y);
 	}
 	if(isNaN(dist) == false && mousepos.x > 0 && mousepos.x < mod_measure_width && mousepos.y > 0 && mousepos.y < mod_measure_height){



More information about the Mapbender_commits mailing list