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

📄 地图显示.frm

📁 本程序利用vb实现了地理信息系统中空间分析的各种方法
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{6E9D12E3-A025-11D2-9F40-00C04F8ECE6F}#1.1#0"; "MO2Legend.ocx"
Begin VB.Form 地图显示 
   Caption         =   "地图显示"
   ClientHeight    =   6300
   ClientLeft      =   2220
   ClientTop       =   1695
   ClientWidth     =   8370
   LinkTopic       =   "Form1"
   ScaleHeight     =   6300
   ScaleWidth      =   8370
   WindowState     =   2  'Maximized
   Begin MapObjects2.Map Map2 
      Height          =   1935
      Left            =   6120
      TabIndex        =   3
      Top             =   3840
      Width           =   2055
      _Version        =   131072
      _ExtentX        =   3625
      _ExtentY        =   3413
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "地图显示.frx":0000
   End
   Begin VB.Frame Frame1 
      Caption         =   "图层控制"
      Height          =   2895
      Left            =   6120
      TabIndex        =   2
      Top             =   720
      Width           =   2055
      Begin MO2legend.legend legend1 
         Height          =   2535
         Left            =   120
         TabIndex        =   5
         Top             =   240
         Width           =   1815
         _ExtentX        =   3201
         _ExtentY        =   4471
         BackColor       =   -2147483644
         ForeColor       =   -2147483630
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   615
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   8370
      _ExtentX        =   14764
      _ExtentY        =   1085
      ButtonWidth     =   820
      ButtonHeight    =   926
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   5
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "放大"
            Key             =   "zoomin"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "缩小"
            Key             =   "zoomout"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "漫游"
            Key             =   "pan"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "全图"
            Key             =   "globe"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "箭头"
            Key             =   "arrow"
            ImageIndex      =   5
         EndProperty
      EndProperty
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   600
      Top             =   5760
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin MapObjects2.Map Map1 
      Height          =   5055
      Left            =   0
      TabIndex        =   0
      Top             =   720
      Width           =   6015
      _Version        =   131072
      _ExtentX        =   10610
      _ExtentY        =   8916
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "地图显示.frx":001A
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   0
      Top             =   5760
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   5
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "地图显示.frx":0034
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "地图显示.frx":0146
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "地图显示.frx":0258
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "地图显示.frx":036A
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "地图显示.frx":047C
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Label labresult 
      Height          =   255
      Left            =   1920
      TabIndex        =   4
      Top             =   5880
      Width           =   1695
   End
   Begin VB.Menu mnufile 
      Caption         =   "文件"
      Begin VB.Menu mnuopenshp 
         Caption         =   "打开shp文件"
      End
      Begin VB.Menu mnuopencov 
         Caption         =   "打开cov文件"
      End
      Begin VB.Menu mnuopencad 
         Caption         =   "打开cad文件"
      End
      Begin VB.Menu mnu 
         Caption         =   "————"
      End
      Begin VB.Menu mnuexit 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu mnutools 
      Caption         =   "工具"
      Begin VB.Menu mnuzoomin 
         Caption         =   "放大"
      End
      Begin VB.Menu mnuzoomout 
         Caption         =   "缩小"
      End
      Begin VB.Menu mnupan 
         Caption         =   "漫游"
      End
      Begin VB.Menu mnuglobe 
         Caption         =   "全图"
      End
   End
End
Attribute VB_Name = "地图显示"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim recset1 As MapObjects2.Recordset
Dim bufferline As New MapObjects2.polygon
Dim g_feedback As DragFeedback



Private Sub Form_Resize()
Map1.Move 20, 800, 地图显示.Width - 3000, 地图显示.Height - 2000
frame1.Move 地图显示.Width - 2800, 800, 2055, Map1.Height - Map2.Height - 100
legend1.Move 100, 300, 1850, frame1.Height - 400
Map2.Move 地图显示.Width - 2800, 地图显示.Height - 3150

End Sub

Private Sub legend1_AfterSetLayerVisible(Index As Integer, isVisible As Boolean)
Map1.Refresh
Map2.Refresh

End Sub

Private Sub Map1_AfterTrackingLayerDraw(ByVal hdc As stdole.OLE_HANDLE)
Dim sym2 As New MapObjects2.Symbol
sym2.Color = moRed


If Not recset1 Is Nothing Then
    Map1.DrawShape recset1, sym2
       labresult.Caption = recset1.Fields("name").Value
    
         
End If

End Sub

Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 Dim curRectangle As Rectangle
 Dim p As MapObjects2.Point
 Set p = Map1.ToMapPoint(X, Y)
 Dim pot As MousePointerConstants
 pot = Map1.MousePointer
 Select Case pot
        
        Case moZoomIn
        Set Map1.Extent = Map1.TrackRectangle
        
        
        Case moZoomOut
        Dim r As MapObjects2.Rectangle
        Set r = Map1.Extent
        r.ScaleRectangle 1.5
        Map1.Extent = r
                  
        Case moPan
        Map1.Pan
        

⌨️ 快捷键说明

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