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

📄 mygis002.frm

📁 电子地图查询系统
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Key             =   "default"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   8599
         EndProperty
      EndProperty
   End
   Begin MapXLib.Map Map2 
      Height          =   3075
      Left            =   6840
      TabIndex        =   4
      Top             =   555
      Width           =   3135
      _Version        =   500009
      _ExtentX        =   5530
      _ExtentY        =   5429
      _StockProps     =   1
      BackColor       =   -2147483633
      MapCatalog.GeoDictionary=   "GeoDictionary"
      GeoSet          =   "Empty GeosetName {9A9AC2F4-8375-44d1-BCEB-476AE986F190}"
      GeoSetUserName  =   "United States"
      MousePointer    =   17
      MapBackColor    =   16777215
      DefaultStyle.TextFontBackColor=   16777215
      DefaultStyle.SupportsBitmapSymbols=   -1  'True
      DefaultStyle.SymbolChar=   55
      DefaultStyle.SymbolFontBackColor=   16777215
      BeginProperty DefaultStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty DefaultStyle.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Map Symbols"
         Size            =   14.25
         Charset         =   2
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      DefaultStyle.LineStyle=   1
      DefaultStyle.LineWidth=   1
      DefaultStyle.RegionColor=   16777215
      DefaultStyle.LinePattern=   2
      DefaultStyle.RegionBackColor=   16777215
      DefaultStyle.RegionBorderStyle=   1
      DefaultStyle.RegionBorderWidth=   1
      Title.Visible   =   0   'False
      Title.Text      =   "Empty Title {01A9504B-CE13-4415-A5A0-51D8C2F15204}"
      Title.Style.TextFontBackColor=   16777215
      Title.Style.TextFontOpaque=   -1  'True
      Title.Style.SymbolChar=   0
      BeginProperty Title.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   23.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Title.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   23.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Title.X         =   1045
      Title.Y         =   204
      Map.NumericCoordSys.ProjectionInfo=   "MYGIS002.frx":10A58
      Map.DisplayCoordSys.ProjectionInfo=   "MYGIS002.frx":10B88
   End
   Begin MSComctlLib.TreeView TreeView1 
      Height          =   3045
      Left            =   6840
      TabIndex        =   3
      Top             =   4005
      Width           =   3150
      _ExtentX        =   5556
      _ExtentY        =   5371
      _Version        =   393217
      Style           =   7
      Appearance      =   1
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H80000011&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "查询结果:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   6840
      TabIndex        =   5
      Top             =   3690
      Width           =   1260
   End
   Begin VB.Menu menufile 
      Caption         =   "文件(&F)"
      Begin VB.Menu menumapopen 
         Caption         =   "打开地图"
         Shortcut        =   ^O
      End
      Begin VB.Menu menumapsave 
         Caption         =   "保存地图"
         Shortcut        =   ^S
      End
      Begin VB.Menu othersave 
         Caption         =   "另存为…"
      End
      Begin VB.Menu menumapclose 
         Caption         =   "关闭地图"
      End
      Begin VB.Menu dddd 
         Caption         =   "-"
      End
      Begin VB.Menu outmap 
         Caption         =   "输出当前地图"
         Begin VB.Menu outmapbmp 
            Caption         =   "BMP图片"
         End
         Begin VB.Menu outmapjpg 
            Caption         =   "JPG图片"
         End
         Begin VB.Menu outmapgif 
            Caption         =   "GIF图片"
         End
         Begin VB.Menu outmaptif 
            Caption         =   "TIF图片"
         End
      End
      Begin VB.Menu aaaa 
         Caption         =   "-"
      End
      Begin VB.Menu menuexit 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu menumapedit 
      Caption         =   "编辑(&E)"
      Visible         =   0   'False
      Begin VB.Menu menueditcopy 
         Caption         =   "复制"
      End
      Begin VB.Menu menueditpaste 
         Caption         =   "粘贴"
      End
      Begin VB.Menu menueditmove 
         Caption         =   "移动"
      End
   End
   Begin VB.Menu menutool 
      Caption         =   "工具(&T)"
      Begin VB.Menu menutoolarrow 
         Caption         =   "箭头"
      End
      Begin VB.Menu menutoolzoomin 
         Caption         =   "放大"
      End
      Begin VB.Menu menutoolzoomout 
         Caption         =   "缩小"
      End
      Begin VB.Menu menutoolpan 
         Caption         =   "漫游"
      End
      Begin VB.Menu menuselectnotall 
         Caption         =   "全部不选"
      End
      Begin VB.Menu menuviewalllayer 
         Caption         =   "全图显示"
      End
   End
   Begin VB.Menu menulayer 
      Caption         =   "图层(&L)"
      Begin VB.Menu menulayeropen 
         Caption         =   "加载图层"
      End
      Begin VB.Menu menulayeropengst 
         Caption         =   "加载图层集"
      End
      Begin VB.Menu menulayerremove 
         Caption         =   "删除图层"
      End
      Begin VB.Menu menulayerview 
         Caption         =   "图层可见"
      End
      Begin VB.Menu menulayerbz 
         Caption         =   "图层标注"
      End
      Begin VB.Menu movelayers 
         Caption         =   "移动图层"
      End
      Begin VB.Menu bzgg 
         Caption         =   "标注更改"
         Begin VB.Menu symbolgg 
            Caption         =   "符号样式更改"
         End
         Begin VB.Menu textgg 
            Caption         =   "文字样式更改"
         End
         Begin VB.Menu linegg 
            Caption         =   "直线样式更改"
         End
         Begin VB.Menu regiongg 
            Caption         =   "面域样式更改"
         End
      End
      Begin VB.Menu cccc 
         Caption         =   "-"
      End
      Begin VB.Menu menulayercontrol 
         Caption         =   "图层控制"
      End
   End
   Begin VB.Menu menusearch 
      Caption         =   "查询(&S)"
      Begin VB.Menu distansesearch 
         Caption         =   "距离查询"
      End
      Begin VB.Menu areasearch 
         Caption         =   "面积查询"
      End
      Begin VB.Menu areatool 
         Caption         =   "范围查询"
      End
      Begin VB.Menu dwsearch 
         Caption         =   "地物查询"
         Begin VB.Menu dwsearchpoint 
            Caption         =   "单点选择"
         End
         Begin VB.Menu dwsearchrect 
            Caption         =   "矩形选择"
         End
         Begin VB.Menu dwsearchradius 
            Caption         =   "圆形选择"
         End
         Begin VB.Menu dwsearchpolygon 
            Caption         =   "多边形选择"
         End
      End
      Begin VB.Menu mbsearch 
         Caption         =   "模糊查询"
      End
      Begin VB.Menu gjsearch 
         Caption         =   "精确查询"
      End
   End
   Begin VB.Menu menuhelp 
      Caption         =   "帮助(&H)"
      Begin VB.Menu about 
         Caption         =   "关于…"
      End
      Begin VB.Menu gotoweb 
         Caption         =   "访问我们的网站"
      End
   End
