ホーム » ARCGIS » ArcObjects axMapControl 指定座標にPan

ArcObjects axMapControl 指定座標にPan

[code]
ESRI.ArcGIS.Geometry.IPoint pt = new ESRI.ArcGIS.Geometry.Point();
pt.PutCoords(-35708, -53655);
axMapControl1.CenterAt(pt);
axMapControl1.Refresh();
[/code]

ちなみに以下の方法で座標を設定したら正しく動作しなかった
[code]
ESRI.ArcGIS.Geometry.IPoint pt = new ESRI.ArcGIS.Geometry.Point(-35708, -53655);
[/code]

更にMAPと空間データの座標刑が違う場合はstackoverflow Converting Lat / long to PointClassを参照

念の為
[code]
ISpatialReferenceFactory srFactory = new SpatialReferenceEnvironmentClass();
IGeographicCoordinateSystem gcs = srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
ISpatialReference sr1 = gcs;
IPoint point = new PointClass() as IPoint;
point.PutCoords(-92.96000, 44.9227);
IGeometry geometryShape;
geometryShape = point;
geometryShape.SpatialReference = sr1;
geometryShape.Project(mapControl.SpatialReference);
mapControl.DrawShape(geometryShape);
[/code]

AxMapControl: How to set map extent in ArcObjects?