[Mapbender-commits] r8054 - in trunk/mapbender/http: javascripts plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Aug 3 11:05:48 EDT 2011


Author: verenadiewald
Date: 2011-08-03 08:05:48 -0700 (Wed, 03 Aug 2011)
New Revision: 8054

Modified:
   trunk/mapbender/http/javascripts/mod_setBackground.php
   trunk/mapbender/http/plugins/mb_handleStartUpWmsParams.php
Log:
new event for setBackground to handle backgroundwms from handleStartupParams in the right way

Modified: trunk/mapbender/http/javascripts/mod_setBackground.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_setBackground.php	2011-08-03 15:04:05 UTC (rev 8053)
+++ trunk/mapbender/http/javascripts/mod_setBackground.php	2011-08-03 15:05:48 UTC (rev 8054)
@@ -30,6 +30,9 @@
 eventAfterLoadWMS.register(function () {
 	mod_setBackground_init();
 });
+
+Mapbender.events.setBackgroundIsReady = new Mapbender.Event();
+
 var mod_setBackground_active = false;
 function mod_setBackground_init(){
 	var map = Mapbender.modules[mod_setBackground_target];
@@ -63,6 +66,8 @@
 		setSingleMapRequest(mod_setBackground_target,map.wms[ind].wms_id);
 	}
 	mod_setBackground_active = ind;
+
+        Mapbender.events.setBackgroundIsReady.trigger();
 }
 
 function mod_setBackground_change(obj){	

Modified: trunk/mapbender/http/plugins/mb_handleStartUpWmsParams.php
===================================================================
--- trunk/mapbender/http/plugins/mb_handleStartUpWmsParams.php	2011-08-03 15:04:05 UTC (rev 8053)
+++ trunk/mapbender/http/plugins/mb_handleStartUpWmsParams.php	2011-08-03 15:05:48 UTC (rev 8054)
@@ -84,7 +84,7 @@
 
 
 // set background WMS
-Mapbender.events.afterInit.register(function () {
+Mapbender.events.setBackgroundIsReady.register(function () {
 	if (apiBackgroundWms !== '') {
 		var newBackgroundWms = parseInt(apiBackgroundWms);
 		if (mod_setBackground_active !== false && wms[mod_setBackground_active]) {



More information about the Mapbender_commits mailing list