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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jul 9 05:36:23 EDT 2008


Author: verenadiewald
Date: 2008-07-09 05:36:23 -0400 (Wed, 09 Jul 2008)
New Revision: 2631

Modified:
   trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
Log:
current version with all new features

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2008-07-09 09:12:58 UTC (rev 2630)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2008-07-09 09:36:23 UTC (rev 2631)
@@ -18,12 +18,18 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
+session_start();
+$gui_id = $_SESSION["mb_user_gui"];
 
-$gui_id = $_SESSION["mb_user_gui"];
 $target = $_REQUEST["e_target"];
+$e_id_css = $_REQUEST["e_id_css"];
+$e_id = $_REQUEST["e_id"];
 $isLoaded = $_REQUEST["isLoaded"];
 
+require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
@@ -38,7 +44,8 @@
 <?php 
 	include '../include/dyn_js.php';
 	include '../include/dyn_php.php';
-	
+	include(dirname(__FILE__) . "/../../conf/" . $wfs_spatial_request_conf_filename);
+
 	echo "var targetString = '" . $target . "';";
 	echo "var wfsConfIdString = '" . $wfsConfIdString . "';";
 	echo "var e_id_css = '" . $e_id_css . "';";
@@ -58,21 +65,235 @@
 	maxHighlightedPoints = 0;
 //	var e = new parent.Mb_warning("mod_wfs_gazetteer_client.php: Element var maxHighlightedPoints is not set, see 'edit element vars'.");
 }
+// Element var showResultInPopup
+try {if(showResultInPopup){}}catch(e) {showResultInPopup = 1;}
 
+//element var openLinkFromSearch for opening attribute link directly onclick of searchResult entry
+try{
+	if (openLinkFromSearch){}
+}
+catch(e){
+	openLinkFromSearch =0;
+}
+
 var targetArray = targetString.split(",");
 var global_wfsConfObj;
 var global_selectedWfsConfId;
 var point_px = 10;
 var resultGeom = null;
 var cw_fillcolor = "#cc33cc";
+var frameName = e_id_css;
+var inputNotEnough = [];
 
+//start button management spatialRequest ////////
+var button_point = "point";
+var button_polygon = "polygon";
+var button_rectangle = "rectangle";
+var button_extent = "extent";
+var mb_wfs_tolerance = 8;
 
+var activeButton = null;
+var mod_wfs_spatialRequest_geometry = null;
+var mod_wfs_spatialRequest_frameName = "";
+var mod_wfs_spatialRequest_epsg;
+var mod_wfs_spatialRequest_width;
+var mod_wfs_spatialRequest_height;
+
+/**
+ * This Geometry contains the geometry of the optinal spatial constraint
+ */
+var spatialRequestGeom = null;
+
+/**
+ * Something like box, polygon, point, extent
+ */
+var spatialRequestType = null;
+
+/**
+ * This Geometry contains the result from the WFS request
+ */
+var geomArray;
+
+var buttonWfs_id = [];
+var buttonWfs_on = [];
+var buttonWfs_src = [];
+var buttonWfs_title_off = [];
+var buttonWfs_title_on = [];
+var buttonWfs_x = [];
+var buttonWfs_y = [];
+
+function addButtonWfs(id, isOn, src, title, x, y) {
+	buttonWfs_id.push(id);
+	buttonWfs_on.push(isOn);
+	buttonWfs_src.push(src);
+	buttonWfs_title_off.push(title);
+	buttonWfs_title_on.push(title);
+	buttonWfs_x.push(x);
+	buttonWfs_y.push(y);
+}
+// end of button management spatialRequest ///////////
+
 parent.mb_registerInitFunctions("window.frames['"+this.name+"'].initModWfsGazetteer()");
+parent.mb_registerInitFunctions("window.frames['"+this.name+"'].init_wfsSpatialRequest()");
 
