map loading error
cris ricana
crisricana at GMAIL.COM
Wed Jul 19 23:09:49 PDT 2006
Hello!
I'd like some help in using PHP/Mapscript. I have a freshly installed
Mapserver machine and is testing some simple php webpages to see if
everything is working, especially PHP/Mapscript:
<?php
dl ("php_mapscript.so");
echo("php_mapscript.so loaded.\n"); //to see if the library will
sucessfully load.
$map_path="/usr/local/apache2/htdocs/recipe1/hello.map";
echo($map_path); // absolute path to the map file
$map = ms_newMapObj($map_path);
$image=$map->draw();
$image_url=$image->saveWebImage();
?>
<HTML>
<HEAD>
<TITLE>Mapserver "hello world"</TITLE>
</HEAD>
<BODY>
<img SRC="<?php echo $image_url; ?>">
<p>This is the simplest example I could come up with.</p>
...
</BODY>
</html>
I'm using the following map file. It should produce an image with just
a line of text in it:
MAP
NAME HELLO
STATUS ON
EXTENT 0 0 4000 3000
SIZE 400 300
IMAGECOLOR 200 255 255
WEB
IMAGEPATH "/usr/local/apache2/htdocs/tmp/"
IMAGEURL "/tmp/"
END
LAYER
NAME "credits"
STATUS DEFAULT
TRANSFORM FALSE
TYPE ANNOTATION
FEATURE
POINTS
200 150
END
TEXT 'Hello world. Mapserver rocks.'
END
CLASS
LABEL
TYPE BITMAP
COLOR 0 0 0
END
END
END
END
The output I'm getting is the following:
php_mapscript.so loaded. /usr/local/apache2/htdocs/recipe1/hello.map
So
More information about the MapServer-users
mailing list