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

 

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to