📄 main.frm
字号:
Map.Layers.Layer3.LabelProperties.Offset= 2
Map.Layers.Layer3.LabelProperties.LineType= 2
Map.Layers.Layer3.LabelProperties.Zoom= 0 'False
Map.Layers.Layer3.LabelProperties.ZoomMin= 0
Map.Layers.Layer3.LabelProperties.ZoomMax= 10000
Map.Layers.Layer3.LabelProperties.Visible= -1 'True
Map.Layers.Layer3.LabelProperties.Position= 2
Map.Layers.Layer3.LabelProperties.Parallel= -1 'True
Map.Layers.Layer3.LabelProperties.LabelAlong= 1
Map.Layers.Layer3.LabelProperties.PartialSegments= 0 'False
Map.Layers.Layer3.LabelProperties.Style.TextFontBackColor= 16777215
Map.Layers.Layer3.LabelProperties.Style.SymbolChar= 0
BeginProperty Map.Layers.Layer3.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Map.Layers.Layer3.LabelProperties.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Map.Layers.Layer3.LabelProperties.Style.LineStyle= 1
Map.Layers.Layer3.LabelProperties.Style.LineWidth= 1
Map.Layers.Layer4.HasFileSpec= -1 'True
Map.Layers.Layer4.Skip= 0 'False
Map.Layers.Layer4.Path= "austrlia.tab"
Map.Layers.Layer4.Name= "Australia"
Map.Layers.Layer4.Visible= -1 'True
Map.Layers.Layer4.Selectable= -1 'True
Map.Layers.Layer4.Editable= 0 'False
Map.Layers.Layer4.ShowNodes= 0 'False
Map.Layers.Layer4.ShowCentroids= 0 'False
Map.Layers.Layer4.ShowLineDirection= 0 'False
Map.Layers.Layer4.AutoLabel= -1 'True
Map.Layers.Layer4.DrawLabelsAfter= 0 'False
Map.Layers.Layer4.ZoomLayering= 0 'False
Map.Layers.Layer4.ZoomMin= 0
Map.Layers.Layer4.ZoomMax= 0
Map.Layers.Layer4.DoOverrideStyle= 0 'False
Map.Layers.Layer4.LabelProperties.LabelMax= 100
Map.Layers.Layer4.LabelProperties.Overlap= 0 'False
Map.Layers.Layer4.LabelProperties.Duplicate= 0 'False
Map.Layers.Layer4.LabelProperties.Offset= 2
Map.Layers.Layer4.LabelProperties.LineType= 0
Map.Layers.Layer4.LabelProperties.Zoom= -1 'True
Map.Layers.Layer4.LabelProperties.ZoomMin= 750
Map.Layers.Layer4.LabelProperties.ZoomMax= 3850.5
Map.Layers.Layer4.LabelProperties.Visible= -1 'True
Map.Layers.Layer4.LabelProperties.Position= 0
Map.Layers.Layer4.LabelProperties.Parallel= -1 'True
Map.Layers.Layer4.LabelProperties.LabelAlong= 1
Map.Layers.Layer4.LabelProperties.PartialSegments= 0 'False
Map.Layers.Layer4.LabelProperties.Style.TextFontColor= 128
Map.Layers.Layer4.LabelProperties.Style.TextFontBackColor= 13696976
Map.Layers.Layer4.LabelProperties.Style.TextFontHalo= -1 'True
Map.Layers.Layer4.LabelProperties.Style.SymbolChar= 0
BeginProperty Map.Layers.Layer4.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Map.Layers.Layer4.LabelProperties.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Map.Layers.Layer4.LabelProperties.Style.LineStyle= 1
Map.Layers.Layer4.LabelProperties.Style.LineWidth= 1
Map.Layers.Layer5.HasFileSpec= -1 'True
Map.Layers.Layer5.Skip= 0 'False
Map.Layers.Layer5.Path= "ocean_ll.tab"
Map.Layers.Layer5.Name= "Ocean (Lat/ Long)"
Map.Layers.Layer5.Visible= -1 'True
Map.Layers.Layer5.Selectable= 0 'False
Map.Layers.Layer5.Editable= 0 'False
Map.Layers.Layer5.ShowNodes= 0 'False
Map.Layers.Layer5.ShowCentroids= 0 'False
Map.Layers.Layer5.ShowLineDirection= 0 'False
Map.Layers.Layer5.AutoLabel= 0 'False
Map.Layers.Layer5.DrawLabelsAfter= 0 'False
Map.Layers.Layer5.ZoomLayering= 0 'False
Map.Layers.Layer5.ZoomMin= 0
Map.Layers.Layer5.ZoomMax= 0
Map.Layers.Layer5.DoOverrideStyle= 0 'False
Map.Layers.Layer5.LabelProperties.LabelMax= 100
Map.Layers.Layer5.LabelProperties.Overlap= 0 'False
Map.Layers.Layer5.LabelProperties.Duplicate= -1 'True
Map.Layers.Layer5.LabelProperties.Offset= 2
Map.Layers.Layer5.LabelProperties.LineType= 0
Map.Layers.Layer5.LabelProperties.Zoom= 0 'False
Map.Layers.Layer5.LabelProperties.ZoomMin= 0
Map.Layers.Layer5.LabelProperties.ZoomMax= 10000
Map.Layers.Layer5.LabelProperties.Visible= -1 'True
Map.Layers.Layer5.LabelProperties.Position= 0
Map.Layers.Layer5.LabelProperties.Parallel= -1 'True
Map.Layers.Layer5.LabelProperties.LabelAlong= 1
Map.Layers.Layer5.LabelProperties.PartialSegments= 0 'False
Map.Layers.Layer5.LabelProperties.Style.TextFontBackColor= 16777215
Map.Layers.Layer5.LabelProperties.Style.SymbolChar= 0
BeginProperty Map.Layers.Layer5.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Map.Layers.Layer5.LabelProperties.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Map.Layers.Layer5.LabelProperties.Style.LineStyle= 1
Map.Layers.Layer5.LabelProperties.Style.LineWidth= 1
Map.NumericCoordSys.ProjectionInfo= "Main.frx":0000
Map.DisplayCoordSys.ProjectionInfo= "Main.frx":0130
Map.Zoom = 3840.25
Map.CenterX = 133.530048
Map.CenterY = -26.9901905
FeatureEditMode = 1
End
Begin VB.CommandButton Command4
Caption = "选择"
Height = 375
Left = 0
TabIndex = 3
Top = 0
Width = 855
End
Begin VB.CommandButton Command3
Caption = "平移"
Height = 375
Left = 840
TabIndex = 2
Top = 0
Width = 855
End
Begin VB.CommandButton Command2
Caption = "放大"
Height = 375
Left = 1680
TabIndex = 1
Top = 0
Width = 855
End
Begin VB.CommandButton Command1
Caption = "缩小"
Height = 375
Left = 2520
TabIndex = 0
Top = 0
Width = 855
End
End
Attribute VB_Name = "Main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'"放大"按钮单击响应程序
Private Sub Command1_Click()
'放大功能
Map1.CurrentTool = miZoomOutTool
End Sub
'"添加图层"按钮单击响应程序
Private Sub Command10_Click()
CommonDialog1.CancelError = True
CommonDialog1.Filter = "MapInfo 表 (*.tab)|*.tab"
On Error GoTo NoSelFile
CommonDialog1.ShowOpen
On Error GoTo OpenErr
Dim li As New MapXLib.LayerInfo
li.Type = miLayerInfoTypeTab
li.AddParameter "FileSpec", CommonDialog1.FileName
li.AddParameter "Visible", True
li.AddParameter "AutoCreateDataset", True
Map1.Layers.Add li
Call LoadLayerList
SubExit:
Exit Sub
NoSelFile:
GoTo SubExit
OpenErr:
MsgBox "打开错误!", vbExclamation, "注意"
GoTo SubExit
End Sub
'"图层控制"按钮单击响应程序
Private Sub Command11_Click()
Map1.Layers.LayersDlg
End Sub
'"打开GeoSet"按钮单击响应程序
Private Sub Command12_Click()
CommonDialog1.CancelError = True
CommonDialog1.Filter = "GeoSet (*.gst)|*.gst"
On Error GoTo NoSelFile
CommonDialog1.ShowOpen
On Error GoTo OpenErr
Map1.GeoSet = CommonDialog1.FileName
Call LoadLayerList
SubExit:
Exit Sub
NoSelFile:
GoTo SubExit
OpenErr:
MsgBox "打开错误!", vbExclamation, "注意"
GoTo SubExit
End Sub
'"保存GeoSet"按钮单击响应程序
Private Sub Command13_Click()
CommonDialog1.CancelError = True
CommonDialog1.Filter = "GeoSet (*.gst)|*.gst"
On Error GoTo NoSelFile
CommonDialog1.ShowSave
On Error GoTo OpenErr
Map1.SaveMapAsGeoset "MyGeoSet", CommonDialog1.FileName
SubExit:
Exit Sub
NoSelFile:
GoTo SubExit
OpenErr:
MsgBox "保存!", vbExclamation, "注意"
GoTo SubExit
End Sub
'"缩小"按钮单击响应程序
Private Sub Command2_Click()
'缩小功能
Map1.CurrentTool = miZoomInTool
End Sub
'"平移"按钮单击响应程序
Private Sub Command3_Click()
'平移功能
Map1.CurrentTool = miPanTool
End Sub
'"选择"按钮单击响应程序
Private Sub Command4_Click()
'选择功能
Map1.CurrentTool = miSelectTool
End Sub
'"全图"按钮单击响应程序
Private Sub Command5_Click()
'全图显示功能
Set Map1.Bounds = Map1.Layers.Bounds
End Sub
'"上移"按钮单击响应程序
Private Sub Command6_Click()
If List1.ListIndex > 0 Then
Dim i As Long
i = List1.ListIndex
'移动图层,最顶层的图层编号为1
Map1.Layers.Move i + 1, i
'刷新图层列表
Call LoadLayerList
List1.ListIndex = i - 1
End If
End Sub
'"下移"按钮单击响应程序
Private Sub Command7_Click()
'判断是否选中图层,或图层是否可以移动
If List1.ListIndex < List1.ListCount - 1 And List1.ListIndex > -1 Then
Dim i As Long
i = List1.ListIndex
'移动图层,最顶层图层编号为1
Map1.Layers.Move i + 1, i + 2
'刷新图层列表
Call LoadLayerList
List1.ListIndex = i + 1
End If
End Sub
'"删除"按钮单击响应程序
Private Sub Command8_Click()
If List1.ListIndex > -1 Then
'删除选定图层
Map1.Layers.Remove List1.ListIndex + 1
Call LoadLayerList
End If
End Sub
'"属性"按钮单击响应程序
Private Sub Command9_Click()
If List1.ListIndex > -1 Then
Load Layer
Layer.LayerIndex = List1.ListIndex + 1
'刷新属性窗口,读入被选中图层的属性
Layer.LoadProp
Layer.Show vbModal
End If
End Sub
Private Sub Form_Load()
'刷新图层列表
Call LoadLayerList
End Sub
Private Sub LoadLayerList()
'将图层名读入图层列表中
Dim i As Long
Dim lyr As MapXLib.Layer
List1.Clear
For i = 1 To Map1.Layers.Count
Set lyr = Map1.Layers(i)
List1.AddItem lyr.Name
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -