form1.frm

来自「利用MAPX和VB编的一个关于地图匹配的程序。加载地图后方可使用!」· FRM 代码 · 共 514 行 · 第 1/2 页

FRM
514
字号
      Layer2.maxzoom  =   0
      Layer2.DrawLabelsAfter=   0   'False
      Layer2.styleoverride=   0   'False
      Layer2.labelstyle.TextFontBackColor=   16777215
      Layer2.labelstyle.SymbolChar=   0
      BeginProperty Layer2.labelstyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "System"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Layer2.labelstyle.LineStyle=   1
      Layer2.labelstyle.LineWidth=   1
      Layer2.LabelMax =   100
      Layer2.LabelOverlap=   0   'False
      Layer2.LabelDuplicate=   -1  'True
      Layer2.LabelOffset=   2
      Layer2.LabelLineType=   0
      Layer2.LabelZoomMax=   10000
      Layer2.LabelZoomMin=   0
      Layer2.LabelZoom=   0   'False
      Layer2.LabelVisible=   -1  'True
      Layer2.LabelOrientation=   0
      Layer2.LabelParellel=   -1  'True
      Layer2.PartialSegments=   0   'False
      Layer3.path     =   "E:\诱导项目\地图\地图备份\长春_水系.TAB"
      Layer3.name     =   "长春_水系"
      Layer3.visible  =   -1  'True
      Layer3.selectable=   -1  'True
      Layer3.editable =   0   'False
      Layer3.shownodes=   0   'False
      Layer3.showcentroids=   0   'False
      Layer3.showlinedirection=   0   'False
      Layer3.autolabel=   0   'False
      Layer3.zoomlayering=   0   'False
      Layer3.minzoom  =   0
      Layer3.maxzoom  =   0
      Layer3.DrawLabelsAfter=   0   'False
      Layer3.styleoverride=   0   'False
      Layer3.labelstyle.TextFontBackColor=   16777215
      Layer3.labelstyle.SymbolChar=   0
      BeginProperty Layer3.labelstyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "System"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Layer3.labelstyle.LineStyle=   1
      Layer3.labelstyle.LineWidth=   1
      Layer3.LabelMax =   100
      Layer3.LabelOverlap=   0   'False
      Layer3.LabelDuplicate=   -1  'True
      Layer3.LabelOffset=   2
      Layer3.LabelLineType=   0
      Layer3.LabelZoomMax=   10000
      Layer3.LabelZoomMin=   0
      Layer3.LabelZoom=   0   'False
      Layer3.LabelVisible=   -1  'True
      Layer3.LabelOrientation=   0
      Layer3.LabelParellel=   -1  'True
      Layer3.PartialSegments=   0   'False
      Layer4.path     =   "E:\诱导项目\地图\地图备份\长春_背景.TAB"
      Layer4.name     =   "长春_背景"
      Layer4.visible  =   -1  'True
      Layer4.selectable=   -1  'True
      Layer4.editable =   0   'False
      Layer4.shownodes=   0   'False
      Layer4.showcentroids=   0   'False
      Layer4.showlinedirection=   0   'False
      Layer4.autolabel=   0   'False
      Layer4.zoomlayering=   0   'False
      Layer4.minzoom  =   0
      Layer4.maxzoom  =   0
      Layer4.DrawLabelsAfter=   0   'False
      Layer4.styleoverride=   0   'False
      Layer4.labelstyle.TextFontBackColor=   16777215
      Layer4.labelstyle.SymbolChar=   0
      BeginProperty Layer4.labelstyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "System"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Layer4.labelstyle.LineStyle=   1
      Layer4.labelstyle.LineWidth=   1
      Layer4.LabelMax =   100
      Layer4.LabelOverlap=   0   'False
      Layer4.LabelDuplicate=   -1  'True
      Layer4.LabelOffset=   2
      Layer4.LabelLineType=   0
      Layer4.LabelZoomMax=   10000
      Layer4.LabelZoomMin=   0
      Layer4.LabelZoom=   0   'False
      Layer4.LabelVisible=   -1  'True
      Layer4.LabelOrientation=   0
      Layer4.LabelParellel=   -1  'True
      Layer4.PartialSegments=   0   'False
      TitleStyle.TextFontBackColor=   16777215
      TitleStyle.TextFontOpaque=   -1  'True
      TitleStyle.SymbolChar=   0
      BeginProperty TitleStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   33.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty TitleStyle.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      DefaultStyle.TextFontBackColor=   16777215
      DefaultStyle.SupportsBitmapSymbols=   -1  'True
      DefaultStyle.SymbolChar=   35
      DefaultStyle.SymbolFontColor=   255
      DefaultStyle.SymbolFontBackColor=   16777215
      BeginProperty DefaultStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty DefaultStyle.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Map Symbols"
         Size            =   8.25
         Charset         =   2
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      DefaultStyle.LineStyle=   1
      DefaultStyle.LineWidth=   1
      DefaultStyle.RegionColor=   16777215
      DefaultStyle.LinePattern=   2
      DefaultStyle.RegionBackColor=   16777215
      DefaultStyle.RegionBorderStyle=   1
      DefaultStyle.RegionBorderWidth=   1
      HasProjectionInfo=   -1  'True
      NumericCoordsys =   "Form1.frx":0000
      DisplayCoordsys =   "Form1.frx":0130
      NumDatasets     =   0
      TitleX          =   5000
      TitleY          =   1000
      TitleVisible    =   0   'False
      TitleEditable   =   -1  'True
      TitlePostiion   =   0
      TitleBorder     =   -1  'True
   End
   Begin VB.Label Label2 
      Caption         =   "后一节点"
      Height          =   495
      Left            =   8400
      TabIndex        =   10
      Top             =   5280
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "前一节点"
      Height          =   495
      Left            =   8400
      TabIndex        =   9
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim CarGpsX As Double
Dim CarGpsY As Double
Dim lyr As New Layer
Dim Mapsymbol As Feature
Dim NewSymbol As Feature

Private Sub Command1_Click()


Set lyr = Map1.Layers.CreateLayer(symbol, , 1)
 Dim pt As New Point
 pt.Set CarGpsX, CarGpsY
 Set NewSymbol = Map1.FeatureFactory.CreateSymbol(pt, Map1.DefaultStyle)
 If lyr.AllFeatures.Count < 1 Then
     Set Mapsymbol = lyr.AddFeature(NewSymbol)
 End If
Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
End Sub

Private Sub Command3_Click()
Map1.CurrentTool = miZoomInTool
End Sub

Private Sub Command4_Click()
Map1.CurrentTool = miZoomOutTool
End Sub

Private Sub Command5_Click()
Map1.CurrentTool = miPanTool
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
Map1.CurrentTool = miArrowTool
End Sub

Private Sub Timer1_Timer()
Dim GpsX As Double
Dim GpsY As Double
Dim che As Car



GpsX = Adodc1.Recordset.Fields("精度值").Value
GpsY = Adodc1.Recordset.Fields("纬度值").Value
Adodc1.Recordset.MoveNext

che = MapMatch(GpsX, GpsY)

CarGpsX = che.X
CarGpsY = che.Y
Text2.Text = che.qian
Text3.Text = che.hou



 Mapsymbol.Point.Set CarGpsX, CarGpsY
 Mapsymbol.Update
 


End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?