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.
This is a discussion on Center Map to a pushpin? within the MapPoint Desktop 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 ...
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.
Hi,
Yes you can:
The first 3 lines place the pushpin on the map, the last one center to the pushpin.Code:Location Loc = MP.ActiveMap.GetLocation(Lat, Lon, Alt); Pushpin PP = MP.ActiveMap.AddPushpin(Loc, ""); PP.Symbol = 1; MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
Your last line gives me a Compile error with MapPoint2004...
Expected: =
Is there something I don't get ?
Hi,
Wierd. seems ok to me. ok this is copy/paste should work
MP is the mappoint component on the form.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); }
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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();
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();
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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.
Originally Posted by Wilfried
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)