var itemsInLocation = this.layer.GetItemsInLocation(eventArgs.Location).OfType<PolylineData>();
var clickedItem = itemsInLocation.Last();
}
I get the last item from the items in the clicked location because there could be several polylines. If so, there won't be clear which one is clicked. To determine that you can get the element with the highest ZIndex and if all have the same ZIndex you can get the last one in the collection. This will be the item that is at the top of the order stack of the visual tree.
As a side note, the GetItemsInLocation() method is located in the VisualizationLayer class.
Please try this approach and let me know if it works for you.
Regards,
Martin
Telerik
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