Rotation of Label based on field

370
4
11-08-2019 02:27 AM
ClemensMöller
New Contributor II

Is it possible to rotate a label based on the value of a field? The documentation for RotationValue says that it can be used with textSymbols but not how. Since labels have no visualVariables attribute I don't know where I can set a rotation definition

Tags (2)
0 Kudos
4 Replies
RobertBorchert
Frequent Contributor III

Why do it with code? select the rotation field in the label class

0 Kudos
ClemensMöller
New Contributor II

Thanks for your answer but where can I select the rotation field? LabelClass doesn't have a rotation attribute and angle in TextSymbol doesn't work with fields but only with static integers

0 Kudos
Noah-Sager
Esri Regular Contributor

You can, but I'm not sure this is what you want. The RotationVariable can be used on a renderer, and renderers support Symbol, of which TextSymbol is a valid type. So this means that you can rotate a desired TextSymbol based on the value of a field, but this does not mean that you can rotate individual labels of features. The text of the TextSymbol will be defined by the string input. Not sure if this is clear. Here's an example of rotating TextSymbol:

https://codepen.io/noash/pen/QWWBVMZ 

0 Kudos
ClemensMöller
New Contributor II

Thanks for your answer. That's not exactly what I was looking for but probably the best I can get. Then I will create another layer from the labels and display it additionally to the other layer