End
Attribute VB_Name = "Formmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function ShellExecute Lib _
     "shell32.dll" Alias "ShellExecuteA" _
     (ByVal hwnd As Long, ByVal lpOperation _
     As String, ByVal lpFile As String, ByVal _
     lpParameters As String, ByVal lpDirectory _
     As String, ByVal nShowCmd As Long) As Long
Dim m_TempLayer As MapXLib.Layer     '导航图上临时图层
Dim m_Fea As MapXLib.Feature '导航图上反映主地图窗口位置的Feature
Dim bDown As Boolean         '鼠标在导航图上按下的标志
Dim CopyFtrs As MapXLib.Features
Dim teststyle As MapXLib.Style
Const AREATOOLSEARCH As Integer = 3
Const AREASEARCH00 As Integer = 2
Dim lyR As Layer

Private Sub about_Click()
frmAbout.Show
End Sub

Private Sub areasearch_Click()
Map1.CurrentTool = AREASEARCH00
End Sub

Private Sub areatool_Click()
Map1.CurrentTool = AREATOOLSEARCH
End Sub

Private Sub distansesearch_Click()
Map1.CurrentTool = 1
End Sub

Private Sub dwsearchpoint_Click()
Map1.CurrentTool = miSelectTool
End Sub

Private Sub dwsearchpolygon_Click()
Map1.CurrentTool = miPolygonSelectTool
End Sub

