[Mapbender-commits] r4234 - in branches/2.6/http: javascripts print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jun 25 09:24:24 EDT 2009


Author: astrid_emde
Date: 2009-06-25 09:24:24 -0400 (Thu, 25 Jun 2009)
New Revision: 4234

Modified:
   branches/2.6/http/javascripts/wms.js
   branches/2.6/http/print/mod_printPDF.php
Log:
http://trac.osgeo.org/mapbender/ticket/469

When the default STYLE is used (STYLE=,,,,), Mapbender now takes the first style from the database

Modified: branches/2.6/http/javascripts/wms.js
===================================================================
--- branches/2.6/http/javascripts/wms.js	2009-06-25 13:22:13 UTC (rev 4233)
+++ branches/2.6/http/javascripts/wms.js	2009-06-25 13:24:24 UTC (rev 4234)
@@ -380,8 +380,9 @@
 				return false;
 			}
 			for(var k=0; k< this.objLayer[i].layer_style.length; k++){
-				if(this.objLayer[i].layer_style[k].name == guiLayerStyle){
-					var legendUrl = this.objLayer[i].layer_style[k].legendurl;
+				var legendUrl = '';
+				if(guiLayerStyle == '' && k == 0){
+					legendUrl = this.objLayer[i].layer_style[k].legendurl;
 					if (this.gui_wms_sldurl !== "") {
 					 		legendUrl += "&SLD="+escape(this.gui_wms_sldurl);
 					}				
@@ -391,6 +392,17 @@
 					else {
 						return false;
 					}
+				}else if(this.objLayer[i].layer_style[k].name == guiLayerStyle){
+					legendUrl = this.objLayer[i].layer_style[k].legendurl;
+					if (this.gui_wms_sldurl !== "") {
+					 		legendUrl += "&SLD="+escape(this.gui_wms_sldurl);
+					}				
+					if(legendUrl !=='' && legendUrl !== null && typeof(legendUrl) != 'undefined'){
+						return legendUrl;
+					}
+					else {
+						return false;
+					}
 				}
 			}
 		}

Modified: branches/2.6/http/print/mod_printPDF.php
===================================================================
--- branches/2.6/http/print/mod_printPDF.php	2009-06-25 13:22:13 UTC (rev 4233)
+++ branches/2.6/http/print/mod_printPDF.php	2009-06-25 13:24:24 UTC (rev 4234)
@@ -93,7 +93,7 @@
 					var title = pt.mb_mapObj[ind].wms[i].getTitleByLayerName(layers[j]);
 					var layerStyle = pt.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layers[j]);
 					if(layerStyle==false){
-						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],"default");
+						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],"");
 					}
 					else{
 						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],layerStyle);



More information about the Mapbender_commits mailing list