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 5 of 5

problem with waypoints

This is a discussion on problem with waypoints within the MapPoint Desktop 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 ...

  1. #1
    Josemi is offline 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.

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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.

  3. #3
    Josemi is offline 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.

  4. #4
    Bob Chase is offline Junior Member Yellow Belt
    Join Date
    Mar 2003
    Posts
    13

    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)

  5. #5
    Josemi is offline Junior Member White Belt
    Join Date
    Mar 2003
    Posts
    5

    Tanks!

    Thanks, found it and now it works fine.

    José C.

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, 02:57 AM
  2. Waypoints to GPS now beta 3
    By Evert in forum News and Announcements
    Replies: 1
    Last Post: 10-05-2003, 09:47 AM
  3. Bug with Waypoints in Directions
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 07-21-2003, 03:02 PM
  4. Fix Waypoints?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-29-2002, 06:56 AM
  5. GPS WAYPOINTS
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-15-2002, 12: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