AE开发----获取地图上当前选中的要…
2015-05-07 10:09
169 查看
// 获取地图上当前选中的要素(一)
int selCount = axMapControl1.Map.SelectionCount;
IEnumFeature pEnumFeature = axMapControl1.Map.FeatureSelection as IEnumFeature;
IFeature pFeature = pEnumFeature.Next();
while (pFeature != null)
{
string str1 = pFeature.OID.ToString();
string str2 = pFeature.get_Value(2).ToString();
pFeature = pEnumFeature.Next();
}
// 获取地图上当前选中的要素(二)
IMap map = axMapControl1.Map;
ISelection selection = map.FeatureSelection;
IEnumFeatureSetup iEnumFeatureSetup = (IEnumFeatureSetup)selection;
iEnumFeatureSetup.AllFields = true;
IEnumFeature pEnumFeature = (IEnumFeature)iEnumFeatureSetup;
pEnumFeature.Reset();
IFeature pFeature = pEnumFeature.Next();
while (pFeature != null)
{
string str1 = pFeature.OID.ToString();
string str2 = pFeature.get_Value(2).ToString();
pFeature = pEnumFeature.Next();
}
注:以上两种方法均在电脑上测试通过,至于之间的区别还得慢慢消化。
int selCount = axMapControl1.Map.SelectionCount;
IEnumFeature pEnumFeature = axMapControl1.Map.FeatureSelection as IEnumFeature;
IFeature pFeature = pEnumFeature.Next();
while (pFeature != null)
{
string str1 = pFeature.OID.ToString();
string str2 = pFeature.get_Value(2).ToString();
pFeature = pEnumFeature.Next();
}
// 获取地图上当前选中的要素(二)
IMap map = axMapControl1.Map;
ISelection selection = map.FeatureSelection;
IEnumFeatureSetup iEnumFeatureSetup = (IEnumFeatureSetup)selection;
iEnumFeatureSetup.AllFields = true;
IEnumFeature pEnumFeature = (IEnumFeature)iEnumFeatureSetup;
pEnumFeature.Reset();
IFeature pFeature = pEnumFeature.Next();
while (pFeature != null)
{
string str1 = pFeature.OID.ToString();
string str2 = pFeature.get_Value(2).ToString();
pFeature = pEnumFeature.Next();
}
注:以上两种方法均在电脑上测试通过,至于之间的区别还得慢慢消化。
相关文章推荐
- AE开发----获取地图上当前选中的要素
- AE 获取地图上当前选中的要素
- 微信小程序开发之真机测试 地图定位 map API 无法获取当前位置的问题
- 微信小程序开发之真机测试 地图定位 map API 无法获取当前位置的问题
- Rcp(插件开发) 如何获取当前视图选中的对象
- Eclipse插件开发中获取当前选中工程的几种方法
- 贴一段eclipse插件开发中获取当前package explorer中选中的目录代码
- 微信小程序开发之真机测试 地图定位 map API 无法获取当前位置的问题
- 百度地图最新版本sdk使用系列(八)-获取当前地图中心点的经纬度并计算与当前位置的距离
- 【HERE地图开发记录(1)】点击地图获取坐标
- 【eclipse插件开发】右键菜单获取选中文件以及文件的创建
- [开发笔记]-jQuery获取radio选中项的值
- 获取GridView中RowCommand的当前选中行的索引或主键Id
- C#之获取ListView当前选中的行的数据!...
- iOS开发之runtime的运用-获取当前网络状态
- .Net C# WinForm -- 获取TextBox当前焦点所在位置,插入文本,选中文本
- 使用js如何获取treeview控件的当前选中的节点
- Delphi Cxgrid获取选中行列,排序规则,当前正在编辑的单元格内的值
- 地图开发中如何获取安全码
- Android studio 百度地图开发(8)地图已标记POI点和搜索POI点的获取和利用