基于 ArcGis Engine 开发的一个小实例
Nuoya_design@
第一步配置环境和设计界面
环境:ArcGis Engine + Microsoft Visual Basic
使用Engine控件:ESRI ToolbarControl, ESRI ontrol 、ESRI LicenseControl、ESRI MapControl。
(按Ctrl+T调出部件面板,选中以下控件)
再从[工程]-[引用]添加一下引用:
界面布局(ontrol命名为MapControl1,为显示地图主界面。ontrol命名为MapControl2,作为地图鹰眼。在工具栏里添加如图的几个按钮即可。monDialog1和状态栏):
在ESRI ontrol 和 ESRI ToolbarControl属性里绑定控件Esri MapControl(buddy选择MapControl1)。
这样基本界面就布置好了。
第二步加载地图
代码为:
'打开地图文档
On Error Resume Next
Dim sFileName As String
monDialog1
.DialogTitle = "Open Map Document"
.Filter = "Map Documents (*.mxd;*.pmf)|*.mxd;*.pmf"
.ShowOpen
If .FileName = "" Then Exit Sub
sFileName = .FileName
End With
If (sFileName) Then
sFileName
=
Else
MsgBox sFileName & " is not a valid ArcMap document"
Exit Sub
End If
(3).Text = sFileName ‘状态栏显示文件路径
第三步让鹰眼地图跟MapControl1的地图互动
:
'地图鹰眼
Private m_pEnvelope As IEnvelope ' The envelope drawn on the MapControl
Private m_pFillSymbol As ISimpleFillSymbol ' The symbol used to draw the
Private WithEvents m_pTransformEvents As displayTransformation
:
Private Sub CreateOverviewSymbol() '设置鹰眼图中的红线框
' Get the IRgbColor interface.
Dim pColor As IRgbColor
Set pColor = New RgbColor
' Set the color properties.
= RGB(255, 0,
ArcGisEngine学习笔记 来自淘豆网m.daumloan.com转载请标明出处.