Private Sub dwsearchradius_Click()
Map1.CurrentTool = miRadiusSelectTool
End Sub

Private Sub dwsearchrect_Click()
Map1.CurrentTool = miRectSelectTool
End Sub

Private Sub Form_Load()
Formmain.Show
menumapopen_Click
If Map1.GeoSet = "" Then
menutool.Enabled = False
menulayer.Enabled = False
menusearch.Enabled = False
Else
menutool.Enabled = True
menulayer.Enabled = True
menusearch.Enabled = True
End If
Map1.CreateCustomTool 1, miToolTypePoly, 2, , , "距离查询"
Map1.CreateCustomTool AREASEARCH00, miToolTypePolygon, 2, , , "面积查询"
Map1.CreateCustomTool AREATOOLSEARCH, miToolTypePoint, 2, , , "范围查询"
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set m_Fea = Nothing
Set m_TempLayer = Nothing
End Sub

Private Sub gjsearch_Click()
If Map1.GeoSet = "" Then
MsgBox "当前没有地图,不能进行精确查询", , "提示"
Exit Sub
End If
Form5.Show
End Sub

Private Sub gotoweb_Click()
  ShellExecute hwnd, "Open", "http://cadgis.126.com", 0, 0, 0
End Sub

Private Sub linegg_Click()
Set teststyle = Map1.DefaultStyle
teststyle.PickLine
Set Map1.DefaultStyle = teststyle
End Sub


Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels.Item(1).Text = Str(X) & "," & Str(Y)
End Sub

Private Sub Map1_PolyToolUsed(ByVal ToolNum As Integer, ByVal Flags As Long, ByVal Points As Object, ByVal bShift As Boolean, ByVal bCtrl As Boolean, EnableDefault As Boolean)
Select Case ToolNum
Case 1
Dim dis As Double, dissum As Double, i As Integer
Dim x1 As Double, X2 As Double, y1 As Double, Y2 As Double
Dim oftr
Dim nodx As Node, nodY As Node
Map1.MapUnit = miUnitMeter
If Points.Count > 1 Then
    Set oftr = Map1.FeatureFactory.CreateLine(Points, Map1.DefaultStyle)
 For i = 1 To Points.Count - 1
 x1 = Points.Item(i).X
 y1 = Points.Item(i).Y
 X2 = Points.Item(i + 1).X
 Y2 = Points.Item(i + 1).Y
 dis = Map1.Distance(x1, y1, X2, Y2)
 dissum = dissum + dis
       TreeView1.Nodes.Clear
Set nodx = TreeView1.Nodes.Add(, 0)
nodx.Text = "距离:" & CStr(dis) & "米"
Set nodY = TreeView1.Nodes.Add(, 0)
nodY.Text = "总距离:" & CStr(dissum) & "米"
Next
End If
Case AREASEARCH00
Map1.AreaUnit = miUnitSquareMeter
On Error Resume Next
Dim apolygoN As New MapXLib.Feature
Dim ax As Double
If (Points.Count > 2) Then
Set apolygoN = New Feature
Set apolygoN = Map1.FeatureFactory.CreateRegion(Points)
ax = apolygoN.Area
End If
TreeView1.Nodes.Clear
Set nodx = TreeView1.Nodes.Add(, 0)
nodx.Text = "面积:" & CStr(ax) & "平方米"
End Select
End Sub

Private Sub Map1_SelectionChanged()
On Error Resume Next

⌨️ 快捷键说明

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