Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
715
map.ElementClick event not firing
posted

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>

                </igMap:MapLayer>

 

 

                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