[Mapbender-commits] r5628 - in trunk/mapbender/http: javascripts plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Feb 24 06:51:04 EST 2010


Author: kmq
Date: 2010-02-24 06:51:04 -0500 (Wed, 24 Feb 2010)
New Revision: 5628

Modified:
   trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
   trunk/mapbender/http/plugins/mb_resultList_setVendorspecific.js
Log:
vendorspecific send null if no data is available 

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2010-02-24 11:49:29 UTC (rev 5627)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2010-02-24 11:51:04 UTC (rev 5628)
@@ -530,9 +530,6 @@
 			
 		}
 		parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
-		parent.Mapbender.modules.gazetteerWFS.events.onWfsConfSelect.trigger({
-			wfsConfId: global_selectedWfsConfId
-		});
 
 }
 
@@ -638,6 +635,9 @@
 		 	}
 	    	appendStyles();
 			appendWfsForm();
+			parent.Mapbender.modules.gazetteerWFS.events.onWfsConfSelect.trigger({
+				wfsConfId: global_selectedWfsConfId
+			});
 		};
 	}
 	else{
@@ -872,6 +872,10 @@
 	return cnt;
 }
 function validate(){
+
+	parent.Mapbender.modules.gazetteerWFS.events.onWfsConfSelect.trigger({
+		wfsConfId: global_selectedWfsConfId
+	});
 	if(geomArray.count()>0){
  		geomArray.empty();
  	}

Modified: trunk/mapbender/http/plugins/mb_resultList_setVendorspecific.js
===================================================================
--- trunk/mapbender/http/plugins/mb_resultList_setVendorspecific.js	2010-02-24 11:49:29 UTC (rev 5627)
+++ trunk/mapbender/http/plugins/mb_resultList_setVendorspecific.js	2010-02-24 11:51:04 UTC (rev 5628)
@@ -10,16 +10,28 @@
 		var i = 0;
 		for(i in wms.objLayer){
 			layer = wms.objLayer[i];
-			if(currentFeatureTypeId == layer.gui_layer_wfs_featuretype){
+			if(layer.gui_layer_wfs_featuretype == ""){ continue;}
+
+			if(layer.gui_layer_wfs_featuretype == currentFeatureTypeId){
 				// currentFeatureType is valid for this WMS
 				var j = 0;
 				for(j in parameters){
 					resultString += encodeURIComponent(parameters[j].key) + "=" +encodeURIComponent(parameters[j].value) + "&";
 				}
-				return resultString;
+			}else{
+				//default to NULL to satisfy Mapfiles
+				var k = 0;
+				for(k in options.featuretype_properties){
+					if(layer.gui_layer_wfs_featuretype == options.featuretype_properties[k].ftId){
+						var j = 0;
+						for(j in options.featuretype_properties[k].fields){
+							resultString += encodeURIComponent(options.featuretype_properties[k].fields[j]) + "=NULL&";
+						}
+					}
+				}
 			}
 		}	
-		return "";
+		return resultString;
 	};
 	
 	Mapbender.modules[options.target[0]].rowclick.register(function(row){
@@ -32,9 +44,8 @@
 		var value="";
 		var i = 0;
 		for(i in options.featuretype_properties){
-			parameters  = [];
 			if(options.featuretype_properties[i].ftId == currentFeatureTypeId){
-
+				parameters  = [];
 				var j = 0;
 				for(j in options.featuretype_properties[i].fields){
 					key = options.featuretype_properties[i].fields[j];
@@ -60,6 +71,21 @@
 
 	Mapbender.modules[options.target[1]].events.onWfsConfSelect.register(function(data){
 		currentFeatureTypeId = data.wfsConfId;
+		var key ="";
+		var value="";
+		var i = 0;
+		for(i in options.featuretype_properties){
+			parameters  = [];
+			if(options.featuretype_properties[i].ftId == currentFeatureTypeId){
+				var j = 0;
+				for(j in options.featuretype_properties[i].fields){
+					key = options.featuretype_properties[i].fields[j];
+					value = "NULL";
+					parameters.push({ key: key, value: value});
+				}	
+
+			}
+		}
 	});
 
 	Mapbender.modules[options.target[1]].events.onFormReset.register(function(){
@@ -68,8 +94,7 @@
 	
 };
 
-Mapbender.events.afterInit.register(function(){
+Mapbender.events.init.register(function(){
 	Mapbender.modules[options.id] = $.extend(new API(options), Mapbender.modules[options.id]);
 	mb_registerVendorSpecific("Mapbender.modules." +options.id + ".getParamater(currentWms, functionName)");
 });
-



More information about the Mapbender_commits mailing list