How to convert an Arcade Label to a String?

695
2
04-17-2019 05:25 AM
DanielKilimnik
New Contributor

So I know it is possible to extract the json from a LabelDefinition. There I can see the Arcade Expression but I want to see the parsed Arcade Label.

I would like a method wich I can call together with a Feature and get the Label Text wich would be shown in the MapView.

The same already exists for the Graphics. There is a Renderer class with a method GetSymbol and the parameter of a Feature (GeoElement) and I get a Graphic returened.

Why isn't there a LabelRenderer Class which does the same for Labels? I can't be so difficult to parse Arcade because you are already doing this for the MapView.

Tags (3)
0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

That's good feedback, and an interesting idea.

Would you just want the label string for a feature, or a more generic Arcade Evaluator API?

DanielKilimnik
New Contributor

I think the label string would be enough for me but a generic Evaluator API would be great too. It would be nice to have both. The API so you could Evaluate any Arcade code and the label evaluation because labels have a where clause so you could decide which label to use. 

0 Kudos