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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 19 09:49:32 EST 2010


Author: christoph
Date: 2010-11-19 06:49:32 -0800 (Fri, 19 Nov 2010)
New Revision: 7143

Modified:
   trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
Log:
do not display geometry symbol if not explicitly point, line, or polygon

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2010-11-19 13:25:43 UTC (rev 7142)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2010-11-19 14:49:32 UTC (rev 7143)
@@ -1,8 +1,8 @@
-<?php 
+<?php
 # $Id$
 # maintained by http://www.mapbender.org/index.php/User:Verena Diewald
 # http://www.mapbender.org/index.php/WFS_gazetteer
-# Copyright (C) 2002 CCGIS 
+# Copyright (C) 2002 CCGIS
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">	
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
 <title>mod_wfs_gazetteer</title>
 
 <?php
@@ -39,15 +39,15 @@
  *
  * Description:
  * A WFS gazetteer for pre configured WFS configurations.
- * 
+ *
  * Files:
  *  - http/javascripts/mod_wfs_gazetteer_client.php
  *  - http/php/mod_wfs_gazetteer_server.php
  *
  * SQL:
- * > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, 
- * > e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, 
- * > e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, 
+ * > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment,
+ * > e_title, e_element, e_src, e_attributes, e_left, e_top, e_width,
+ * > e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file,
  * > e_mb_mod, e_target, e_requires, e_url) VALUES ('<appId>','gazetteerWFS',
  * > 2,1,'a gazetteer for user in the mapbender user map','Search','iframe',
  * > '../javascripts/mod_wfs_gazetteer_client.php?sessionID&target=mapframe1,overview',
@@ -57,29 +57,29 @@
  * > 'mapframe1,overview','','http://www.mapbender.org/GazetteerWFS');
  * >
  * >
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES ('<appId>', 'gazetteerWFS', 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES ('<appId>', 'gazetteerWFS',
  * > 'wfsConfIdString', '<value>', 'comma seperated list of WFS conf ids' ,
  * > 'php_var');
  * >
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS', 
- * > 'wfs_spatial_request_conf_filename', 'wfs_additional_spatial_search.conf', 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS',
+ * > 'wfs_spatial_request_conf_filename', 'wfs_additional_spatial_search.conf',
  * > 'location and name of the WFS configuration file for spatialRequest' ,
  * > 'php_var');
  * >
- * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS', 
+ * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS',
  * > 'initializeOnLoad', '0', 'start gazetteer onload' ,'var');
  * >
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS', 
- * > 'enableSearchWithoutParams', '0', 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS',
+ * > 'enableSearchWithoutParams', '0',
  * > 'define that search can be started without any search params' ,
  * > 'var');
  * >
- * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS', 
+ * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'gazetteerWFS',
  * > 'removeSpatialRequestHighlight', '0', 'remove spatialrequest highlighting when firing search' ,'var');
  *
  * Help:
@@ -87,23 +87,23 @@
  *
  * Maintainer:
  * http://www.mapbender.org/User:Verena_Diewald
- * 
+ *
  * Parameters:
  * wfsConfIdString - comma seperated list of WFS conf ids
- * wfs_spatial_request_conf_filename - location and name of the WFS 
+ * wfs_spatial_request_conf_filename - location and name of the WFS
  * 			configuration file for spatialRequest
  * initializeOnLoad - start gazetteer onload
- * enableSearchWithoutParams - define that search can be started without any 
+ * enableSearchWithoutParams - define that search can be started without any
  * 			search params
  * removeSpatialRequestHighlight - remove spatialrequest highlighting when firing search
  *
  * License:
  * Copyright (c) 2009, Open Source Geospatial Foundation
- * This program is dual licensed under the GNU General Public License 
- * and Simplified BSD license.  
+ * This program is dual licensed under the GNU General Public License
+ * and Simplified BSD license.
  * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
  */
-<?php 
+<?php
 	include '../include/dyn_js.php';
 	include '../extensions/jquery-ui-1.7.2.custom/js/jquery-1.3.2.min.js';
 	include '../include/dyn_php.php';
