如何在Silverlight中的代码中更改图例颜色:
<esri:Map x:Name="Map" Background="White" Loaded="Map_Loaded" WrapAround="True" Grid.ColumnSpan="3"
MouseClick="Map_MouseClick" >
<esri:ArcGISDynamicMapServiceLayer x:Name="gisdynamic" ID="gisdynamic"
Url="http://192.168.10.1:6080/arcgis/rest/services/babolsar/Babolsar10/MapServer"
DisplayName="نقشه بابلسر" DisableClientCaching="true" Initialized="Map_Initialized" InitializationFailed="layer_InitializationFailed"
DynamicLayerInfos="{x:Null}" ImageFormat="PNG24" LayerDrawingOptions="{x:Null}" ProxyURL="{x:Null}" />
<esri:GraphicsLayer ShowLegend="false" ID="ResultsGraphicsLayer" />
<esri:GraphicsLayer ShowLegend="false" ID="MyGraphicsLayer" />
<esri:GraphicsLayer ShowLegend="false" ID="MySelectionGraphicsLayer" MouseEnter="GraphicsLayer_MouseEnter" MouseLeave="GraphicsLayer_MouseLeave"/>
<esri:GraphicsLayer ShowLegend="false" ID="IdentifyIconGraphicsLayer"/>
<esri:Legend Name="Legend" HorizontalAlignment="Left" Background="White" Foreground="White"
`enter code here` VerticalAlignment="Top" Margin="0,0,0,0" Width="300"
Map="{Binding ElementName=Map}"
LayerItemsMode="Tree" ShowOnlyVisibleLayers="false" Refreshed="Legend_Refreshed">
<esri:Legend.MapLayerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" >
</CheckBox>
<Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="100" />
</StackPanel>
</DataTemplate>
</esri:Legend.MapLayerTemplate>
<esri:Legend.LayerTemplate>
<DataTemplate>
<CheckBox Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" >
</CheckBox>
</DataTemplate>
</esri:Legend.LayerTemplate>
</esri:Legend>
答案 0 :(得分:0)
关于图例颜色和字体更改,以下链接将帮助您..您只是访问它
http://support.esri.com/es/knowledgebase/techarticles/detail/38761