PhpMapscript says ms_png not defined
keon at NACSE.ORG
Fri Sep 24 23:13:25 EDT 2004
Arguments are no longer necessary for saveWebImage(). You can just do:
$url = $img->saveWebImage();
Use an OUTPUTFORMAT block in your mapfile to define how the image should
be created. Or you can just use the default values associated with
whatever IMAGETYPE you declare (e.g., IMAGETYPE PNG). See
for more info.
John Kim wrote:
> I just installed PHPMapScript and tried running a simple PHP script with a
> test map, and the resulting html says, "use of undefined constant MS_PNG".
> Where should this have been defined? (I had a similar problem when I tried
> the GMap demo, except it said MS_GIF was undefined.)
> Here's my PHP code:
> $map = ms_newMapObj("test.map");
> print $map->numlayers; // this line prints 4
> $img = $map->draw();
> $url = $img->saveWebImage(MS_PNG, 0, 0, 0);
> I'm using Mapserver 4.2.3, PHP 4.3.9, PHP Mapscript 4.2, and Apache 2.0
> on Windows 2000. Did I not configure something right?
> John Kim
More information about the mapserver-users