[mapserver-users] Re: Mapscript Legend question

Sacha Black sacha.black at gmail.com
Fri Mar 28 15:42:53 EDT 2008


after some flailing, was able to answer my own question:

$oMap->legend->imagecolor->setRGB(0,255,0);

will override the mapfile and turn the legend backgound green.

sacha


On Wed, Mar 26, 2008 at 5:51 PM, Sacha Black <sacha.black at gmail.com> wrote:
> hi list,
>
>  right now I do this to get a legend from my map file:
>
>         $oImg=$oMap->drawLegend();
>         $oImg->saveImage($szImg.'_legend',$oMap);
>         copy($szImg.'_legend', $szImg.'_legend.png');
>         $legendW = $oImg->width;
>         $legendH = $oImg->height;
>         $oImg->free();
>
>  my question is: is it possible to request the basic legend with a
>  different background color than the background color specified in the
>  mapfile? better yet, is there a way to specify that the background is
>  transparent ?
>
>  thanks for any suggestions,
>
>  sacha
>
>  [apologies if this is a very basic mapscript question, but i couldn't
>  find the answer I was looking for when I searched.]
>


More information about the mapserver-users mailing list