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

MapPolygon.MouseLeftButtonUp event and clicked location

1 Answer 33 Views
Map
This is a migrated thread and some comments may be shown as answers.
Mrn
Top achievements
Rank 1
Mrn asked on 30 Aug 2011, 10:42 AM
Hello,

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!

1 Answer, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 02 Sep 2011, 09:16 AM
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);

 
// ...
}

Regards,
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 >>

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