[Mapbender-commits] r7713 - trunk/mapbender/owsproxy/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Mar 17 12:38:31 EDT 2011
Author: armin11
Date: 2011-03-17 09:38:31 -0700 (Thu, 17 Mar 2011)
New Revision: 7713
Modified:
trunk/mapbender/owsproxy/http/index.php
Log:
Bugfixes for error message from owsproxy - shows the message inimage again
Modified: trunk/mapbender/owsproxy/http/index.php
===================================================================
--- trunk/mapbender/owsproxy/http/index.php 2011-03-17 16:29:49 UTC (rev 7712)
+++ trunk/mapbender/owsproxy/http/index.php 2011-03-17 16:38:31 UTC (rev 7713)
@@ -26,6 +26,8 @@
/***** conf *****/
$imageformats = array("image/png","image/gif","image/jpeg", "image/jpg");
+$width = 400;
+$height = 400;
/***** conf *****/
$con = db_connect(DBSERVER,OWNER,PW);
@@ -184,8 +186,12 @@
ImageFilledRectangle($image,0,0,$width,$height,$transparent);
imagecolortransparent($image, $transparent);
$text_color = ImageColorAllocate ($image, 233, 14, 91);
- for($i=0; $i<count($e); $i++){
- ImageString ($image, 3, 5, $i*20, $e[$i], $text_color);
+ if (count($e) > 1){
+ for($i=0; $i<count($e); $i++){
+ ImageString ($image, 3, 5, $i*20, $e[$i], $text_color);
+ }
+ } else {
+ ImageString ($image, 3, 5, $i*20, $e, $text_color);
}
responseImage($image);
}
@@ -195,10 +201,11 @@
function responseImage($im){
global $reqParams;
$format = $reqParams['format'];
+ $format="image/gif";
if($format == 'image/png'){header("Content-Type: image/png");}
if($format == 'image/jpeg' || $format == 'image/jpg'){header("Content-Type: image/jpeg");}
if($format == 'image/gif'){header("Content-Type: image/gif");}
-
+
if($format == 'image/png'){imagepng($im);}
if($format == 'image/jpeg' || $format == 'image/jpg'){imagejpeg($im);}
if($format == 'image/gif'){imagegif($im);}
@@ -246,7 +253,7 @@
*/
function getFeatureInfo($url){
global $info_format;
- //$e = new mb_notice("owsproxy: Try to fetch FeatureInfoRequest: ".$url);
+ //$notice = new mb_notice("owsproxy: Try to fetch FeatureInfoRequest: ".$url);
header("Content-Type: ".$info_format);
if (func_num_args() == 2) { //new for HTTP Authentication
@@ -391,11 +398,11 @@
preg_match_all($pattern,$content,$matches);
for($i=0; $i<count($matches[1]); $i++){
$req = $matches[1][$i];
- $e = new mb_notice("owsproxy found URL ".$i.": ".$req);
+ $notice = new mb_notice("owsproxy found URL ".$i.": ".$req);
#$notice = new mb_notice("owsproxy id:".$req);
$id = registerURL($req);
$extReq = setExternalRequest($id);
- $e = new mb_notice("MD5 URL ".$id." - external link: ".$extReq);
+ $notice = new mb_notice("MD5 URL ".$id." - external link: ".$extReq);
$content = str_replace($req,$extReq,$content);
}
return $content;
More information about the Mapbender_commits
mailing list