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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 29 08:30:30 EDT 2007


Author: christoph
Date: 2007-10-29 08:30:30 -0400 (Mon, 29 Oct 2007)
New Revision: 1767

Modified:
   trunk/mapbender/http/javascripts/mod_legend.php
Log:
imported from Geoportal

Modified: trunk/mapbender/http/javascripts/mod_legend.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_legend.php	2007-10-29 12:25:10 UTC (rev 1766)
+++ trunk/mapbender/http/javascripts/mod_legend.php	2007-10-29 12:30:30 UTC (rev 1767)
@@ -127,32 +127,35 @@
 					var layerParent = parent.mb_mapObj[ind].wms[i].checkLayerParentByLayerName(layerNames[j]); 
 					var layerTitle = parent.mb_mapObj[ind].wms[i].getTitleByLayerName(layerNames[j]);
 					var layerStyle = parent.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layerNames[j]);
-					if(layerStyle==false){
-						var legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],"default");	
+					var legendUrl = false;
+					if(layerStyle == false){
+						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],"default");	
 					}
 					else{
-						var legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],layerStyle);
+						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],layerStyle);
 					}
 					//console.log("layer_infos : %s",layerNames[j],"---",layerParent,"---",layerTitle,"---",layerStyle,"---",legendUrl);
 			         
-					if (legendUrl!='' && legendUrl!=0){
-	 					//if(layerParent == 0){
-	 						if(showlayertitle == 'true'){
+					if (legendUrl !== false){
+						
+//						console.log("legendUrl: %s, typeof(legendUrl): %s", legendUrl, typeof(legendUrl));
+//	 					if(layerParent == 0){
+		 					if(showlayertitle == 'true'){
 								str_tmp += "<div><span class='titles'>" + layerTitle+ "</span></div>";
 							}
 							str_tmp += "<div>";
-	                    	if(legendlink == 'true'){
-	                    		str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layerNames[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+layerTitle+"' target='result'>";
-	                    	}
-	                    	str_tmp += "<img border=0 src = '";			
+		                    if(legendlink == 'true'){
+		                    	str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layerNames[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+layerTitle+"' target='result'>";
+		                    }
+		                    str_tmp += "<img border=0 src = '";			
 							str_tmp += legendUrl;
 							str_tmp += "'></img>";
 							if (legendlink == 'true'){
-	                    		str_tmp += "</a>";
-	                    	}
-	                    	str_tmp += "</div>";
-	                	//}
-	               } 
+		                    	str_tmp += "</a>";
+		                    }
+		                    str_tmp += "</div>";
+//	                	}
+					} 
 				}
 			if(str_tmp !=''){
 				if (showwmstitle == 'true'){



More information about the Mapbender_commits mailing list