⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form07.frm

📁 VB+MO的GIS开发代码
💻 FRM
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "Mo20.ocx"
Begin VB.Form Form07 
   Caption         =   "图表渲染"
   ClientHeight    =   5610
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7230
   LinkTopic       =   "Form1"
   ScaleHeight     =   5610
   ScaleWidth      =   7230
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command1 
      Caption         =   "显示"
      Height          =   495
      Left            =   3120
      TabIndex        =   1
      Top             =   5040
      Width           =   1215
   End
   Begin MapObjects2.Map Map1 
      Height          =   4935
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   7215
      _Version        =   131072
      _ExtentX        =   12726
      _ExtentY        =   8705
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "Form07.frx":0000
   End
End
Attribute VB_Name = "Form07"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xuewei,2003/6/8
'ChartRenderer简单示例;
'

Option Explicit
Dim Cr As New MapObjects2.ChartRenderer
Private Sub Command1_Click()
  With Cr
    .ChartType = moBar
    .FieldCount = 2
    .Field(0) = "AREA"
    .Color(0) = moRed
    .Field(1) = "featureId"
    .Color(1) = moGreen
  End With
  Map1.Refresh
End Sub

Private Sub Form_Load()
  DrawLayer   '添加一个States图层
  Set Map1.Layers.Item("states").Renderer = Cr
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 = moPaleYellow
  layer.Symbol.Size = 1
  layer.Symbol.OutlineColor = moBrown
  Map1.Layers.Add layer
  
  Map1.Refresh
End Sub

⌨️ 快捷键说明

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