@@ -191,12 +191,12 @@
 function filteredCopy(obj,filter){
   filter = filter || /.*/;
   obj    = obj    || {};
- 
-  var deleteStack = []; 
+
+  var deleteStack = [];
   var subtree = null;
   var entry   = null;
 
-  // visit each node, and check it's subtree for 
+  // visit each node, and check it's subtree for
   // nodes containing "filter"
   // if it doesn contain any of those, put the subtree index
   // on a list
@@ -226,7 +226,7 @@
       }
     }
   }
-  
+
   for( entry in deleteStack)
   {
     if(deleteStack.hasOwnProperty(entry)) {
@@ -237,11 +237,11 @@
 }
 
 function localizeGazetteer(){
-  
+
   // make overlaytree containing only entries to be translated
   var inObj = $.extend(true,{},global_wfsConfObj);
   var labels = filteredCopy(inObj,/button_id$|label$/);
- 
+
   var  req  =  new parent.Mapbender.Ajax.Request({
       url: "../php/mod_wfs_gazetteer_l10n.php",
       method: "translateServiceData" ,
@@ -271,10 +271,10 @@
 		parent.Mapbender.modules.gazetteerWFS.events = {};
 		var ev = parent.Mapbender.modules.gazetteerWFS.events;
 		ev.receiveFeatureCollection = parent.Mapbender.modules.gazetteerWFS.receiveFeatureCollection;
-		
+
 		/**
 		 * Property: events.onWfsConfSelect
-		 * 
+		 *
 		 * Description:
 		 * event is fired whenever a new WFS is selected
 		 */
@@ -282,7 +282,7 @@
 
 		/**
 		 * Property: events.onFormReset
-		 * 
+		 *
 		 * Description:
 		 * event is fired whenever the form is resetted
 		 */
@@ -293,10 +293,10 @@
 		var styleProperties = {"position":"absolute", "top":"0px", "left":"0px", "z-index":80};
 		requestGeometryHighlight = new parent.Highlight(targetArray, "requestGeometryHighlight", styleProperties, 2);
 		parent.mb_registerSubFunctions("window.frames['" + frameName +"'].requestGeometryHighlight.paint()");
-	
 
-		initModWfsGazetteer();	
-		init_wfsSpatialRequest();	
+
+		initModWfsGazetteer();
+		init_wfsSpatialRequest();
 	}
 	catch (exc) {
 		alert(exc);
@@ -308,7 +308,7 @@
 		});
 	}
 	catch (exc) {
-		
+
 	}
 
 	try {
@@ -370,9 +370,9 @@
 
 function wfsInitFunction (j) {
 	var functionCall = "parent.mb_regButton_frame('initWfsButton', '"+frameName+"', "+j+")";
-	var x = new Function ("", functionCall); 
+	var x = new Function ("", functionCall);
 	x();
-} 
+}
 
 function initWfsButton(ind, pos) {
 	parent.mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
@@ -390,7 +390,7 @@
 	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 ++) {
@@ -404,7 +404,7 @@
 			currentImg.onmouseover = new Function("wfsInitFunction("+i+")");
 			var b = document.getElementById("displaySpatialButtons");
 			if (b !== null) {
-				b.appendChild(currentImg);	
+				b.appendChild(currentImg);
 			}
 		}
 	}
@@ -424,7 +424,7 @@
    	el.onmousedown = null;
    	el.onmouseup = null;
    	el.onmousemove = null;
-   	
+
 	if (obj.id == button_point) {
 		if (activeButton == null) {
 			activeButton = obj;
@@ -466,13 +466,13 @@
 				spatialRes.className = "spatialResHint";
 				var b = document.getElementById("displaySpatialButtons");
 				if (b !== null) {
-					b.appendChild(spatialRes);	
+					b.appendChild(spatialRes);
 				}
 				document.getElementById("spatialResHint").innerHTML = "<br><img src='"+spatialRequestIsSetImg+"'></img>"+spatialRequestIsSetMessage;
 				spatialRequestGeom = queryGeom;
 			}
 			parent.mb_disableThisButton(selectedType);
-			
+
 			// spatialRequestGeom is a Geometry, but for the highlight
 			// a MultiGeometry is needed.
 			var multiGeom;
@@ -496,11 +496,11 @@
 				multiGeom = new parent.MultiGeometry(spatialRequestGeom.geomType);
 				multiGeom.add(spatialRequestGeom);
 			}
