How do I resize symbols from a 2525 dictionary renderer?

162
3
Jump to solution
10-22-2021 07:28 AM
TroyFoster
New Contributor III

I finally got my runtime qt app converted over from 100.4 to 100.11.  I remember from one of the devsummit briefs that 2525 dictionary symbols were able to be resized in a later release. Is there a sample or code snippet displaying how to resize those dictionary symbols?

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

There is no sample at the moment. Here is the doc - https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-dictionaryrenderer.html#setSca...

 

Here is an example we have in our tests:

 

// Simple case... double the size 
ArcadeExpression* arcadeExpression = new ArcadeExpression("2", this);
dictionaryRenderer->setScaleExpression(arcadeExpression);

// More advanced case... double the size if the identity_code attribute is 4
ArcadeExpression* arcadeExpression = new ArcadeExpression("iif($feature.Identity_code == 4, 2,1)", this);
dictionaryRenderer->setScaleExpression(arcadeExpression);

 

Here is an Arcade reference you can use to write your expressions - https://developers.arcgis.com/arcade/ 

View solution in original post

0 Kudos
3 Replies
LucasDanzinger
Esri Frequent Contributor

There is no sample at the moment. Here is the doc - https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-dictionaryrenderer.html#setSca...

 

Here is an example we have in our tests:

 

// Simple case... double the size 
ArcadeExpression* arcadeExpression = new ArcadeExpression("2", this);
dictionaryRenderer->setScaleExpression(arcadeExpression);

// More advanced case... double the size if the identity_code attribute is 4
ArcadeExpression* arcadeExpression = new ArcadeExpression("iif($feature.Identity_code == 4, 2,1)", this);
dictionaryRenderer->setScaleExpression(arcadeExpression);

 

Here is an Arcade reference you can use to write your expressions - https://developers.arcgis.com/arcade/ 

View solution in original post

0 Kudos
TroyFoster
New Contributor III

That just cleaned up about 130 lines of janky workaround to resize the symbols

KerryRobinson
Esri Contributor

Hi Troy.  Yes, as Lucas mentioned, there is a new `scaleExpression` method on the Dictionary Renderer that can accept either a constant or an Arcade expression.   So it doesn't set your symbol to a specific size, but you can scale all symbols based on a specific value, or use the expression to scale based on an attribute, map scale, etc. 

0 Kudos