[Mapbender-commits] r3403 - branches/2.5/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 5 05:34:37 EST 2009


Author: christoph
Date: 2009-01-05 05:34:37 -0500 (Mon, 05 Jan 2009)
New Revision: 3403

Modified:
   branches/2.5/http/classes/class_bbox.php
   branches/2.5/http/classes/class_point.php
Log:
http://trac.osgeo.org/mapbender/ticket/361

Modified: branches/2.5/http/classes/class_bbox.php
===================================================================
--- branches/2.5/http/classes/class_bbox.php	2009-01-05 10:30:08 UTC (rev 3402)
+++ branches/2.5/http/classes/class_bbox.php	2009-01-05 10:34:37 UTC (rev 3403)
@@ -31,7 +31,23 @@
 	/**
 	 * @constructor
 	 */
-	function __construct($param0, $param1, $param2, $param3, $param4) {
+	function __construct() {
+		if (func_num_args() == 5) {
+			$param0 = func_get_arg(0);
+			$param1 = func_get_arg(1);
+			$param2 = func_get_arg(2);
+			$param3 = func_get_arg(3);
+			$param4 = func_get_arg(4);
+		}
+		else if (func_num_args() == 3) {
+			$param0 = func_get_arg(0);
+			$param1 = func_get_arg(1);
+			$param2 = func_get_arg(2);
+		}
+		else {
+			return;
+		}
+		
 		// params are point, point, epsg
 		if (is_a($param0, "Mapbender_point") && is_a($param1, "Mapbender_point") && !$param3 && !$param4) {
 			$e = new mb_notice("Mapbender_bbox: constructor: point1, point2, epsg");
@@ -144,6 +160,10 @@
 		return false;
 	}
 	
+	function toHtml () {
+		return (string) $this->min->toHtml() . " | " . $this->max->toHtml(); 
+	}
+	
 	function __toString() {
 		return (string) "[" . $this->min . $this->max . " " . $this->epsg . "]"; 
 	}

Modified: branches/2.5/http/classes/class_point.php
===================================================================
--- branches/2.5/http/classes/class_point.php	2009-01-05 10:30:08 UTC (rev 3402)
+++ branches/2.5/http/classes/class_point.php	2009-01-05 10:34:37 UTC (rev 3403)
@@ -31,13 +31,23 @@
 	/**
 	 * @constructor
 	 */
-	function __construct($x, $y, $z, $epsg) {
-		// may be called without $z; so $epsg is the third parameter, $z
-		if (isset($x) && isset($y) && isset($z) && !isset($epsg)) {
-			$e = new mb_notice("Mapbender_point: constructor: probably 2d call (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
-			$epsg = $z;
+	function __construct() {
+		if (func_num_args() == 4) {
+			$x = func_get_arg(0);
+			$y = func_get_arg(1);
+			$z = func_get_arg(2);
+			$epsg = func_get_arg(3);
+		}
+		else if (func_num_args() == 3) {
+			$x = func_get_arg(0);
+			$y = func_get_arg(1);
 			$z = false;
+			$epsg = func_get_arg(2);
 		}
+		else {
+			return;
+		}
+
 		if (!isset($x) || !isset($y) || !isset($epsg)) {
 			$e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
 		}



More information about the Mapbender_commits mailing list