PHP/Mapscript: send map to browser directly

Wally Maddoc wallacher at INNOMIS.COM
Fri Jan 11 10:50:20 EST 2008


Hi list.

The usual way to send a map to the browser is to store the image file (e.g
mymap.png) on the server and invoke the URL to this file in the HTML-Code. 
I think of something like this:
________________________________________
<?php
$map = ms_newMapObj($map_path.$map_file)
...
$image=$map->draw();
$image_url=$image->saveWebImage()
...
>

<!--- HTML-Code -->
...
<INPUT TYPE=IMAGE NAME="mapa" SRC="<?php echo $image_url?>"
...
________________________________________


Is there a direct method to send the map to the browser without saving the
map in a file. I think of some corresponding PHP code:

header('Content-type: image/png');
imagepng($image);

Thanks for any advice that anyone might have.

Erik



More information about the mapserver-users mailing list