-function openwindow(Adresse) {
-	Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
-	Fenster1.focus();
+function init_wfsSpatialRequest() {
+	//parent.mb_ajax_json("../php/mod_wfsSpatialRequest_messages.php", function(obj, status) {
+	//	msgObj = obj;
+		buttonWfs_id = [];
+		buttonWfs_on = [];
+		buttonWfs_src = [];
+		buttonWfs_title_off = [];
+		buttonWfs_title_on = [];
+		buttonWfs_x = [];
+		buttonWfs_y = [];
+		addButtonWfs("rectangle", buttonRectangle.status, buttonRectangle.img, buttonRectangle.title, buttonRectangle.x, buttonRectangle.y);
+		addButtonWfs("polygon", buttonPolygon.status, buttonPolygon.img, buttonPolygon.title, buttonPolygon.x, buttonPolygon.y);
+		addButtonWfs("point", buttonPoint.status, buttonPoint.img, buttonPoint.title, buttonPoint.x, buttonPoint.y);
+		addButtonWfs("extent", buttonExtent.status, buttonExtent.img, buttonExtent.title, buttonExtent.x, buttonExtent.y);
+		displayButtons();
+	//});
 }
+
+function wfsInitFunction (j) {
+	var functionCall = "parent.mb_regButton_frame('initWfsButton', '"+frameName+"', "+j+")";
+	var x = new Function ("", functionCall); 
+	x();
+} 
+
+function initWfsButton(ind, pos) {
+	parent.mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
+	parent.mb_button[ind].img_over = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_over");
+	parent.mb_button[ind].img_on = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_on");
+	parent.mb_button[ind].img_off = buttonWfs_imgdir + buttonWfs_src[pos];
+	parent.mb_button[ind].img_out = buttonWfs_imgdir + buttonWfs_src[pos];
+	parent.mb_button[ind].status = 0;
+	parent.mb_button[ind].elName = buttonWfs_id[pos];
+	parent.mb_button[ind].frameName = frameName;
+	parent.mb_button[ind].go = new Function ("requestGeometryHighlight.clean(); wfsEnable(parent.mb_button["+ind+"], " + pos + ")");
+	parent.mb_button[ind].stop = new Function ("wfsDisable(parent.mb_button["+ind+"], " + pos + ")");
+	var ind = parent.getMapObjIndexByName("mapframe1");
+	mod_wfs_spatialRequest_width = parent.mb_mapObj[ind].width;
+	mod_wfs_spatialRequest_height = parent.mb_mapObj[ind].height;
+	mod_wfs_spatialRequest_epsg = parent.mb_mapObj[ind].epsg;
+	parent.mb_registerPanSubElement("measuring");
+}	
+
+function displayButtons() {
+	for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
+		if (parseInt(buttonWfs_on[i])==1) {
+			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.style.marginRight = "5px";
+			currentImg.onmouseover = new Function("wfsInitFunction("+i+")");
+			
+			document.getElementById("displaySpatialButtons").appendChild(currentImg);
+		}
+	}
+}
+
+function disableButtons() {
+	removeChildNodes(document.getElementById("displaySpatialButtons"));
+}
+
+function wfsEnable(obj) {
+   	var el = parent.window.frames["mapframe1"].document;
+   	el.onmouseover = null;
+   	el.onmousedown = null;
+   	el.onmouseup = null;
+   	el.onmousemove = null;
+   	
+	if (obj.id == button_point) {
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+	}
+	if (obj.id == button_polygon) {
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+	}
+	else if (obj.id == button_rectangle){
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+	}
+	else if (obj.id == button_extent){
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+	}
+	callRequestGeometryConstructor(obj.id,"mapframe1");
+}
+
+function callRequestGeometryConstructor(selectedType,target){
+		if(document.getElementById("res")){
+			document.getElementById("res").innerHTML ="";
+			spatialRequestGeom = null;
+		}
+		if(document.getElementById("spatialResHint")){
+			document.getElementById("spatialResHint").innerHTML = "";
+		}
+		spatialRequestType = selectedType;
+		var geometryConstructor = new parent.RequestGeometryConstructor(target);
+		geometryConstructor.getGeometry(selectedType,function(target,queryGeom){
+			if(queryGeom !=''){
+				var spatialRes = document.createElement("span");
+				spatialRes.id = "spatialResHint";
+				spatialRes.name = "spatialResHint";
+				document.getElementById("displaySpatialButtons").appendChild(spatialRes);
+				document.getElementById("spatialResHint").innerHTML = spatialRequestIsSetMessage;
+				spatialRequestGeom = queryGeom;
+			}
+			parent.mb_disableThisButton(selectedType);
+			
+			// spatialRequestGeom is a Geometry, but for the highlight
+			// a MultiGeometry is needed.
+			var multiGeom;
+			// a line represents a bbox...but highlight must be a polyon
+			// (extent or box selection)
+			if (spatialRequestGeom.geomType == parent.geomType.line) {
+				multiGeom = new parent.MultiGeometry(parent.geomType.polygon);
+				newGeom = new parent.Geometry(parent.geomType.polygon);
+				var p1 = spatialRequestGeom.get(0);
+				var p2 = spatialRequestGeom.get(1);
+				newGeom.addPoint(p1);
+				newGeom.addPointByCoordinates(p1.x, p2.y);
+				newGeom.addPoint(p2);
+				newGeom.addPointByCoordinates(p2.x, p1.y);
+				newGeom.close();
+				multiGeom.add(newGeom);
+			}
+			// standard case
+			// (polygon and point selection)
+			else {
+				multiGeom = new parent.MultiGeometry(spatialRequestGeom.geomType);
+				multiGeom.add(spatialRequestGeom);
+			}
+			
+			// add highlight of geometry
+			requestGeometryHighlight.add(multiGeom);
+			requestGeometryHighlight.paint();
+		
+		});
+}
+
+function wfsDisable(obj) {
+	var el = parent.window.frames["mapframe1"].document; 
+	el.onmousedown = null;
+	el.ondblclick = null;
+	el.onmousemove = null;
+	parent.writeTag("mapframe1","measure_display","");
+	parent.writeTag("mapframe1","measure_sub","");
+	activeButton = null;
+}
+
+function openwindow(url) {
+	window1 = window.open(url, "Information", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+	window1.focus();
+}
 //----------------------------------------------------------------------------------
 
 function appendWfsConf(newWfsConfIdString) {
@@ -146,7 +367,9 @@
 	}
 	document.getElementById("wfsGeomType").style.visibility = "hidden";
 	document.getElementById("wfsRemove").style.visibility = "hidden";
-	
+		
+	geomArray = new parent.GeometryArray();
+
 	parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json, status) {
 		global_wfsConfObj = json;
 		var wfsCount = 0;
@@ -170,6 +393,12 @@
 		}
 		parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
 	});
