[Mapbender-commits] r6888 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Sep 3 10:52:08 EDT 2010
Author: christoph
Date: 2010-09-03 14:52:08 +0000 (Fri, 03 Sep 2010)
New Revision: 6888
Modified:
trunk/mapbender/http/javascripts/mod_coords_div.php
Log:
make target div of show coords customizable
Modified: trunk/mapbender/http/javascripts/mod_coords_div.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_coords_div.php 2010-09-03 14:51:46 UTC (rev 6887)
+++ trunk/mapbender/http/javascripts/mod_coords_div.php 2010-09-03 14:52:08 UTC (rev 6888)
@@ -19,7 +19,10 @@
require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
echo "var mod_showCoords_div_target = '".$e_target[0]."';";
+
+include '../include/dyn_js.php';
?>
+var displayTarget = displayTarget ? displayTarget : "dependentDiv";
var mod_showCoords_div_win = null;
var mod_showCoords_div_elName = "showCoords_div";
@@ -52,8 +55,8 @@
var $map = $(mod_showCoords_div_mapObj.getDomElement());
$map.unbind("mousemove", mod_showCoords_div_display);
$map.unbind("click", mod_showCoords_div_click);
- if(document.getElementById("dependentDiv")){
- writeTag("","dependentDiv","");
+ if(document.getElementById(displayTarget)){
+ writeTag("",displayTarget,"");
}
}
function mod_showCoords_div_click(e){
@@ -61,9 +64,9 @@
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]);
+ var pos = mod_showCoords_div_mapObj.convertPixelToReal(click);
+ mod_showCoords_div_fix = "Selection: " + pos.x + " / " + pos.y;
+ mod_showCoord_write(pos.x,pos.y);
}
function mod_showCoords_div_display(e){
var click = mod_showCoords_div_mapObj.getMousePosition(e);
@@ -74,11 +77,11 @@
mod_showCoord_write(pos[0],pos[1]);
}
function mod_showCoord_write(x,y){
- if(document.getElementById("dependentDiv")){
+ if(document.getElementById(displayTarget)){
var str = x + " / " + y;
if(mod_showCoords_div_fix != ""){
str += "<div>" + mod_showCoords_div_fix + "</div>";
}
- writeTag("","dependentDiv", str);
+ writeTag("",displayTarget, str);
}
}
More information about the Mapbender_commits
mailing list