MapPolygon.MouseLeftButtonUp event and clicked location

2 posts, 1 answers
  1. Mrn
    Mrn avatar
    29 posts
    Member since:
    Apr 2011

    Posted 30 Aug 2011 Link to this post


    how could I get the location of the mouse when a shape MouseXButtonUp/MouseXButtonDown event is triggered? In this case, I'd like to know the location clicked for a MapPolygon, in order to display some information in a TextBlock I need to place where the user had clicked... thanks!
  2. Answer
    Andrey avatar
    1681 posts

    Posted 02 Sep 2011 Link to this post

    Hello Mrn,

    You can use the Location.GetCoordinates method to get the location of the mouse when a MouseXButtonUp/MouseXButtonDown event is triggered . The sample code of the MouseLeftButtonDown event handler is below.
    private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
     Point point = e.GetPosition(this.radMap);
     Location location = Location.GetCoordinates(this.radMap, point);

    // ...

    Andrey Murzov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top