Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Bug with Waypoints in Directions

This is a discussion on Bug with Waypoints in Directions within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have a COM addin I have written that iterates through the directions on a route. For each direction it ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002

    Bug with Waypoints in Directions

    I have a COM addin I have written that iterates through the directions
    on a route. For each direction it selects the direction, makes the map
    jump to that direction, zooms out, then copies the map image to the
    clipboard. I then use a VB ActiveX control to save the image as a JPG.
    I end up with a bunch of html pages, each a direction, with a small
    JPG map for each. I then transfer these onto my PDA for "Pocket
    Directions". The code looks something like ...

    iCurrentDirection = iCurrentDirection + 1
    Set objDirection =
    appMapPoint.ActiveMap.ActiveRoute.Directions(iCurr entDirection)
    Picture1.Picture = Clipboard.GetData
    SavePicture Picture1, strOutDir & "\" & strName & "\step" &
    iCurrentDirection & ".bmp"
    ' code to open bmp in ActiveX control then save it as a jpg

    It works if I have directions that are point to point, but I have
    found a bug with the GoTo method when I add a waypoint. If I have 10
    directions, and there is a waypoint at direction 5, when I go to
    direction 6 and call
    appMapPoint.ActiveMap.ActiveRoute.Directions(6).Lo cation.Goto instead
    of displaying the map for direction 6, it goes back to the start and
    shows the map for direction 1. I have also tried using the WayPoints
    collection and the SegmentDirections collection (breaking my
    directions up into the Waypoint segments) like so ...

    appMapPoint.ActiveMap.ActiveRoute.Waypoints(2).Seg mentDirections(1).Location.GoTo

    but it has the same result as above - instead of jumping to the map
    which is the first direction after the waypoint (direction 6) it jumps
    to the map for direction 1.

    Has anyone else seen problems with this method and it's behaviours
    with Waypoints??

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    I've noticed the same thing but by trying to attempt something a little different.
    I also have a COM add-in that iterates the directions within a route and sends thhe directions location to a GPS. When I added a stop on the route via a pushpin/waypoint things went horribly wrong after the waypoint.

    I eleminated the GPS element out of the problem by doing the following.
    The COM component adds pushpins to the map at the directions locations.
    When this is a start & finish all is well.
    When, however, there's a stop involved the locations for the directions afer the stop are littered around the route start.

    Is the a MS bug or just a dumb arse me programming wrong!

    Code as follows

    Private Sub cmdPushpins_Click()
    On Error GoTo Trap
    Dim oWpt As Waypoint
    Dim oRoute As Route
    Dim oMap As Map

    Set oRoute = g_oApp.ActiveMap.ActiveRoute
    If Not oRoute Is Nothing Then
    Set oMap = g_oApp.ActiveMap
    Dim oDir As Direction
    Dim sInstruction As String
    Dim oPushPin As Pushpin
    For Each oDir In oRoute.Directions
    sInstruction = oDir.Instruction
    Set oPushPin = oMap.AddPushpin(oDir.Location, oDir.Instruction)
    End If
    Exit Sub
    MsgBox Err.Description
    End Sub

  3. #3
    Labtek is offline Member Yellow Belt
    Join Date
    Mar 2003

    This is something that I've been struggling with for months now in my program (http://www.hypercubed.com/projects/coordex/). Like you said when the route has any waypoints (other then start and stop) the directions after the first stop are all screwed. The way I get around this problem is to store all the waypoint locations in an array, clear the route, calculate a route between each pair of waypoints and extract the directions in between This helps quite a bit but even then some of the directions are not right. I use a modified version of Gilles Kohl's CalcPos to get the position of each direction but sometimes the result is way off. It is still something I'm working on.


  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Not a bad idea!

    Something also for the pot!

    If you do say Guildford -> Portsmouth (say) with a Waypoint half way down the A3 all ok.

    Do reverse i.e Portsmouth -> Guildford (leaving previous waypoint as before).

    Gibberish! Perhaps it's designed to stop us "southerners" go up t'north like!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Label Waypoints
    By MD2000 in forum MapPoint Desktop Discussion
    Replies: 10
    Last Post: 11-07-2006, 03:57 AM
  2. Waypoints to GPS now beta 3
    By Evert in forum News and Announcements
    Replies: 1
    Last Post: 10-05-2003, 10:47 AM
  3. problem with waypoints
    By Josemi in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-11-2003, 05:22 AM
  4. Fix Waypoints?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-29-2002, 07:56 AM
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-15-2002, 01:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127