MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How-to set map location to make set of points visisble

This is a discussion on How-to set map location to make set of points visisble within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am using the MapPoint 2002 control in a Visual Basic application. I have a problem which I can't seem ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How-to set map location to make set of points visisble

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2004
Member
Yellow Belt
 
Join Date: Feb 2003
Posts: 48
You could use the datasets ZoomTo method and let MP do the thinking:

objMap.DataSets("My Pushpins").ZoomTo


M.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thanks Mossoft but I am not working with DataSets. I am strictly working with Lats/Lons. Unless there is a way to create a dataset programically which is not displayed on the map then I can use this method. I've looked into that and to me it doesn't look like I can do that.

Thanks again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-19-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How-to set map location to make set of points visisble

Have you tried using the GetLocation method to get an object location for each set of Lat/Lon coordinates then using the Union method with the array of object locations.

Set objLoc1 = objMap.GetLocation(Lat1, Lon1)
Set objLoc2 = objMap.GetLocation(Lat2, Lon2)
etc.

objMap.Union(Array(objLoc1, objLoc2)).GoTo

Presumably this can be extended to cover more locations

objMap.Union(Array(objLoc1, objLoc2, ---- etc. )).GoTo

Quote from the Union Method:

"Returns a Location object that represents the best map view to display all of the specified locations."


RVH.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 01-19-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thanks a lot RVH, that certainly seems to work quite well. I haven't tested it out in terms of performance over time with many points but I think this may be the answer.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 01-20-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 09-08-2004
Junior Member
White Belt
 
Join Date: May 2004
Posts: 9
In case this is useful to you. I just posted some information about calculating altitude based on a circular area/radius around a location.

The information can be found at:

http://www.mp2kmag.com/mappoint/disc...?p=10457#10457


Basically I determined that:

objMap.Altitude = Round(radius + (radius * 3.25))

Don't ask.. I have a lot of free time.. sometimes. hah.

Sounds like you pretty much got your issue figured out and if you used this, you'd still have to figure out the radius to use, but more information is better than not enough eh?

Good luck!

-TG
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
How to make shapes unmoveable ? Jaba MapPoint 2006/2009 Discussion 6 01-12-2005 04:03 AM
$$$ Will Pay for A Way to Make a Map $$$ webdbx MapPoint 2006/2009 Discussion 4 07-28-2004 07:38 AM
How to make invisible a pushpin clavijo MapPoint 2006/2009 Discussion 2 07-09-2004 06:41 AM
Make New own baseMap Anonymous MapPoint 2006/2009 Discussion 1 12-03-2003 09:02 AM
trying to make a 'locator map' Anonymous MapPoint 2006/2009 Discussion 0 04-09-2003 03:37 PM


All times are GMT -5. The time now is 09:59 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Jersey Flights
Holiday Hypermarket should be your first choice for cheap flights. Book flights to exotic destinations or even just to Jersey.

Flights to Portugal
Find cheap flights to Portugal on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Portugal.

Flights Canada
Our search results will show you a selection of airlines, travel agents and tour operators offering cheap flights to Canada. See for yourself who has the cheapest deals.

Holidays to Mauritius
Visit the paradise island in your holidays to Mauritius. Enjoy the friendliness of the locals, the warm of the sun and the beauty of the views!

Cheap Balearics Holidays
Cheap Balearics holidays are available if you know when to book and who to book with. The Balearics have many fascinating places to visit all year round. The partying never stops.

Compare Holidays
Compare holidays online where you can see all the amazing possibilities at Travel.co.uk

Holidays to Florida
Sun and sea! Get info on holidays to Florida, only at On The Beach.


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