?? mygis002.frm
字號:
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 + -