[mapserver-users] The browser can't display the rendered image
Pietro Giannini
pgiannini at bytewise.it
Wed Nov 19 12:37:12 PST 2008
Attila,
It is strange, because the IMAGEURL in mapfile is correct, but the html
generated from the script report <IMG
SRC="c:/ms4w/tmp/ms_tmp/4923f091_c84_0.jpeg">, i.e. a local path and not a
url.
The correct tag should be something like <IMG
SRC="/tmp/ms_tmp/4923f091_c84_0.jpeg">
Are you sure the mapfile of the script is the same you are editing?
ciao .................pg
On Mer, Novembre 19, 2008 21:22, Attila Borbás wrote:
> 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>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list