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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jan 2 05:53:53 EST 2009


Author: christoph
Date: 2009-01-02 05:53:53 -0500 (Fri, 02 Jan 2009)
New Revision: 3382

Modified:
   trunk/mapbender/http/javascripts/geometry.js
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/mod_box1.js
   trunk/mapbender/http/javascripts/mod_center1.php
   trunk/mapbender/http/javascripts/mod_coords.php
   trunk/mapbender/http/javascripts/mod_coords_div.php
   trunk/mapbender/http/javascripts/mod_dragMapSize.php
   trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php
   trunk/mapbender/http/javascripts/mod_highlightPOI.php
   trunk/mapbender/http/javascripts/mod_selArea1.php
Log:
http://trac.osgeo.org/mapbender/ticket/360

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/geometry.js	2009-01-02 10:53:53 UTC (rev 3382)
@@ -1643,7 +1643,7 @@
 		mapframeHeight = mb_mapObj[mapObjInd].height;
 	});
 	var style = aStyle;
-	var canvas = new jsGraphics(aTagName, window.frames[mapframe]);
+	var canvas = new jsGraphics(aTagName, mb_mapObj[mapObjInd].getDomElement().frameName?window.frames[mapframe]:window);
 	canvas.setStroke(lineWidth);
 	mb_registerPanSubElement(aTagName);
 }

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-01-02 10:53:53 UTC (rev 3382)
@@ -58,6 +58,11 @@
 	 */
 	this.setHeight = function(height){
 		this.height = parseInt(height, 10);
+		//apply new height
+		if(this.frameName){
+			document.getElementById(this.frameName).style.height = this.height;
+		}
+		this.domElement.style.height = this.height;
 	};
 	
 	/**

Modified: trunk/mapbender/http/javascripts/mod_box1.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_box1.js	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_box1.js	2009-01-02 10:53:53 UTC (rev 3382)
@@ -7,6 +7,7 @@
 var mb_isActive = false;
 var mb_isBF = false;
 var mb_zF = false;
+var mb_boxMapObj = null;
 
 var mb_offset_top = 0;
 var mb_offset_right = 0;
@@ -14,8 +15,9 @@
 var mb_offset_left = 0;
 
 function  mod_box_start(e){
+	mb_boxMapObj = getMapObjByName(mb_isBF);
 	mb_isActive = true;
-	mb_getMousePos(e,mb_isBF);
+	mb_boxMapObj.getMousePos(e);
 	mb_start_x = clickX;
 	mb_start_y = clickY;
 	mb_end_x = mb_start_x+1;
@@ -29,13 +31,10 @@
 }
 function mod_box_run(e){
 	if(mb_isActive){
-		mb_getMousePos(e,mb_isBF);
-		for(var i=0; i<mb_mapObj.length; i++){
-			if(mb_mapObj[i].frameName == mb_isBF){
-				var width = mb_mapObj[i].width;
-				var height = mb_mapObj[i].height;
-			}
-		}
+		mb_boxMapObj.getMousePos(e);
+		var width = mb_boxMapObj.width;
+		var height = mb_boxMapObj.height;
+
 		if (((clickX>width) || (clickY>height) || (clickX<=0) ||(clickY<=0))){
 			isActive = false;  
 			mod_box_stop(e);
@@ -60,6 +59,37 @@
 	mb_isActive = false;
 }
 function mb_drawBox(left,top,right,bottom){
+	//Look if we have the Box elements
+	mb_boxMapObj = getMapObjByName(mb_isBF);
+	var map_el = mb_boxMapObj.getDomElement();
+	if(!map_el.ownerDocument.getElementById(mb_boxMapObj.elementName+"_l_top")){
+		//create Box Elements
+		el_top = map_el.ownerDocument.createElement("div");
+		el_top.style.position = "absolute";
+		el_top.style.top = "0px";
+		el_top.style.left = "0px";
+		el_top.style.width = "0px";
+		el_top.style.height = "0px";
+		el_top.style.overflow = "hidden";
+		el_top.style.zIndex = "10";
+		el_top.style.visibility = "hidden";
+		el_top.style.cursor = "crosshair";
+		el_top.style.backgroundColor = "#ff0000";
+		
+		el_left = el_top.cloneNode(false);
+		el_right = el_top.cloneNode(false);
+		el_bottom = el_top.cloneNode(false);
+		
+		el_top.id = mb_boxMapObj.elementName+"_l_top";
+		el_left.id = mb_boxMapObj.elementName+"_l_left";
+		el_right.id = mb_boxMapObj.elementName+"_l_right";
+		el_bottom.id = mb_boxMapObj.elementName+"_l_bottom";
+		
+		map_el.appendChild(el_top);
+		map_el.appendChild(el_left);
+		map_el.appendChild(el_right);
+		map_el.appendChild(el_bottom);
+	}
 	mb_arrangeBox("l_top",left,top,right,top+2);
 	mb_arrangeBox("l_left",left,top,left+2,bottom);
 	mb_arrangeBox("l_right",right-2,top,right,bottom);
@@ -70,17 +100,20 @@
 	mb_displayElement("l_bottom");
 }
 function mb_arrangeBox(name, left, top, right, bottom){
-	var el = window.frames[mb_isBF].document.getElementById(name).style;
+	var map_el = mb_boxMapObj.getDomElement();
+	var el = map_el.ownerDocument.getElementById(mb_boxMapObj.elementName+"_"+name).style;
 	el.height = Math.abs(bottom - top);
 	el.width = Math.abs(right - left);
 	el.top = top + "px";
 	el.left = left + "px";
 }
 function mb_displayElement(name){
-	window.frames[mb_isBF].document.getElementById(name).style.visibility = "visible";
+	var map_el = mb_boxMapObj.getDomElement();
+	var el = map_el.ownerDocument.getElementById(mb_boxMapObj.elementName+"_"+name).style.visibility = "visible";
 }
 function mb_hideElement(name) {
-	window.frames[mb_isBF].document.getElementById(name).style.visibility = "hidden";
+	var map_el = mb_boxMapObj.getDomElement();
+	var el = map_el.ownerDocument.getElementById(mb_boxMapObj.elementName+"_"+name).style.visibility = "hidden";
 }
 function evalExtent(){
 	if(mb_start_x>mb_end_x){
@@ -139,4 +172,4 @@
 		return ret;      
 		//zoom(mb_zF,true,1.0,pos[0], pos[1]);
 	}
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/mod_center1.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_center1.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_center1.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -21,6 +21,7 @@
 echo "var mod_center_target = '".$e_target[0]."';";
 ?>
 
+var mod_center_mapObj = null;
 var mod_center_elName = "center1";
 var mod_center_frameName = "";
 
@@ -29,7 +30,10 @@
 var mod_center_img_off = new Image(); mod_center_img_off.src = "<?php  echo $e_src;  ?>";
 var mod_center_img_over = new Image(); mod_center_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
-function init_gui1_center(ind){
+function init_gui1_center(ind){ 
+	//get Pointer to my MapObj
+	mod_center_mapObj = getMapObjByName(mod_center_target);
+	
 	mb_button[ind] = document.getElementById(mod_center_elName);
 	mb_button[ind].img_over = mod_center_img_over.src;
 	mb_button[ind].img_on = mod_center_img_on.src;
@@ -41,21 +45,14 @@
 	mb_button[ind].stop = new Function ("mod_center_disable()");
 }
 function mod_center_click(){
-	window.frames[mod_center_target].document.onclick = mod_center_event;
+	mod_center_mapObj.getDomElement().onclick = mod_center_event;
 }
 function mod_center_disable(){
-	window.frames[mod_center_target].document.onclick = null;
+	mod_center_mapObj.getDomElement().onclick = null;
 }
 function mod_center_event(e){
-	if(ie){
-		clickX = window.frames[mod_center_target].event.clientX;
-		clickY = window.frames[mod_center_target].event.clientY;
+	mod_center_mapObj.getMousePos(e);
 
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
 	var pos = makeClickPos2RealWorldPos(mod_center_target, clickX, clickY);
 	zoom(mod_center_target,true,1.0,pos[0], pos[1]);
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/mod_coords.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_coords.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_coords.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -21,6 +21,7 @@
 echo "var mod_showCoords_target = '".$e_target[0]."';";
 ?>
 
+var mod_showCoords_map = null;
 var mod_showCoords_win = null;
 var mod_showCoords_elName = "showCoords";
 var mod_showCoords_frameName = "";
@@ -37,43 +38,33 @@
 	mb_button[ind].elName = mod_showCoords_elName;
 	mb_button[ind].fName = mod_showCoords_frameName;
 	mb_button[ind].go = new Function ("mod_showCoords_run()");
-	mb_button[ind].stop = new Function ("mod_showCoords_disable()");   
+	mb_button[ind].stop = new Function ("mod_showCoords_disable()");
+	
+	mod_showCoords_map = getMapObjByName(mod_showCoords_target);
 }
 function mod_showCoords_run(){
-	window.frames[mod_showCoords_target].document.onmousemove = mod_showCoords_display;
-	window.frames[mod_showCoords_target].document.onclick = mod_showCoords_click;
+	var el = mod_showCoords_map.getDomElement();
+	el.onmousemove = mod_showCoords_display;
+	el.onclick = mod_showCoords_click;
 }
 function mod_showCoords_disable(){
-	window.frames[mod_showCoords_target].document.onclick = null;
-	window.frames[mod_showCoords_target].document.onmousemove = null;
+	var el = mod_showCoords_map.getDomElement();
+	el.onmousemove = null;
+	el.onclick = null;
 	window.status = "";
 }
 function mod_showCoords_click(e){
 	mod_showCoords_win = window.open("","","width=150, height=100");
 	mod_showCoords_win.document.open("text/html");
-	if(ie){
-		clickX = window.frames[mod_showCoords_target].event.clientX;
-		clickY = window.frames[mod_showCoords_target].event.clientY;
 
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
+	mod_showCoords_map.getMousePos(e);
 	var pos = makeClickPos2RealWorldPos(mod_showCoords_target, clickX, clickY);
 	mod_showCoords_win.document.write((Math.round(pos[0]*100)/100) + " / " +  (Math.round(pos[1]*100)/100));
 	mod_showCoords_win.document.close();
 	mod_showCoords_win.focus();
 }
 function mod_showCoords_display(e){
-	if(ie){
-		clickX = window.frames[mod_showCoords_target].event.clientX;
-		clickY = window.frames[mod_showCoords_target].event.clientY;
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
+	mod_showCoords_map.getMousePos(e);
 	var pos = makeClickPos2RealWorldPos(mod_showCoords_target, clickX, clickY);
 	window.status = pos[0] + " / " +  pos[1];
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/mod_coords_div.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_coords_div.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_coords_div.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -28,8 +28,11 @@
 var mod_showCoords_div_img_off = new Image(); mod_showCoords_div_img_off.src = "<?php  echo $e_src;  ?>";
 var mod_showCoords_div_img_over = new Image(); mod_showCoords_div_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 var mod_showCoords_div_fix = "";
+var mod_showCoords_div_mapObj = null;
 
 function init_mod_showCoords_div(ind){
+	mod_showCoords_div_mapObj = getMapObjByName(mod_showCoords_div_target );
+	
 	mb_button[ind] = document.getElementById(mod_showCoords_div_elName);
 	mb_button[ind].img_over = mod_showCoords_div_img_over.src;
 	mb_button[ind].img_on = mod_showCoords_div_img_on.src;
@@ -41,40 +44,24 @@
 	mb_button[ind].stop = new Function ("mod_showCoords_div_disable()");   
 }
 function mod_showCoords_div_run(){
-	window.frames[mod_showCoords_div_target].document.onmousemove = mod_showCoords_div_display;
-	window.frames[mod_showCoords_div_target].document.onclick = mod_showCoords_div_click;
+	mod_showCoords_div_mapObj.getDomElement().onmousemove = mod_showCoords_div_display;
+	mod_showCoords_div_mapObj.getDomElement().onclick = mod_showCoords_div_click;
 }
 function mod_showCoords_div_disable(){
-	window.frames[mod_showCoords_div_target].document.onclick = null;
-	window.frames[mod_showCoords_div_target].document.onmousemove = null;
+	mod_showCoords_div_mapObj.getDomElement().onclick = null;
+	mod_showCoords_div_mapObj.getDomElement().onmousemove = null;
 	if(document.getElementById("dependentDiv")){
 		writeTag("","dependentDiv","");
 	}
 }
 function mod_showCoords_div_click(e){
-	if(ie){
-		clickX = window.frames[mod_showCoords_div_target].event.clientX;
-		clickY = window.frames[mod_showCoords_div_target].event.clientY;
-
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
+	mod_showCoords_div_mapObj.getMousePos(e);
 	var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, clickX, clickY);
 	mod_showCoords_div_fix = "Selection: " + pos[0] + " / " +  pos[1];
 	mod_showCoord_write(pos[0],pos[1]);
 }
 function mod_showCoords_div_display(e){
-	if(ie){
-		clickX = window.frames[mod_showCoords_div_target].event.clientX;
-		clickY = window.frames[mod_showCoords_div_target].event.clientY;
-
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
+	mod_showCoords_div_mapObj.getMousePos(e);
 	var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, clickX, clickY);
 	mod_showCoord_write(pos[0],pos[1]);
 }
@@ -86,4 +73,4 @@
 		}
 		writeTag("","dependentDiv", str);
 	}
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/mod_dragMapSize.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_dragMapSize.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_dragMapSize.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -82,29 +82,27 @@
 	mb_getMousePos(e);
 	mb_end_x = clickX;
 	mb_end_y = clickY;
-	var ind = getMapObjIndexByName(mod_dragMapSize_target);
+	targetObject = getMapObjByName(mod_dragMapSize_target);
 	var dif_x = (parseFloat(mb_end_x) - parseFloat(mb_start_x));
 	var dif_y = (parseFloat(mb_end_y) - parseFloat(mb_start_y));
 	
-	if(parseFloat(mb_mapObj[ind].width) + parseFloat(dif_x)<0 ||
-		parseFloat(mb_mapObj[ind].height) + parseFloat(dif_y)<0)
+	if(parseFloat(targetObject.width) + parseFloat(dif_x)<0 ||
+		parseFloat(targetObject.height) + parseFloat(dif_y)<0)
 	{
 		var dif_x = mb_start_x - (parseInt(document.getElementById('dragMapSize').style.width) / 2);
 		var dif_y = mb_start_y - (parseInt(document.getElementById('dragMapSize').style.height) / 2);
 		mb_arrangeElement('', "dragMapSize", dif_x, dif_y);
 		return;
 	}
-	
-	var pos =  makeClickPos2RealWorldPos(mod_dragMapSize_target, (parseFloat(mb_mapObj[ind].width) + parseFloat(dif_x)), (parseFloat(mb_mapObj[ind].height) + parseFloat(dif_y)));
-	mb_mapObj[ind].width = parseFloat(mb_mapObj[ind].width) + parseFloat(dif_x);
-	mb_mapObj[ind].height = parseFloat(mb_mapObj[ind].height) + parseFloat(dif_y);
-	document.getElementById(mod_dragMapSize_target).style.width = mb_mapObj[ind].width;
-	document.getElementById(mod_dragMapSize_target).style.height = mb_mapObj[ind].height;
-	window.frames[mod_dragMapSize_target].document.getElementById("maps").style.width = mb_mapObj[ind].width;
-	window.frames[mod_dragMapSize_target].document.getElementById("maps").style.height = mb_mapObj[ind].height;
-	var mybbox = mb_mapObj[ind].extent.split(",");
-	mb_mapObj[ind].extent = mybbox[0] + "," + pos[1] + "," + pos[0] + "," +  mybbox[3];
-	setMapRequest(mod_dragMapSize_target);
+	var newX = (parseFloat(mb_mapObj[ind].width) + parseFloat(dif_x));
+	var newY = (parseFloat(mb_mapObj[ind].height) + parseFloat(dif_y));
+	var pos =  makeClickPos2RealWorldPos(mod_dragMapSize_target, newX, newY);
+	targetObject.setWidth(targetObject.getWidth() + parseFloat(dif_x));
+	targetObject.setHeight(targetObject.getHeight() + parseFloat(dif_y));
+
+	var mybbox = targetObject.extent.split(",");
+	targetObject.setExtent(mybbox[0], pos[1], pos[0], mybbox[3]);
+	targetObject.setMapRequest();
 	eventResizeMap.trigger();
 }
 

Modified: trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -31,6 +31,7 @@
 var mod_featureInfoTunnel_elName = "featureInfoTunnel";
 var mod_featureInfoTunnel_frameName = "";
 var mod_featureInfoTunnel_target = "<?php echo $e_target[0]; ?>";
+var mod_featureInfoTunnel_map = null;
 
 var mod_featureInfoTunnel_img_on = new Image(); mod_featureInfoTunnel_img_on.src =  "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
 var mod_featureInfoTunnel_img_off = new Image(); mod_featureInfoTunnel_img_off.src ="<?php  echo $e_src;  ?>";
@@ -46,40 +47,34 @@
 	mb_button[ind].fName = mod_featureInfoTunnel_frameName;
 	mb_button[ind].go = new Function ("mod_featureInfoTunnel_click()");
 	mb_button[ind].stop = new Function ("mod_featureInfoTunnel_disable()");
+	
+	mod_featureInfoTunnel_map = getMapObjByName(mod_featureInfoTunnel_target);
 }
 function mod_featureInfoTunnel_click(){   
-	window.frames[mod_featureInfoTunnel_target].document.onclick = mod_featureInfoTunnel_event;
+	mod_featureInfoTunnel_map.getDomElement().onclick = mod_featureInfoTunnel_event;
 }
 function mod_featureInfoTunnel_disable(){
-	window.frames[mod_featureInfoTunnel_target].document.onclick = null;
+	mod_featureInfoTunnel_map.getDomElement().onclick = null;
 }
 function mod_featureInfoTunnel_event(e){
-	if(ie){
-		clickX = window.frames[mod_featureInfoTunnel_target].event.clientX;
-		clickY = window.frames[mod_featureInfoTunnel_target].event.clientY;
+	mod_featureInfoTunnel_map.getMousePos(e);
 
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
 	eventBeforeFeatureInfo.trigger({"fName":mod_featureInfoTunnel_target});
 
-	var ind = getMapObjIndexByName(mod_featureInfoTunnel_target);
-	var point = new Point(clickX,clickY);
+	var point = mod_featureInfoTunnel_map.getMousePos(e);
 	var path = '../extensions/ext_featureInfoTunnel.php';
 	
 //TODO that code should go to featureInfo Redirect module
 	if(document.getElementById("FeatureInfoRedirect")){
 		//fill the frames
-		for(var i=0; i<mb_mapObj[ind].wms.length; i++){
-			var req = mb_mapObj[ind].wms[i].getFeatureInfoRequest(mb_mapObj[ind], point);
+		for(var i=0; i<mod_featureInfoTunnel_map.wms.length; i++){
+			var req = mod_featureInfoTunnel_map.wms[i].getFeatureInfoRequest(mb_mapObj[ind], point);
 			if(req)
-				window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[ind].wms[i].wms_id).src = path+"?url="+escape(req);
+				window.frames.FeatureInfoRedirect.document.getElementById(mod_featureInfoTunnel_map.wms[i].wms_id).src = path+"?url="+escape(req);
 		}
 	}
 	else{
-		urls = mb_mapObj[ind].getFeatureInfoRequests(point);
+		urls = mod_featureInfoTunnel_map.getFeatureInfoRequests(point);
 		if(urls){
 			for(var i=0;i<urls.length;i++){
 				if(featureInfoLayerPopup == 'true'){

Modified: trunk/mapbender/http/javascripts/mod_highlightPOI.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_highlightPOI.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_highlightPOI.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -125,11 +125,8 @@
 
 function mod_highlightPOI_draw(){
   var ind = getMapObjIndexByName(mod_highlightPOI_target);
-  window.frames[mod_highlightPOI_target].document.getElementById('permanent').style.width = mb_mapObj[ind].width;
-  window.frames[mod_highlightPOI_target].document.getElementById('permanent').style.height = mb_mapObj[ind].height;
-  window.frames[mod_highlightPOI_target].document.getElementById('permanent').style.top = 0;
-  window.frames[mod_highlightPOI_target].document.getElementById('permanent').style.left = 0;
-  window.frames[mod_highlightPOI_target].document.getElementById('permanent').style.visibility = 'visible';
+  var div = new DivTag(mod_highlightPOI_target+'permanent', mb_mapObj[ind].frameName, 
+  	"position:absolute;width:"+mb_mapObj[ind].width+";height:"+mb_mapObj[ind].height+";top:0;left:0;visibility:visible");
   var tagSource = "";
   for(var i=0; i<mod_highlightPOI_params.length; i=i+3){
     var pos = makeRealWorld2mapPos(mod_highlightPOI_target,mod_highlightPOI_params[i+1], mod_highlightPOI_params[i+2]);
@@ -138,5 +135,5 @@
     tagSource += "<span style='"+poi_style+"'>"+mod_highlightPOI_params[i]+"<span>";
     tagSource += "</div>";
   }
-  writeTag(mod_highlightPOI_target, "permanent", tagSource);
+  div.write(tagSource);
 }

Modified: trunk/mapbender/http/javascripts/mod_selArea1.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_selArea1.php	2009-01-02 10:07:41 UTC (rev 3381)
+++ trunk/mapbender/http/javascripts/mod_selArea1.php	2009-01-02 10:53:53 UTC (rev 3382)
@@ -23,6 +23,7 @@
 var mod_selArea_frameName = "";
 var mod_selArea_target = "<?php echo $e_target[0]; ?>";
 
+var mod_selArea_MapObj = null;
 var mod_selArea_img_on = new Image(); 
 mod_selArea_img_on.src = "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
 var mod_selArea_img_off = new Image(); 
@@ -31,6 +32,7 @@
 mod_selArea_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
 function init_selArea1(ind){
+	mod_selArea_MapObj = getMapObjByName(mod_selArea_target);
 	mb_button[ind] = document.getElementById(mod_selArea_elName);
 	mb_button[ind].img_over = mod_selArea_img_over.src;
 	mb_button[ind].img_on = mod_selArea_img_on.src;
@@ -42,14 +44,14 @@
 	mb_button[ind].stop = new Function ("mod_selArea_disable()");
 }
 function mod_selArea_click(){
-	var el = window.frames[mod_selArea_target].document;
+	var el = mod_selArea_MapObj.getDomElement();
 	el.onmouseover = mod_selArea_init;
 	el.onmousedown = mod_box_start;
 	el.onmouseup = mod_selArea_get;
 	el.onmousemove = mod_box_run;
 }
 function mod_selArea_disable(){
-	var el = window.frames[mod_selArea_target].document; 
+	var el = mod_selArea_MapObj.getDomElement();
 	el.onmousedown = null;
 	el.onmouseup = null;
 	el.onmousemove = null;



More information about the Mapbender_commits mailing list