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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 28 08:47:22 EDT 2009


Author: christoph
Date: 2009-08-28 08:47:21 -0400 (Fri, 28 Aug 2009)
New Revision: 4553

Modified:
   trunk/mapbender/http/javascripts/mod_coords_div.php
Log:
bug fix: abort if mouse position cannot be determined

Modified: trunk/mapbender/http/javascripts/mod_coords_div.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_coords_div.php	2009-08-28 12:43:47 UTC (rev 4552)
+++ trunk/mapbender/http/javascripts/mod_coords_div.php	2009-08-28 12:47:21 UTC (rev 4553)
@@ -55,14 +55,20 @@
 	}
 }
 function mod_showCoords_div_click(e){
-	mod_showCoords_div_mapObj.getMousePos(e);
-	var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, clickX, clickY);
+	var click = mod_showCoords_div_mapObj.getMousePosition(e);
+	if (click === null) {
+		return;
+	}
+	var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, click.x, click.y);
 	mod_showCoords_div_fix = "Selection: " + pos[0] + " / " +  pos[1];
 	mod_showCoord_write(pos[0],pos[1]);
 }
 function mod_showCoords_div_display(e){
-	mod_showCoords_div_mapObj.getMousePos(e);
-	var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, clickX, clickY);
+	var click = mod_showCoords_div_mapObj.getMousePosition(e);
+	if (click === null) {
+		return;
+	}
+	var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, click.x, click.y);
 	mod_showCoord_write(pos[0],pos[1]);
 }
 function mod_showCoord_write(x,y){



More information about the Mapbender_commits mailing list