📄 form01.frm
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form01
Caption = "墨西哥地图"
ClientHeight = 5220
ClientLeft = 60
ClientTop = 345
ClientWidth = 6765
LinkTopic = "Form1"
ScaleHeight = 5220
ScaleWidth = 6765
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 2760
TabIndex = 1
Top = 4680
Width = 1335
End
Begin MapObjects2.Map Map1
Height = 4575
Left = 0
TabIndex = 0
Top = 0
Width = 6735
_Version = 131072
_ExtentX = 11880
_ExtentY = 8070
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Contents = "Form01.frx":0000
End
End
Attribute VB_Name = "Form01"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xuewei,2003/5/27
'显示图层的坐标系对象;
Option Explicit
Private Sub Command1_Click()
Dim coordSys As Object
Dim myLayer As MapObjects2.MapLayer
Set myLayer = Map1.Layers(0)
Set coordSys = myLayer.CoordinateSystem
If coordSys.IsProjected Then
MsgBox "图层为投影坐标系!"
ElseIf Not coordSys.IsProjected Then
MsgBox "图层为地理坐标系!"
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "显示信息"
DrawLayer
End Sub
Private Sub DrawLayer()
Dim DC As New DataConnection
Dim layer As MapLayer
DC.Database = App.Path + "\..\" + "Mexico"
If Not DC.Connect Then
MsgBox "在指定的文件夹下没找到图层数据文件!"
End
End If
Set layer = New MapLayer
Set layer.GeoDataset = DC.FindGeoDataset("states")
layer.Symbol.Color = moLimeGreen
Map1.Layers.Add layer
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -