[mapguide-users] Feature Label Alignment

Frank Misurec frank.misurec at open-minds.ca
Mon Aug 16 09:47:45 EDT 2010


This approach works:

 

MgStringProperty hAlignProp = new MgStringProperty("HALIGN", "Left");

properties.Add(hAlignProp);

 

As often happens, you stare at the problem for a while, finally send out a
question to the community and five minutes later figure out that the problem
was a typo. In my case the sdf schema creation had a typo in the name of the
properties. I think it would be helpful if an exception was thrown when
trying to insert a value into a field that doesn't exist.

 

Thanks,

 

Frank. 

 

 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Frank Misurec
Sent: August 16, 2010 9:33 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Feature Label Alignment

 

Hi,

 

I have a layer definition that uses a fixed label. The Horizontal and
Vertical alignment properties are set to use properties from the feature
class. The feature source is sdf which is created dynamically during
runtime. The feature with the label (multiline) is shown on the map but the
alignment properties appear to be ignored and always default to 'Center' for
horizontal alignment and 'Halfline' for Vertical alignment. I tried setting
the alignment property using the following approaches, for example setting
the horizontal alignment:

 

MgStringProperty hAlignProp = new MgStringProperty("HALIGN", "Left");

properties.Add(hAlignProp);

 

or

 

MgStringProperty hAlignProp = new MgStringProperty("HALIGN", "\'Left\'");

properties.Add(hAlignProp);

 

 

If the layer definition uses one of the fixed values (ie. 'Left') instead of
a property then the alignment works. Does anyone know the proper way to
specify the alignment property for a label? I'm using MGE 2011.

 

Thanks,

 

Frank.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100816/8f96c39f/attachment.html


More information about the mapguide-users mailing list