两种方法在VB+MAPX中在指定坐标处添加符号
第一种方法
Private Sub Command1_Click()
Dim X As Double, Y As Double
X = Text1.Text
Y = Text2.Text
Map1.Annotations.addsymbol X, Y
End Sub
第二种方法:
Private Sub Command1_Click()
Dim C_X As Double, C_Y As Double
Dim FeaFac As MapXLib.FeatureFactory
Dim Fea As New MapXLib.Feature
Dim Pts As New MapXLib.Points, Pt As New MapXLib.Point
C_XString = Text1.Text
C_YString = Text2.Text
C_X = Val(C_XString)
C_Y = Val(C_YString)
Fea.Attach form1.Map1
Fea.Type = miFeatureTypeSymbol
Fea.Style = form1.Map1.DefaultStyle
Fea.Point.Set C_X, C_Y
form1.Map1.Layers(1).AddFeature Fea
form1.Map1.Refresh
end sub
Technorati 标签: VB MapX 添加自定义图元