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: [email protected]
[mailto:[email protected]] On Behalf Of Frank Misurec
Sent: August 16, 2010 9:33 AM
To: [email protected]
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.
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users