使用ArcGIS Engine来实现地图的点击查询并闪烁 (C#)-未完成
2011-02-26 09:51
417 查看
ArcGIS Engine没有提供在MapControl中点击查询的命令,只是提供了ReaderControl中的使用的点击查询的命令,下面的代码就是实现点击查询并闪烁的代码。
过程描述
Private Sub MapControl1_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long, ByVal mapX As Double, ByVal mapY As Double)
Dim pMap As IMap
Dim i As Integer
Dim pPoint As IPoint
Set pMap = MapControl1.Map
Set pPoint = MapControl1.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)
Dim pIdentify As IIdentify
Dim pIDArray As IArray
Dim pFeatIdObj As IFeatureIdentifyObj
Dim pIdObj As IIdentifyObj
Set pIdentify = pMap.Layer(1)
Dim pEnv As IEnvelope
Set pEnv = New Envelope
Set pEnv = MapControl1.ActiveView.Extent
pEnv.Height = 100
pEnv.Width = 100
pEnv.CenterAt pPoint
Set pIDArray = pIdentify.Identify(pEnv)
If Not pIDArray Is Nothing Then
Set pFeatIdObj = pIDArray.Element(0)
Set pIdObj = pFeatIdObj
pIdObj.Flash MapControl1.ActiveView.ScreenDisplay
'消息显示查询目标的信息
MsgBox "Layer:" & pIdObj.Layer.Name & vbNewLine & "Feature:" & pIdObj.Name
Else
MsgBox "No feature identified."
End If
End Sub
过程描述
Private Sub MapControl1_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long, ByVal mapX As Double, ByVal mapY As Double)
Dim pMap As IMap
Dim i As Integer
Dim pPoint As IPoint
Set pMap = MapControl1.Map
Set pPoint = MapControl1.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)
Dim pIdentify As IIdentify
Dim pIDArray As IArray
Dim pFeatIdObj As IFeatureIdentifyObj
Dim pIdObj As IIdentifyObj
Set pIdentify = pMap.Layer(1)
Dim pEnv As IEnvelope
Set pEnv = New Envelope
Set pEnv = MapControl1.ActiveView.Extent
pEnv.Height = 100
pEnv.Width = 100
pEnv.CenterAt pPoint
Set pIDArray = pIdentify.Identify(pEnv)
If Not pIDArray Is Nothing Then
Set pFeatIdObj = pIDArray.Element(0)
Set pIdObj = pFeatIdObj
pIdObj.Flash MapControl1.ActiveView.ScreenDisplay
'消息显示查询目标的信息
MsgBox "Layer:" & pIdObj.Layer.Name & vbNewLine & "Feature:" & pIdObj.Name
Else
MsgBox "No feature identified."
End If
End Sub
相关文章推荐
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- C#中使用ADOMD.NET查询多维数据集的实现方法
- 使用c#实现简单的数据库添加和查询
- C#+AE 实现点击查询属性功能
- 【MySQL】如何使用C#+MySQL实现一条MySQL语句进行多表查询
- 点击地图div上的按钮实现对地图数据的操作:查询点、添加点、删除点
- C#使用yield实现高效查询
- 使用C#反射实现数据查询
- 使用百度API实现实时公交站点查询及地图显示
- 如何在C# 中使用WMI 实现远程查询和共享
- Android中使用百度API定位,并实现手势操作(显示最后点击地图的位置)
- NET(C#)使用WMI事件查询实现对进程和可移动磁盘的监控
- arcgis二次开发时,c#代码实现鼠标点击地图时,获取地图的表的字段的信息
- C#+AE 实现点击查询属性功能
- 使用百度API实现实时公交线路查询及地图显示
- 使用C#语言实现的查询条件界面展开和收起功能
- 如何在C# 中使用WMI 实现远程查询和共享