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

Embedded ActiveX control - locationtoX/Y probs...

This is a discussion on Embedded ActiveX control - locationtoX/Y probs... within the MapPoint Desktop Discussion forums, part of the Map Forums category; My app needs to find out whether a list of locations (lat,lon) are in the currently displayed screen. The latest ...

  1. #1
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10

    Embedded ActiveX control - locationtoX/Y probs...

    My app needs to find out whether a list of locations (lat,lon) are in the currently displayed screen.

    The latest method involves making a location object for each list item's lat and lon, and then calling locationtox and locationtoy to find out the screen position of each lat/lon.

    This method is very costly when performing this process for sizeable lists (gets painful after about 1000 at once), I guess mainly due to needing to call the interfaces for all those 1000+ times.

    Can anyone suggest ways that I can cut down this painful delay time?

    An idea is if I can work out the projection MapPoint uses, I should be able to use the map's altitude, centre lat/lon and the screen width/height to calculate the screen x/y for given lat/lons, taking the load off the interface between me and mappoint, and putting the blame on me if anything's slow

    I browsed the forum and could not find any answers to this question.

    Any ideas would be appreciated. If there's any more info you'd like me to provide, please don't hesitate to ask.

    Thanks,

    Fireball

  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
    If you get a handful of points (ideally widely spaced on the screen) you should be able to calculate your own mapping, assuming you are zoomed in enough that you can assume a "flat Earth". Then the transformation from longitude,latitude to screen coords in a linear transformation.


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

  3. #3
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10
    Unfortunately I'm not allowed to limit the users to flat-earth-accurate zooms.

    A colleague pointed out the projection formula http://mathworld.wolfram.com/MillerC...rojection.html - it maps the 'x' coordinate by subtracting it from a reference longitude, and calculates the 'y' coordinate by a sort of hyperbola transfer function, which gives an output of +/- ~2.303 for a range of input latitudes of +/- 90 degrees.

    Can anyone assist me in getting from these formulas to a screen position?

    Thanks,

    Dave

  4. #4
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10

    Re: Embedded ActiveX control - locationtoX/Y probs...

    Projection's now sorted, but unfortunately, MapPoint does not use what it says is 9200m where the projections swap.

    Using the mappoint altitude slider:

    In the data-populated map areas, whilst increasing altitude, the map will change from Orthographic to Miller at 11000m. Whilst decreasing altitude, the map will change back to Orthographic at 8000m.

    In non-data-populated map areas (E.g., Australia), whilst increasing altitude, the map will change from Orthographic to Miller at the same 11000m, but whilst decreasing altitude, the map will change back to Orthographic at 6000m!

    This makes it pretty hard to predict where to use each projection. Any ideas?

    Cheers,

    Dave

  5. #5
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10
    Problem solved. I just tried to note the uncertainty area - over the whole map, between 12500 and 5500 you can be uncertain of which projection MapPoint is in, so I just implemented a 4-point "Accuracy Test" of my manually calculated projections. It's normally sorted with the first point, but there are 4 there just incase

    Cheers,

    Dave

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Re: Keyboard control in mappoint activex control
    By djcapslock in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-10-2005, 11:16 AM
  2. Embedded Graphics and MP Control
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-27-2005, 05:18 PM
  3. ActiveX Control
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-04-2002, 06:44 PM
  4. I am trying to build an activeX control using Map....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-24-2001, 06:05 PM
  5. I am using the MapPoint ActiveX control in a VB Ap....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-24-2001, 07:35 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