svn commit: r980 - trunk/mapbender/http/classes/class_wmc.php

christoph at osgeo.org christoph at osgeo.org
Mon Dec 11 06:26:46 EST 2006


Author: christoph
Date: 2006-12-11 11:26:45+0000
New Revision: 980

Modified:
   trunk/mapbender/http/classes/class_wmc.php

Log:
improved handling of bbox overview 

Modified: trunk/mapbender/http/classes/class_wmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/classes/class_wmc.php?view=diff&rev=980&p1=trunk/mapbender/http/classes/class_wmc.php&p2=trunk/mapbender/http/classes/class_wmc.php&r1=979&r2=980
==============================================================================
--- trunk/mapbender/http/classes/class_wmc.php	(original)
+++ trunk/mapbender/http/classes/class_wmc.php	2006-12-11 11:26:45+0000
@@ -1,5 +1,5 @@
 <?php
-# $Id: class_wmc.php 566 2006-11-23 12:14:13Z christoph $
+# $Id: class_wmc.php 645 2006-12-08 12:58:39Z christoph $
 # http://www.mapbender.org/index.php/class_wmc.php
 # Copyright (C) 2002 CCGIS 
 #
@@ -680,6 +680,21 @@
 			$wmc_string .= "\t\t}\n";
 			$wmc_string .= "\t}\n";
 			$wmc_string .= "}\n";
+			
+			$sql = "SELECT minx, miny, maxx, maxy FROM layer_epsg WHERE fkey_layer_id = $1 AND epsg = $2 LIMIT 1";
+			$v = array($this->wmc_layer_id[0], $this->wmc_bBox_SRS);
+			$t = array('i', 's');
+			$res = db_prep_query($sql, $v, $t);
+			$row = db_fetch_array($res);
+			if ($row["minx"] && $row["miny"] && $row["maxx"] && $row["maxy"]) {
+				$ov_bbox = array($row["minx"],$row["miny"],$row["maxx"],$row["maxy"]);
+			}
+			else if ($this->wmc_layer_id[0] && $this->wmc_bBox_SRS){
+				$ov_bbox = array($this->wmc_bBox_minx, $this->wmc_bBox_miny, $this->wmc_bBox_maxx, $this->wmc_bBox_maxy);
+			}
+			else {
+				$ov_bbox = array();
+			}
 			$wmc_string .= "for (var i=0; i<old_mapObj.length; i++) {\n";
 			$wmc_string .= "\tif (old_mapObj[i].frameName != 'overview') {\n";
 			$wmc_string .= "\t\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
@@ -687,8 +702,20 @@
 			$wmc_string .= $this->wmc_bBox_maxx .",".$this->wmc_bBox_maxy.");\n";
 			$wmc_string .= "\t}\n";
 			$wmc_string .= "\telse {\n";
-			$wmc_string .= "\t\tvar ov_index = " . $target . "getMapObjIndexByName('overview');\n";
-			$wmc_string .= "\t\t" . $target . "mb_mapObj[ov_index].extent = old_mapObj[i].extent;\n"; 
+			if (count($ov_bbox)>0) {
+//				$wmc_string .= "alert('found bbox for ov: ".implode(',',$ov_bbox)."');";
+				$wmc_string .= "\t\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
+				$wmc_string .= $ov_bbox[0] .",".$ov_bbox[1] .",";
+				$wmc_string .= $ov_bbox[2] .",".$ov_bbox[3] .");\n";
+			}
+			else {
+//				$wmc_string .= "alert('no bbox found for ov: old bbox ".$this->wmc_bBox_minx." etc');";
+				$wmc_string .= "\t\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
+				$wmc_string .= $this->wmc_bBox_minx .",".$this->wmc_bBox_miny .",";
+				$wmc_string .= $this->wmc_bBox_maxx .",".$this->wmc_bBox_maxy.");\n";
+//				$wmc_string .= "\t\tvar ov_index = " . $target . "getMapObjIndexByName('overview');\n";
+//				$wmc_string .= "\t\t" . $target . "mb_mapObj[ov_index].extent = old_mapObj[i].extent;\n"; 
+			}
 			$wmc_string .= "\t}\n";
 			$wmc_string .= "\t". $target . "setMapRequest(old_mapObj[i].frameName);\n";
 			$wmc_string .= "}\n";




More information about the Mapbender_commits mailing list