I am using the AxMapControl to display a map and I want to record a point where I am and want to be able to return to the same point later on using the CenterAt() method.

  • Welcome to GIS SE! Would you be able to edit your Question to provide a few more details (code snippets) to show what you have tried and where you are stuck, please?
    – PolyGeo
    Commented Jun 13, 2014 at 6:58

1 Answer 1


The AxMapcontrol has a property Extent which returns an envelope, from this the average X and average Y would be the centre:

double CentX = ( MapControl.Extent.Xmin + MapControl.Extent.Xmax ) / 2;
double CentY = ( MapControl.Extent.Ymin + MapControl.Extent.Ymax ) / 2;

IPoint CentPoint = new PointClass();
IPoint.SpatialReference = MapControl.SpatialReference;

You can CenterAt() this IPoint later, the spatial reference is the same as the map so you should have no problems.. you could consider keeping the extent object if you want the map to zoom to exactly the same spot with the same scale.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.