MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




problem with waypoints

This is a discussion on problem with waypoints within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I'm using mappoint (Europe, in spanish) from VB 6, trying the following code: mp1 is a mappoint control in ...


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

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 03-31-2003
Junior Member
White Belt
 
Join Date: Mar 2003
Posts: 5
problem with waypoints

Hi, I'm using mappoint (Europe, in spanish) from VB 6, trying the following code:

mp1 is a mappoint control in the form

Code:
    For l = 1 To mp1.ActiveMap.ActiveRoute.Waypoints.Count
        g_dbPalmera.Execute "insert into Ped_Rutas(pru_Lugar,pru_Numero) values('" & _
            LegalizarComillas(mp1.ActiveMap.ActiveRoute.Waypoints.Item(l).Name) & "'," & SomeNumber & ")"
    Next l
I'm looping through the waypoints and saving them in a table. Later, I read those names and create a route in the map, with this code:

Code:
    mp1.ActiveMap.ActiveRoute.Clear
    If Not (m_rsLineasRuta.EOF And m_rsLineasRuta.BOF) Then
        m_rsLineasRuta.MoveFirst
        While Not m_rsLineasRuta.EOF
            mp1.ActiveMap.ActiveRoute.Waypoints.Add mp1.ActiveMap.FindPlaceResults(m_rsLineasRuta("pru_Lugar")).Item(1)
            m_rsLineasRuta.MoveNext
        Wend
        m_rsLineasRuta.MoveFirst
        mp1.PaneState = geoPaneRoutePlanner
    End If
The problem is: The user enters a place in the route planner, for example "Le Havre", and finds "Le Havre, Alta Normandía, Francia". Now he adds it to the route, and in the route it looks "El Havre", which is what the first loop above reads in mp1.ActiveMap.ActiveRoute.Waypoints.Item(l).Name and saves to the database. When the second loop above reads the database, mp1.ActiveMap.FindPlaceResults("El Havre").Item(1) can't find the place the user entered the first time. It finds "El Haméré" instead.
Can anyone please tell me what am I doing wrong?

Thanks in advance.
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 04-03-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
RE: problem with waypoints

The problem is that you're providing to little information to the FindPlaceResults method, I mean, you're only giving it the name of the place and, in this case, that is not enough to get a direct hit to the correct location you're looking for. As you explained in your previous post, the user is actually adding "Le Havre, Alta Normandía, Francia" but the waypoint is saved only as "Le Havre"; without the country and region information the FindPlaceResults will have trouble to give you what you want.
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 04-07-2003
Junior Member
White Belt
 
Join Date: Mar 2003
Posts: 5
Thanks for your reply.
What I'm passing to FindPlaceResults is what I get from the route. I mean, the user adds a place to the route using the search, and chooses "le Havre...". I (my VB code) still know nothing, cause it's done inside the MapPoint control. When the user has added all the points and calculates the route, I catch the event and loop through the waypoints to save them into my database. In that loop, I don't find "Le Havre..." (the full name) but "El Havre" (short, and translated to spanish).
I need a way to find the exact names of the places the user entered in the route, to save them in my DB and be able to find them later.
It would be even better if the places had an unique numeric code, but I don't they the have.
Sorry for my bad english, and thanks again for helping.

José C.
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 04-07-2003
Junior Member
Yellow Belt
 
Join Date: Mar 2003
Posts: 12
Work around

When you save the stops on the route, you can also save their longitude and latitude. (Search this site and you will find a good way to do this.) Then when you want to create the route on the map, you can use the following code:

.
.
.
Set objLocation = GetLocation(recordset!Latitude, recordset!Longitude)
Set objPin=objMap.AddPushPin(objLocation,recordset!Nam e)
Set objWayPoint=objMap.ActiveRoute.Waypoints.Add(objPi n)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-11-2003
Junior Member
White Belt
 
Join Date: Mar 2003
Posts: 5
Tanks!

Thanks, found it and now it works fine.

José C.
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
problem, 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 03:57 AM
Waypoints to GPS now beta 3 Evert News and Announcements 1 10-05-2003 10:47 AM
Bug with Waypoints in Directions Anonymous MapPoint 2006/2009 Discussion 3 07-21-2003 04:02 PM
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


All times are GMT -5. The time now is 11:06 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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