Clicking Stacked Map Items

2 posts, 1 answers
  1. Christopher
    Christopher avatar
    5 posts
    Member since:
    Aug 2012

    Posted 16 Dec 2011 Link to this post

    I have a RadMap that has items added to an information layer. Sometimes these items overlap or they are in the exact same position making it impossible to click the item underneath. Is there support for finding all the items underneath a mouse click?
  2. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 21 Dec 2011 Link to this post

    Hi Christopher,

    You can use the InformationLayer.GetItemsInLocation method to get all items under the mouse pointer. The sample code is below.
    private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        Point point = e.GetPosition(this.radMap);
        Location location = Location.GetCoordinates(this.radMap, point);
        IEnumerable<object> items = this.informationLayer.GetItemsInLocation(location);
        foreach (object item in items)
        {
            // ...
        }
    }

    All the best,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top