Context Menu on Polygon

2 posts, 0 answers
  1. Amit
    Amit avatar
    1 posts
    Member since:
    Aug 2015

    Posted 06 Aug 2015 Link to this post


    I ​have loaded multiple polygons from SQL on a bing map and have a context menu for the polygons on the information layer.

    However, I cant find any way to bind and get the unique id of the clicked polygon.

    <telerik:InformationLayer x:Name="infoLayer" >
                        <telerik:SqlGeospatialDataReader Source="{Binding SpatialData}" x:Name="Data"
                                                         ToolTipTemplate="{StaticResource ToolTipDataTemplate}"
                        <ContextMenu x:Name="PolygonMenu">
                            <MenuItem Header="Menu Item 1" Command="{Binding Path=PolygonSelectedCommand}"
                                      CommandParameter="{Binding ElementName=infoLayer,Path=????}"/>
                        <telerik:MapShapeFill Fill="Transparent"  Stroke="Red" StrokeThickness="1" />
                        <telerik:MapShapeFill Fill="#b2FFFFFF"  Stroke="Red" StrokeThickness="1" />


  2. Evgenia
    Evgenia avatar
    1398 posts

    Posted 11 Aug 2015 Link to this post

    Hi Amit,

    Since RadMap shapes like MapPolyline, MapPolygon and etc. does not support context menu out-of-the-box I highly recommend that you use the approach my colleague Andrey demonstrated in this forum post. (as you will see we add the context menu to the RadMap itself and not the Information Layer). I believe that you would be able to find the clicked polygon from MenuItemClicked event args.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top