[Mapbender-commits] r4673 - in branches/2.6/http: classes javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Sep 22 04:28:37 EDT 2009


Author: christoph
Date: 2009-09-22 04:28:37 -0400 (Tue, 22 Sep 2009)
New Revision: 4673

Modified:
   branches/2.6/http/classes/class_map.php
   branches/2.6/http/javascripts/mod_loadwmc.js
Log:


Modified: branches/2.6/http/classes/class_map.php
===================================================================
--- branches/2.6/http/classes/class_map.php	2009-09-22 08:07:04 UTC (rev 4672)
+++ branches/2.6/http/classes/class_map.php	2009-09-22 08:28:37 UTC (rev 4673)
@@ -250,10 +250,11 @@
 	 * @param $jsMapObject Object
 	 */
 	public function createFromJs ($jsMapObject) {
-		$minx = $jsMapObject->extent->min->x;
-		$miny = $jsMapObject->extent->min->y;
-		$maxx = $jsMapObject->extent->max->x;
-		$maxy = $jsMapObject->extent->max->y;
+		$arrayBBox = explode(",", $jsMapObject->extent);
+		$minx = floatval($arrayBBox[0]);
+		$miny = floatval($arrayBBox[1]);
+		$maxx = floatval($arrayBBox[2]);
+		$maxy = floatval($arrayBBox[3]);
 		$srs = $jsMapObject->epsg;
 		$bbox = new Mapbender_bbox($minx, $miny, $maxx, $maxy, $srs);
 
@@ -471,20 +472,10 @@
 			// reset the WMS array
 			// BEWARE, SUPER UGLY CODE AHEAD!!
 			// (BUT THERE IS NO OTHER WAY TO DO IT)
-			if (strpos($row["e_js_file"], "ovnf.php") !== false) {
+			if (strpos($row["e_src"], "mod_mapOV.php?wms") !== false) {
 //				$e = new mb_exception("guess this is the OV");
-
-				$ov_sql = "SELECT var_value FROM gui_element_vars WHERE " . 
-					"var_name = 'overview_wms' AND fkey_e_id = $1 AND " . 
-					"fkey_gui_id = $2";
-				$ov_v = array($frameName, $appId);
-				$ov_t = array('s', 's');
-				$ov_res = db_prep_query($ov_sql, $ov_v, $ov_t);
-				$ov_row = db_fetch_array($ov_res);
-				if ($ov_row) {
-					$ov_index = intval($row["var_value"]);
-				}
-				
+				$pattern = "/[\.\/a-zA-Z_]*\?wms=([0-9]*)[^0-9]*/";
+				$ovIndex = preg_replace($pattern, "\$1", $row["e_src"]);
 //				$e = new mb_exception("OV index: " . $ovIndex);
 				if (!$ovIndex) {
 					$ovIndex = 0;

Modified: branches/2.6/http/javascripts/mod_loadwmc.js
===================================================================
--- branches/2.6/http/javascripts/mod_loadwmc.js	2009-09-22 08:07:04 UTC (rev 4672)
+++ branches/2.6/http/javascripts/mod_loadwmc.js	2009-09-22 08:28:37 UTC (rev 4673)
@@ -102,7 +102,7 @@
 						try {
 							if (resultObj.javascript && typeof(resultObj.javascript) == "object") {
 								for (var j=0; j < resultObj.javascript.length; j++) {
-//									var e = new Mb_notice("Statement: %s", resultObj.javascript[j]);
+//									var e = new Mb_notice("Statement: " + resultObj.javascript[j]);
 									eval(resultObj.javascript[j]);
 								}
 							}	



More information about the Mapbender_commits mailing list