[Mapbender-commits] r3451 - branches/print_dev/http/print/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 14 12:16:51 EST 2009


Author: mschulz
Date: 2009-01-14 12:16:51 -0500 (Wed, 14 Jan 2009)
New Revision: 3451

Modified:
   branches/print_dev/http/print/classes/mbMapDecorator.php
   branches/print_dev/http/print/classes/mbOverviewDecorator.php
   branches/print_dev/http/print/classes/mbTemplatePdf.php
   branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php
Log:
mapExtent available in templatePDF

Modified: branches/print_dev/http/print/classes/mbMapDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbMapDecorator.php	2009-01-13 23:09:18 UTC (rev 3450)
+++ branches/print_dev/http/print/classes/mbMapDecorator.php	2009-01-14 17:16:51 UTC (rev 3451)
@@ -19,21 +19,21 @@
 		$array_urls = explode("___", $urls);
 		$width = $this->conf->width;
 		$height = $this->conf->height;
-		$res = $this->pdf->k*($this->conf->res_dpi/72);
+		$res = $this->pdf->objPdf->k*($this->conf->res_dpi/72);
 		$myURL = new stripRequest($array_urls[0]);
 		$e = new mb_notice("mbMapDecorator: original bbox: ".$myURL->get('BBOX'));
-		parent::setMapExtent($this->adjustBbox(explode(",",$myURL->get('BBOX')), $myURL->get('srs')));
-		$e = new mb_notice("mbMapDecorator: adjusted bbox: ".parent::getMapExtent());
+		$this->pdf->setMapExtent($this->adjustBbox(explode(",",$myURL->get('BBOX')), $myURL->get('srs')));
+		$e = new mb_notice("mbMapDecorator: adjusted bbox: ".$this->pdf->getMapExtent());
 		for($i=0; $i<count($array_urls); $i++){
 			$m = new stripRequest($array_urls[$i]);
 			$m->set('width',(intval($width*$res)));
 			$m->set('height',(intval($height*$res)));
-			$m->set('bbox', parent::getMapExtent());
+			$m->set('bbox', $this->pdf->getMapExtent());
 			$array_urls[$i] = $m->url;
 		}
 		
-		$i = new weldMaps2PNG(implode("___",$array_urls),$this->filename);
-		$this->pdf->Image($this->filename, $this->conf->x_ul, $this->conf->y_ul, $width, $height,'png');
+		$i = new weldMaps2PNG(implode("___",$array_urls), $this->filename);
+		$this->pdf->objPdf->Image($this->filename, $this->conf->x_ul, $this->conf->y_ul, $width, $height,'png');
 	}
 	
 	protected function adjustBbox($aBboxArray, $aSrsString) {

Modified: branches/print_dev/http/print/classes/mbOverviewDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbOverviewDecorator.php	2009-01-13 23:09:18 UTC (rev 3450)
+++ branches/print_dev/http/print/classes/mbOverviewDecorator.php	2009-01-14 17:16:51 UTC (rev 3451)
@@ -18,7 +18,7 @@
 		$o_url = new stripRequest($overview_url);
 		$width = $this->conf->width;
 		$height = $this->conf->height;
-		$res = $this->pdf->k*($this->conf->res_dpi/72);		
+		$res = $this->pdf->objPdf->k*($this->conf->res_dpi/72);		
 		$o_url->set('width',intval($width*$res));
 		$o_url->set('height',intval($height*$res));
 		$overview_url = $o_url->url;	
@@ -26,10 +26,10 @@
 		$urls = $_REQUEST["map_url"];
 		$array_urls = explode("___", $urls);
 		$myURL = new stripRequest($array_urls[0]);
-		$myURL->set('bbox', parent::getMapExtent());
+		$myURL->set('bbox', $this->pdf->getMapExtent());
 
 		$i = new weldOverview2PNG($overview_url, $myURL->url, $this->filename);
-		$this->pdf->Image($this->filename, $this->conf->x_ul, $this->conf->y_ul, $width, $height,'png');
+		$this->pdf->objPdf->Image($this->filename, $this->conf->x_ul, $this->conf->y_ul, $width, $height,'png');
 	}
 }
 

Modified: branches/print_dev/http/print/classes/mbTemplatePdf.php
===================================================================
--- branches/print_dev/http/print/classes/mbTemplatePdf.php	2009-01-13 23:09:18 UTC (rev 3450)
+++ branches/print_dev/http/print/classes/mbTemplatePdf.php	2009-01-14 17:16:51 UTC (rev 3451)
@@ -17,7 +17,17 @@
 									$this->confPdf->format);
 		$this->outputFileName = $this->generateOutputFileName("map","pdf");
 	}
+
+	public function setMapExtent($aBboxString) {
+		$this->mapExtent = $aBboxString;
+		$e = new mb_notice("mbTemplatePdf: setting mapExtent to ".$this->mapExtent);
+	}
 	
+	public function getMapExtent() {
+		$e = new mb_notice("mbTemplatePdf: getting mapExtent as ".$this->mapExtent);
+		return $this->mapExtent;
+	}	
+	
 	public function render() {
 		foreach ($this->confPdf->pages as $pageConf) {
 			/* apply the template to the pdf page */
@@ -29,10 +39,10 @@
             foreach ($pageConf->elements as $pageElementId => $pageElementConf) {
 				switch ($pageElementId) {
 					case "map":
-						$err = new mbMapDecorator($this->objPdf, $pageElementConf);
+						$err = new mbMapDecorator($this, $pageElementConf);
 						break;
 					case "overview":
-						$err = new mbOverviewDecorator($this->objPdf, $pageElementConf);
+						$err = new mbOverviewDecorator($this, $pageElementConf);
 						break;						
 				}
             }

Modified: branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php	2009-01-13 23:09:18 UTC (rev 3450)
+++ branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php	2009-01-14 17:16:51 UTC (rev 3451)
@@ -2,7 +2,7 @@
 
 abstract class mbTemplatePdfDecorator extends mbTemplatePdf {
 
-	/* the pdf object to decorate */
+	/* the template pdf object to decorate */
 	public $pdf;
 	/* the conf object for the desired decoration */
 	public $conf;
@@ -14,16 +14,6 @@
 		$this->conf = $mapConf;
 	}
 	
-	public function setMapExtent($aBboxString) {
-		parent::$mapExtent = $aBboxString;
-		$e = new mb_notice("mbTemplatePdfDecorator: setting mapExtent to ".parent::$mapExtent);
-	}
-	
-	public function getMapExtent() {
-		$e = new mb_notice("mbTemplatePdfDecorator: getting mapExtent as ".parent::$mapExtent);
-		return parent::$mapExtent;
-	}
-	
 	abstract public function decorate();
 
 }



More information about the Mapbender_commits mailing list