HI ,
Im new to xam map until now i can add element to layers , How i know wich element is cliked ?
thanks
Hi bouhmid86,
Please take a look at the following sample.
XAML:<Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="400"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <ListBox x:Name="lstClickedElement" Height="250" Width="400" Grid.Row="0"/> <igMap:XamMap x:Name="XamMap1" ElementClick="XamMap1_ElementClick" Grid.Row="1"> <igMap:XamMap.Layers> <igMap:MapLayer x:Name="europe" FillMode="RandomSelect"> <igMap:MapLayer.Reader> <igMap:ShapeFileReader Uri="Shapefiles/europe/europe" DataMapping="Name=CNTRY_NAME; Caption=CNTRY_NAME; ToolTip=CURR_TYPE"/> </igMap:MapLayer.Reader> </igMap:MapLayer> </igMap:XamMap.Layers> </igMap:XamMap> </Grid>
CB: private void XamMap1_ElementClick(object sender, MapElementClickEventArgs e) { this.lstClickedElement.Items.Add(String.Format("Clicked on {0}.", e.Element.Caption)); }
Hope that helps,Milana Zhileva