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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Oct 16 03:54:27 EDT 2007


Author: verenadiewald
Date: 2007-10-16 03:54:26 -0400 (Tue, 16 Oct 2007)
New Revision: 1734

Modified:
   trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
Log:
some debugging and restructuring of function displayButtons()

Modified: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2007-10-16 07:52:24 UTC (rev 1733)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2007-10-16 07:54:26 UTC (rev 1734)
@@ -21,7 +21,6 @@
 import_request_variables("PG");
 require_once("../php/mb_validateSession.php");
 require_once("../../conf/mapbender.conf");
-require_once("../../conf/wfs_default.conf");
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
 
@@ -105,20 +104,42 @@
 		buttonWfs_title_on = [];
 		buttonWfs_x = [];
 		buttonWfs_y = [];
-		addButtonWfs("rectangle", buttonRectangle.status, buttonRectangle.img, msgObj.buttonLabelRectangle, msgObj.buttonLabelRectangle, buttonRectangle.x, buttonRectangle.y);
-		addButtonWfs("polygon", buttonPolygon.status, buttonPolygon.img, msgObj.buttonLabelPolygon, msgObj.buttonLabelPolygon, buttonPolygon.x, buttonPolygon.y);
-		addButtonWfs("point", buttonPoint.status, buttonPoint.img, msgObj.buttonLabelPoint, msgObj.buttonLabelPoint, buttonPoint.x, buttonPoint.y);
-		addButtonWfs("extent", buttonExtent.status, buttonExtent.img, msgObj.buttonLabelExtent, msgObj.buttonLabelExtent, buttonExtent.x, buttonExtent.y);
-		addButtonWfs("dialogue", buttonDialogue.status, buttonDialogue.img, msgObj.buttonLabelDialogue, msgObj.buttonLabelDialogue, buttonDialogue.x, buttonDialogue.y);
+		addButtonWfs("rectangle", buttonRectangle.status, buttonRectangle.img, msgObj.buttonLabelRectangle, buttonRectangle.x, buttonRectangle.y);
+		addButtonWfs("polygon", buttonPolygon.status, buttonPolygon.img, msgObj.buttonLabelPolygon, buttonPolygon.x, buttonPolygon.y);
+		addButtonWfs("point", buttonPoint.status, buttonPoint.img, msgObj.buttonLabelPoint, buttonPoint.x, buttonPoint.y);
+		addButtonWfs("extent", buttonExtent.status, buttonExtent.img, msgObj.buttonLabelExtent, buttonExtent.x, buttonExtent.y);
+		addButtonWfs("dialogue", buttonDialogue.status, buttonDialogue.img, msgObj.buttonLabelDialogue, buttonDialogue.x, buttonDialogue.y);
+		displayButtons();
 	});
 }
 // ------------------------------------------------------------------------------------------
 // ------------ button handling -------------------------------------------------------------
 
+function wfsInitFunction (j) {
+	var functionCall = "mb_regButton_frame('initWfsButton', null, "+j+")";
+	var x = new Function ("", functionCall); 
+	x();
+} 
+
 function displayButtons() {
 	for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
 		if (parseInt(buttonWfs_on[i])==1) {
-			document.write("<div id='div_"+buttonWfs_id[i]+"' style='position:absolute; top:"+buttonWfs_y[i]+"; left:"+buttonWfs_x[i]+"; z-index:"+buttonWfs_zIndex+"'><img name=\""+buttonWfs_id[i]+"\" onmouseover=\"mb_regButton_frame('initWfsButton', null, "+i+");\" id=\""+buttonWfs_id[i]+"\" title=\""+buttonWfs_title_off[i]+"\" src=\""+buttonWfs_imgdir+buttonWfs_src[i]+"\"></div>");
+			var currentDiv = document.createElement("div");
+			currentDiv.id = buttonWfs_id[i]+"Div";
+			currentDiv.style.position = "absolute";
+			currentDiv.style.left = buttonWfs_x[i]
+			currentDiv.style.top = buttonWfs_y[i];
+			currentDiv.style.zIndex = buttonWfs_zIndex;
+			
+			var currentImg = document.createElement("img");
+			currentImg.id = buttonWfs_id[i];
+			currentImg.name = buttonWfs_id[i];
+			currentImg.title = buttonWfs_title_off[i];
+			currentImg.src = buttonWfs_imgdir+buttonWfs_src[i];
+			currentImg.onmouseover = new Function("wfsInitFunction("+i+")");
+			
+			currentDiv.appendChild(currentImg);
+			document.getElementsByTagName('body')[0].appendChild(currentDiv);
 		}
 	}
 }
@@ -507,11 +528,8 @@
 	});
 }
 
-//deprecated stuff
-function mod_wfs_spatialRequest_dialog(){	
-}
 function useExtentIsSet () {
 	return mod_wfs_spatialRequest_useExtent;
 }
 
-displayButtons();
+



More information about the Mapbender_commits mailing list