在文本框输入一个城市,在地图上查找,当找到后让mapcontrol自动跳转到地图上该点。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
IQueryFilter filter =
new
QueryFilterClass();
filter.WhereClause =
" NAME='"
+城市名称+
"'"
;
IFeatrueSel.SelectFeatures(filter, esriSelectionResultEnum.esriSelectionResultNew,
false
);
IFeatureCursor cursor = IFeatureLay.Search(filter,
false
);
IFeature feat = cursor.NextFeature();
if
(feat !=
null
)
{
//先清除地图中被选中的要素
this
.axMapControl1.Map.ClearSelection();
IGeometry zdGeo = feat.Shape;
try
{
this
.axMapControl1.ActiveView.ExtentStack.Do(zdGeo.Envelope);
this
.axMapControl1.ActiveView.Extent = zdGeo.Envelope;
this
.axMapControl1.ActiveView.Refresh();
this
.axMapControl1.FlashShape(zdGeo, 2, 300, Type.Missing);
}
catch
(Exception ex)
{
return
;
}
}
System.Runtime.InteropServices.Marshal.ReleaseComObject(cursor);
|
AE中将地图页面跳转到指定坐标点
1
2
3
4
|
Mappoint p=
new
Mappoint();
p.x=已知点X坐标;
p.y=已知点Y坐标;
mapControl1.Extent.CenterAt(p);
|
参考文章
1. arcgis engine 当在文本框输入一个城市,在地图上查找定位
没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的自由、好奇、充满创造力的想法被现实的框架所束缚,让创造力自由成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。
本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/5816989.html
,如需转载请自行联系原作者