欢迎来到天天文库
浏览记录
ID:10279185
大小:54.10 KB
页数:53页
时间:2018-06-15
《arcengine主要功能源码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、usingSystem;usingSystem.IO;usingSystem.Windows.Forms;usingESRI.ArcGIS.Carto;usingESRI.ArcGIS.Controls;usingESRI.ArcGIS.DataSourcesFile;usingESRI.ArcGIS.DataSourcesGDB;usingESRI.ArcGIS.DataSourcesRaster;usingESRI.ArcGIS.Display;usingESRI.ArcGIS.esriSystem;usingESRI.ArcGIS
2、.Geodatabase;usingESRI.ArcGIS.Geometry;usingESRI.ArcGIS.SystemUI;namespaceMapOperation{publicpartialclassFormMain:Form{#region变量定义//地图导出窗体privateFormExportMapfrmExpMap=null;//长度、面积量算privateFormMeasureResultfrmMeasureResult=null;//量算结果窗体privateINewLineFeedbackpNewLineFeed
3、back;//追踪线对象privateINewPolygonFeedbackpNewPolygonFeedback;//追踪面对象privateIPointpPointPt=null;//鼠标点击点privateIPointpMovePt=null;//鼠标移动时的当前点privatedoubledToltalLength=0;//量测总长度privatedoubledSegmentLength=0;//片段距离privateIPointCollectionpAreaPointCol=newMultipointClass();//面积量
4、算时画的点进行存储;privatestringsMapUnits="未知单位";//地图单位变量privateobjectmissing=Type.Missing;//TOC菜单IFeatureLayerpTocFeatureLayer=null;//点击的要素图层privateFormAtrributefrmAttribute=null;//图层属性窗体privateILayerpMoveLayer;//需要调整显示顺序的图层privateinttoIndex;//存放拖动图层移动到的索引号//鹰眼同步privateboolbCanD
5、rag;//鹰眼地图上的矩形框可移动的标志privateIPointpMoveRectPoint;//记录在移动鹰眼地图上的矩形框时鼠标的位置privateIEnvelopepEnv;//记录数据视图的Extent#endregion#region初始化publicFormMain(){InitializeComponent();axTOCControl.SetBuddyControl(mainMapControl);EagleEyeMapControl.Extent=mainMapControl.FullExtent;pEnv=Eag
6、leEyeMapControl.Extent;DrawRectangle(pEnv);}#endregion#region数据加载#regionLoadMxFile方法加载地图文档文件privatevoidbtnLoadMxFile_Click(objectsender,EventArgse){//加载数据前如果有数据则清空try{OpenFileDialogpOpenFileDialog=newOpenFileDialog();pOpenFileDialog.CheckFileExists=true;pOpenFileDialog.T
7、itle="打开地图文档";pOpenFileDialog.Filter="ArcMap文档(*.mxd)
8、*.mxd;
9、ArcMap模板(*.mxt)
10、*.mxt
11、发布地图文件(*.pmf)
12、*.pmf
13、所有地图格式(*.mxd;*.mxt;*.pmf)
14、*.mxd;*.mxt;*.pmf";pOpenFileDialog.Multiselect=false;//不允许多个文件同时选择pOpenFileDialog.RestoreDirectory=true;//存储打开的文件路径if(pOpenFileDialog.ShowDial
15、og()==DialogResult.OK){stringpFileName=pOpenFileDialog.FileName;if(pFileName==""){return;}if(mainMapCon
此文档下载收益归作者所有