PMACAFEE
01-08-2005, 12:40 AM
I want to programatically select the pan mode, (the cursor is a hand) rather than a pointer that allows me to rubber band a square.
Can someone help, I looked through the docs.?
Wilfried
01-08-2005, 12:36 PM
Hi,
You have 2 options to pan programatily:
this is the first:
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:
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.
Anonymous
01-08-2005, 08:14 PM
Wilfried, That's not the answer I wanted but it is the answer I needed.
What I wanted to do was be able to use the mouse pan mode in my control. I found the two settings:
MapCntrl.MousePointer = geoPointerHand
MapCntrl.ActiveMap.DragBehavior = geoDragHand
But my next question was was going to be on how to hold a perspective (position and altitude/zoom) while (or after) adding new reverse-geocoded pins.
I think your code is perfect for that thanks.
Wilfried
01-09-2005, 04:44 AM
Hi,
That's not the answer I wanted but it is the answer I needed
thats good news :)