使用ArcGIS Engine来实现地图的点击查询并闪烁
2007-05-22 15:51
561 查看
使用ArcGIS Engine来实现地图的点击查询并闪烁
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
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
相关文章推荐
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- 使用ArcGIS Engine来实现地图的点击查询并闪烁 (C#)-未完成
- 使用ArcGIS Engine来实现地图的点击查询并闪烁
- Android中使用百度API定位,并实现手势操作(显示最后点击地图的位置)
- 使用百度API实现实时公交线路查询及地图显示
- 使用百度API实现实时公交站点查询及地图显示
- 点击地图div上的按钮实现对地图数据的操作:查询点、添加点、删除点
- MySQL数据库(11)----使用子查询实现多表查询
- 使用鼠标滚轮实现放大缩小地图
- 使用预处理语句实现数据查询的方法
- python使用urllib模块和pyquery实现阿里巴巴排名查询
- Android简单实现 高德地图的定位与显示,点击按钮切换地图图层
- ArcGIS 实现框选区域查询要素后,要素点击弹出框
- Java+oracle树查询实现easyui中tree使用的json
- Hibernate使用sql语句实现多表关联查询
- 使用JS代码实现点击按钮下载文件
- android使用百度地图、定位SDK实现地图和定位功能!(最新、可用+吐槽)
- Android使用百度LBS SDK(三)点击地图POI导航
- XZ_iOS之使用KVO实现textField在填写完数据时,button可点击且变颜色