MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Bug with Waypoints in Directions

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


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-07-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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)
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??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-20-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-21-2003
Member
Yellow Belt
 
Join Date: Mar 2003
Posts: 41
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 07-21-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
bug, directions, waypoints


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Label Waypoints MD2000 MapPoint 2006/2009 Discussion 10 11-07-2006 02:57 AM
Waypoints to GPS now beta 3 Evert News and Announcements 1 10-05-2003 09:47 AM
problem with waypoints Josemi MapPoint 2006/2009 Discussion 4 04-11-2003 04:22 AM
Fix Waypoints? Anonymous MapPoint 2006/2009 Discussion 0 09-29-2002 06:56 AM
GPS WAYPOINTS Anonymous MapPoint 2006/2009 Discussion 1 09-15-2002 12:34 PM


All times are GMT -5. The time now is 01:21 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Tenerife Holiday
Find a great deal on a Tenerife holiday through UlookUbook! Check out the options online...



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