kev84

How to show ArcGISLocalDynamicMapServiceLayer Symbol in Legend?

Discussion created by kev84 on Oct 2, 2012
Latest reply on Oct 4, 2012 by MBranscomb-esristaff
I followed the online example on dynamically adding raster/shape files into the map. However, the legend does not show allow me to expand the layer to show the symbol that it is using.

Is there a way to show it? The WPF examples that came with the SDK DOES show it, but the layers are part of the map package, and not added dynamically, the template for the legend is the same also. So I have no idea.
Anyone can help me out, that would be great.

    
       <esri:Legend Map="{Binding ElementName=MyMap}"  
                         LayerIDs="USA"
                         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="50" />
                        </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>

Outcomes