MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Center Map to a pushpin?

This is a discussion on Center Map to a pushpin? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello All - Is there a way i can center the map to a pushpin? I would like to animate ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-24-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Center Map to a pushpin?

Hello All -

Is there a way i can center the map to a pushpin? I would like to animate a pushpin (move), and keep the pushpin in the center of the screen as it moves.

Thanks,
Laz.
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 12-25-2004
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Yes you can:

Code:
            Location Loc = MP.ActiveMap.GetLocation(Lat, Lon, Alt);
            Pushpin  PP  = MP.ActiveMap.AddPushpin(Loc, "");
            PP.Symbol    = 1;
            MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
The first 3 lines place the pushpin on the map, the last one center to the pushpin.
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-20-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Your last line gives me a Compile error with MapPoint2004...

Expected: =

Is there something I don't get ?
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-20-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Wierd. seems ok to me. ok this is copy/paste should work

Code:
        private void testToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            double Lat = 51.249434;
            double Lon = 4.483;
            Double Alt = 1;

            Location Loc = MP.ActiveMap.GetLocation(Lat, Lon, Alt);
            Pushpin PP = MP.ActiveMap.AddPushpin(Loc, "");
            PP.Symbol = 1;
            MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
        }
MP is the mappoint component on the form.
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-20-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Hi Wilfried,
What language are you using? I can't seem to find this fucntion GoToLatLon.

In C++, I normally do a

mLoc = mMap.GetLocation(dLat, dLon, dAlt);
mpPin = mMap.AddPushpin(mLoc,"Yeehoo");

mpPin.SetSymbol(21);
mpPin.SetBalloonState(2);
mLoc.GoTo();
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-21-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

this is in C#, but should make no difference as far as it is calling the mappoint functions. Very wierd ! you can also use of course the location.Goto() or also ther is a pushpin.Goto();
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 01-21-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Very interesting, I created the C++ class wrapper by imported the type lib and I don't have these API that your C# has.
Thanks for the information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 02-14-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Quote:
Originally Posted by Wilfried
Hi,

Wierd. seems ok to me. ok this is copy/paste should work

Code:
        private void testToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            double Lat = 51.249434;
            double Lon = 4.483;
            Double Alt = 1;

            Location Loc = MP.ActiveMap.GetLocation(Lat, Lon, Alt);
            Pushpin PP = MP.ActiveMap.AddPushpin(Loc, "");
            PP.Symbol = 1;
            MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
        }
MP is the mappoint component on the form.
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

Tags
center, map, pushpin


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
Center Point colin_turner99 MapPoint 2006/2009 Discussion 1 07-14-2006 02:38 PM
Finding Center of Data kerleyp MapPoint 2006/2009 Discussion 2 08-18-2005 04:34 PM
Find center of a polygon Anonymous MapPoint 2006/2009 Discussion 11 05-25-2005 09:54 AM
Determining Center of a Zipcode shaistasohail MapPoint 2006/2009 Discussion 0 10-21-2002 11:13 PM
VB6 + ACCESS : Center to a pushpin and other things... Anonymous MapPoint 2006/2009 Discussion 0 09-05-2002 11:40 AM


All times are GMT -5. The time now is 02:10 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


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