求ArcEngine 选择属性表内字段,然后在地图高亮显示选择要素的C#代码
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏15(财富值+成长值)
展开全部
ESRI.ArcGIS.Carto.IFeatureLayer pFeatureLayer = axMapControl1.get_Layer(cbxLayerName.SelectedIndex) as ESRI.ArcGIS.Carto.IFeatureLayer;
if (pFeatureLayer == null)
{
MessageBox.Show("选择图层不是Feature图层!");
return;
}
ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();
queryFilter.WhereClause = queryFiltertextBox.Text;
try
{
ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = pFeatureLayer.Search(queryFilter, false);
ESRI.ArcGIS.Geodatabase.IFeature pFeature;
while ((pFeature = featureCursor.NextFeature()) != null)
{
axMapControl1.FlashShape(pFeature.Shape);
}
}
catch (Exception pException)
{
MessageBox.Show(pException.Message);
}
cbxLayerName.SelectAll();
}
if (pFeatureLayer == null)
{
MessageBox.Show("选择图层不是Feature图层!");
return;
}
ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();
queryFilter.WhereClause = queryFiltertextBox.Text;
try
{
ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = pFeatureLayer.Search(queryFilter, false);
ESRI.ArcGIS.Geodatabase.IFeature pFeature;
while ((pFeature = featureCursor.NextFeature()) != null)
{
axMapControl1.FlashShape(pFeature.Shape);
}
}
catch (Exception pException)
{
MessageBox.Show(pException.Message);
}
cbxLayerName.SelectAll();
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询