This is a migrated thread and some comments may be shown as answers.

Clicking Stacked Map Items

1 Answer 51 Views
Map
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 16 Dec 2011, 09:01 PM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 21 Dec 2011, 04:12 PM
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 >>

Tags
Map
Asked by
Christopher
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or