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

MP2004 - XYToLocation

This is a discussion on MP2004 - XYToLocation within the MapPoint Desktop Discussion forums, part of the Map Forums category; I want to know the extent of the displayed map, so I have a MapPoint control on a VB6 form ...

  1. #1
    AndyWood is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    4

    MP2004 - XYToLocation

    I want to know the extent of the displayed map, so I have a MapPoint control on a VB6 form and it's width and height are 900 x 900. I want to get the top left and bottom right coordinates - using of course using Gilles' CalcPos.

    So I do :-

    Dim X As Double
    Dim Y As Double
    X = 0
    Y = 0
    Set objLoc = MP.ActiveMap.XYToLocation(X, Y)

    All OK...

    X = MP.Width-1
    Y = MP.Height-1
    Set objLoc = MP.ActiveMap.XYToLocation(X, Y)

    And our old friend -2147024809 The parameter is incorrect makes an appearance!

    It will only work if you subtract 6 from Height and Width, and if you do a MouseMove and look at the X and Y the range is 0 to 893.

    Any ideas why?

    Andy.

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

    You are right, I checked in my code and this is how I find the center of a map:

    Code:
        int x = (MP.Width - 6) / 2;
        int y = (MP.Height - 6) / 2;
    I did never search to it. I think it has to do with the 3D stile of the control (all sides 3 pixel).

  3. #3
    AndyWood is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    4
    Thanks for that - I thought it was me!

    Andy.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MP2004 and terminal services
    By SeanB in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 10-16-2006, 12:16 PM
  2. Using MP2004 with Delphi
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 13
    Last Post: 03-02-2005, 08:50 AM
  3. Using S&T 2005 maps in MP2004
    By Fleet in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-18-2004, 01:54 PM
  4. need to check accuracy of MP2004
    By jaharris67 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-16-2004, 12:28 AM
  5. XYToLocation Limitations
    By Martel in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-07-2004, 09:34 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