[MAPSERVER-USERS] PHP MapScript AGG

Daniel Morissette dmorissette at mapgears.com
Mon Mar 24 08:36:42 PDT 2008


> Bryn Roberts-2 wrote:
>> Everything works fine but the following two lines seem not to trigger AGG
>> rendering (I have never tried setting output format options from within
>> MapScript before and was unable to find any examples).
>> .....
>> $map->outputformat->setOption("name", "AGG");
>> $map->outputformat->setOption("imagemode", MS_IMAGEMODE_RGB);
>> $map->outputformat->setOption("driver", "AGG/PNG");
>> .....
>> Can somebody set me straight and point out where I am going wrong?

The setOption() method is for FORMATOPTIONs only. Name, imagemode and 
driver are properties of the OutputFormatObj class and are set using the 
set() method:

   $map->outputformat->set("name", "AGG");
   $map->outputformat->set("imagemode", MS_IMAGEMODE_RGB);
   $map->outputformat->set("driver", "AGG/PNG");


BTW, I believe a predefined "AGGPNG24" output format is available by 
default, so you could simply select it using:

   $map->selectOutputFormat("AGGPNG24");

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the MapServer-users mailing list