[Mapbender-commits] r7354 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 22 05:00:54 EST 2010


Author: kmq
Date: 2010-12-22 02:00:54 -0800 (Wed, 22 Dec 2010)
New Revision: 7354

Modified:
   trunk/mapbender/http/plugins/wfsConfTree.js
Log:
load wfsConf into tree when given via GET parameter

Modified: trunk/mapbender/http/plugins/wfsConfTree.js
===================================================================
--- trunk/mapbender/http/plugins/wfsConfTree.js	2010-12-22 09:45:24 UTC (rev 7353)
+++ trunk/mapbender/http/plugins/wfsConfTree.js	2010-12-22 10:00:54 UTC (rev 7354)
@@ -1,5 +1,15 @@
 var $confTree = $(this);
 var ConfTree = function(o){
+
+	wfsConfIdString = o.wfsConfIdString || "";
+
+
+	// getParams is a global variable that contains the Querystring as a json object
+	var getwfsConfIdString = getParams['FEATURETYPE'] || "";
+
+	wfsConfIdString = wfsConfIdString  + "," + getwfsConfIdString;
+
+
 	$confTree.children().remove();
 	$confTree.addClass('conftree');
 
@@ -33,15 +43,14 @@
 				}
 			}
 	});
-	mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:"2,3,4,5,6"}, function(json,status){
+	mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString: wfsConfIdString }, function(json,status){
 		aWFSConf = json;
-		console.log(aWFSConf);
 		for(var i in  aWFSConf){
 
 			// group by featyretype
 			$featuretypeFolder = $WFSConffolder.find("li.featuregroup_"+aWFSConf[i].featuretype_id);
 			if($featuretypeFolder.size() == 0){
-				$featuretypeFolder = $('<li class="featuregroup_"'+ aWFSConf[i].featuretype_id + '">'+ aWFSConf[i].wfs_conf_abstract + '<ul></ul></li>');
+				$featuretypeFolder = $('<li class="open featuregroup_'+ aWFSConf[i].featuretype_id + '"><button class="toggle"></button>'+ aWFSConf[i].wfs_conf_abstract + '<ul></ul></li>');
 				$WFSConffolder.find(" > ul").append($featuretypeFolder);
 				$featuretypeList = $featuretypeFolder.find("ul");
 			}else{
@@ -101,6 +110,16 @@
 	}); 
 
 	
+	$("button.toggle",$confTree).live('click', function(){
+		if($(this).parent().hasClass("open")){
+			$(this).parent().removeClass("open");
+			$(this).parent().addClass("closed");
+		}else{
+			$(this).parent().removeClass("closed");
+			$(this).parent().addClass("open");
+
+		}
+	});
 };
 
 Mapbender.events.init.register(function(){



More information about the Mapbender_commits mailing list