-			
+
 			// add highlight of geometry
 			requestGeometryHighlight.add(multiGeom);
 			requestGeometryHighlight.paint();
-		
+
 		});
 }
 
@@ -537,7 +537,7 @@
 		// rebuild form
 		initModWfsGazetteer();
 	}
-	
+
 }
 
 function removeChildNodes(node) {
@@ -551,24 +551,24 @@
 		}
 	}
 	catch (exc) {
-		
+
 	}
 }
 
 /**
  * removes whitespaces and endlines before and after a string
  *
- */ 
+ */
 function trimString (str) {
 	return str.replace(/^\s+|\s+|\n+$/g, '');
 }
 
 function appendStyles() {
-	//first of all remove all style tags from former wfs confs 
+	//first of all remove all style tags from former wfs confs
 	var styleNodes = document.getElementsByTagName("style");
 	for (var i=0; i < styleNodes.length; i++) {
 		var parentNodeOfStyle = styleNodes[i].parentNode;
-		parentNodeOfStyle.removeChild(styleNodes[i]);	
+		parentNodeOfStyle.removeChild(styleNodes[i]);
 	}
 	var styleObj;
 	var rule = global_wfsConfObj[global_selectedWfsConfId].g_style + global_wfsConfObj[global_selectedWfsConfId].g_res_style;
@@ -589,7 +589,7 @@
 		styleObj=document.createElement("style");
 		styleObj.setAttribute("type","text/css");
 		document.getElementsByTagName("head")[0].appendChild(styleObj);
-		styleObj.appendChild(document.createTextNode(rule+"\n"));		
+		styleObj.appendChild(document.createTextNode(rule+"\n"));
 	}
 }
 
@@ -603,11 +603,11 @@
 		var currentNode = document.getElementById(currentId);
 		removeChildNodes(currentNode);
 	}
-	
+
 	geomArray = new parent.GeometryArray();
-    
+
     // Would be much nicer to have
-    // initWFSConf() and reloadWFSConf 
+    // initWFSConf() and reloadWFSConf
      parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json,status) {
         reapplyWFSConfObject(json, status);
         localizeGazetteer();
@@ -630,7 +630,7 @@
 	global_wfsConfObj = json;
 	var wfsCount = 0;
 	for (var wfsConfId in global_wfsConfObj) {
-		global_selectedWfsConfId = wfsConfId; 
+		global_selectedWfsConfId = wfsConfId;
 		if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
 			wfsCount++;
 		}
@@ -644,15 +644,15 @@
 	}
 	else {
 		appendWfsConfSelectBox();
-		
+
 	}
 }
 
 function setWfsInfo() {
-	
+
 	var bodyNode = document.getElementById("wfsIcons");
 	removeChildNodes(bodyNode);
-	var bulbNode = document.createElement("a");	
+	var bulbNode = document.createElement("a");
 	bulbNode.name = "wfsInfo";
 	bulbNode.id = "wfsInfo";
 	bodyNode.appendChild(bulbNode);
@@ -668,7 +668,7 @@
 	bulbNode.appendChild(imgNode);
 	bulbNode.href = "javascript:openwindow('../php/mod_featuretypeMetadata.php?wfs_conf_id=" + global_selectedWfsConfId.toString() + "');";
 	bulbNode.style.visibility = "visible";
-		
+
 	// set image: remove this WFS
 	var wfsRemoveNode = document.createElement("img");
 	wfsRemoveNode.name = "wfsRemove";
@@ -681,8 +681,8 @@
 	// Internet explorer
 	if (parent.ie) {
 		wfsRemoveNode.onclick = function() {
-			var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'WFSCONFIDSTRING':wfsConfIdString});"); 
-			x(); 
+			var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'WFSCONFIDSTRING':wfsConfIdString});");
+			x();
 		};
 	}
 	// Firefox
