[Mapbender-commits] r4498 - branches/print_dev/http/print/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Aug 6 09:01:36 EDT 2009
Author: mschulz
Date: 2009-08-06 09:01:36 -0400 (Thu, 06 Aug 2009)
New Revision: 4498
Modified:
branches/print_dev/http/print/classes/mbMapDecorator.php
branches/print_dev/http/print/classes/mbOverviewDecorator.php
Log:
added check whether php-imagick is installed, fixed an issue with overview map
Modified: branches/print_dev/http/print/classes/mbMapDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbMapDecorator.php 2009-08-05 15:07:30 UTC (rev 4497)
+++ branches/print_dev/http/print/classes/mbMapDecorator.php 2009-08-06 13:01:36 UTC (rev 4498)
@@ -2,7 +2,11 @@
require_once(dirname(__FILE__)."/../../classes/class_stripRequest.php");
require_once(dirname(__FILE__)."/../../classes/class_weldMaps2PNG.php");
-require_once(dirname(__FILE__)."/../../classes/class_weldMaps2PNG_rotate.php");
+if (class_exists('Imagick')) {
+ require_once(dirname(__FILE__)."/../../classes/class_weldMaps2PNG_rotate.php");
+} else {
+ $e = new mb_notice("mbMapDecorator: php-imagick module has to be installed to be able to use rotated printing.");
+}
require_once(dirname(__FILE__)."/../../classes/class_map.php");
class mbMapDecorator extends mbTemplatePdfDecorator {
@@ -76,7 +80,12 @@
}
if ($this->angle != 0) {
- $i = new weldMaps2PNG_rotate(implode("___",$array_urls), $this->filename, $this->angle);
+ if (class_exists('weldMaps2PNG_rotate')) {
+ $i = new weldMaps2PNG_rotate(implode("___",$array_urls), $this->filename, $this->angle);
+ } else {
+ $i = new weldMaps2PNG(implode("___",$array_urls), $this->filename);
+ $e = new mb_notice("mbMapDecorator: no rotation possible.");
+ }
} else {
$i = new weldMaps2PNG(implode("___",$array_urls), $this->filename);
}
Modified: branches/print_dev/http/print/classes/mbOverviewDecorator.php
===================================================================
--- branches/print_dev/http/print/classes/mbOverviewDecorator.php 2009-08-05 15:07:30 UTC (rev 4497)
+++ branches/print_dev/http/print/classes/mbOverviewDecorator.php 2009-08-06 13:01:36 UTC (rev 4498)
@@ -2,7 +2,11 @@
require_once(dirname(__FILE__)."/../../classes/class_stripRequest.php");
require_once(dirname(__FILE__)."/../../classes/class_weldOverview2PNG.php");
-require_once(dirname(__FILE__)."/../../classes/class_weldOverview2PNG_rotate.php");
+if (class_exists('Imagick')) {
+ require_once(dirname(__FILE__)."/../../classes/class_weldOverview2PNG_rotate.php");
+} else {
+ $e = new mb_notice("mbOverviewDecorator: php-imagick module has to be installed to be able to use rotated printing.");
+}
class mbOverviewDecorator extends mbTemplatePdfDecorator {
@@ -57,17 +61,23 @@
$res = $this->pdf->objPdf->k*($this->conf->res_dpi/72);
$o_url->set('width',intval($width*$res));
$o_url->set('height',intval($height*$res));
- $o_url->set('bbox', $this->pdf->adjustBbox(intval($width*$res), intval($height*$res), explode(",",$o_url->get('BBOX')), $o_url->get('srs'), $this->conf->res_dpi));
+ $o_url->set('bbox', $this->pdf->adjustBbox($this->conf, explode(",",$o_url->get('BBOX')), $o_url->get('srs')));
$overview_url = $o_url->url;
$urls = $_REQUEST["map_url"];
$array_urls = explode("___", $urls);
$myURL = new stripRequest($array_urls[0]);
$myURL->set('bbox', $this->pdf->getMapExtent());
- $rotatedExtent = $this->rotatePoints(explode(",",$this->pdf->getMapExtent()), intval($angle));
-
if ($this->angle != 0) {
- $i = new weldOverview2PNG_rotate($overview_url, $myURL->url, $this->filename, $rotatedExtent);
+ if (class_exists('weldOverview2PNG_rotate')) {
+ $rotatedExtent = $this->rotatePoints(explode(",",$this->pdf->getMapExtent()), intval($this->angle));
+ for ($i==0;$i<count($rotatedExtent);$i++)
+ $e = new mb_notice("mbOverviewDecorator: rotated extent: " . implode("|",$rotatedExtent[$i]));
+ $i = new weldOverview2PNG_rotate($overview_url, $myURL->url, $this->filename, $rotatedExtent);
+ } else {
+ $i = new weldOverview2PNG($overview_url, $myURL->url, $this->filename);
+ $e = new mb_notice("mbOverviewDecorator: no rotation possible.");
+ }
} else {
$i = new weldOverview2PNG($overview_url, $myURL->url, $this->filename);
}
More information about the Mapbender_commits
mailing list