Change Symbology with Radio Buttons

813
4
02-10-2014 05:46 AM
WesleyAskew
New Contributor III

fg

0 Kudos
4 Replies
JohnGravois
Frequent Contributor
have you seen this sample?  it doesn't have any radio buttons, but it shows how you can define a renderer and apply it to a FeatureLayer on the fly.
0 Kudos
WesleyAskew
New Contributor III
have you seen this sample?  it doesn't have any radio buttons, but it shows how you can define a renderer and apply it to a FeatureLayer on the fly.


Thanks for your response.  I think that this method would work well for displaying based on different attributes, however, how could I add a legend to the application that would update based on which symbology is visible?  I cannot find any samples or resources that use a legend when the symbology is set in the code and not the feature service.
0 Kudos
JohnGravois
Frequent Contributor
its definitely a little trickier to create legends when you can't rely on the legend resource present in REST which uses the symbology defined for the service layer itself.

if you are hardcoding the renders in your own code perhaps the most straightforward solution would be to prebake the legend images you'd like to display.
0 Kudos
WesleyAskew
New Contributor III
its definitely a little trickier to create legends when you can't rely on the legend resource present in REST which uses the symbology defined for the service layer itself.

if you are hardcoding the renders in your own code perhaps the most straightforward solution would be to prebake the legend images you'd like to display.


Thanks again.  I am trying to avoid having to manually create a legend.  I will probably go with adding multiple feature services for the same feature class, each symbolized appropriately.  I guess that this would be my best bet if setting renderers is my only other option.
0 Kudos