Using returned Arcade value as input to Rotational Render field value

276
1
03-16-2023 08:38 AM
ChrisSchmeissner
New Contributor II

I am wanting to rotate a symbol as in the example https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=visualization-vv-rotatio.... However in my case there is no field in the FeatureLayer that can be used for the "field" value in the rotationVisualVariable. I would like to use the returned value of an Arcade expression for this field in the rotationVisualVariable. Specifically I need to convert a string (found in the FeatureLayer)  such as "North East" to a number 45, which represents degrees. Or "South East" to 135.

I do not know how to get this returned Arcade value into the rotational Renderer. 

0 Kudos
1 Reply
AnneFitz
Esri Regular Contributor

Hi @ChrisSchmeissner - you can use the "valueExpression" property instead of "field" to base the rotation visual variable off of an Arcade expression: https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-Rotatio...

0 Kudos