[Mapserver-users] legendObj outlinecolor property does not exist?

Gerald Buckmaster gbuckmaster at cox.net
Tue May 27 21:53:46 EDT 2003


All,

I'm discovering the labelObj does not function the way I would expect it to 
work when attached to the legendObj or scalebarObj.  Paul Spencer eluded 
yesterday truetype fonts could not be used with scalebars...if that is true, 
could I be trying to control color of text in the wrong manner? I have yet to 
see any outlines around anything in the legend.  Haven't tried specific 
scripting for icons, as Daniel points out may be the reason the outlinecolor 
property was dropped.  Here are my major script comments, extracted to ease 
the reading:

/*
various labelObj properties dealing with color apparently do not
work when attached to a scalebarObj or legendObj.  All I get is black
text and evidence of shadow.

legendObj->imagecolor appears to be conflicting/affecting attached
labelObj->color, outlinecolor and backgroundcolor when set to -1,-1,-1 or
0,0,0 - you get color, but not what was expected.
*/

As a reminder, I am using Mapserver 4.0 (DEVELOPMENT) built  4-6 days ago and 
PHP 4.3.2RC3.  

	/* BUILD LEGEND */
	$my_legend = $map->legend;
	$my_legend->set(height, 80);
	$my_legend->set(width, 160);
	$my_legend->imagecolor->setRGB(200,200,200); # light grey - works?
	$my_legend->outlinecolor->setRGB(255,255,255); # red - nonoperable
	$my_legend->set(status, MS_EMBED); # works
	$my_legend->set(position, MS_UL); # works

	/* SET LEGEND LABEL PROPERTIES */
	$my_lg_label = $my_legend->label;
	$my_lg_label->set(font, "arial"); # works
	$my_lg_label->set(type, MS_TRUETYPE); # works
	$my_lg_label->set(minsize, 20); # works
	$my_lg_label->set(maxsize, 30); # works

	$my_lg_label->color->setRGB(0,0,255); # blue - nonoperable
	$my_lg_label->outlinecolor->setRGB(0,255,0); # green - nonoperable
	$my_lg_label->backgroundcolor->setRGB(255,0,0); # red - nonoperable

	$my_lg_label->shadowcolor->setRGB(255,0,0); # red - nonoperable
	$my_lg_label->set(shadowsizex,4); # works - hard to see
	$my_lg_label->set(shadowsizey,4); # works - hard to see

	$my_lg_label->backgroundshadowcolor->setRGB(255,0,0); # red - nonoperable
	$my_lg_label->set(backgroundshadowsizex,6); # nonoperable
	$my_lg_label->set(backgroundshadowsizex,6); # nonoperable

	$my_legend->set(postlabelcache, MS_TRUE);
	/* DRAW LEGEND */
	$map->drawLegend();

Thanks for the help, everyone.  BTW - is there a specific list dedicated to 
Mapscript vice Mapserver?  I feel like I may be a little off topic.

Gerald


On Tuesday 27 May 2003 07:23 am, Daniel Morissette wrote:
> Gerald Buckmaster wrote:
> > I still have no outline around the legend.  Probably something simple.
>
> There doesn't seem to be any code in either 3.6 or 4.0 to draw an
> outline around the legend.  I think this was taken out quite a while ago
> because we wanted to use the OUTLINECOLOR to specify an outline around
> the legend icons and nobody seemed to use outlines around their legend.
>
> I don't remember if there has been a discussion on this or if someone
> just took it out by accident... maybe someone else remembers?
>
> Daniel




More information about the mapserver-users mailing list