Hi,
I use XamMap with two layers (.shp file layer and SymbolLayer)
The map.ElementClick event gets fired for the SurfaceElements in the shape file, but not for the elements in the symbollayer.
<igMap:MapLayer x:Name="shpLayer" DataMapping="Name=MicroMarket; Value=MetricValue" ToolTip="custom tooltip: {Value}" FillMode="Chloropleth" Imported="MapLayer_Imported">
<igMap:MapLayer.Reader>
<igMap:ShapeFileReader Uri="shapefile" DataMapping="Name, Caption=Id" />
</igMap:MapLayer.Reader>
</igMap:MapLayer>
<igMap:MapLayer x:Name="symbolLayer" VisibleFromScale="55" >
<igMap:MapLayer.ValueTemplate>
<DataTemplate>
<Image Source="{Binding ImageUrl}" ToolTipService.ToolTip="{Binding ToolTip}" />
</DataTemplate>
</igMap:MapLayer.ValueTemplate>
map.ElementClick += (s, e) =>
{
if (e.Element != null && e.Element is SymbolElement)
//doesn't come here :(
}
if (e.Element is SurfaceElement)
MessageBox.Show(string.Format("You clicked surface element {0}", e.Element.Name));
};
If I add an eventhandler on the Image_MousLeftButtonDown for the image it works, but I rather have the map.ElementClick because I want to add the event in another class where I have access to the map and I can handle the clicks in one cosistent way.
Thanks in advance
Hi, vamsi2654,
Please, find attached a sample application () for the MapElementClick's firing. The only thing that needs to be done in order to get it working is to add Infragistics dlls.
Feel free to write back should you need any further information.
Best regards,Milana Zhileva
Hello,
Infragistics Team
We purchased new version 11.1 and still the click for symbol element is not firing when we use mapelemnt_click. we set all the other properties issensitivity = true, isselected=true and isclickable=true. Can you please help us in this one. The new service release you are talking about is included for 11.1? if yes, please help us in firing event.
Regards,
Vamsi.
Hi Ivan,
It works now!
Thanks
Hi Roel,
I have tested the same version and it seems to work. Could you check if MapLayer's and SymbolElements's IsSensitive is set to true. If it is set to false then XamMap doesn't rise the ElementClick event.
Ivan Kotev