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

XYToLocation Limitations

This is a discussion on XYToLocation Limitations within the MapPoint Desktop Discussion forums, part of the Map Forums category; Has anyone else experienced a problem with the MapPoint Control and XYToLocation method? I have used this method with VBA, ...

  1. #1
    Martel is offline Junior Member Yellow Belt
    Join Date
    Feb 2003
    Posts
    28

    XYToLocation Limitations

    Has anyone else experienced a problem with the MapPoint Control and XYToLocation method? I have used this method with VBA, VB and in several add-ins. Now I am creating an application that uses the MapPoint Control and I receive a run-time error "The parameter is incorrect." According to the documentation, XYToLocation takes an two longs, an x and a y value. There is no mention of a "minimum window size," or a relationship to the altitude. After running this a few times, it looks like the success of the method is dependent upon the altitude and the height and width of the map window. Does anyone have any specifications on this method besides what the documentation has to offer?

    Sample output from running my code:
    height = window height
    width = window width
    x = height/2
    y = width /2
    Long = resultant longitude
    Lat = resultant latitude
    Alt = current map altitude

    Code:
    height: 474 width: 788
    x: 237 y: 394
    Long: -118.340380094652 Lat: 33.7549985135525 Alt: 20
    
    height: 410 width: 700
    x: 205 y: 350
    Long: -118.343601811638 Lat: 33.7523305436096 Alt: 20
    
    height: 266 width: 658
    x: 133 y: 329
    -2147024809 The parameter is incorrect.
    Long: 0 Lat: 0 Alt: 20
    
    
    height: 197 width: 591
    x: 98 y: 296
    -2147024809 The parameter is incorrect.
    Long: 0 Lat: 0 Alt: 20
    
    height: 127 width: 579
    x: 64 y: 290
    -2147024809 The parameter is incorrect.
    Long: 0 Lat: 0 Alt: 20
    
    height: 133 width: 414
    x: 66 y: 207
    -2147024809 The parameter is incorrect.
    Long: 0 Lat: 0 Alt: 20
    
    height: 266 width: 525
    x: 133 y: 262
    Long: -118.362419905387 Lat: 33.7366550973123 Alt: 20
    
    height: 164 width: 180
    x: 82 y: 90
    Long: -118.301369519975 Lat: 33.7874543229921 Alt: 20
    
    height: 129 width: 170
    x: 64 y: 85
    Long: -118.316505793891 Lat: 33.7748780336992 Alt: 20
    
    height: 94 width: 241
    x: 47 y: 120
    -2147024809 The parameter is incorrect.
    Long: 0 Lat: 0 Alt: 20
    
    height: 122 width: 236
    x: 61 y: 118
    Long: -118.359875718943 Lat: 33.7387751003645 Alt: 20
    
    
    height: 110 width: 221
    x: 55 y: 110
    Long: -118.300049711108 Lat: 33.7885592398372 Alt: 2

  2. #2
    Alex Chow is offline Junior Member White Belt
    Join Date
    Dec 2003
    Posts
    6
    Martel,

    I am running into the same problem, when the object is out of the window due to zooming, when I redraw the object, I got a run-time error saying that the parameter is invalid. How do you resolve this issue?

  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
    Doesn't XYToLocation map screen coordinates to Locations?

    In which case, any X,Y screen coordinate outside of the current window is invalid by definition.
    Also, as you zoom in, I would expect the accuracy to get better.


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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MP2004 - XYToLocation
    By AndyWood in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-05-2006, 11:13 AM
  2. plotting pushpin limitations
    By Anonymous in forum Bing Maps and MapPoint Web Service
    Replies: 2
    Last Post: 11-11-2004, 12:57 PM
  3. How can I overcome the limitations of "Avoid Area"
    By Anthony_Hunt in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 05-26-2004, 07:58 AM
  4. Limitations of 10,000 records with MapPoint 2002 (Trial)
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-05-2003, 05:55 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