I am using the MapPoint 2002 control in a Visual Basic application. I have a problem which I can't seem to figure out. I've got a set of geographic locations ( lats/lons ) and I am trying to figure out how I can calculate the best location to set the map object's location to ( lat, lon and altitude ) so that all of these points are visible on the screen. The altitude should be the lowest possible altitude were all the points are visible.
The map is using the orthographic projection ( m_oMap.Projection = geoGlobeViewWhenZoomedOut ) but all my points are within North America so there is never a concern about a point being on the other side of the globe.
Also, the aspect ratio of the map is not fixed. If the aspect ratio was fixed, I could come up with a suitable solution.
Does anybody know of an algorithm I can use to solve this problem. My best (not very good) method right now is to calculate the range of coordinates of all these points and use the center of the bounding box of these points as my map location and then estimate the best altitude. My problem is that sometimes my altitude is far higher than it needs to be.
Thanks for any assitance.