|
阅读:1439回复:3
地图如何高亮度显示
根据图层中的某个属性实现对空间位置的查询,通过在世界地图中根据国家名称字段来查找国家所对应的位置,一旦查找到该国家,地图将其高亮度显示出来。
这个代码如何实现啊?我用的是AO开发! 急啊!! Public g_pActiveView As esriCarto.IActiveView Public g_pMap As esriCarto.IMap If Not pFeature Is Nothing Then '求实现的代码 End If |
|
|
1楼#
发布于:2004-12-08 12:29
自己顶一下
|
|
|
2楼#
发布于:2004-12-09 08:34
给你方法:让它选中后闪烁,或是让它显示为选中后的状态!就像在ArcMap中用选中工具选中时那样。
|
|
|
3楼#
发布于:2004-12-11 16:20
Public Sub HighLight()
Dim pMxDoc As IMxDocument Dim pDisplay As IDisplay Dim pApp1 As IMxApplication Dim pMap As IMap Dim Tvw As TreeView Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap Dim pFeature As IFeature Dim pIdentify As IIdentify Dim pFeatureIdentifyObj As IFeatureIdentifyObj Dim pArray As IArray Dim pIdentifyObj As IIdentifyObj Dim pGeometry As IGeometry Dim pLayer As ILayer 'begin获取图层和图元 Dim OID As String Dim str_LayerName As String Set Tvw = frm_ShuXing.trw_Features If Not Tvw.SelectedItem.Parent Is Nothing Then str_LayerName = Tvw.SelectedItem.Parent.Text OID = Left(Tvw.SelectedItem.key, (Len(Tvw.SelectedItem.key) _ - Len(Tvw.SelectedItem.Parent.key))) Set pFeature = GetFeatureName(OID, str_LayerName) Dim lyrCount As Integer ' For lyrCount = 0 To pMap.LayerCount - 1 Set pLayer = GetLayer(str_LayerName) ' If pLayer.name = str_LayerName Then ' Exit For ' End If ' Next Else Exit Sub End If 'end获取图层和图元 Set pIdentify = pLayer Set pGeometry = pFeature.Shape Set pArray = pIdentify.Identify(pGeometry) If pArray Is Nothing Then Exit Sub '如果pArray为空则跳出 Set pFeatureIdentifyObj = pArray.Element(0) Set pIdentifyObj = pFeatureIdentifyObj If pIdentifyObj Is Nothing Then Exit Sub '如果pIdentifyObj为空则跳出 pIdentifyObj.Flash pMxDoc.ActiveView.ScreenDisplay End Sub |
|
