View Single Post

  #2 (permalink)  
Old 04-19-2004
brianmcg brianmcg is offline
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 17
Send a message via ICQ to brianmcg
re: Converting points to lines

You could try something like this (pseudo VB code):

' assuming an array of your GPS latitudes 'aLat', and longitudes 'aLong'

dim aObjLocs(0 to Ubound(aLat)) as MapPoint.Location

' now create an array of location objects - one for each GPS fix

For n = 0 to Ubound(aLat)
Set aObjLocs(n) = objMap.GetLocation(aLat(n),aLong(n))
Next n

' now turn the array of locations into a polyline

objMap.Shapes.AddPolyline aObjLocs

You'd use the objMap.Shapes.Item(x).Vertices to retrieve and work with the array of locations that make up the Polyline, assuming 'x' is the item in the Shapes collection that you just added. Get this by calling objMap.Shapes.Count right after you call the AddPolyline method.

Note: Don't expect this code to work first time. I've probably left out a few things, but it gives the sense of a method that you could try.
Reply With Quote