View Single Post

  #2 (permalink)  
Old 01-21-2004
Matrices Matrices is offline
Member
Yellow Belt
 
Join Date: Sep 2003
Posts: 44
Here's what I use to do that
Code:
Dim sa As MapPoint.SelectedArea
        Dim dbllat As Double
        Dim dbllon As Double
        sa = objmap.SelectedArea

        objloc = objmap.XYToLocation(sa.Left, sa.Top)
        CalcPos(objmap, objloc, 1)
        objloc = objmap.XYToLocation(sa.Left + sa.Width, sa.Top + sa.Height)
        CalcPos(objmap, objloc, 2)
It gets the top left of the square, assigns it to a location object and then uses the code in the article below to obtain the long and lat, then does it again for the bottom right corner (got by taking the left and adding the width to it and the top and adding the height, I know in theory you should subtract the height from the top but heh it works!! )

http://www.mp2kmag.com/articles.asp?...xtract.lat.lon

M
Reply With Quote