Ok, I've several questions.

1) If it's possi....

Anonymous
12-10-2001, 10:32 AM
Ok, I've several questions.



1) If it's possible, how can I retrieve all points (lat/lon) that belong to the road network?

2) Again, if it's possible and from what I understood from my last question, how can I find a route between two points? What kind of struture will be the output? Does it contains what kind of roads are each segment?

3) Does anyone can share with me some similar code that does what I pretend?



Oh... And thanks for your feedback!

Walt Cygan
12-10-2001, 10:32 AM
Let me answer 2) first. The easiest way to get familiar with the object model for routes is to create a VB app with the MapPoint ActiveX control called "ctlMapPoint" and a Command button called "cmdTest", create a route on the map and step through the following code:


Private Sub cmdTest_Click()

On Error GoTo ErrSub

Dim objRoute As MapPointCtl.Route

Dim objWP As MapPointCtl.Waypoints

Dim objDir As MapPointCtl.Directions

Set objRoute = ctlMapPoint.ActiveMap.ActiveRoute

Set objWP = objRoute.Waypoints

Set objDir = objRoute.Directions

ExitSub:

Set objDir = Nothing

Set objWP = Nothing

Set objRoute = Nothing

Exit Sub

ErrSub:

Resume ExitSub

End Sub


Each step in the driving direction contained in objDir has a location object as a property. You can then get lat/lon using Gilles Kohl's code available here (http://www.mp2kmag.com/articles.asp?ArticleID=13).


It doesn't appear to me as if the type of road for each segment is generated. MapPoint must have that information internally for the cost calculation, but it does not appear in the direction object.


- Walt Cygan (http://www.mp2kmag.com/author.asp?id=9)

 
Web mp2kmag.com
mapforums.com