public Symbol GetSymbol(Graphic graphic) { if (graphic != null && UVR.Attribute != null) { if (graphic.Attributes.ContainsKey(UVR.Attribute)) { object objValue = graphic.Attributes[UVR.Attribute]; foreach (UniqueValueInfo info in UVR.Infos) { if (info.Value == objValue || objValue != null && info.Value != null && objValue.GetHashCode() == info.Value.GetHashCode()) return info.Symbol; } } } return UVR.DefaultSymbol; }
<esri:UniqueValueRenderer x:Name="UniqueValueRenderer" Attribute="LEASELEFT" > <esri:UniqueValueRenderer.DefaultSymbol> <esriSymbols:SimpleFillSymbol Fill="Blue" BorderBrush="Green" BorderThickness="2"/> </esri:UniqueValueRenderer.DefaultSymbol> <esri:UniqueValueInfo > <esri:UniqueValueInfo.Value> <sys:Int32>1</sys:Int32> </esri:UniqueValueInfo.Value> <esri:UniqueValueInfo.Symbol> <esriSymbols:SimpleFillSymbol Fill="Red" BorderBrush="Green" BorderThickness="2"/> </esri:UniqueValueInfo.Symbol> </esri:UniqueValueInfo> </esri:UniqueValueRenderer>
<esri:FeatureLayer ID="MyFeatureLayer" Url="Map layer url" Renderer="{StaticResource UniqueValueRenderer}" />
<esri:UniqueValueRenderer x:Key="MyRenderer" Attribute="ftype"> <esri:UniqueValueRenderer.DefaultSymbol> <esri:SimpleMarkerSymbol Color="Blue" Size="10" Style="Circle"/> </esri:UniqueValueRenderer.DefaultSymbol> <esri:UniqueValueInfo > <esri:UniqueValueInfo.Value> <sys:Int32>10901</sys:Int32> </esri:UniqueValueInfo.Value> <esri:UniqueValueInfo.Symbol> <esri:SimpleMarkerSymbol Color="Yellow" Size="10" Style="Diamond"/> </esri:UniqueValueInfo.Symbol> </esri:UniqueValueInfo> </esri:UniqueValueRenderer>
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.