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

570 david - January 7, 2002

Thanks for the useful article about linking mappoint with access to retrive driving directions and map but i was wondering is it possible to gain directions by using just a postal code as not all addresses have street names.

Answer:

Use the FindResults method. Try:

Dim oPush(1 To 2) As MapPointCtl.Pushpin
Dim oLoc(1 To 2) As MapPointCtl.Location
Dim oMap As MapPointCtl.Map
Dim oRoute As MapPointCtl.Route
Dim distance As Double

    Set oMap = ctlMapPoint.ActiveMap
    Set oLoc(1) = oMap.FindResults("SW1X 7XL, United Kingdom")(1)
    Set oLoc(2) = oMap.FindResults("SW1P 4RG, United Kingdom")(1)

    If Not oLoc(1) Is Nothing Then
        Set oPush(1) = oMap.AddPushpin(oLoc(1))
        oPush(1).GoTo
        oPush(1).Highlight = True
        If Not oLoc(2) Is Nothing Then
            Set oPush(2) = oMap.AddPushpin(oLoc(2))
            oPush(2).GoTo
            oPush(2).Highlight = True

            Set oRoute = oMap.ActiveRoute
            oRoute.Clear
            oRoute.Waypoints.Add oLoc(1)
            oRoute.Waypoints.Add oLoc(2)
            oRoute.Calculate
            MsgBox CStr(oRoute.distance)
        End If
    End If

- 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.