@@ -690,10 +690,10 @@
 		wfsRemoveNode.onclick = function () {
 			delete global_wfsConfObj[global_selectedWfsConfId];
 			setWfsConfIdString();
-			initModWfsGazetteer();			
+			initModWfsGazetteer();
 			parent.mb_setWmcExtensionData({"WFSCONFIDSTRING":wfsConfIdString});
 		}
-	} 
+	}
 	// set wfsGeomType image
 	var wfsGeomTypeNode = document.createElement("img");
 	wfsGeomTypeNode.name = "wfsGeomType";
@@ -719,6 +719,7 @@
 		wfsGeomTypeNode.title = '<?php echo _mb("Polygon");?>';
 	}
 	else {
+		wfsGeomTypeNode.style.display = "none";
 		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");
 	}
 }
@@ -726,7 +727,7 @@
 function setWfsConfIdString() {
 	var str = [];
 	for (var wfsConfId in global_wfsConfObj) {
-		global_selectedWfsConfId = wfsConfId; 
+		global_selectedWfsConfId = wfsConfId;
 		if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
 			str.push(wfsConfId);
 		}
@@ -743,7 +744,7 @@
 			global_selectedWfsConfId = this.value;
 			initializeOnLoad = 0;
 
-			//close old dialogs 
+			//close old dialogs
 			parent.$('.resultList').dialog('close');
 			parent.$('.infoPopup').dialog('close');
 
@@ -760,7 +761,7 @@
 	var isSelected = false;
 	for (var wfsConfId in global_wfsConfObj) {
 		var optionNode = document.createElement("option");
-		
+
 		optionNode.value = wfsConfId;
 		optionNode.innerHTML = global_wfsConfObj[wfsConfId].wfs_conf_abstract;
 
@@ -774,7 +775,7 @@
 
 	var form = document.getElementById('selectWfsConfForm');
 	form.appendChild(selectNode);
-	
+
 	appendStyles();
 	appendWfsForm();
 }
@@ -787,12 +788,12 @@
 	removeChildNodes(form);
 	var resultDiv = document.getElementById("res");
 	removeChildNodes(resultDiv);
-	
+
 	var divContainer = document.createElement("div");
 	divContainer.className = global_wfsConfObj[global_selectedWfsConfId].g_label_id;
-	
+
 	divContainer.innerHTML = global_wfsConfObj[global_selectedWfsConfId].g_label;
-	
+
 	form.appendChild(divContainer);
 
 	var wfsConfElementArray = global_wfsConfObj[global_selectedWfsConfId].element;
@@ -813,7 +814,7 @@
 				inputNode.id = wfsConfElementArray[i].element_name+"Checkbox";
 				inputNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
 			}
-			else{ 
+			else{
 				var inputNode = document.createElement("input");
 				inputNode.type = "text";
 				inputNode.className = wfsConfElementArray[i].f_style_id;
@@ -826,7 +827,7 @@
 			}
 			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");
@@ -843,9 +844,9 @@
 	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";
@@ -854,8 +855,8 @@
 	// Internet explorer
 	if (parent.ie) {
 		delFilterButton.onclick = function() {
-			var x = new Function ("", "clearFilter();"); 
-			x(); 
+			var x = new Function ("", "clearFilter();");
+			x();
 		};
 	}
 	// Firefox
@@ -863,11 +864,11 @@
 		delFilterButton.onclick = function () {
 			clearFilter();
 		}
-	}  
+	}
 	form.appendChild(delFilterButton);
-	
+
 	checkSrs();
-	
+
 	if(initializeOnLoad == 1) {
 		return validate();
 	}
@@ -902,17 +903,17 @@
 		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++){ 
+				for (var j = 0; j < elementArray.length; j++){
 					elementArray[j].checked = "";
 				}
 				document.getElementById('checkAll').checked = "";
 			}
 			else{
-				document.getElementById(wfsConfElementArray[i].element_name).value = "";	
+				document.getElementById(wfsConfElementArray[i].element_name).value = "";
 			}
