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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 16 05:11:21 EST 2009


Author: verenadiewald
Date: 2009-11-16 05:11:13 -0500 (Mon, 16 Nov 2009)
New Revision: 4990

Modified:
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/wms.js
Log:
possibility to add a vendor specific to getFeatureInfoRequest

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-11-16 10:10:02 UTC (rev 4989)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-11-16 10:11:13 UTC (rev 4990)
@@ -726,17 +726,22 @@
         url += "EXCEPTIONS=" + currentWms.gui_wms_exceptionformat + "&";
         
         // add vendor-specific
-        for (var v = 0; v < mb_vendorSpecific.length; v++) {
-            var functionName = 'setMapRequest';
-            var vendorSpecificString = eval(mb_vendorSpecific[v]);
-            // if eval doesn't evaluate a function, the result is undefined.
-            // Sometimes it is necessary not to evaluate a function, for
-            // example if you want to change a variable from the current
-            // scope (see mod_addSLD.php) 
-            if (typeof(vendorSpecificString) != "undefined") {
-                url += vendorSpecificString + "&";
-            }
-        }
+		for (var v = 0; v < mb_vendorSpecific.length; v++) {
+			var functionName = 'setMapRequest';
+			var currentWms_wms_title = currentWms.wms_title;
+			var vendorSpecificString = eval(mb_vendorSpecific[v]);
+			// if eval doesn't evaluate a function, the result is undefined.
+			// Sometimes it is necessary not to evaluate a function, for
+			// example if you want to change a variable from the current
+			// scope (see mod_addSLD.php) 
+			if (typeof(vendorSpecificString) != "undefined") {
+				url += vendorSpecificString + "&";
+				if (currentWms.wms_title == removeLayerAndStylesAffectedWMSTitle) {
+					url = url.replace(/LAYERS=[^&]*&/, '');
+					url = url.replace(/STYLES=[^&]*&/, '');
+				}
+			}
+		}
         // add Filter
         if (currentWms.wms_filter !== "") {
             url += "&SLD=" + currentWms.wms_filter + "?id=" + mb_styleID + "&";

Modified: trunk/mapbender/http/javascripts/wms.js
===================================================================
--- trunk/mapbender/http/javascripts/wms.js	2009-11-16 10:10:02 UTC (rev 4989)
+++ trunk/mapbender/http/javascripts/wms.js	2009-11-16 10:11:13 UTC (rev 4990)
@@ -255,6 +255,24 @@
 	if(mb_feature_count > 0){             
 		rq += "&FEATURE_COUNT="+mb_feature_count;
 	}
+	rq += "&";
+	// add vendor-specific
+	for (var v = 0; v < mb_vendorSpecific.length; v++) {
+		var functionName = 'setFeatureInfoRequest';
+		var currentWms_wms_title = this.wms_title;
+		var vendorSpecificString = eval(mb_vendorSpecific[v]);
+		// if eval doesn't evaluate a function, the result is undefined.
+		// Sometimes it is necessary not to evaluate a function, for
+		// example if you want to change a variable from the current
+		// scope (see mod_addSLD.php) 
+		if (typeof(vendorSpecificString) != "undefined") {
+			rq += vendorSpecificString + "&";
+			if (this.wms_title == removeLayerAndStylesAffectedWMSTitle) {
+				rq = url.replace(/LAYERS=[^&]*&/, '');
+				rq = url.replace(/STYLES=[^&]*&/, '');
+			}
+		}
+	}
 	return rq;
 };
 



More information about the Mapbender_commits mailing list