Select to view content in your preferred language

Silverlight 5 c# how to capture the layer on i was clicked

683
1
06-18-2013 10:40 PM
CETECK_SOLARCETECK_SOLAR
New Contributor
i have the next problem, i'm making one app in silverlight 5 c# whit sdk Esri and i have de the XAML

<Grid x:Name="LayoutRoot" >
     <Grid.ColumnDefinitions>
            <ColumnDefinition Width="196*"/>
            <ColumnDefinition Width="7*"/>
            <ColumnDefinition Width="197*"/>
      </Grid.ColumnDefinitions>

     <esri:Map WrapAround="True" x:Name="MyMap"  Extent="-1082593,4487171,742111,5174493" ZoomFactor="4.0" Grid.ColumnSpan="3"/>

</Grid>


and the nextc c# code

 public MainPage()
    {
        InitializeComponent();

        var myLayer = new ArcGISDynamicMapServiceLayer();
        myLayer.Url = "http://192.168.1.165:6080/arcgis/rest/services/Myservice/";
        myLayer.ID = "servicioWeb";
        myLayer.Initialize();
        MyMap.Layers.Add(myLayer);

        MyMap.MouseClick += MyMap_MouseClick;        
    }

    void MyMap_MouseClick(object sender, Map.MouseEventArgs e)
    {
       I NEED HELP
    }



what code i have to put for catch the clic on ArcGISDynamicMapServiceLayer´s layer?(i my map service have Type: Raster Layer and Type: Feature Layer) I saw a lot of examples but only i saw examples with featureLayer and graphics.
Exists another option to get the map hosted in my arcgis server?.


Thanks for all.

Regards.
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
As, with an ArcGISDynamicMapServiceLayer, nothing is loaded at client side (except an image), you have to query the server to get informations about the underlying features.
You can look at the Identify sample.
0 Kudos