symbolizer.Alignment does not affect text placement

Developer
Feb 4, 2011 at 11:37 PM

The MapLabelLayer class creates a StringFormat and passes it to GraphicsPath.AddString(), but this doesn't seem to affect the placement when symbolizer.Alignment is set. Should symbolizer.Orientation be used instead? Is the Alignment property obsolete?

Developer
Feb 5, 2011 at 12:02 AM

I may be remembering incorrectly, but my thoguht was that Orientation controls the position of the label relative to the feature and Alignment is supposed to control the positioning of the text within the rectangular bounds.  The alignment is typically implemented through specifying something like a TextFormat class or something that is passed into Graphics.DrawString method.  If something has changed so that the GraphicsPath.AddString method does not specify any kind of string formatting, then it is possible that the alignment characteristic has been lost.  A better solution than removing it entirely would be to see the GraphicsPath can have a text formatting property set or if it can be passed as a parameter tot he AddString content.  That's all I can think of off the top of my head anyway.

Ted

 

Developer
Feb 5, 2011 at 12:25 AM

Thank you. All we needed to do was update the XML comments.