Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
420
Mouse Coordinates
posted

How do I find the geographic coordinates of the mouse when it is over the xamGeographicMap? I need to know when the user clicks on a specific ShapefileRecord. the xamGeographicMap.MouseLeftButtonDown doesn't return this information. If I can just get the coordinates of the mouse at the time, I can figure it out myself.

Thanks.

Parents
No Data
Reply
  • 22015
    Verified Answer
    posted

    Hello RVassar,

     

    Thank you for your post!

     

    I have been looking into your question. You can get the mouse coordinates using the GetPosition method of the MouseButtonEventArgs from the PreviewMouseLeftButtonDown event. You can use the following line:

                var mousePosition = e.GetPosition(this.GeoMap);

     

    Also, I can suggest to take a look at our samples browser, that is installed on your computer together with our controls. In the section for the XamGeographicMap you would be able to find a sample, names "Map Crosshair", where it is shown, how to get Longitude, Latitude and X and Y coordinates.

     

    Please do not hesitate to let me know if you have any further questions on this matter.

Children