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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 13 18:09:19 EST 2009


Author: mschulz
Date: 2009-01-13 18:09:18 -0500 (Tue, 13 Jan 2009)
New Revision: 3450

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:
connecting an adjusted mapextent to the templatePDF. work in progress.

Modified: branches/print_dev/http/print/classes/mbMapDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbMapDecorator.php	2009-01-13 19:48:39 UTC (rev 3449)
+++ branches/print_dev/http/print/classes/mbMapDecorator.php	2009-01-13 23:09:18 UTC (rev 3450)
@@ -22,13 +22,13 @@
 		$res = $this->pdf->k*($this->conf->res_dpi/72);
 		$myURL = new stripRequest($array_urls[0]);
 		$e = new mb_notice("mbMapDecorator: original bbox: ".$myURL->get('BBOX'));
-		$this->mapExtent = $this->adjustBbox(explode(",",$myURL->get('BBOX')), $myURL->get('srs'));
-		$e = new mb_notice("mbMapDecorator: adjusted bbox: ".$this->mapExtent);
+		parent::setMapExtent($this->adjustBbox(explode(",",$myURL->get('BBOX')), $myURL->get('srs')));
+		$e = new mb_notice("mbMapDecorator: adjusted bbox: ".parent::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', $this->mapExtent);
+			$m->set('bbox', parent::getMapExtent());
 			$array_urls[$i] = $m->url;
 		}
 		

Modified: branches/print_dev/http/print/classes/mbOverviewDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbOverviewDecorator.php	2009-01-13 19:48:39 UTC (rev 3449)
+++ branches/print_dev/http/print/classes/mbOverviewDecorator.php	2009-01-13 23:09:18 UTC (rev 3450)
@@ -19,16 +19,16 @@
 		$width = $this->conf->width;
 		$height = $this->conf->height;
 		$res = $this->pdf->k*($this->conf->res_dpi/72);		
-		$o_url->set('width',(intval($width*$res)));
-		$o_url->set('height',(intval($height*$res)));
+		$o_url->set('width',intval($width*$res));
+		$o_url->set('height',intval($height*$res));
 		$overview_url = $o_url->url;	
 
 		$urls = $_REQUEST["map_url"];
 		$array_urls = explode("___", $urls);
 		$myURL = new stripRequest($array_urls[0]);
-		$myURL->set('bbox', $this->mapExtent);
+		$myURL->set('bbox', parent::getMapExtent());
 
-		$i = new weldOverview2PNG($overview_url,$myURL->url ,$this->filename);
+		$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');
 	}
 }

Modified: branches/print_dev/http/print/classes/mbTemplatePdf.php
===================================================================
--- branches/print_dev/http/print/classes/mbTemplatePdf.php	2009-01-13 19:48:39 UTC (rev 3449)
+++ branches/print_dev/http/print/classes/mbTemplatePdf.php	2009-01-13 23:09:18 UTC (rev 3450)
@@ -5,7 +5,7 @@
 class mbTemplatePdf extends mbPdf {
 
 	/* it seems several decorators are going to need this information */
-	public $mapExtent;
+	public $mapExtent;	
 
 	public function __construct($jsonConf) {
 		$this->confPdf = $jsonConf;
@@ -17,7 +17,7 @@
 									$this->confPdf->format);
 		$this->outputFileName = $this->generateOutputFileName("map","pdf");
 	}
-
+	
 	public function render() {
 		foreach ($this->confPdf->pages as $pageConf) {
 			/* apply the template to the pdf page */

Modified: branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php	2009-01-13 19:48:39 UTC (rev 3449)
+++ branches/print_dev/http/print/classes/mbTemplatePdfDecorator.php	2009-01-13 23:09:18 UTC (rev 3450)
@@ -14,6 +14,16 @@
 		$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