For i = 1 To Map1.Layers.Count
If Map1.Layers(i).Name = "中国主干公路节点" Then
nodelayerindex = i '公路节点图层编号
End If
If Map1.Layers(i).Name = "中国主干公路线" Then
linelayerindex = i '线路图层编号
End If
Next i
Set nodelyr = Map1.Layers(nodelayerindex)
nodelyr.AutoLabel = True
Set nodeds = Map1.DataSets.
Add(miDataSetLayer, nodelyr)
Set nodelyr.LabelProperties.Dataset = nodeds
Set nodelyr.LabelProperties.DataField =
nodeds.Fields(3)
nodelyr.LabelProperties.Position =
miPositionCR
nodelyr.LabelProperties.Visible = True
nNode = 0: nLineNode = 0
For Each ftr In
Map1.Layers(nodelayerindex).AllFeatures
nNode = nNode + 1 '节点数
Next
For Each ftr In
Map1.Layers(linelayerindex).AllFeatures
nLineNode = nLineNode + 1 '线路数
Next
ReDim LonNode(1 To nNode) As Double,
LatNode(1 To nNode) As Double, NoNode(1
To nNode) As Integer '节点初始化
ReDim LineNode(1 To 2, 1 To nLineNode),
LineDis(1 To nLineNode) '线路初始化
For i = 1 To nNode
LatNode(i) =
|