获取选择集、选择集颜色设置

来源:互联网 发布:软件开发的课程 编辑:程序博客网 时间:2024/05/21 12:48

1、图层选择集

      IFeatureLayer pLayer = GIS.BasciClass.MapManger.GetLayerByName(pMap, pLayerName) as IFeatureLayer;
            IFeatureSelection pSelection = pLayer as IFeatureSelection;

            ISelectionSet pSelectSet = pSelection.SelectionSet;

            pSelectSet.Search(null, false, out pCursor);

2、图层选择集

        IFeatureSelection pSelection = player as IFeatureSelection;
            IQueryFilter pQuery = new QueryFilterClass();
            pQuery.WhereClause = where_clause;
            pSelection.SelectFeatures(pQuery, esriSelectionResultEnum.esriSelectionResultNew, false);
            pSelection.SelectionSymbol = pSymbol;
            ISelectionSet pSelectionSet = pSelection.SelectionSet;

3、地图选择集

      ISelection selection = pMap.FeatureSelection;
            IEnumFeatureSetup enumFeatureSetup = selection as IEnumFeatureSetup;    //这里很必要
            enumFeatureSetup.AllFields = true;
            //这里很必要
            IEnumFeature enumFeature = enumFeatureSetup as IEnumFeature;
            enumFeature.Reset();
            IFeature feature = enumFeature.Next();

4、选择集颜色设置

      ISelectionEnvironment pSelectionEnvironment = new SelectionEnvironmentClass();
            pSelectionEnvironment.DefaultColor = MapManger.ConvertColorToIColor(Color.Red);



0 0
原创粉丝点击