Select to view content in your preferred language

GraphicsLayer SimpleFillSymbol + Label

3110
4
Jump to solution
09-19-2013 05:59 AM
JustinHunter
Regular Contributor
Hey all,

I'm fairly new at Silverlight so I apologize in advance if this is a stupid question. I'm looking to be able to use a simple fill on my polygons but I'd also like to add a label to them and I can't seem to figure out how to do so... My renderer uses a field called "total_amt" to determine which colour of fill to use.

Thanks
0 Kudos
1 Solution

Accepted Solutions
JohanCarlsson
Regular Contributor
So you want a label visualized on top of the polygon in your map view, not a label in the map contents? I am not too familiar with bindings in xaml unfortunately, but perhaps this can help you.

View solution in original post

0 Kudos
4 Replies
JohanCarlsson
Regular Contributor
As far as I know only renderers have the label attribute available. Could you describe your problem a bit more? Is "total_amt" an attribute of your graphics? How do you represent your color? ARGB, string or something else?
0 Kudos
JustinHunter
Regular Contributor
Each graphic has multiple attributes - total_amt is one of them...

I have a ClassBreaksRenderer that uses total_amt as the field
<esri:ClassBreaksRenderer x:Key="MyClassBreaksRenderer" Field="total_amt">
    <esri:ClassBreaksRenderer.Classes>
        <esri:ClassBreakInfo MinimumValue="0" MaximumValue="50" Symbol="{StaticResource LowFillSymbol}"  Label="$0 - $50" />
        <esri:ClassBreakInfo MinimumValue="50" MaximumValue="100" Symbol="{StaticResource MediumFillSymbol}" Label="$50 - $100" />
        <esri:ClassBreakInfo MinimumValue="100" MaximumValue="1000000" Symbol="{StaticResource HighFillSymbol}" Label="$100+" />
    </esri:ClassBreaksRenderer.Classes>
</esri:ClassBreaksRenderer>

but it'd be great if the graphic could also show a label based off the attribute: name
0 Kudos
JohanCarlsson
Regular Contributor
So you want a label visualized on top of the polygon in your map view, not a label in the map contents? I am not too familiar with bindings in xaml unfortunately, but perhaps this can help you.
0 Kudos
JustinHunter
Regular Contributor
That geometry service and adding a dynamic label would likely do the trick. Thanks - didn't even think about that.
0 Kudos