+	
+	// creates a Highlight object for the request geometry
+	var styleProperties = {"position":"absolute", "top":"0px", "left":"0px", "z-index":100};
+	requestGeometryHighlight = new parent.Highlight(targetArray, "requestGeometryHighlight", styleProperties, 2);
+	parent.mb_registerSubFunctions("window.frames['" + frameName +"'].requestGeometryHighlight.paint()");
+	
 }
 
 function setWfsInfo() {
@@ -207,7 +436,7 @@
 		wfsGeomTypeNode.style.visibility = 'visible';
 	}
 	else {
-		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");		
+		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");
 	}
 	
 	// set image: remove this WFS
@@ -230,7 +459,7 @@
 			initModWfsGazetteer();			
 			parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
 		}
-	}
+	}  
 }
 
 function setWfsConfIdString() {
@@ -248,14 +477,27 @@
 	var selectNode = document.createElement("select");
 	selectNode.name = "wfs_conf_sel";
 	var wfsFormNode = document.getElementById("selectWfsConfForm");
-	selectNode.onchange = function() {
+	if (parent.ie) {
+		selectNode.onchange = function() {
 		global_selectedWfsConfId = this.value;
-		setWfsInfo();
+     	if(typeof(resultGeometryPopup)!="undefined"){
+	 		resultGeometryPopup.destroy();
+	 	}
+	 	if(typeof(wfsPopup)!="undefined"){
+	 		wfsPopup.destroy();
+	 	}
+    	setWfsInfo();
 		appendStyles();
 		appendWfsForm();
-	};
+		};
+	}
+	else{
+	   selectNode.setAttribute("onchange", "if(typeof(resultGeometryPopup)!='undefined'){resultGeometryPopup.destroy();}if(typeof(wfsPopup)!='undefined'){wfsPopup.destroy();};global_selectedWfsConfId = this.value;setWfsInfo();appendStyles();appendWfsForm();");
+	}
 	var isSelected = false;
+
 	for (var wfsConfId in global_wfsConfObj) {
+	
 		var optionNode = document.createElement("option");
 		
 		optionNode.value = wfsConfId;
@@ -294,150 +536,715 @@
 	for (var i = 0; i < wfsConfElementArray.length; i++){
 		if (parseInt(wfsConfElementArray[i].f_search)) {
 			var spanNode = document.createElement("span");
-			spanNode.setAttribute("id", "ttttt");
+			spanNode.setAttribute("id", wfsConfElementArray[i].element_name+"Span");
 			spanNode.className = wfsConfElementArray[i].f_label_id;
 			spanNode.innerHTML = wfsConfElementArray[i].f_label;
-			var inputNode = document.createElement("input");
-			inputNode.type = "text";
-			inputNode.className = wfsConfElementArray[i].f_style_id;
-			inputNode.id = wfsConfElementArray[i].element_name;
-			
+			if(wfsConfElementArray[i].f_form_element_html.match(/\<select/)){
+				var inputNode = document.createElement("span");
+				inputNode.id = wfsConfElementArray[i].element_name+"Select";
+				inputNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
+			}
+			else if(wfsConfElementArray[i].f_form_element_html.match(/checkbox/)){
+				var inputNode = document.createElement("span");
+				inputNode.id = wfsConfElementArray[i].element_name+"Checkbox";
+				inputNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
+			}
+			else{ 
+				var inputNode = document.createElement("input");
+				inputNode.type = "text";
+				inputNode.className = wfsConfElementArray[i].f_style_id;
+				inputNode.id = wfsConfElementArray[i].element_name;
+				if(wfsConfElementArray[i].f_form_element_html.match(/datepicker/)){
+					inputNode.readOnly=true;
+					inputNode.style.backgroundColor = "#D3D3D3";
+					inputNode.title = "Use datepicker for selection of date";
+				}
+			}
 			form.appendChild(spanNode);
 			form.appendChild(inputNode);
+			
+			//build imgNode for datepicker image
+			if(wfsConfElementArray[i].f_form_element_html.match(/datepicker/)){
+				var imgNode = document.createElement("span");
+				imgNode.id = wfsConfElementArray[i].element_name+"Img";
+				imgNode.title = "Click here to open datepicker";
+				imgNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
+				form.appendChild(imgNode);
+			}
 			form.appendChild(document.createElement("br"));
 		}
 	}
 	var submitButton = document.createElement("input");
 	submitButton.type = "submit";
+	submitButton.id = "submitButton";
 	submitButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
 	submitButton.value = global_wfsConfObj[global_selectedWfsConfId].g_button;
 	
 	form.appendChild(submitButton);
+	
+	var delFilterButton = document.createElement("input");
+	delFilterButton.type = "button";
+	delFilterButton.style.marginLeft = "5px";
+	delFilterButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
+	delFilterButton.value = clearFilterButtonLabel;
+	// Internet explorer
+	if (parent.ie) {$_REQUEST['pdfPathString']
+		delFilterButton.onclick = function() {
+			var x = new Function ("", "clearFilter();"); 
+			x(); 
+		};
+	}
+	// Firefox
+	else {
+		delFilterButton.onclick = function () {
+			clearFilter();
+		}
+	}  
+	form.appendChild(delFilterButton);
+	
+	checkSrs();
 }
 
+function checkSrs(){
+	//check SRS
+	var ind = parent.getMapObjIndexByName("mapframe1");
+	var submit = document.getElementById("submitButton");
+	if(global_wfsConfObj[global_selectedWfsConfId].featuretype_srs.toUpperCase()!=parent.mb_mapObj[ind].getSRS().toUpperCase()){
+		var msg = "Different EPSG of map and wfs featuretype, no spatial request possible!\n";
+		msg += parent.mb_mapObj[ind].getSRS()+" und "+global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
+		alert(msg);
+			
+		//disable Submit Button
+		if(submit)submit.disabled = true;
+	}
+	else{
+		//disable Submit Button
+		if(submit)submit.disabled = false;
+	}
+}
+
+function clearFilter(){
+	var wfsConfElementArray = global_wfsConfObj[global_selectedWfsConfId].element;
+	for (var i = 0; i < wfsConfElementArray.length; i++){
+		if (parseInt(wfsConfElementArray[i].f_search)) {
+			if(wfsConfElementArray[i].f_form_element_html.match(/checkbox/)){
+				var elementArray = document.getElementsByName(wfsConfElementArray[i].element_name);
+				for (var j = 0; j < elementArray.length; j++){ 
+					elementArray[j].checked = "";
+				}
+				document.getElementById('checkAll').checked = "";
+			}
+			else{
+				document.getElementById(wfsConfElementArray[i].element_name).value = "";	
+			}
+		}	
+	}
+	
+	//remove geometry from spatialrequest, remove drawn rectangle or polygon and hint
+	spatialRequestGeom = null;
+	requestGeometryHighlight.clean();
+	requestGeometryHighlight.paint();
+	if(document.getElementById('spatialResHint')){
+ 		document.getElementById("spatialResHint").innerHTML = "";
+ 	}
+		
+	//remove result popup
+	if(typeof(resultGeometryPopup)!="undefined"){
+ 		resultGeometryPopup.destroy();
+ 	}
+ 	//remove detail popup
+ 	if(typeof(wfsPopup)!="undefined"){
+ 		wfsPopup.destroy();
+ 	}
+	
+ 	if(document.getElementById('spatialResHint')){
+ 		document.getElementById("spatialResHint").innerHTML = "";
+ 	}
+ 	document.getElementById("res").innerHTML = "";
+}
+
+function getNumberOfFilterParameters(){
+	var cnt = 0;
+	var el = global_wfsConfObj[global_selectedWfsConfId].element;
+	inputNotEnough = [];
+	for (var i = 0; i < el.length; i++){
+	
+		if( el[i]['f_search'] == 1){
+			if(el[i]['f_form_element_html'].match(/\<select/)){
+				var elementValue = document.getElementById(el[i]['element_name']).options[document.getElementById(el[i]['element_name']).selectedIndex].value;
+    		}
+    		else if(el[i]['f_form_element_html'].match(/checkbox/)){
+				var elementArray = document.getElementsByName(el[i]['element_name']);
+				var selectedVal = [];
+				for (var j = 0; j < elementArray.length; j++){ 
+					if (elementArray[j].checked == true){ 
+						selectedVal.push(elementArray[j].value);
+					}
+				}
+				var elementValue = selectedVal.join(",");
+			}
+			else{
+				var elementValue = document.getElementById(el[i]['element_name']).value;
+			}
+	
+			if (elementValue != '') {
+				cnt++;
+			}
+			if(elementValue.length < el[i]['f_min_input']){
+				inputNotEnough.push(el[i]['element_name']+"("+el[i]['f_min_input']+")");
+			}
+		}
+	}
+	
+	if(inputNotEnough.length>0){
+		alert("Mandatory fields: "+inputNotEnough.join(', '));
+		return false;
+	}
+	
+	if(spatialRequestGeom == null){
+		alert("Bitte räumliche Eingrenzung vornehmen.");
+		return false;
+	}
+	
+	return cnt;
+}
+
 function validate(){
+	if(geomArray.count()>0){
+ 		geomArray.empty();
+ 	}
+ 	if(typeof(resultGeometryPopup)!="undefined"){
+ 		resultGeometryPopup.destroy();
+ 	}
+ 	if(typeof(wfsPopup)!="undefined"){
+ 		wfsPopup.destroy();
+ 	}
 	global_resultHighlight = new parent.Highlight(targetArray, "wfs_gazetteer_highlight", {"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 2);
 
 	var filterParameterCount = getNumberOfFilterParameters();
 	
-	if(filterParameterCount == 0){
+	if(filterParameterCount == 0 && spatialRequestGeom == null){
+	//if(filterParameterCount == 0){
+		//alert("Please specify at least one filter attribute.");
 		return false;
 	}
 	else{
-		var andConditions = "";
+		if(inputNotEnough.length==0){
+			var andConditions = "";
+			
+			var el = global_wfsConfObj[global_selectedWfsConfId].element;
+			var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
 		
-		var el = global_wfsConfObj[global_selectedWfsConfId].element;
-
-		for (var i = 0; i < el.length; i++) {
-			if (el[i]['f_search'] == 1 && document.getElementById(el[i]['element_name']).value != '') {
-		
-				var a = new Array();
-				a = document.getElementById(el[i]['element_name']).value.split(",");
-				var orConditions = "";
-				for (var j=0; j < a.length; j++) {
-					
-					orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
-					orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-					orConditions += "<ogc:Literal>*";
-					if(el[i]['f_toupper'] == 1){
-						orConditions += a[j].toUpperCase();
+			for (var i = 0; i < el.length; i++) {
+				if (el[i]['f_search'] == 1){
+					if(el[i]['f_form_element_html'].match(/\<select/)){
+						var elementValue = document.getElementById(el[i]['element_name']).options[document.getElementById(el[i]['element_name']).selectedIndex].value;
+	    			}
+	    			else if(el[i]['f_form_element_html'].match(/checkbox/)){
+						var elementArray = document.getElementsByName(el[i]['element_name']);
+						var selectedVal = [];
+						for (var j = 0; j < elementArray.length; j++){ 
+							if (elementArray[j].checked == true){ 
+								selectedVal.push(elementArray[j].value);
+							}
+						}
+						var elementValue = selectedVal.join(",");
 					}
 					else{
-						orConditions += a[j];
+						var elementValue = document.getElementById(el[i]['element_name']).value;
 					}
-					orConditions += "*</ogc:Literal>";
-					orConditions += "</ogc:PropertyIsLike>";
 				}
-				if(a.length > 1){
-					andConditions += "<Or>" + orConditions + "</Or>";
+				
+				if (el[i]['f_search'] == 1 && elementValue != '') {
+					var a = new Array();
+					a = elementValue.split(",");
+					var orConditions = "";
+					for (var j=0; j < a.length; j++) {
+						if(el[i]['f_operator']=='bothside'){
+							orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>*";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "*</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsLike>";
+					}
+						else if(el[i]['f_operator']=='rightside'){
+							orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "*</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsLike>";
+						}
+						else if(el[i]['f_operator']=='greater_than'){
+							orConditions += "<ogc:PropertyIsGreaterThan>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsGreaterThan>";
+						}
+						else if(el[i]['f_operator']=='less_than'){
+							orConditions += "<ogc:PropertyIsLessThan>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsLessThan>";
+						}
+						else if(el[i]['f_operator']=='less_equal_than'){
+							orConditions += "<ogc:PropertyIsLessThanOrEqualTo>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsLessThanOrEqualTo>";
+						}
+						else if(el[i]['f_operator']=='greater_equal_than'){
+							orConditions += "<ogc:PropertyIsGreaterThanOrEqualTo>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsGreaterThanOrEqualTo>";
+						}
+						else if(el[i]['f_operator']=='equal'){
+							orConditions += "<ogc:PropertyIsEqualTo>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsEqualTo>";
+						}
+						else{
+							orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+							orConditions += "<ogc:Literal>*";
+							if(el[i]['f_toupper'] == 1){
+								orConditions += a[j].toUpperCase();
+							}
+							else{
+								orConditions += a[j];
+							}
+							orConditions += "*</ogc:Literal>";
+							orConditions += "</ogc:PropertyIsLike>";
+						}
+					}
+					if(a.length > 1){
+						andConditions += "<Or>" + orConditions + "</Or>";
+					}
+					else {
+						andConditions += orConditions;
+					}
 				}
-				else {
-					andConditions += orConditions;
-				}
 			}
-		}
-
-		var u = global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature + parent.mb_getConjunctionCharacter(global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature);
-		u += "REQUEST=getFeature&Typename="+global_wfsConfObj[global_selectedWfsConfId].featuretype_name+"&Version=1.0.0&service=WFS";
-		u += "&filter=";
-
-		if (filterParameterCount > 1) {
-			andConditions = "<And>" + andConditions + "</And>";
-		}
-
-		var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
-
-		document.getElementById("res").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
-		var parameters = {command:"getSearchResults", "wfs_conf_id":global_selectedWfsConfId, "frame":this.name, "url":u, "filter":filter, "backlink":""};
-		parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
-			document.getElementById("res").innerHTML = "<table><tr><td>Arranging search results...</td></tr></table>";
 			
-			eval(jsCode);
-			
-			for (var i=0; i < parent.wms.length; i++) {
-				for (var j=0; j < parent.wms[i].objLayer.length; j++) {
-	
-					var currentLayer = parent.wms[i].objLayer[j];
-					var wms_id = parent.wms[i].wms_id; 
-	
-					if (currentLayer.gui_layer_wfs_featuretype == global_selectedWfsConfId) {
-						var layer_name = currentLayer.layer_name; 
-						parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'querylayer',1); 
-						parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'visible',1);
+			if(spatialRequestGeom!=null){
+				if(spatialRequestGeom.geomType == "polygon"){
+					if(buttonPolygon.filteroption=='within'){	
+						andConditions += "<Within><ogc:PropertyName>";
+						for (var j=0; j < el.length; j++) {
+							if(el[j]['f_geom']==1){
+								var elementName = el[j]['element_name'];
+								andConditions += el[j]['element_name'];
+							}
+						}
+						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+						for(var k=0; k<spatialRequestGeom.count(); k++){
+							if(k>0)	andConditions += " ";
+							andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
+						}
+						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						andConditions += "</gml:Polygon></Within>";
 					}
+					else if(buttonPolygon.filteroption=='intersects'){
+						andConditions += "<Intersects><ogc:PropertyName>";
+						for (var j=0; j < el.length; j++) {
+							if(el[j]['f_geom']==1){
+								var elementName = el[j]['element_name'];
+								andConditions += el[j]['element_name'];
+							}
+						}
+						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+						for(var k=0; k<spatialRequestGeom.count(); k++){
+							if(k>0)	andConditions += " ";
+							andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
+						}
+						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						andConditions += "</gml:Polygon></Intersects>";
+					}
+				}	
+				else if(spatialRequestGeom.geomType == "line"){
+					var rectangle = [];
+					rectangle = spatialRequestGeom.getBBox();
+					
+					if(buttonRectangle.filteroption=='within'){	
+						andConditions += "<Within><ogc:PropertyName>";
+						for (var j=0; j < el.length; j++) {
+							if(el[j]['f_geom']==1){
+								var elementName = el[j]['element_name'];
+								andConditions += el[j]['element_name'];
+							}
+						}
+						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+						andConditions += rectangle[0].x+","+rectangle[0].y;
+						andConditions += " ";
+						andConditions += rectangle[0].x+","+rectangle[1].y;
+						andConditions += " ";
+						andConditions += rectangle[1].x+","+rectangle[1].y;
+						andConditions += " ";
+						andConditions += rectangle[1].x+","+rectangle[0].y;
+						andConditions += " ";
+						andConditions += rectangle[0].x+","+rectangle[0].y;
+						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						andConditions += "</gml:Polygon></Within>";
+					}
+					else if(buttonRectangle.filteroption=='intersects'){
+						andConditions += "<Intersects><ogc:PropertyName>";
+						for (var j=0; j < el.length; j++) {
+							if(el[j]['f_geom']==1){
+								var elementName = el[j]['element_name'];
+								andConditions += el[j]['element_name'];
+							}
+						}
+						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+						andConditions += rectangle[0].x+","+rectangle[0].y;
+						andConditions += " ";
+						andConditions += rectangle[0].x+","+rectangle[1].y;
+						andConditions += " ";
+						andConditions += rectangle[1].x+","+rectangle[1].y;
+						andConditions += " ";
+						andConditions += rectangle[1].x+","+rectangle[0].y;
+						andConditions += " ";
+						andConditions += rectangle[0].x+","+rectangle[0].y;
+						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						andConditions += "</gml:Polygon></Intersects>";
+					}			
 				}
+				else if(spatialRequestGeom.geomType == "point"){
+					var tmp = spatialRequestGeom.get(0);
+					var mapPos = parent.makeRealWorld2mapPos("mapframe1",tmp.x, tmp.y);
+					var buffer = mb_wfs_tolerance/2;
+					var mapPosXAddPix = mapPos[0] + buffer; 
+					var mapPosYAddPix = mapPos[1] +buffer;
+					var mapPosXRemovePix = mapPos[0] - buffer;
+					var mapPosYRemovePix = mapPos[1] - buffer;
+					var realWorld1 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYRemovePix);
+					var realWorld2 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
+					var realWorld3 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
+					var realWorld4 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYAddPix);
+					andConditions += "<Intersects><ogc:PropertyName>";
+					for (var j=0; j < el.length; j++) {
+						if(el[j]['f_geom']==1){
+							var elementName = el[j]['element_name'];
+							andConditions += el[j]['element_name'];
+						}
+					}
+					andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+					andConditions += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] +  " ";
+					andConditions += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1]; 
+					andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects>";
+				}
+				//andConditions += "<ogc:Not><ogc:PropertyIsNull>";
+	            //andConditions += "<ogc:PropertyName>" + elementName + "</ogc:PropertyName>";
+	       		//andConditions += "</ogc:PropertyIsNull></ogc:Not>";
 			}
 			
-			var body = "";
-			if (typeof(geom) == 'object') {
-				resultGeom = geom; // set the global variable
-				for (var i=0; i < geom.count(); i++) {
-					body += "<div id='geom"+i+"'style='cursor:pointer;' ";
-					if ((i % 2) === 0) {
-						body += "class='even'";
+			var u = global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature + parent.mb_getConjunctionCharacter(global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature);
+			u += "REQUEST=getFeature&Typename="+global_wfsConfObj[global_selectedWfsConfId].featuretype_name+"&Version=1.0.0&service=WFS";
+			u += "&filter=";
+	
+			if (filterParameterCount > 1 || spatialRequestGeom != null) {
+				andConditions = "<And>" + andConditions + "</And>";
+			}
+	
+			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
+	
+			document.getElementById("res").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
+			var parameters = {command:"getSearchResults", "wfs_conf_id":global_selectedWfsConfId, "frame":this.name, "url":u, "filter":filter, "backlink":""};
+			parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
+				document.getElementById("res").innerHTML = "<table><tr><td>Arranging search results...</td></tr></table>";
+				
+				if(status=='success'){
+					for (var i=0; i < parent.wms.length; i++) {
+						for (var j=0; j < parent.wms[i].objLayer.length; j++) {
+							var currentLayer = parent.wms[i].objLayer[j];
+							var wms_id = parent.wms[i].wms_id; 
+							if (currentLayer.gui_layer_wfs_featuretype == global_selectedWfsConfId) {
+								var layer_name = currentLayer.layer_name; 
+								parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'querylayer',1); 
+								parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'visible',1);					
+							}
+						}
 					}
-					else {
-						body += "class='uneven'";
+					var geoObj = eval('(' + jsCode + ')');	
+		       		if (jsCode) {
+			        	if (typeof(geoObj) == 'object') {
+			        		geomArray.importGeoJSON(geoObj);
+			        		document.getElementById("res").innerHTML = '';
+							displayResult(geomArray);
+						}
+						else {
+							document.getElementById("res").innerHTML = '';
+							displayResult();
+						}
 					}
-					body += " onmouseover=\"setResult('over', this.id)\" ";
-					body += " onmouseout=\"setResult('out', this.id)\" ";
-					body += " onclick=\"setResult('click', this.id)\">";
-					for (var j=0; j < geom.get(i).e.count(); j++) {
-						body += geom.get(i).e.getValue(j) + " ";
+		       		else {
+						document.getElementById("res").innerHTML = '';
+						alert("No results.");
 					}
-					body += "</div>";
-				}
+		       	}
+			});
+		}
+		else{
+			return false;
+		}
+	}	
+	//spatialRequestGeom = null;
+	return false;
+}
+
+function displayResult(geom){
+	geomArray = geom;
+	if(geomArray!=null && geomArray.count()>0){
+		var contentHtml = createListOfGeometries();
+	}
+	else{
+		var contentHtml = "No results.";
+	}
+	
+	if(showResultInPopup==1){
+		if (typeof(resultGeometryPopup) == "undefined") {
+			resultGeometryPopup = new parent.mb_popup(searchPopupTitle,contentHtml,searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
+		}
+		else {
+			resultGeometryPopup.destroy();
+			resultGeometryPopup = new parent.mb_popup(searchPopupTitle,contentHtml,searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
+		}
+		resultGeometryPopup.show();
+	
+	}
+	else{
+		document.getElementById("res").innerHTML = contentHtml;
+	}
+	
+} 
+
+function createListOfGeometries(){
+	if(showResultInPopup==1){
+		var domPath = "window.frames['"+frameName+"'].";
+	}
+	else{
+		var domPath = "";
+	}
+	var listOfGeom = "<form name='resultListForm'><table style='background-color:#EEEEEE;'>\n";
+	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
+	var labelArray = [];
+	if (geomArray.count() > 0) {
+				
+		if(showResultInPopup==1){
+			listOfGeom += "<tr>";
+			listOfGeom += "<td>\n";
+			listOfGeom += "&nbsp;";
+			listOfGeom += "</td>\n";
+			var labelObj = getListTitle();
+			for (var k = 1 ; k < labelObj.length; k ++) {
+				listOfGeom += "<td>";
+				listOfGeom += labelObj[k];
+				listOfGeom += "</td>";
 			}
-			else {
-				body = "Kein Ergebnis.";
+			listOfGeom += "</tr>";
+		}
+						
+		for (var i = 0 ; i < geomArray.count(); i ++) {
+			if (geomArray.get(i).get(-1).isComplete()) {
+				listOfGeom += "<tr>\n";
+				var resultElObj = getListValues(geomArray.get(i));
+				for (var l = 1 ; l < resultElObj.length; l ++) {
+					if(resultElObj[l]!=''){
+						listOfGeom += "<td style='cursor:pointer;\n";
+						if(showResultInPopup==1){
+							if ((i % 2) === 0) {
+								listOfGeom += "color:blue'";
+							}
+							else {
+								listOfGeom += "color:red'";
+							}
+						}
+						else{
+							if ((i % 2) === 0) {
+								listOfGeom += "' class='even'";
+							}
+							else {
+								listOfGeom += "' class='uneven'";
+							}
+						}
+						listOfGeom += " onmouseover=\""+domPath+"setResult('over',"+i+")\" ";
+						listOfGeom += " onmouseout=\""+domPath+"setResult('out',"+i+")\" ";
+						listOfGeom += " onclick=\""+domPath+"setResult('click',"+i+"); "+domPath+"showWfs("+i+");\" ";
+						listOfGeom += ">"+ resultElObj[l] +"</td>";
+					}
+				}	
+				listOfGeom += "\t</tr>\n"; 
 			}
-			document.getElementById('res').innerHTML = body;
-		});
+		}
 	}
-	return false;
+	listOfGeom += "</table></form>\n";
+	return listOfGeom; 
 }
 
-function getNumberOfFilterParameters(){
-	var cnt = 0;
-	var el = global_wfsConfObj[global_selectedWfsConfId].element;
+function getListTitle(){
+	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
+	var labelArray = [];
+	for (var j = 0 ; j < wfsConf.element.length ; j++) {
+		if(wfsConf.element[j].f_show == 1 && wfsConf.element[j].f_label!=''){
+			var labelPos = wfsConf.element[j].f_respos;
+			labelArray[labelPos] = wfsConf.element[j].f_label;
+		}
+	}
+	return labelArray;
+}
+		
+function getListValues(geom){
+	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
+	var resultArray = [];
+	for (var i = 0 ; i < wfsConf.element.length ; i++) {
+		if (wfsConf.element[i].f_show == 1 && geom.e.getElementValueByName(wfsConf.element[i].element_name) !=false) {
+			var pos = wfsConf.element[i].f_respos;
+			if(pos>0){
+				resultArray[pos] = geom.e.getElementValueByName(wfsConf.element[i].element_name);
+			}
+		}
+	}
+	return resultArray;
+}
 
-	for (var i = 0; i < el.length; i++){
-		if( el[i]['f_search'] == 1){
-			if (document.getElementById(el[i]['element_name']).value != '') {
-				cnt++;
+function showWfs(geometryIndex) {
+	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
+	var wfsElement = geomArray.get(geometryIndex).e;
+	var showDetailsObj = [];
+	var details = 0;
+	for (var i = 0 ; i <wfsConf.element.length; i ++) {
+		if(wfsConf.element[i].f_show_detail == 1 && wfsElement.getElementValueByName(wfsConf.element[i].element_name)!=''){
+			var elPos = wfsConf.element[i].f_detailpos;
+			if(elPos>0){
+				var currentObj = {};
+//				showDetailsObj[elPos] = {};
+				currentObj.elPos = elPos;
+				currentObj.data = {};
+				//var elementVal = wfsElement.getElementValueByName(wfsConf.element[i].element_name);
+				//showDetailsObj[elPos][wfsConf.element[i].f_label] = elementVal;
+				if(wfsConf.element[i].f_form_element_html.indexOf("href")!=-1){
+					var newPath = wfsElement.getElementValueByName(wfsConf.element[i].element_name).replace(/%computername%/,"Rechnername");
+					var setUrl = wfsConf.element[i].f_form_element_html.replace(/href\s*=\s*['|"]\s*['|"]/, "href='"+newPath+"' target='_blank'");
+					if(setUrl.match(/><\/a>/)){
+						var newLink	=	setUrl.replace(/><\/a>/, ">"+wfsElement.getElementValueByName(wfsConf.element[i].element_name)+"</a>");
+					}
+					else{
+						var newLink = setUrl;
+					}
+					if(openLinkFromSearch=='1'){
+						window.open(elementVal, elementVal,"width=500, height=400,left=100,top=100,scrollbars=yes");
+					}
+//					showDetailsObj[elPos][wfsConf.element[i].f_label] =  newLink;
+					currentObj.data[wfsConf.element[i].f_label] = newLink;
+				}
+				else{
+//					showDetailsObj[elPos][wfsConf.element[i].f_label] = wfsElement.getElementValueByName(wfsConf.element[i].element_name);
+					currentObj.data[wfsConf.element[i].f_label] = wfsElement.getElementValueByName(wfsConf.element[i].element_name);
+				}
+				showDetailsObj.push(currentObj);
 			}
+			details = 1;
 		}
+		else{
+			details = 0;
+		}
 	}
-	return cnt;
+	var resultHtml = "";
+	resultHtml += "<table style='background-color:#EEEEEE;'>\n";
+//	for (var elPos in showDetailsObj) {
+
+	showDetailsObj.sort(showDetailObjSort);
+	for (var i=0; i < showDetailsObj.length; i++) {
+//		var currentDetail = showDetailsObj[elPos];
+		var currentDetail = showDetailsObj[i].data;
+		for(var key in currentDetail){
+			var currentDetailName = key;
+			var currentDetailValue = currentDetail[key];
+			resultHtml +="<tr><td>\n"; 
+			resultHtml += currentDetailName;
+			resultHtml +="</td>\n"; 
+			resultHtml += "<td>\n";
+			resultHtml += currentDetailValue;
+			resultHtml += "</td></tr>\n";
+		}
+	}
+	if(details != 1){
+		resultHtml +="<tr><td>No detail information</td></tr>\n";
+	}
+	resultHtml += "</table>\n";
+	if(showResultInPopup==1){
+		if (typeof(wfsPopup) == "undefined") {
+			wfsPopup = new parent.mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
+		}
+		else {
+			wfsPopup.destroy();
+			wfsPopup = new parent.mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
+		}
+		wfsPopup.show();
+	}
 }
+
+function showDetailObjSort (a, b) {
+	return (parseInt(a.elPos) - parseInt(b.elPos));
+}
+
 /*
 * event -> {over || out || click}
 * geom -> commaseparated coordinates x1,y1,x2,y2 ...
 */
-function setResult(event, id){
-	var index = parseInt(id.slice(4));
-
-	var currentGeom = resultGeom.get(index);
+function setResult(event, index){
+	var currentGeom = geomArray.get(index);
 	if (maxHighlightedPoints > 0 && currentGeom.getTotalPointCount() > maxHighlightedPoints) {
 		currentGeom = currentGeom.getBBox4();
 	}
@@ -463,14 +1270,23 @@
 	}
 	return true;
 }
+
+function callPick(obj){
+	dTarget = obj;
+	var dp = window.open('../tools/datepicker/datepicker.php?m=Jan_Feb_Mar_Apr_May_June_July_Aug_Sept_Oct_Nov_Dec&d=Mon_Tue_Wed_Thu_Fri_Sat_Sun&t=today','dp','left=200,top=200,width=230,height=210,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0');
+	dp.focus();
+	return false;
+}
+
 </script>
 </head>
 <body leftmargin='0' topmargin='10'  bgcolor='#ffffff'>
 <form name='selectWfsConfForm' id='selectWfsConfForm'></form>
+<div name='displaySpatialButtons' id='displaySpatialButtons' style='width:180px'></div>
+<a name='wfsInfo' id='wfsInfo'></a>
+<img src = "" name='wfsRemove' id='wfsRemove'>
 <img src = "" name='wfsGeomType' id='wfsGeomType'>
-<img src = "" name='wfsRemove' id='wfsRemove'>
-<a name='wfsInfo' id='wfsInfo'></a>
 <form name='wfsForm' id='wfsForm' onsubmit='return validate()'></form>
 <div name='res' id='res' style='width:180px'></div>
 </body>
-</html>
\ No newline at end of file
+</html>



More information about the Mapbender_commits mailing list