PhpMapscript says ms_png not defined

Dylan Keon 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
http://mapserver.gis.umn.edu/doc42/mapfile-reference.html#outputformat
for more info.

--Dylan


John Kim wrote:
> Hi,
>
> 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:
>  dl("php_mapscript_42.dll");
>  $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?
>
> Thanks,
>
> --
> John Kim



More information about the mapserver-users mailing list