-		}	
+		}
 	}
-	
+
 	//remove geometry from spatialrequest, remove drawn rectangle or polygon and hint
 	spatialRequestGeom = null;
 	requestGeometryHighlight.clean();
@@ -920,11 +921,11 @@
 	if(document.getElementById('spatialResHint')){
  		document.getElementById("spatialResHint").innerHTML = "";
  	}
-		
-	//close old dialogs 
+
+	//close old dialogs
 	parent.$('.resultList').dialog('close');
 	parent.$('.infoPopup').dialog('close');
-	
+
  	if(document.getElementById('spatialResHint')){
  		document.getElementById("spatialResHint").innerHTML = "";
  	}
@@ -936,7 +937,7 @@
 	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;
@@ -944,8 +945,8 @@
     		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){ 
+				for (var j = 0; j < elementArray.length; j++){
+					if (elementArray[j].checked == true){
 						selectedVal.push(elementArray[j].value);
 					}
 				}
@@ -954,7 +955,7 @@
 			else{
 				var elementValue = document.getElementById(el[i]['element_name']).value;
 			}
-	
+
 			if (elementValue != '') {
 				cnt++;
 			}
@@ -963,21 +964,21 @@
 			}
 		}
 	}
-	
+
 	if(inputNotEnough.length>0){
 		alert("Mandatory fields: "+inputNotEnough.join(', '));
 		return false;
 	}
-	
+
 	if(enableSearchWithoutParams == 1) {
     	cnt = 2;
 	}
-	
+
 //	if(spatialRequestGeom == null){
 //		alert("Bitte räumliche Eingrenzung vornehmen.");
 //		return false;
 //	}
-	
+
 	return cnt;
 }
 function validate(){
@@ -988,17 +989,17 @@
 	if(geomArray.count()>0){
  		geomArray.empty();
  	}
-	//close old dialogs 
+	//close old dialogs
 	parent.$('.resultList').dialog('close');
 	parent.$('.infoPopup').dialog('close');
 
-	if(removeSpatialRequestHighlight == 1) { 
+	if(removeSpatialRequestHighlight == 1) {
 		requestGeometryHighlight.clean();
 		requestGeometryHighlight.paint();
 	}
-	
+
 	var filterParameterCount = getNumberOfFilterParameters();
-	
+
 	if(filterParameterCount == 0 && spatialRequestGeom == null && initializeOnLoad != 1){
 	//if(filterParameterCount == 0 && spatialRequestGeom == null){
 	//if(filterParameterCount == 0){
@@ -1008,7 +1009,7 @@
 	else{
 		if(inputNotEnough.length==0){
 			var andConditions = [];
-			
+
 			var el = global_wfsConfObj[global_selectedWfsConfId].element;
 			//var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
 			var ind = parent.getMapObjIndexByName("mapframe1");
@@ -1031,8 +1032,8 @@
 	    			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){ 
+						for (var j = 0; j < elementArray.length; j++){
+							if (elementArray[j].checked == true){
 								selectedVal.push(elementArray[j].value);
 							}
 						}
@@ -1044,7 +1045,7 @@
 						a = elementValue.split(",");
 					}
 				}
-				
+
 				if (el[i]['f_search'] == 1 && elementValue != '') {
 					var orConditions = "";
 					for (var j=0; j < a.length; j++) {
@@ -1161,11 +1162,11 @@
 					}
 				}
 			}
-			
+
 			if(spatialRequestGeom!=null){
 				var currentAndCondition = "";
 				if(spatialRequestGeom.geomType == "polygon"){
-					if(buttonPolygon.filteroption=='within'){	
+					if(buttonPolygon.filteroption=='within'){
 						currentAndCondition = "<Within><ogc:PropertyName>";
 						for (var j=0; j < el.length; j++) {
 							if(el[j]['f_geom']==1){
@@ -1189,7 +1190,7 @@
 							}
 						}
 						currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 						for(var k=0; k<spatialRequestGeom.count(); k++){
 							if(k>0)	currentAndCondition += " ";
 							currentAndCondition += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
@@ -1197,12 +1198,12 @@
 						currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
 						currentAndCondition += "</gml:Polygon></Intersects>";
 					}
-				}	
+				}
 				else if(spatialRequestGeom.geomType == "line"){
 					var rectangle = [];
 					rectangle = spatialRequestGeom.getBBox();
-					
-					if(buttonRectangle.filteroption=='within'){	
+
+					if(buttonRectangle.filteroption=='within'){
 						currentAndCondition = "<Within><ogc:PropertyName>";
 						for (var j=0; j < el.length; j++) {
 							if(el[j]['f_geom']==1){
@@ -1231,7 +1232,7 @@
 							}
 						}
 						currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 						currentAndCondition += rectangle[0].x+","+rectangle[0].y;
 						currentAndCondition += " ";
 						currentAndCondition += rectangle[0].x+","+rectangle[1].y;
@@ -1243,13 +1244,13 @@
 						currentAndCondition += rectangle[0].x+","+rectangle[0].y;
 						currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
 						currentAndCondition += "</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 mapPosXAddPix = mapPos[0] + buffer;
 					var mapPosYAddPix = mapPos[1] +buffer;
 					var mapPosXRemovePix = mapPos[0] - buffer;
 					var mapPosYRemovePix = mapPos[1] - buffer;
@@ -1263,9 +1264,9 @@
 							currentAndCondition += ftns + el[j]['element_name'];
 						}
 					}
-					currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+					currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 					currentAndCondition += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] +  " ";
-					currentAndCondition += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1]; 
+					currentAndCondition += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1];
 					currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects>";
 				}
 				if (currentAndCondition !== "") {
@@ -1273,21 +1274,21 @@
 				}
 
 			}
