📄 form04.frm
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form04
Caption = "墨西哥地图"
ClientHeight = 7050
ClientLeft = 60
ClientTop = 345
ClientWidth = 10410
LinkTopic = "Form1"
ScaleHeight = 7050
ScaleWidth = 10410
StartUpPosition = 2 '屏幕中心
Begin MapObjects2.Map Map1
Height = 7095
Left = 0
TabIndex = 0
Top = 0
Width = 10455
_Version = 131072
_ExtentX = 18441
_ExtentY = 12515
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Contents = "Form04.frx":0000
End
End
Attribute VB_Name = "Form04"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xue Wei,2003/5/2
'属性的标注和标注字体的设置
Option Explicit
Private Sub Form_Load()
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 = moOrange
layer.Symbol.Size = 1
layer.Symbol.Style = 2
layer.Symbol.OutlineColor = moBrown
Map1.Layers.Add layer
Set layer = New MapLayer
Set layer.GeoDataset = dc.FindGeoDataset("Rivers")
layer.Symbol.Color = moDarkGreen
layer.Symbol.Size = 2
Map1.Layers.Add layer
Set layer = New MapLayer
Set layer.GeoDataset = dc.FindGeoDataset("Cities")
layer.Symbol.Color = moRed
layer.Symbol.Size = 3
layer.Symbol.Style = 0
Set layer.Renderer = New LabelRenderer
layer.Renderer.Field = "NAME" '指定要显示的字段
'layer.Renderer.Symbol(0).Font.Name = "幼圆"
'layer.Renderer.Symbol(0).Font.Bold = False '缺省为True
layer.Renderer.Symbol(0).Color = moBlack
layer.Renderer.Symbol(0).Font.Size = 8
layer.Renderer.AllowDuplicates = True
Map1.Layers.Add layer
Map1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -