private LabelProperties InitLabels()
{
LabelProperties property = new LabelProperties();
AttributeLabelClass attrLabel = new AttributeLabelClass();
attrLabel.TextExpression = string.Format("[{0}]", attributeLabel);
attrLabel.LabelPosition = LabelPosition.FixedPositionWithOverlaps;
attrLabel.Symbol = new TextSymbol
{
BackgroundColor = Colors.Yellow,
Color = Colors.Black,
YOffset = 200
};
attrLabel.IsWordWrapEnabled = true;
attrLabel.WordWrapLength = 30;
property.LabelClasses.Add(attrLabel);
return property;
}
I have a simple method to create a label property to apply to a GraphicsOverlay. After applying the above, the label offset does not seem to be offsetting the labels at all.
A value of 200 should display the label significantly far away from the actual graphic point but no change is noticed. The same method is applied to a GraphicsLayer but no change is seen.
Is there a fix to this?
Solved! Go to Solution.
Hi Ed,
Actually that's a limitation with the AttributeLabelClass. The positioning properties (XOffset , YOffset , Angle and AngleAlignment) is not supported for AttributeLabelClass.Symbol.
Thanks,
Asser
Hi Ed,
Actually that's a limitation with the AttributeLabelClass. The positioning properties (XOffset , YOffset , Angle and AngleAlignment) is not supported for AttributeLabelClass.Symbol.
Thanks,
Asser