Select to view content in your preferred language

dynamic add map tip in feature layer

2843
1
08-20-2012 04:45 PM
ForamParikh
Regular Contributor
Hello every one,

I want to display map tip dynamically.
does any one know how to implement it?
I tried
<Grid x:Name="layoutroot">
        <Grid.Resources>
            <DataTemplate x:Key="myLabel" >
                <Border Background="White" >
                    <StackPanel>
                        <TextBlock Text="testing " />
                        <TextBlock Text="{Binding [name]}" FontSize="8" Foreground="Red" />
                    </StackPanel>
                </Border>
            </DataTemplate>

in code behind

  FeatureLayer Watersheds_Query = new FeatureLayer();
                Watersheds_Query.Url = "http://pipelineforthefuture.org/ArcGIS/rest/services/LAWEP/Watersheds_Query/MapServer/0";
                Watersheds_Query.Opacity = 1.0;
                Watersheds_Query.ID = "Watersheds_Query";
                Watersheds_Query.OutFields.Add("*");
                Watersheds_Query.MapTip = new ContentControl() { ContentTemplate = (DataTemplate)layoutroot.Resources["myLabel"] };
               
                Watersheds_Query.UpdateCompleted += new EventHandler(alllayer_UpdateCompleted);
                MyMap.Layers.Add(Watersheds_Query);   

I can see testing in web page but i want value as well.

Please help,
Thanks
Foram
0 Kudos
1 Reply
FilipJung
Frequent Contributor
0 Kudos