[Mapbender-commits] r7631 - in trunk/mapbender/http: classes plugins print print/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun Feb 20 14:17:58 EST 2011


Author: armin11
Date: 2011-02-20 11:17:58 -0800 (Sun, 20 Feb 2011)
New Revision: 7631

Modified:
   trunk/mapbender/http/classes/class_connector.php
   trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php
   trunk/mapbender/http/print/classes/mbMapDecorator.php
   trunk/mapbender/http/print/classes/mbOverviewDecorator.php
   trunk/mapbender/http/print/mod_printPDF_pdf.php
Log:
Bugfixes with print and metadata saving for wmc

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2011-02-19 10:23:59 UTC (rev 7630)
+++ trunk/mapbender/http/classes/class_connector.php	2011-02-20 19:17:58 UTC (rev 7631)
@@ -64,7 +64,7 @@
 	public function load($url) {
 		//some firewalls have problems to allow requests from a server behind it to the same server thru an internet connection. It can be that some requests are done thru this class to the urls of HTTP_AUTH_PROXY or OWSPROXY. If some of those are part of the url they must be exchanged with localhost - which hopefully should work. TODO: check if http is ok for all 
 		
-		$posPROXY = strpos($url,OWSPROXY);
+		/*$posPROXY = strpos($url,OWSPROXY);
 		if ($posPROXY !== false) {
 			$url = str_replace($_SERVER['HTTP_HOST'], "localhost", $url);
 			$url = str_replace("https", "http", $url);
@@ -73,7 +73,7 @@
 		if ($posPROXY !== false) {
 			$url = str_replace($_SERVER['HTTP_HOST'], "localhost", $url);
 			$url = str_replace("https", "http", $url);
-		}
+		}*/
 		if (!$url) {
 			$e = new mb_exception("connector: no URL given");
 			return false;

Modified: trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php	2011-02-19 10:23:59 UTC (rev 7630)
+++ trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php	2011-02-20 19:17:58 UTC (rev 7631)
@@ -29,7 +29,7 @@
 		$mapUrlsNew = array();
 		$problemUrls = array();
 		for($i=0; $i<count($mapUrls); $i++){
-			if ($mapUrls[$i] != false) {
+			if ($mapUrls[$i] != 'false') {
 				$mapUrlsNew[] = $mapUrls[$i];
 			} else {
 				$problemUrls[] = $i;

Modified: trunk/mapbender/http/print/classes/mbMapDecorator.php
===================================================================
--- trunk/mapbender/http/print/classes/mbMapDecorator.php	2011-02-19 10:23:59 UTC (rev 7630)
+++ trunk/mapbender/http/print/classes/mbMapDecorator.php	2011-02-20 19:17:58 UTC (rev 7631)
@@ -59,6 +59,16 @@
 	public function decorate() {
 		$urls = $_REQUEST["map_url"];
 		$array_urls = explode("___", $urls);
+		//problem with false in some map_urls see http/plugins/mb_metadata_wmcPreview.php
+		//exchange array_urls with array_urls without false entries
+		$newArray_urls = array();
+		for ($i=0; $i<count($array_urls); $i++) {
+			if ($array_urls[$i] != 'false') {
+			    $newArray_urls[] = $array_urls[$i];
+			}
+		}
+		$array_urls = $newArray_urls;
+		$e = new mb_exception("print/classes/mbMapDecorator.php: array_urls[0]: ".$array_urls[0]);
 		$width = $this->conf->width;
 		$height = $this->conf->height;
 		$res = $this->pdf->objPdf->k * ($this->res_dpi/72);

Modified: trunk/mapbender/http/print/classes/mbOverviewDecorator.php
===================================================================
--- trunk/mapbender/http/print/classes/mbOverviewDecorator.php	2011-02-19 10:23:59 UTC (rev 7630)
+++ trunk/mapbender/http/print/classes/mbOverviewDecorator.php	2011-02-20 19:17:58 UTC (rev 7631)
@@ -66,6 +66,15 @@
 
 		$urls = $_REQUEST["map_url"];
 		$array_urls = explode("___", $urls);
+		//problem with false in some map_urls see http/plugins/mb_metadata_wmcPreview.php
+		//exchange array_urls with array_urls without false entries - it depends on the scale hints - if not visible the map_url is false!
+		$newArray_urls = array();
+		for ($i=0; $i<count($array_urls); $i++) {
+			if ($array_urls[$i] != 'false') {
+			    $newArray_urls[] = $array_urls[$i];
+			}
+		}
+		$array_urls = $newArray_urls;
 		$myURL = new stripRequest($array_urls[0]);
 		$myURL->set('bbox', $this->pdf->getMapExtent());
 		if ($this->angle != 0) {

Modified: trunk/mapbender/http/print/mod_printPDF_pdf.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF_pdf.php	2011-02-19 10:23:59 UTC (rev 7630)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php	2011-02-20 19:17:58 UTC (rev 7631)
@@ -148,7 +148,15 @@
 
 
 $array_urls = explode("___", $urls);
-
+//problem with false in some map_urls see http/plugins/mb_metadata_wmcPreview.php
+//exchange array_urls with array_urls without false entries - it depends on the scale hints - if not visible the map_url is false!
+$newArray_urls = array();
+for ($i=0; $i<count($array_urls); $i++) {
+	if ($array_urls[$i] != 'false') {
+		$newArray_urls[] = $array_urls[$i];
+	}
+}
+$array_urls = $newArray_urls;
 $myURL = new stripRequest($array_urls[0]);
 $map_width = round($myURL->get("width"));
 $map_height = round($myURL->get("height"));



More information about the Mapbender_commits mailing list