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
135
XamMap Create Window By ElementClick
posted

Hello,

I have a XamMap with a layer which consists of a number of points and I need to output a dialog at this point's position by ElementClick. I can get WorldRect of the clicked MapElement. How can I convert it to window coordinates? Or is there any other way to get coordinates of the clicked point?

Thank you.

Parents
No Data
Reply
  • 2505
    Suggested Answer
    Offline posted

    Hi Sergey,

    The following article provides information on point coordinates projecting to xamMap: link.

    In your case, you want to unproject the coordinates, so UnprojectFromMap could be used, for example:
          private void theMap_ElementClick(object sender, MapElementClickEventArgs e)
            {
                Point pt1 = theMap.MapProjection.UnprojectFromMap(new Point(e.Element.SymbolOrigin.X, e.Element.SymbolOrigin.Y));
           ...
            }

    Best Regards,
    Milana Zhileva

Children