ArcGIS Engine数据视图与布局视图同步

不能直接使用两者的Map和Extent画等号的形式。需用到IObjectCopy接口

添加引用:

using ESRI.ArcGIS.esriSystem; 

在Map的 OnExtentUpdatedEvent事件添加以下事件:

        private void mapWithPage(object sender,AxESRI.ArcGIS.Controls.IMapControlEvents2_OnExtentUpdatedEvent e)
        {
            IObjectCopy pobjectcopy = new ObjectCopyClass();
            object from = pobjectcopy.Copy(axMapControl2.Map);
            object to = axPageLayoutControl1.ActiveView.FocusMap;
            pobjectcopy.Overwrite(from, ref to);

            axPageLayoutControl1.ActiveView.Refresh();
        }

 

你可能感兴趣的:(ArcGIS,Engine)