[mapguide-users] Re: MaestroAPI 3 or 4 - How do I get corner coordinates of a RuntimeMap

Hans Milling hm at geograf.dk
Thu Dec 15 05:52:49 EST 2011


Thank you both for your help. It is for a simple test application. I made
this MouseMove event on a PictureBox that holds the map image. This is how
my solution looks then:


private void pictureBox1_MouseMove(object sender, MouseEventArgs e)

{

  int centerx = pictureBox1.Width / 2;

  int centery = pictureBox1.Height / 2;

  double ratio = 0.0254 / map.DisplayDpi * map.ViewScale;

  int x = (int)(map.ViewCenter.X + ((e.X - centerx)*ratio));

  int y = (int)(map.ViewCenter.Y - ((e.Y - centery)*ratio));

  ssx.Text = x.ToString();

  ssy.Text = y.ToString();

}



Hans...

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/MaestroAPI-3-or-4-How-do-I-get-corner-coordinates-of-a-RuntimeMap-tp7093318p7096708.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20111215/c1a4028e/attachment.html


More information about the mapguide-users mailing list