[Mapbender-commits] r4780 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Oct 15 09:09:00 EDT 2009


Author: christoph
Date: 2009-10-15 09:08:57 -0400 (Thu, 15 Oct 2009)
New Revision: 4780

Modified:
   trunk/mapbender/http/classes/class_map.php
   trunk/mapbender/http/classes/class_wmcToXml.php
   trunk/mapbender/http/classes/class_wms.php
Log:
minor bug fixes (no more php notices)

Modified: trunk/mapbender/http/classes/class_map.php
===================================================================
--- trunk/mapbender/http/classes/class_map.php	2009-10-15 10:39:16 UTC (rev 4779)
+++ trunk/mapbender/http/classes/class_map.php	2009-10-15 13:08:57 UTC (rev 4780)
@@ -595,11 +595,11 @@
 				$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"]);
+					$ov_index = intval($ov_row["var_value"]);
 				}
 				
 //				$e = new mb_exception("OV index: " . $ovIndex);
-				if (!$ovIndex) {
+				if (!isset($ovIndex)) {
 					$ovIndex = 0;
 				}
 				$wmsArray = array($wmsArray[$ovIndex]);	

Modified: trunk/mapbender/http/classes/class_wmcToXml.php
===================================================================
--- trunk/mapbender/http/classes/class_wmcToXml.php	2009-10-15 10:39:16 UTC (rev 4779)
+++ trunk/mapbender/http/classes/class_wmcToXml.php	2009-10-15 13:08:57 UTC (rev 4780)
@@ -365,9 +365,9 @@
 			$wms_epsg[1] = $currentWms->gui_wms_epsg;
 		}
 
-		for ($j = 0; $j < count($currentWms->gui_epsg); $j++) {
-			if (!in_array($currentWms->gui_epsg[$j], $wms_epsg)){
-				array_push($wms_epsg, $currentWms->gui_epsg[$j]);
+		for ($j = 0; $j < count($currentWms->gui_wms_epsg); $j++) {
+			if (!in_array($currentWms->gui_wms_epsg[$j], $wms_epsg)){
+				array_push($wms_epsg, $currentWms->gui_wms_epsg[$j]);
 			}
 		}
 

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2009-10-15 10:39:16 UTC (rev 4779)
+++ trunk/mapbender/http/classes/class_wms.php	2009-10-15 13:08:57 UTC (rev 4780)
@@ -1149,23 +1149,34 @@
 						$str .= "parent.";
 					}
 					$str .= "wms_addSRS('". 
-						$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."','". 
-						$this->objLayer[$i]->layer_epsg[$j]["minx"] ."','". 
-						$this->objLayer[$i]->layer_epsg[$j]["miny"] ."','". 
-						$this->objLayer[$i]->layer_epsg[$j]["maxx"] ."','". 
-						$this->objLayer[$i]->layer_epsg[$j]["maxy"] ."');";
+						$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."',". 
+						$this->objLayer[$i]->layer_epsg[$j]["minx"] .",". 
+						$this->objLayer[$i]->layer_epsg[$j]["miny"] .",". 
+						$this->objLayer[$i]->layer_epsg[$j]["maxx"] .",". 
+						$this->objLayer[$i]->layer_epsg[$j]["maxy"] .");";
 				}
 				if($parent){
 					$str .=  "parent.";
 				}
 				$str .= "layer_addEpsg('". 
-					$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."','". 
-					$this->objLayer[$i]->layer_epsg[$j]["minx"] ."','". 
-					$this->objLayer[$i]->layer_epsg[$j]["miny"] ."','". 
-					$this->objLayer[$i]->layer_epsg[$j]["maxx"] ."','". 
-					$this->objLayer[$i]->layer_epsg[$j]["maxy"] ."');";
+					$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."',". 
+					$this->objLayer[$i]->layer_epsg[$j]["minx"] .",". 
+					$this->objLayer[$i]->layer_epsg[$j]["miny"] .",". 
+					$this->objLayer[$i]->layer_epsg[$j]["maxx"] .",". 
+					$this->objLayer[$i]->layer_epsg[$j]["maxy"] .");";
 			}
 			for($j=0; $i==0 && $j<count($this->wms_srs);$j++){
+				$found = false;
+				for ($k = 0; $k < count($this->objLayer[$i]->layer_epsg); $k++){
+					if ($this->objLayer[$i]->layer_epsg[$k]["epsg"] === $this->wms_srs[$j]) {
+						$found = true;
+						break;
+					}
+				}
+				if ($found) {
+					continue;
+				}
+				
 				if($parent){
 					$str .= "parent.";
 				}
@@ -1181,7 +1192,7 @@
 					"', ".$j.
 					",".$i.
 					",'".$this->objLayer[$i]->layer_style[$j]["legendurl"].
-					"', '".$this->objLayer[$i]->layer_style[$j]["legendformat"]."');";
+					"', '".$this->objLayer[$i]->layer_style[$j]["legendurlformat"]."');";
 			}
 		}
 		return $str;
@@ -1273,7 +1284,7 @@
 				if($parent){
 				echo "parent.";
 				}
-				print("wms_addLayerStyle('".$this->objLayer[$i]->layer_style[$j]["name"]."', '".$this->objLayer[$i]->layer_style[$j]["title"]."', ".$j.",".$i.",'".$this->objLayer[$i]->layer_style[$j]["legendurl"]."', '".$this->objLayer[$i]->layer_style[$j]["legendformat"]."');");
+				print("wms_addLayerStyle('".$this->objLayer[$i]->layer_style[$j]["name"]."', '".$this->objLayer[$i]->layer_style[$j]["title"]."', ".$j.",".$i.",'".$this->objLayer[$i]->layer_style[$j]["legendurl"]."', '".$this->objLayer[$i]->layer_style[$j]["legendurlformat"]."');");
 			}
 		   }	
 		}



More information about the Mapbender_commits mailing list