Can Arcade expressions be used in AGSUniqueValueRenderer?

10-18-2019 05:18 PM
New Contributor II

Can Arcade expressions be used in AGSUniqueValueRenderer in a similar fashion as the valueExpression property of UniqueValueRenderer in the JavaScript API?

I need to define symbols based on selective values across multiple attributes (e.g. attribute A = "foo" OR attribute B = "bar") and I can't figure out how to achieve that using AGSUniqueValueRenderer in the iOS SDK. Is there a way?

I also didn't have much luck subclassing AGSRenderer and defining my own symbolForFeature logic.

Tags (1)
0 Kudos
1 Reply
Esri Regular Contributor

So it looks like valueExpression on a UVR should work, there just isn't an API in Runtime to manipulate it.

One thing you could try is to define a UVR with a valueExpression in the JS API and use toJson() on it to get back JSON, translate that JSON to a NSDictionary, then provide that dictionary to the Runtime's AGSUniqueValueRenderer.fromJSON:error:() method.

Does that help? Let me know how that goes.

Two notes:

  • You could get that JSON out of a saved web map using AGO Assistant if you prefer not to do any JS API code.
  • Another approach would be to use a Dictionary Renderer. See this blog post for some info on that.
0 Kudos