Community of VE/MapPoint Users and Developers
This is a discussion on Embedded ActiveX control - locationtoX/Y probs... within the MapPoint 2006/2009 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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Embedded ActiveX control - locationtoX/Y probs... 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 |
| ||||
|
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 Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
|
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 |
| |||
| 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 |
| |||
|
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 |
![]() |
| Tags |
| activex, control, embedded, locationtox or y, probs |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Keyboard control in mappoint activex control | djcapslock | MapPoint 2006/2009 Discussion | 1 | 03-10-2005 11:16 AM |
| Embedded Graphics and MP Control | Anonymous | MapPoint 2006/2009 Discussion | 3 | 01-27-2005 05:18 PM |
| ActiveX Control | Anonymous | MapPoint 2006/2009 Discussion | 3 | 09-04-2002 06:44 PM |
| I am trying to build an activeX control using Map.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-24-2001 06:05 PM |
| I am using the MapPoint ActiveX control in a VB Ap.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-24-2001 07:35 AM |