[mapserver-users] mapsript legend
Chris Green
chris.green at ibstv.co.uk
Thu Aug 18 00:02:16 PDT 2011
Hi all
I have a map created via Mapscript under Mapserver 6.0 but I can't find a
way to add a legend. Recent examples are hard to find but I found the
following dating from 2002 which seemed simple enough:
$legend = $map->legend;
$legend->set(width,40);
$legend->set(height,100);
$legend->imagecolor->setRGB(240,220,200); # tan
$legend->outlinecolor->setRGB(1,1,1); # black
$legend->set(status, MS_EMBED);
$legend->set(position, MS_UL);
// SET LEGEND LABEL PROPERTIES
$lg_label = $legend->label;
$lg_label->set(font, "arial");
$lg_label->set(type, MS_TRUETYPE);
$lg_label->set(size, 10);
$lg_label->set(minsize, 6);
$lg_label->set(maxsize, 12);
$lg_label->color->setRGB(100,100,100);
$legend->set(postlabelcache, MS_TRUE);
// DRAW LEGEND
$legendImage=$map->drawLegend();
Unfortunately this produces no output. Can anyone give me any clues why?
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110818/0292b044/attachment.htm>
More information about the MapServer-users
mailing list