Community of VE/MapPoint Users and Developers
This is a discussion on Bug with Waypoints in Directions within the MapPoint 2006/2009 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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Bug with Waypoints in 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) objDirection.Select objDirection.Location.GoTo objMap.ZoomOut objMap.CopyMap 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?? |
| |||
|
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) Next End If Exit Sub Trap: MsgBox Err.Description End Sub |
| |||
|
Richard, 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. Hypercubed www.hypercubed.com |
| |||
|
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! |
![]() |
| Tags |
| bug, directions, waypoints |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Label Waypoints | MD2000 | MapPoint 2006/2009 Discussion | 10 | 11-07-2006 03:57 AM |
| Waypoints to GPS now beta 3 | Evert | News and Announcements | 1 | 10-05-2003 10:47 AM |
| problem with waypoints | Josemi | MapPoint 2006/2009 Discussion | 4 | 04-11-2003 05:22 AM |
| Fix Waypoints? | Anonymous | MapPoint 2006/2009 Discussion | 0 | 09-29-2002 07:56 AM |
| GPS WAYPOINTS | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-15-2002 01:34 PM |