Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| problem with waypoints 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
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
Can anyone please tell me what am I doing wrong? Thanks in advance. |
| |||
| 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. |
| |||
|
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. |
| |||
| 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) |
![]() |
| Tags |
| problem, 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 |
| 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 |