星期六

topMap给实体设置数值
    Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
        
Me.StatusBar1.Text = "稍等."
        
Dim layCount As Object
        
Dim layNameIndex As Object
        tgMap.LayerIndexGet(
"地级市", layNameIndex)
        tgMap.LayerSet(Convert.ToInt32(layNameIndex), TGMAPXLib.emLayerFlag.ETGLayerVisibleStatus, 
False)
        
'tgMap.LayerIndexGet("一级雨量站", layNameIndex)
        'tgMap.LayerSet(Convert.ToInt32(layNameIndex), TGMAPXLib.emLayerFlag.ETGLayerVisibleStatus, False)
        tgMap.LayerIndexGet("墒情站", layNameIndex)
        tgMap.LayerSet(Convert.ToInt32(layNameIndex), TGMAPXLib.emLayerFlag.ETGLayerVisibleStatus, 
True)
        tgMap.LayerIndexGet(
"墒情站点标注", layNameIndex)
        tgMap.LayerSet(Convert.ToInt32(layNameIndex), TGMAPXLib.emLayerFlag.ETGLayerVisibleStatus, 
True)
        tgMap.LayerSet(Convert.ToInt32(layNameIndex), TGMAPXLib.emLayerFlag.ETGLayerEditStatus, 
True)

        
'设置当前操作层
        'tgMap.MapSet(TGMAPXLib.emMapFlag.ETGMapCurLayerIndex, layNameIndex)

        
'给实体 '小五家子' 设置数值
        Dim value As Object = 800
        
Dim featCount, stcdColIndex, valColIndex, getValue As Object
        tgMap.LayerGet(layNameIndex, TGMAPXLib.emLayerFlag.ETGLayerFeatureCount, featCount)
        tgMap.FieldIndexGet(layNameIndex, 
"站号", stcdColIndex)
        tgMap.FieldIndexGet(layNameIndex, 
"temp4", valColIndex)
        
For i As Int32 = 0 To featCount - 1
            tgMap.ValueGet(layNameIndex, i, stcdColIndex, getValue)
            
If CStr(getValue) = "20116000" Then
                tgMap.ValueSet(layNameIndex, i, valColIndex, value)
            
End If
            getValue 
= Nothing
        
Next
        
Me.tgMap.DrawMap()
        
Me.StatusBar1.Text = "完成."
    
End Sub

posted on 2006-06-19 20:54  星期六  阅读(288)  评论(0)    收藏  举报