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
523
Make Image SymbolElement Clickable
posted

I am currently adding multiple Images and Map Symbols to a Map.   The Map Symbols are clickable and work fine but the Images are not clickable.  Tried messing with setting IsHitTestVisible on the maplayer and even the Image Element but doesn't seem to have any effect. 

Xaml snippet.

        <igMap:XamMap x:Name="xamMap2" Visibility="Collapsed">
            <igMap:XamMap.Layers>
                <igMap:MapLayer x:Name="MapLayer" IsAutoWorldRect="True" Imported="MapLayer_Imported">
                    <igMap:MapLayer.ValueTemplate>
                        <DataTemplate>
                            <Image Width="16" Height="16"
                                     xmlns:local="clr-namespace:Test;assembly=Test"
                                     Source="{Binding Path=(local:MapData.ValueData)}" />
                        </DataTemplate>
                    </igMap:MapLayer.ValueTemplate>
                </igMap:MapLayer>
            </igMap:XamMap.Layers>
        </igMap:XamMap>

In the MapLayer_Imported I loop thru the returned records and add the images.

                'New Element
                element = New SymbolElement()
                element.Name = "Test"

                'Set Position
                element.SymbolOrigin = New Point(20,20))

                'Set Image Path
                MapData.SetValueData(element, New Uri("/Images/" & ImageName, UriKind.Relative))

                element.IsClickable = True
                element.IsSelectable = True
                element.IsSensitive = True

                'Add to Map Layer
                xamMap2.Layers(0).Elements.Add(element)