View Single Post

  #2 (permalink)  
Old 01-02-2004
NickS's Avatar
NickS NickS is offline
Junior Member
White Belt
 
Join Date: Nov 2003
Posts: 10
Try This...

Place a MapPoint control on the form, and then add the following code to the 'Form1_Load':
Code:
Try
  MappointControl.NewMap(MapPoint.GeoMapRegion.geoMapEurope)
Catch ex As Exception
  MessageBox.Show(ex.Message)
End Try
(In this example the control on the form is called 'MappointControl'.)

You may want to try adding this code to a button to move to a specified lat/lon...
Code:
Dim objmap As MapPoint.Map
Dim objLoc As MapPoint.Location
Dim dblLat, dblLon As Double

dblLat = Val(txtLat.Text) 'Or just put numbers here if no textboxes
dblLon = Val(txtLon.Text)

objmap = MappointControl.ActiveMap
objLoc = objmap.GetLocation(dblLat, dblLon, Val(txtAlt.Text))
objLoc.GoTo()
(This uses three textboxes - txtLat,txtLon, and txtAlt for the lat,lon,and altitude for viewing the map.)

Hope this helps...

Nick
Reply With Quote