posts - 41,  comments - 21,  trackbacks - 1
  实现的是类似arcmap里的Label和UnLabel功能

  ''' <summary>
  ''' 用Label方式添加标注
  ''' </summary>
  ''' <param name="pFeatureLayer">需要Label的FeatureClass</param>
  ''' <param name="pFieldName">用于Label的字段名</param>
  ''' <remarks></remarks>

  Public Sub LabelFeature(ByVal pFeatureLayer As IFeatureLayer, ByVal pFieldName As String)
    Dim pLabels As IGeoFeatureLayer = New FeatureLayer
    pLabels = pFeatureLayer
    Dim pAnnoProps As IAnnotateLayerProperties = New LabelEngineLayerProperties
    Dim pLblEngLyrProps As ILabelEngineLayerProperties = New LabelEngineLayerProperties
    pLabels.AnnotationProperties.QueryItem(0, pAnnoProps, Nothing, Nothing)
    pLblEngLyrProps = pAnnoProps
    pLblEngLyrProps.IsExpressionSimple = True
    pLblEngLyrProps.Expression = pFieldName
    pLabels.DisplayAnnotation = True
    ''刷新语句
    pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, Nothing, Nothing)
  End Sub


  ''' <summary>
  ''' 不显示Label
  ''' </summary>
  ''' <param name="pFeaturelayer">操作的图层</param>
  ''' <remarks></remarks>

  Public Sub UnLabelFeature(ByVal pFeatureLayer As IFeatureLayer)
    Dim pLabels As IGeoFeatureLayer = New FeatureLayer
    pLabels = pFeatureLayer
    pLabels.DisplayAnnotation = False
    ''刷新语句
    pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing)
  End Sub
Tag标签: GIS
posted on 2008-07-17 10:31 王者之魂 阅读(177) 评论(0)  编辑 收藏

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      


相关链接:
 

众 万
志 众
成 一
城 心

诚 心
祝 愿
中 震
国 区
人 百
民 姓
幸 安
福 康

QQ:13945133
MSN:yangguanjunmeteor@hotmail.com


<2008年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

与我联系

搜索

 

常用链接

留言簿(1)

我参与的团队

我的标签

随笔档案(41)

友情链接

最新评论

阅读排行榜

评论排行榜

60天内阅读排行