欢迎来到天天文库
浏览记录
ID:29821006
大小:86.01 KB
页数:16页
时间:2018-12-24
《《ae开发之地图加》word版》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingESRI.ArcGIS.AnalysisTools;usingESRI.ArcGIS.Analyst3D;usingESRI.ArcGIS.Carto;usingESRI.ArcGIS.Controls;usingESRI.ArcGIS.Display;usingESRI.ArcGIS.DisplayUI;usingESRI.ArcGIS.esriSystem;usingE
2、SRI.ArcGIS.Geodatabase;usingESRI.ArcGIS.Geometry;usingESRI.ArcGIS.GlobeCore;usingESRI.ArcGIS.Output;usingESRI.ArcGIS.SystemUI;usingESRI.ArcGIS.DataSourcesRaster;usingESRI.ArcGIS.DataSourcesRasterUI;usingSystem.Windows.Forms;usingSystem.Drawing;usingESRI.ArcGIS.DataSource
3、sFile;namespaceAEExercise{publicclassGeoMapLoad{publicstaticIMapDocumentpMapDocument;//定义地图文档接口变量publicstaticintcount=0;publicstaticIRgbColorpColor;//设置颜色publicstaticstringtext="空";//标注内容publicstaticvoidCreateMeasuredGrid(AxPageLayoutControlaxPageLayoutControl1){//设置格网点I
4、SnapGridpSnapGrid;IPageLayoutpPageLayout=axPageLayoutControl1.PageLayout;pSnapGrid=pPageLayout.SnapGrid;//获取PageLayout的SnapGrid对象pSnapGrid.VerticalSpacing=2;//设置垂直间距pSnapGrid.HorizontalSpacing=1;pSnapGrid.IsVisible=true;//设置为可见axPageLayoutControl1.ActiveView.PartialRefre
5、sh(esriViewDrawPhase.esriViewGraphics,null,null);}publicstaticvoidoperatePageLayout(AxPageLayoutControlaxPageLayoutControl1,stringopt,IEnvelopepEnv,intstrBarType=0){switch(opt){case"AddScale":{if(count>0)return;IScaleBarpScaleBar;IMapFramepMapFrame;IMapSurroundFramepMapS
6、urroundFrame;IMapSurroundpMapSurround;IElementPropertiespElementPro;//产生一个UID对象,使用它产生不同的MapSurround对象??UIDpUID=newUIDClass();pUID.Value="esriCarto.scalebar";IPageLayoutpPageLayout;pPageLayout=axPageLayoutControl1.PageLayout;IGraphicsContainerpGraphicsContainer;pGraphicsC
7、ontainer=pPageLayoutasIGraphicsContainer;IActiveViewpActiveView;pActiveView=pGraphicsContainerasIActiveView;IMappMap;pMap=pActiveView.FocusMap;//获得于地图相关的MapFramepMapFrame=pGraphicsContainer.FindFrame(pMap)asIMapFrame;//产生MapsurroundFramepMapSurroundFrame=pMapFrame.Create
8、SurroundFrame(pUID,null);//依据传入参数不同使用不同类型的比例尺MessageBox.Show(strBarType.ToString());switch(strBarType){
此文档下载收益归作者所有