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
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Is there any event for when the route is changed?

This is a discussion on Is there any event for when the route is changed? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Is there any event generated or any other way of knowing when the route has been changed?...

  1. #1
    stephenmillington is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    40

    Is there any event for when the route is changed?

    Is there any event generated or any other way of knowing when the route has been changed?

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    There's the RouteAfterCalculate event, which is called with the route object as a parameter - see the Help file for documentation.

    I see there's also a RouteAfterOptimize() which will work in a similar manner.
    (you might want to trap both of them)


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  3. #3
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    Those will tell you when MapPoint has modified a route.

    Trapping when the user has modified a route might be a bit more difficult.
    Perhaps check the number of waypoints in the route? Have they been added or removed?


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  4. #4
    stephenmillington is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    40
    Thanks for that but I really need to know when the user either removes or adds an item to the route.

  5. #5
    oschulz is offline Junior Member White Belt
    Join Date
    Nov 2005
    Posts
    10
    There is property called "IsCalculated". Thats what you need.

  6. #6
    stephenmillington is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    40
    I needed an actual event not a property, i.e. to be notified as soon as a waypoint is added or removed and what the waypoint was.

  7. #7
    oschulz is offline Junior Member White Belt
    Join Date
    Nov 2005
    Posts
    10
    There is no event that will do that so easy . I have used the OnAfterRedraw-event. When a waypoint is added, the map is redrawed. Maybe you use an own temp route list and compare it with the Mappoint routelist. Then you have the waypoint position which is changed.

  8. #8
    stephenmillington is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    40
    thanks for that suggestion - ii will try it out

  9. #9
    oschulz is offline Junior Member White Belt
    Join Date
    Nov 2005
    Posts
    10
    I have try out the SelectionChange event, thats better for your Problem i think. That event occurs, for example when a new waypoint is added .

  10. #10
    brianmcg is offline Junior Member Yellow Belt
    Join Date
    Jan 2003
    Posts
    17
    How about using the SelectionChange event? You can test for TypeOf is WayPoint then do your stuff:

    Code:
    Private Sub map_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object)
        
        If TypeOf pNewSelection Is Waypoint Then
            '   check to see if it's an addition or deletion, etc
            If map.ActiveMap.ActiveRoute.Waypoints.Count > oldcount Then
                '   if it's an addition
            ElseIf map.ActiveMap.ActiveRoute.Waypoints.Count < oldcount Then
                '   if it's a deletion
            End If
        End If
        
    End Sub
    Brian McGrath
    CAD North Inc.
    http://www.cadnorth.com

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Exporting Changed data back to Excel
    By kbeese in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 05-17-2005, 04:57 PM
  2. Where is the Quit event?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 04-08-2005, 08:36 AM
  3. mouse down event
    By henemonster in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-31-2003, 03:04 PM
  4. Can the geography reference be changed in the MapP....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-31-2002, 05:42 PM
  5. Several Postcodes in England have now been changed....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-13-2002, 08:52 AM

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 84 85 86 87 88 89 90 91 92 93 94 95 96