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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Oct 13 10:09:05 EDT 2011


Author: verenadiewald
Date: 2011-10-13 07:09:05 -0700 (Thu, 13 Oct 2011)
New Revision: 8183

Modified:
   trunk/mapbender/http/classes/class_gml_line.php
   trunk/mapbender/http/classes/class_gml_multipolygon.php
   trunk/mapbender/http/classes/class_gml_polygon.php
Log:
added function getBbox

Modified: trunk/mapbender/http/classes/class_gml_line.php
===================================================================
--- trunk/mapbender/http/classes/class_gml_line.php	2011-10-13 14:03:31 UTC (rev 8182)
+++ trunk/mapbender/http/classes/class_gml_line.php	2011-10-13 14:09:05 UTC (rev 8183)
@@ -95,7 +95,7 @@
 	
 	public function getBbox () {
 		$bboxArray = array();
-		for ($i = 0; $i < count($pointArray); $i++) {
+		for ($i = 0; $i < count($this->pointArray); $i++) {
 			$p = new Mapbender_point(
 				$this->pointArray[$i]["x"],
 				$this->pointArray[$i]["y"],

Modified: trunk/mapbender/http/classes/class_gml_multipolygon.php
===================================================================
--- trunk/mapbender/http/classes/class_gml_multipolygon.php	2011-10-13 14:03:31 UTC (rev 8182)
+++ trunk/mapbender/http/classes/class_gml_multipolygon.php	2011-10-13 14:09:05 UTC (rev 8183)
@@ -181,5 +181,21 @@
 		}
 		return $str;
 	}
+	
+	public function getBbox () {
+		$bboxArray = array();
+        for ($i = 0; $i < count($this->polygonArray); $i++) {
+        	if($this->polygonArray[$i]["x"] && $this->polygonArray[$i]["y"]) {
+            	$p = new Mapbender_point(
+                	$this->polygonArray[$i]["x"],
+                    $this->polygonArray[$i]["y"],
+                    $this->srs
+                );
+                $bboxArray[]= new Mapbender_bbox($p, $p, $this->srs);
+           	}
+     	}
+        return Mapbender_bbox::union($bboxArray);
+   	}
+	
 }
 ?>

Modified: trunk/mapbender/http/classes/class_gml_polygon.php
===================================================================
--- trunk/mapbender/http/classes/class_gml_polygon.php	2011-10-13 14:03:31 UTC (rev 8182)
+++ trunk/mapbender/http/classes/class_gml_polygon.php	2011-10-13 14:09:05 UTC (rev 8183)
@@ -148,5 +148,20 @@
 		}
 		return $str;
 	}
+	
+	public function getBbox () {
+		$bboxArray = array();
+        for ($i = 0; $i < count($this->pointArray); $i++) {
+        	if($this->pointArray[$i]["x"] && $this->pointArray[$i]["y"]) {
+            	$p = new Mapbender_point(
+                	$this->pointArray[$i]["x"],
+                    $this->pointArray[$i]["y"],
+                    $this->srs
+                );
+                $bboxArray[]= new Mapbender_bbox($p, $p, $this->srs);
+           	}
+     	}
+        return Mapbender_bbox::union($bboxArray);
+   	}
 }
 ?>
\ No newline at end of file



More information about the Mapbender_commits mailing list