spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2013
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2013

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
SVG Tutorials
MapPoint

Map Visitors

  MAPPOINT Q & A  

Top | Post New Question | Read All | MP2K Asks Microsoft

533 Ricardo Ferrao - December 10, 2001

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!

Answer:

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.

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

Post New Answer / Follow-up


Google
 
MP2Kmag Internet


 Recent Discussion
 Resources


Want Your Site To Appear Here?

   © 1999-2012 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009/2010/2011/2013 are either trademarks or registered trademarks of Microsoft.