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

AfterViewChange event and Map.Location

This is a discussion on AfterViewChange event and Map.Location within the MapPoint Desktop Discussion forums, part of the Map Forums category; In my event handler for AfterViewChange, I access the Location property of the Map and a few other properties of ...

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

    AfterViewChange event and Map.Location

    In my event handler for AfterViewChange, I access the Location property of the Map and a few other properties of the Map, none of which cause an AfterViewChange event. WHen I click on the edge of the map to scroll it, it goes crazy, not stopping the scrolling for a while.

    Any ideas on what the problem is? Ulitmately my goal is to get the latitude and longitude of the map.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: AfterViewChange event and Map.Location

    Hi,

    Quote Originally Posted by Joemomma
    Ulitmately my goal is to get the latitude and longitude of the map.
    what do you exacly mean by that ? A lat / long pair is just a point!

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    The goal is that when the user changes the view, I need to update another piece of software with the user's map's current location. So the other piece of software will be "following" the user's map.

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

  6. #6
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Let's say you have two maps running. The user pans to a new location on one of the maps. I want to tell the other map to pan to that same location. Theoretically, this can be done using the AfterViewChange event by getting the first map's Location object, and then calculating the latitude and longitude of that Location object. Next, I would tell the second map to set its Location to the same latitude/longitude of the first map's Location property.

  7. #7
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Now I understeand. For the first map just find the center of the map by Width / 2 and Height / 2 to get x, y.

    For the second map use XYToLocation(x, y).GoTo(); to pan to the specific point. Eventually you can also save / use Altitude to get them both at same zoom level.

    The problem you had in your event handler is probably due to lengty code. Try make it as efficient as possible in speed, or execute it "outside" the event handler, eg by posting a message to a custom message handler.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Trying to get the MapPoint.Location at a mouse event
    By BobFromBoston in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 07-30-2005, 08:41 AM
  2. Where is the Quit event?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 04-08-2005, 08:36 AM
  3. VC++ OnSelectionChange event
    By MP2KUser2 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-13-2004, 02:24 PM
  4. How to add click event for VB.Net ?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-31-2003, 01:15 AM
  5. mouse down event
    By henemonster in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-31-2003, 03:04 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 84 85 86 87 88 89 90 91 92 93 94 95 96