#AE 中对矢量数据的基本操作:

Arcgis Engine中的IFeatureLayer、IFeatureClass、IFeature、IField、IFields接口与矢量数据接口的关系:

​ IFeatureLayer为矢量图层

​ IFeatureClass为矢量图层中的属性表

​ IFeature为矢量图层中的某一要素

​ IField为属性表中的某一个字段

​ IFields为属性表中的全部字段的集合

图层操作(IFeatureLayer)

对矢量图层进行改名、设置比例尺、设置图层可见、图层不可见:
1.对矢量图层进行改名:主要使用的是ESRI.ArcGIS.Carto;引用中的IFeatureLayer接口中的Name属性

图片说明
//修改图层名称
        private void button1_Click(object sender, EventArgs e)
        {
            //获得地图控件中的图层IFeatureLayer
            IFeatureLayer mylayer = axMapControl1.Map.get_Layer(0) as IFeatureLayer;
            //通过接口的Name属性修改图层名称
            mylayer.Name = "mylayer";
            //刷新TOC控件
            axTOCControl1.Update();
        } 
2.设置图层的显示比例尺:主要使用的是ESRI.ArcGIS.Carto;引用中的IFeatureLayer接口中的MaximumScale属性和MinimumScale属性进行设置。

图片说明
//设置比例尺,max为最大显示的比例尺,min为最小的显示比例尺
        private void button2_Click(object sender, EventArgs e)
        {
            //通过axmapControl控件的get_Layer()方法可以获取到图层对象(从上到下的下标从0开始增加)
            IFeatureLayer mylayer = axMapControl1.get_Layer(0) as IFeatureLayer;
            mylayer.MaximumScale = 600000;//最大比例尺
            mylayer.MinimumScale = 3000000;//最小比例尺
            axMapControl1.Refresh();//刷新地图
        } 
3.设置图层可见:主要使用的是ESRI.ArcGIS.Carto;引用中的IFeatureLayer接口中的Visible属性来控制图层的可见性
    //设置IfeatureLayer的Visible的属性为true可以设置图层可见
        private void button3_Click(object sender, EventArgs e)
        {
            IFeatureLayer mylayer = axMapControl1.get_Layer(0) as IFeatureLayer;
            mylayer.Visible = true;
            axMapControl1.Refresh();
        }
        //设置IfeatureLayer的Visible的属性为false可以设置图层不可见
        private void button4_Click(object sender, EventArgs e)
        {
            IFeatureLayer mylayer = axMapControl1.get_Layer(0) as IFeatureLayer;
            mylayer.Visible = false;
            axMapControl1.Refresh();
        }