MsgBox ("请用工具栏里的点选择工具(第5个按钮)指定起点、终点!")
End Sub
Private Sub showstartendnodeinfo_Click()
Dim i As Integer, ftr As MapXLib.Feature
For i = 1 To Map1.
Layers(nodelayerindex).Selection.Count
'选择集中的每个feature
For Each ftr In Map1.
Layers(nodelayerindex).AllFeatures
'对应图层中的每个feature
If Map1.Layers(nodelayerindex).
Selection(i).FeatureID = ftr.FeatureID Then
If i = 1 Then
StartNo = ftr.FeatureID
'指定的起点
txtfid.Text = StartNo
End If
If i = Map1.Layers
(nodelayerindex).Selection.Count Then
EndNo = ftr.FeatureID
'指定的终点
txttid.Text = EndNo
End If
For j = 1 To Map1.
DataSets(nodelayerindex).Fields.Count
List1.AddItem Map1.DataSets(nodelayerindex).Fields(j).Name & ":" & Map1.DataSets(nodelayerindex).
Value(ftr.FeatureID, j)
Next j
List1.AddItem "ID:" & Map1.Layers(nodelayerindex).Selection(i).FeatureID
Exit For ' featureID是唯一的
End If
Next
Next i
End Sub
Private Sub Map1_ToolUsed(ByVal ToolNum As Integer, ByVal X1 As Double, ByVal Y1 As Double, ByVal X2 As Double, ByVal Y2 As Double, ByVal Distance As Double, ByVal Shift As Boolean, ByVal Ctrl As Boolean, EnableDefault As Boolean)
Dim curfeatures As MapXLib.Features
Dim ftr As MapXLib.Feature
Dim searchlayer As MapXLib.Layer
Dim pt As New MapXLib.Point
Select Case ToolNum
Case select_point
pt.Set X1, Y1
|