Legend for DynamicLayer

2368
8
01-28-2016 05:16 AM
BrianFoley1
New Contributor II

am trying to create a multi-layer legend for an ArcGISDynamicMapServiceLayer.  I want to be able click on an arrow to drop down to the next level.  The second level has several levels below that, and I also want to be able to click on an arrow to show the final sub-layer.  Now, I'm able to do this, however, on the last sub-layer, I want to show the color and displayname associated with that sub-layer.  This is what my  code looks like :

I can't get the color for the sub-layer to show using <image> tag.  Can anyone provide some help.  Thanks.

Brian

<esri:Legend.LegendItemTemplate>

    <DataTemplate>

       <Button Visibility="Collapsed" Tag="{Binding Label}">

           <Grid>

               <Grid.ColumnDefinitions>

                   <ColumnDefinition/>

                   <ColumnDefinition/>

               </Grid.ColumnDefinitions>

               <Image Grid.Column="0" Source="{Binding ImageSource}" />

               <TextBlock Grid.Column="1" Text="{Binding Label}" />

            </Grid>

       </Button>

    </DataTemplate>

</esri:Legend.LegendItemTemplate>

0 Kudos
8 Replies
AndreaWeeg
New Contributor

how are you setting the ImageSource? if its just a hex color why don't you use a rectangle and fill it with the color instead of using an image control?

0 Kudos
BrianFoley1
New Contributor II

Andrea, I didn't know I had to set the imagesource.  How would I do that ?

0 Kudos
AndreaWeeg
New Contributor

you have to look at the data source, i can't tell from your code what you are binding to..can you share that part of the code?

0 Kudos
BrianFoley1
New Contributor II

Andrea,  the data source is coming from an ArcGISDynamicMapServiceLayer. 

0 Kudos
BrianFoley1
New Contributor II

Andrea,

            It might be better if I send you some code and pictures to better explain what I’m trying to do.  Should I send it to this email or do you have a private email I can send it to ?  Thanks.

Brian

0 Kudos
AndreaWeeg
New Contributor

this email is good. i think is the sublayers that are messing you up but shouldn't be too hard to figure it out

0 Kudos
BrianFoley1
New Contributor II

Andrea, do you have a private email I send my code to ? I don’t feel comfortable putting my code on the forum because one of the ServiceURI links is private and shouldn’t be seen by everyone on the forum.

--Brian

0 Kudos
AndreaWeeg
New Contributor
0 Kudos