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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Dec 17 11:30:35 EST 2010


Author: christoph
Date: 2010-12-17 08:30:35 -0800 (Fri, 17 Dec 2010)
New Revision: 7337

Modified:
   trunk/mapbender/http/plugins/mb_background.js
Log:


Modified: trunk/mapbender/http/plugins/mb_background.js
===================================================================
--- trunk/mapbender/http/plugins/mb_background.js	2010-12-17 16:29:56 UTC (rev 7336)
+++ trunk/mapbender/http/plugins/mb_background.js	2010-12-17 16:30:35 UTC (rev 7337)
@@ -93,7 +93,8 @@
 				$("<span />")
 					.addClass("label-background-wms")
 					.addClass(isVisible ? " label-background-wms-active" : "")
-					.text(wms.wms_title)
+//					.text(wms.wms_title)
+					.text(wms.objLayer[0].layer_currentTitle)
 					.data("wms", wms)
 					.mousedown(function (e) {
 						wms.gui_wms_visible = 2;
@@ -110,6 +111,27 @@
 					}).appendTo($bgRadio);
 			});
 			$bgRadio.appendTo($map);
+
+			map.events.afterMapRequest.register(function () {
+				var scale = map.getScale();
+				$bgRadio.children("span").each(function () {
+					var $span = $(this);
+					var wms = $span.data("wms");
+					if (!wms) {
+						return;
+					}
+					var layer = wms.objLayer[0];
+					if (!layer) {
+						return;
+					}
+					if (layer.gui_layer_maxscale < scale || layer.gui_layer_minscale > scale) {
+						$span.addClass("label-background-wms-unavailable");
+					}
+					else {
+						$span.removeClass("label-background-wms-unavailable");
+					}
+				});
+			});
 		});
 	});
 };



More information about the Mapbender_commits mailing list