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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 1 04:44:48 EST 2010


Author: christoph
Date: 2010-12-01 01:44:48 -0800 (Wed, 01 Dec 2010)
New Revision: 7177

Modified:
   trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js
Log:
pass wms object to handlers on event afterLoadWms

Modified: trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js	2010-12-01 09:44:12 UTC (rev 7176)
+++ trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js	2010-12-01 09:44:48 UTC (rev 7177)
@@ -94,6 +94,8 @@
 }
 
 var mod_addWms_general = function (js, param) {
+	var ind = getMapObjIndexByName('mapframe1');
+	var map = mb_mapObj[ind];
 
 	var success = false;
 	if (js) {
@@ -103,8 +105,6 @@
 		if (newWmsCount > oldWmsCount) {
 			success = true;
 			mb_mapObjaddWMS('mapframe1');
-			var ind = getMapObjIndexByName('mapframe1');
-			var map = mb_mapObj[ind];
 			var lastwms = map.wms[map.wms.length - 1];
 			if (param && param.options && typeof param.options.zoomToExtent === "number" && param.options.zoomToExtent === 1) {
 				// zoom to bbox
@@ -134,7 +134,9 @@
 		param.options.success = success;
 		param.callback(param.options);
 	}
-	mb_execloadWmsSubFunctions();
+	mb_execloadWmsSubFunctions({
+		wms: map.wms.length > 0 ? map.wms[map.wms.length - 1] : null
+	});
 };
 
 function mod_addWMSById_ajax (gui_id, wms_id, param) {



More information about the Mapbender_commits mailing list