Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This should be simple, but I cannot find any documentation on how to do it. I have a legend that is bound to my map that contains several layers. I do not want all of the layers to appear on my Legend so I am using LayerIDs. The problem is that I do not know how to use multiple ones in the LayerIDs. Below is my code:


<esri:Legend Map="{Binding ElementName=MyMap}"
                         LayerIDs="CalvertCity, WaterValves"
                            <StackPanel Orientation="Horizontal">
                                <CheckBox Content="{Binding Label}"
                                    IsChecked="{Binding IsEnabled, Mode=TwoWay}"
                                    IsEnabled="{Binding IsInScaleRange}" >
                                <Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
                            <CheckBox Content="{Binding Label}"
                            IsChecked="{Binding IsEnabled, Mode=TwoWay}"
                            IsEnabled="{Binding IsInScaleRange}" >


<esri:Map x:Name="MyMap" Background="#FFE3E3E3" WrapAround="True"  MouseRightButtonDown="MyMap_MouseRightButtonDown" Extent="-9834972.92753924,4441899.425293319,-9833977.88119163, 4442762.485358352">
                    <esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="" />
                    <esri:GraphicsLayer ID="CandidateGraphicsLayer">
                                <Rectangle Stroke="Gray"  RadiusX="10" RadiusY="10" Fill="#77FF0000" Margin="0,0,0,5" >
                                <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
                                <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="30,20,30,30">
                                    <TextBlock Text="{Binding [Address]}" HorizontalAlignment="Left" Foreground="Black" />
                    <esri:ArcGISDynamicMapServiceLayer ID="CalvertCity" Url="http://localhost:6080/arcgis/rest/services/CalvertCity_Test_2/MapServer"/>
                    <esri:FeatureLayer ID="WaterValves" Url="http://localhost:6080/arcgis/rest/services/CalvertCity_Test_2/MapServer/0" Renderer="{StaticResource MySimpleRenderer}"
                                                  OutFields="WVAL_ID,SIZE,WVAL_USE,WVAL_TYPE,OPENS,TURNS" MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp"/>

If you need any more information, just let me know. I will appreciate any help. Thank you in advance.

share|improve this question

Well it seems that I accidentally answered my own question haha. I put the comma in there to explain that I wanted both of those layers and that is actually how you do it. WOW. That is why coding is fun.

LayerIDs="CalvertCity, WaterValves"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.