[mapserver-users] The browser can't display the rendered image
Burgholzer,Robert
rwburgholzer at deq.virginia.gov
Wed Nov 19 12:26:02 PST 2008
Your image link in http is a direct link to your hard drive. I do not think your web server likes this. The ms_tmp directory has to be readable by apache, and therefore, it must be in the apache htdocs path, or specified in the httpd.conf file to be readable.
HTH,
r.b.
Robert W. Burgholzer
Surface Water Modeler
Office of Water Supply and Planning
Virginia Department of Environmental Quality
rwburgholzer at deq.virginia.gov
804-698-4405
Open Source Modeling Tools:
http://sourceforge.net/projects/npsource/
-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Attila Borbás
Sent: Wednesday, November 19, 2008 3:23 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] The browser can't display the rendered image
Hello,
I still have got a problem. I ve tested my mapfiles (with quickmap.php) and they work fine, but the problem is the same. My php/mapscript code created the map image and saved it to "/ms_tmp/" but the browser couldn't display it (I got a broken img). I enclose the php/mapscript file, the mapfile and the page source.Thx for ur help and patience.
PHP/MAPSCRIPT FILE:
<?php
define( "MAPFILE", "/ms4w/apps/raster/raster.map" );
define( "MODULE", "php_mapscript.dll" );
if(!extension_loaded("mapscript")) dl(MODULE);
$oMap = ms_newMapObj( MAPFILE );
//draw
$oImage = $oMap->draw();
//output map
$url = $oImage->saveWebImage();
?>
<HTML>
<HEAD>
<TITLE>Example 1: Displaying a map</TITLE>
</HEAD>
<BODY>
<IMG SRC="<?php echo $url; ?>">
</BODY>
</HTML>
MAPFILE (I created it with qgis):
MAP
NAME world_raster
SIZE 600 600
UNITS dd
EXTENT -188.678212 -114.270312 189.321981 107.893344
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
''
END
IMAGECOLOR 192 192 192
IMAGEQUALITY 95
IMAGETYPE jpeg
OUTPUTFORMAT
NAME jpeg
DRIVER 'GD/JPEG'
MIMETYPE 'image/jpeg'
#IMAGEMODE PC256
EXTENSION 'jpeg'
END
LEGEND
IMAGECOLOR 255 255 255
STATUS ON
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
END
WEB
IMAGEPATH '/ms4w/tmp/ms_tmp/'
IMAGEURL '/tmp/ms_tmp/'
METADATA
'wms_title' 'world_raster'
'wms_onlineresource' 'http://my.host.com/cgi-bin/mapserv?map=wms.map&'
'wms_srs' 'EPSG:4326'
END
END
LAYER
NAME 'world_raster'
TYPE RASTER
DATA '/ms4w/Apache/htdocs/world_raster.tif'
METADATA
'wms_title' 'world_raster'
END
STATUS DEFAULT
TRANSPARENCY 100
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
''
END
END
END
Page source (after I ran the code the html part saw the link to the image but didn't display it.):
<HTML>
<HEAD>
<TITLE>Example 1: Displaying a map</TITLE>
</HEAD>
<BODY>
<IMG SRC="c:/ms4w/tmp/ms_tmp/4923f091_c84_0.jpeg">
</BODY>
</HTML>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081119/3d2ad72c/attachment.htm>
More information about the MapServer-users
mailing list