-			
+
 			var andConditionString = andConditions.join("");
 			if (andConditions.length > 1) {
 				andConditionString = "<And>" + andConditionString + "</And>";
 			}
-	
+
 			var filter = "<ogc:Filter>"+andConditionString+"</ogc:Filter>";
 
 			document.getElementById("res").innerHTML = "<table><tr><td><img src='"+progressIndicatorImg+"'></td><td>"+progressIndicatorText+"</td></tr></table>";
 			var parameters = {
-				"command" : "getSearchResults", 
-				"wfs_conf_id" : global_selectedWfsConfId, 
+				"command" : "getSearchResults",
+				"wfs_conf_id" : global_selectedWfsConfId,
 				"typename" : global_wfsConfObj[global_selectedWfsConfId].featuretype_name,
-				"frame" : this.name, 
-				"filter" : filter, 
+				"frame" : this.name,
+				"filter" : filter,
 				"backlink" : "",
 				"destSrs" : srs
 			};
@@ -1298,11 +1299,11 @@
 					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; 
+							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);					
+								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);
 							}
 						}
 					}
@@ -1326,15 +1327,15 @@
 						if (typeof(geoObj) == 'object') {
 			        		geomArray.importGeoJSON(geoObj);
 			        		document.getElementById("res").innerHTML = '';
-							
+
 							parent.Mapbender.modules.gazetteerWFS.receiveFeatureCollection.trigger(geoObj);
-							
+
 							var resultList = parent.Mapbender.modules.resultList;
 							resultList.clear();
 							resultList.setTitle(global_wfsConfObj[global_selectedWfsConfId].wfs_conf_abstract);
 							resultList.setWFSconf(global_wfsConfObj[global_selectedWfsConfId]);
 							resultList.addFeatureCollection(geoObj);
-							resultList.show(); 
+							resultList.show();
 						}
 						else {
 							document.getElementById("res").innerHTML = '';
@@ -1352,7 +1353,7 @@
 		else{
 			return false;
 		}
-	}	
+	}
 	//spatialRequestGeom = null;
 	return false;
 }
@@ -1375,4 +1376,4 @@
 <div id="uploader"></div>
 <div class='resultDiv' name='res' id='res'></div>
 </body>
-</html>
+</html>
\ No newline at end of file



More information about the Mapbender_commits mailing list