Esri / arcgis-maps-sdk-dotnet-samples

Sample code for ArcGIS Maps SDK for .NET – WPF, WinUI, .NET MAUI
Apache License 2.0
413 stars 518 forks source link

Does 'IIF arcade expression' supports in Renderer? #1298

Open illusian opened 1 year ago

illusian commented 1 year ago

Hi,

I am currently working on to using IIF syntax arcade expression in renderer which is coming from JSON. So far, I can confirm that simple "valueExpression" in the JSON works fine such as "valueExpression='$feature.category'". But, it won't accept more complicated arcade expression using IIF condition statement.

*valueExpression var nV = IIF($feature.nV != null && $feature.nV != $feature.v, '-'+ $feature.nV,''); var cS = IIF($feature.cS != null && $feature.cS != 'closed', '-'+ $feature.cS, ''); IIF(IsEmpty($feature.endDate), IIF($feature.category == 'brick', $feature.v + nV + cS, $feature.v), 'expired')

*sourceCode var serializeOptions = new JsonSerializerOptions { WriteIndented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; string jsonRenderer = System.Text.Json.JsonSerializer.Serialize(uniqueRenderJSON[renderName], serializeOptions); _renderer = Renderer.FromJson(jsonRenderer); } featureCollectionTable.Renderer = _renderer;

pMaske commented 2 months ago

Can you please provide a simple reproducible sample app with such data?