我做了一个C#的arcengine系统,其中高亮显示所选要素的时候报错说get_layer后面的参数值不在预期的范围内
这是我这边的代码ILayerpLayer=axMapControl1.Map.get_Layer(0);axMapControl1.AddLayer(pLayer);ax...
这是我这边的代码
ILayer pLayer = axMapControl1.Map.get_Layer(0);
axMapControl1.AddLayer(pLayer);
axMapControl1.Refresh(esriViewDrawPhase.esriViewGeoSelection,Type.Missing,Type.Missing);
IFeatureSelection IFS = pLayer as IFeatureSelection;
IFS.Clear();
ESRI.ArcGIS.Geodatabase.IFeatureCursor pCursor1;
ESRI.ArcGIS.Geodatabase.IQueryFilter IQF1 = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();
IQF1.WhereClause = "FID="+"2";
pCursor1 = (ESRI.ArcGIS.Geodatabase.IFeatureCursor)pFeatureClass.Search(IQF1, false);
ESRI.ArcGIS.Geodatabase.IFeature pFeature1 = pCursor1.NextFeature();
axMapControl1.Map.SelectFeature(pLayer,pFeature1);
axMapControl1.Refresh(esriViewDrawPhase.esriViewGeoSelection,Type.Missing,Type.Missing);
我模拟的数据只有一个图层,改了参数也不对 之前也报错说超出索引值。请问这是为什么啊,代码哪里有错请指出 如果有更好的高亮显示方法能分析一下就更好 展开
ILayer pLayer = axMapControl1.Map.get_Layer(0);
axMapControl1.AddLayer(pLayer);
axMapControl1.Refresh(esriViewDrawPhase.esriViewGeoSelection,Type.Missing,Type.Missing);
IFeatureSelection IFS = pLayer as IFeatureSelection;
IFS.Clear();
ESRI.ArcGIS.Geodatabase.IFeatureCursor pCursor1;
ESRI.ArcGIS.Geodatabase.IQueryFilter IQF1 = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();
IQF1.WhereClause = "FID="+"2";
pCursor1 = (ESRI.ArcGIS.Geodatabase.IFeatureCursor)pFeatureClass.Search(IQF1, false);
ESRI.ArcGIS.Geodatabase.IFeature pFeature1 = pCursor1.NextFeature();
axMapControl1.Map.SelectFeature(pLayer,pFeature1);
axMapControl1.Refresh(esriViewDrawPhase.esriViewGeoSelection,Type.Missing,Type.Missing);
我模拟的数据只有一个图层,改了参数也不对 之前也报错说超出索引值。请问这是为什么啊,代码哪里有错请指出 如果有更好的高亮显示方法能分析一下就更好 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询