Option Base 1
Const select_point As Integer = 1
Dim nodelayerindex As Integer, linelayerindex As Integer
Dim LatNode() As Double, LonNode() As
Double, NoNode() As Integer, nNode As
Integer '节点的纬度、经度、标注、节点数
Dim LineNode() As Integer, LineDis() As
Double, nLineNode As Integer
'线路的端点(redim成二维的)、长度、
'线路数
Dim StartNo As Integer, EndNo As Integer '查询时指定的起点、终点
Dim flagMatrix() As Boolean, distmatrix() As
Double '标记节点是否邻接、邻接距离
Dim yjdb() As Boolean, distvector() As
Double
'标记节点是否获得永久标号、与起点的距离
Dim tempstartno As Integer, tempendno As
Integer, oldtempstartno As Integer
Dim isall As Boolean
'标记是否所有节点都获得永久标号
Dim szdno() As Integer '最短路径上的节点
Dim shortestdist As Double '最短距离
Private Sub Form_Load() '初始化,读取数据
Map1.CreateCustomTool select_point,
miToolTypePoint, miCenterCursor
'创建用户自定义点选择工具,
'用于指定起点、终点
Dim lyr As MapXLib.Layer
Dim nodelyr As MapXLib.Layer, nodeds As
MapXLib.Dataset
Dim ftr As MapXLib.Feature
Dim i As Integer, j As Integer, k As Integer,
temp As Integer, q As Integer, maxlen As
Double
For Each lyr In Map1.Layers '添加数据集
Map1.DataSets.Add miDataSetLayer, lyr,
lyr.Name & "dataset"
Next
|