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

How to send events to the MapPoint Control (in C#) ?

This is a discussion on How to send events to the MapPoint Control (in C#) ? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi I would like to be able to move the map to the right, left, down or up but programmatically, ...

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

    How to send events to the MapPoint Control (in C#) ?

    Hi

    I would like to be able to move the map to the right, left, down or up but programmatically, with, if possible, functions like SendMessage/PostMessage that would be "DllImported" into a C# project + A mappoint control (2002 version).

    Thank you very much if anyone has the solution to this, its urgent

    thanks

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

    Possible there are other ways, but I tryed this one:

    Code:
                double Lat;
                double Lon;
                Int32 x = MP.Height / 2;
                Int32 y = MP.Width / 2;
                double Alt = MP.ActiveMap.Altitude;
                Location Loc = MP.ActiveMap.XYToLocation(x, y);
                pos.CalcPos(Loc, out Lat, out Lon);
                Lat += 1;
                MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
    First the center points x, y of the map are calculated, then the current Altitude. The XYToLocation gives back the Location of the current center of the map. The CalcPos routine you will find it on this site (on another name), please try a searcht to 'reverse geocoding' to find it.

    Then at last I change the Latiude and call the GoToLatLong method.

    But like I say it seems a little overkill. Possible there is a simple function call to do this

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

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

    I found another method:
    Code:
    MP.ActiveMap.Pan(GeoPanCmd.geoNorth, Amount);
    But the Amount raises another question. According to the help it say:
    "PanFactor Optional Double. Amount to pan, expressed as a fraction of the screen width or height. "

    But how large is that fraction ? I did a few experiment, and a vaule of 1 pan the map half the distance it fills on the screen.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Catch mappoint events using C++ (without MFC...)
    By Jeurink in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 03-15-2005, 05:35 AM
  2. Triggering Events in MapPoint...
    By joer1234 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-29-2004, 11:52 PM
  3. Send SMS through COM
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-13-2004, 03:28 PM
  4. How does Microsoft send you updates on MapPoint 20....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-21-2001, 07:53 AM
  5. How do I send you information to be updated for yo....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-19-2001, 08:48 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