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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 13 00:39:27 PDT 2016


Author: armin11
Date: 2016-06-13 00:39:27 -0700 (Mon, 13 Jun 2016)
New Revision: 9521

Modified:
   trunk/mapbender/http/javascripts/map_obj.js
Log:
Fix for getfeatureinfo handling with queryable wms layergroups as used by deegree wms

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2016-06-10 10:30:18 UTC (rev 9520)
+++ trunk/mapbender/http/javascripts/map_obj.js	2016-06-13 07:39:27 UTC (rev 9521)
@@ -981,13 +981,14 @@
                 }
             }
             if (!ignoreThisWms) {
-		//switch for service based featureInfo od layer based one
+		//switch for service based featureInfo or layer based one
 		if (featureInfoCollectLayers) {
 			//instantiate return object
 			var featureInfoObj = {};
 			featureInfoObj.title = "";
 			featureInfoObj.names = "";
 			featureInfoObj.legendurl = "";
+			featureInfoObj.styles = "";
 			var featureInfoRequest = this.wms[i].getFeatureInfoRequest(this, clickPoint);
 			//check if featureinfo for this service is available - push only those into return object
 			if (typeof(featureInfoRequest) !== 'undefined' && featureInfoRequest !== "" && featureInfoRequest !== false) {
@@ -1010,6 +1011,11 @@
 							} else {
 								featureInfoObj.legendurl += "empty"+",";
 							}
+							if (typeof(this.wms[i].objLayer[j].layer_style[0]) !=='undefined') {
+								featureInfoObj.styles += this.wms[i].objLayer[j].layer_style[0].name+",";
+							} else {
+								featureInfoObj.styles += "default"+",";
+							}
 						}
 						
 					}
@@ -1017,8 +1023,10 @@
 				//do following things only, if some name exists!
 				if (featureInfoObj.names !=='') {
 					//exchange trailing ","
-					featureInfoObj.names = featureInfoObj.names.replace(/,+$/, "");
-					featureInfoObj.title = featureInfoObj.title.replace(/, +$/, "");
+					featureInfoObj.names = featureInfoObj.names.replace(/,\s*$/, "");
+					featureInfoObj.title = featureInfoObj.title.replace(/,\s*$/, "");
+					featureInfoObj.styles = featureInfoObj.styles.replace(/,\s*$/, "");
+
 					//check for length of title - if length is > 1 use wms title, cause window is too small!
 					/*if(featureInfoObj.title.split(",").length > 1) {
 						featureInfoObj.title = this.wms[i].wms_title;
@@ -1027,6 +1035,7 @@
 					//remove wrong layers from getFeatureInfo request
 					featureInfoRequest = changeURLParameterValue(featureInfoRequest,"LAYERS", featureInfoObj.names);
 					featureInfoRequest = changeURLParameterValue(featureInfoRequest,"QUERY_LAYERS", featureInfoObj.names);
+					featureInfoRequest = changeURLParameterValue(featureInfoRequest,"STYLES", featureInfoObj.styles);
 					featureInfoObj.request = featureInfoRequest;
 					//give back objects
 					allRequests.push(featureInfoObj);



More information about the Mapbender_commits mailing list