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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Feb 17 05:03:02 EST 2011


Author: kmq
Date: 2011-02-17 02:03:01 -0800 (Thu, 17 Feb 2011)
New Revision: 7620

Modified:
   trunk/mapbender/http/javascripts/initWmcObj.php
Log:
load windowsize from wmc

Modified: trunk/mapbender/http/javascripts/initWmcObj.php
===================================================================
--- trunk/mapbender/http/javascripts/initWmcObj.php	2011-02-17 08:13:58 UTC (rev 7619)
+++ trunk/mapbender/http/javascripts/initWmcObj.php	2011-02-17 10:03:01 UTC (rev 7620)
@@ -474,18 +474,34 @@
 ) {
 	Mapbender::session()->set("wmcConstraints", $resultObj);
 	$output = $wmcGetApi->wmsToJavaScript();
-
-	$extentJs = $wmcGetApi->extentToJavaScript();
+	$wmcJs = $wmcGetApi->toJavaScript(array());
+	$wmcJs = implode(";\n",$wmcJs);
+	$extentJs = $wmc->extentToJavaScript();
 	$output[] = <<<JS
+		Mapbender.events.afterInit.register(function () {
+			$wmcJs;
+		});
 		Mapbender.events.beforeInit.register(function () {
 			$extentJs
 		});
 JS;
+JS;
 	Mapbender::session()->delete("wmcGetApi", $wmcGetApi);
 }
 else {
 	Mapbender::session()->set("wmcConstraints", $resultObj);
 	$output = $wmc->wmsToJavaScript();
+	$wmcJs = $wmc->toJavaScript(array());
+	$wmcJs = implode(";\n",$wmcJs);
+	$extentJs = $wmc->extentToJavaScript();
+	$output[] = <<<JS
+		Mapbender.events.afterInit.register(function () {
+			$wmcJs;
+		});
+		Mapbender.events.beforeInit.register(function () {
+			$extentJs
+		});
+JS;
 	Mapbender::session()->set("wmcGetApi", $wmcGetApi);
 }
 



More information about the Mapbender_commits mailing list