Select to view content in your preferred language

How to use public string RotationExpression {get; set;}

614
0
01-27-2014 08:29 AM
AliKaraman1
Deactivated User
(As it is too simple) there is no sample how to use
public string RotationExpression {get; set;}.
Somehow, I did not know how excatly one should initialize this property, I was thinking about much more complicated approaches.

API says:
        //
        // Summary:
        //     Gets/sets the expression describing how a Graphic's attributes are translated
        //     into a rotation to be applied to the Graphic.

Example usage is:

var renderer = new UniqueValueRenderer()
            {
                RotationType = SymbolRotationType.Geographic,
                RotationExpression = "[Direction]", 
                //Direction is an attribute added to a graphic object, like:
                // graphic.Attributes.Add("Direction", <double>);
                Field = "MyLayer",
                Infos = {
                     new UniqueValueInfo()
                    {
                        Value = 0,       
                        Symbol = new SimpleMarkerSymbol() { Color = red,Style=SimpleMarkerSymbol.SimpleMarkerStyle.Cross, Size=20,   }                       
                                               
                    },
};
0 Kudos
0 Replies