Rotation Expression: Arcade expression issue

528
3
05-02-2022 02:01 AM
StephM
by
New Contributor II

Hello,

I'm developing mobile app and some featurelayers contains a column "SYMB_ROTATION" that represents the angle the symbol need to do.

for now I simply create a UniqueValueRenderer and apply the rotation like that:

 

 

 

assetRenderer.RotationExpression = $"[{rotationName}]-90";

 

 

 

Where rotationName is the column of the rotation value.

I also tried with the ArcadeExpression but it doesn't work

Maybe I miss something.

Does someone has a working sample of cod ?

Thanks in advance for your help.
Best regards

Tags (1)
0 Kudos
3 Replies
PreetiMaske
Esri Contributor

Try passing the exact field name in square brackets like [SYMB_ROTATION]

0 Kudos
StephM
by
New Contributor II

Hello @PreetiMaske,
thanks for your reply.

My problem is the "-90" that seems not applied...

The rotation is done, it's the expression itself that doesn't work.

Thanks .
S.

 

 

 

 

0 Kudos
PreetiMaske
Esri Contributor

Hello @StephM 

Currently RotationExpression only accepts a fieldname or a value. It is not equipped to accept an arcade expression. I don't know your use case but an alternate is to set rotation using an arcade expression on your data (in ArcGIS Pro) and publish that data with visual variable. Visual variable on renderers are honored in runtime and you will be able to see custom expression applied on the features.

Here are some helpful resources:

https://pro.arcgis.com/en/pro-app/2.7/help/mapping/layer-properties/vary-symbology-by-rotation.htm

https://developers.arcgis.com/documentation/mapping-apis-and-services/visualization/data-driven-styl....

Hope this helps.

0 Kudos