View Single Post

  #5 (permalink)  
Old 07-31-2002
Anonymous Anonymous is offline
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
First you need to read/download the code written by Gilles Kohl "A More Compact Method for Obtaining Lat/Long " at


http://www.mp2kmag.com/articles.asp?ArticleID=13



cut/paste that code into a module. Make sure you have a reference to the Microsoft Mappoint 9.0 object Library(North America)



Assuming you have a shape on your map this code will give you a message box with the Lat/Long for the shape. Store them in you database. When you want to recreate the shape use the GetLocation method with your lat/long. Then use the addshape method. You will also need the size you want the shape to be so you might want to store that as well.



Public thelat As Double

Public thelon As Double


Private Sub Command1_Click()

Dim iShape As MapPointCtl.Shape

Set iShape = MappointControl1.ActiveMap.Shapes(1)



Dim themap As MapPoint.Map

Set themap = MappointControl1.ActiveMap

Dim theloc As MapPoint.Location

Set theloc = iShape.Location


CalcPos themap, theloc, thelat, thelon

MsgBox thelat & " , " & thelon


John

john@support-pc.com
Reply With Quote