View Single Post

  #2 (permalink)  
Old 01-08-2005
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

You have 2 options to pan programatily:

this is the first:

Code:
            double Lat;
            double Lon; 
            Int32 x = MP.Height / 2; 
            Int32 y = MP.Width / 2; 
            double Alt = MP.ActiveMap.Altitude; 
            Location Loc = MP.ActiveMap.XYToLocation(x, y); 
            pos.CalcPos(Loc, out Lat, out Lon); 
            Lat += 1; 
            MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
this is the other:
Code:
MP.ActiveMap.Pan(GeoPanCmd.geoNorth, Amount);
With the first one you can of course exacly pan the amount of distance you want. The CalcPos does a Geocode from out of the location. You find various article here to do it.
Reply With Quote