Engine工具栏按钮的使用详解
Engine提供的工具条能够轻易实现各种操作,非常方便,可是不好的地方就是太死板了,toolbar的图标都不能改。因此需要自己做按钮做控件去实现这些功能。
比如说放大和全景
//放大
private void ZoomIn_Click(object sender, RoutedEventArgs e)
{
ControlsMapZoomInTool zoomintool = new
ControlsMapZoomInTool();
zoomintool.OnCreate(mapControl.Object);
mapControl.CurrentTool =
(ESRI.ArcGIS.SystemUI.ITool)zoomintool;
}
//全景
private void zoomentire_Click(object sender, RoutedEventArgs
e)
{
ControlsMapFullExtentCommand fullview = new
ControlsMapFullExtentCommand();
fullview.OnCreate(mapControl.Object);
fullview.OnClick();
}
分别是调用了CurrentTool 和OnClick的方式。
ArcGIS MapControl 中常用命令
下面列举更多的一些命令。
功能类 事件
放大 ControlsMapZoomInTool 设置
CurrentTool
缩小ControlsMapZoomOutTool 设置
CurrentTool
打开文件ControlsOpenDocCommand OnClick()
添加数据ControlsAddDataCommand OnClick()
全图ControlsMapFullExtentCommand OnClick()
查找ControlsMapFindCommand OnClick()
属性工具ControlsMapIdentifyTool 设置
CurrentTool
选择Feature ControlsSelectFeaturesTool 设置
CurrentTool
清除选择ControlsClearSelectionCommand OnClick()
开始编辑ControlsEditingStartCommand OnClick()
保存编辑ControlsEditingSaveCommand OnClick()
停止编辑ControlsEditingStopCommand OnClick()
编辑工具ControlsEditingEditTool 设置
CurrentTool
属性编辑命
令
ControlsEditingAttributeCommand OnClick()
测量工具ControlsMapMeasureTool 设置
CurrentTool
创建路径(网
络分析)
ControlsNetworkAnalystRouteCommand OnClick()
创建路径点ControlsNetworkAnalystCreateLocationTool 设 置
CurrentTool
最短路径查
询
ControlsNetworkAnalystSolveCommand OnClick()
Scene缩小ControlsSceneExpandFOVCommand OnClick()
当然,还有很多很多其他的命令。从上面的列表比较我们也可以看出,一般
来说,如果类的后缀是Command,则用OnClick方法;如果是Tool,则设置Map
的CurrentTool属性为该工具。
ArcSence中的命令使用示例
以下是scenecontrol的一些:
private void btn_zoomin_Click(object sender, EventArgs e)
{
ICommand command = new
ControlsSceneZoomInTool();//ControlsSceneZoomInToolClass();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}
private void btnzoomout_Click(object sender, EventArgs e)
{
ICommand command = new ControlsSceneZoomOutTool();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}
//飞行模式。。
private void btntoolfly_Click(object sender, EventArgs e)
{
ICommand command = new
ControlsSceneFlyToolClass();//ControlsSceneZoomInToolClass();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}
//选择模式..
private void btnSelect_Click(object sender, EventArgs e)
{
ICommand command = new
ControlsSceneSelectFeaturesToolClass();//ControlsSceneZoomInToolClass();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}
//放大至目标区域
private void btntargetzoom_Click(object sender, EventArgs e)
{
ICommand command = new
ControlsSceneTargetZoomToolClass();//ControlsSceneZoomInToolClass();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}
//全景
private void btnFullExtern_Click(object sender, EventArgs e)
{
ICommand command = new ControlsSceneFullExtentCommandClass();
command.OnCreate(this.axSceneControl1.Object);
command.OnClick();
}
private void btnpan_Click(object sender, EventArgs e)
{
ICommand command = new ControlsScenePanTool();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}
private void button1_Click(object sender, EventArgs e)
{
ICommand command = new ControlsSceneNavigateTool();
command.OnCreate(this.axSceneControl1.Object);
this.axSceneControl1.CurrentTool = command as
ESRI.ArcGIS.SystemUI.ITool;
}

Engine工具栏按钮的使用详解的更多相关文章
- 第15.15节 PyQt(Python+Qt)入门学习:Designer的menu菜单、toolBar工具栏和Action动作详解
老猿Python博文目录 老猿Python博客地址 一.引言 Qt Designer中的部件栏并没有菜单.toolBar以及Action相关的部件,仅在MainWindow类型窗口提供了menu.to ...
- VC++ WIN32 sdk实现按钮自绘详解.
网上找了很多,可只是给出代码,没有详细解释,不便初学者理解.我就抄回冷饭.把这个再拿出来说说. 实例图片: 首先建立一个标准的Win32 Application 工程.选择a simple Wi ...
- VC++ WIN32 sdk实现按钮自绘详解 之二(关键是BS_OWNERDRAW和WM_DRAWITEM)
网上找了很多,可只是给出代码,没有详细解释,不便初学者理解.我就抄回冷饭.把这个再拿出来说说. 实例图片: 首先建立一个标准的Win32 Application 工程.选择a simple Wi ...
- VC++ WIN32 sdk实现按钮自绘详解 之二.
网上找了很多,可只是给出代码,没有详细解释,不便初学者理解.我就抄回冷饭.把这个再拿出来说说. 实例图片: 首先建立一个标准的Win32 Application 工程.选择a simple Wi ...
- Python连载60-Tkinter布局、按钮以及属性详解
一.Tkinter 1.组件的大致使用步骤 (1)创建总面板 (2)创建面板上的各种组件: i.指定组件的父组件,即依附关系:ii.利用相应的属性对组件进行设置:iii.给组件安排布局. (3)同步 ...
- 第十三章、Designer中的按钮Buttons组件详解
老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 一.引言 Qt Designer中的Buttons部件包括Push Button(常规按钮.一般称按 ...
- Arcgis Engine(ae)接口详解(8):临时元素(element)
//主地图的地图(map)对象 IMap map = null; IActiveView activeView = null; //IGraphicsContainer用于操作临时元素,可以通过map ...
- Arcgis Engine(ae)接口详解(7):地图(map)操作
IMap map = null; //跟map同一层次的activeView对象,他们都是“地图”的对象,map管理地图内容,activeView管理显示内容 IActiveView activeVi ...
- Arcgis Engine(ae)接口详解(5):IGeometry几何高级操作
IPoint point = new PointClass(); point.PutCoords(, ); //ITopologicalOperator接口用于几何对象的几何操作 ITopologic ...
随机推荐
- js简易留言板
<!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...
- chkconfig---检查设置系统服务
chkconfig命令 chkconfig命令检查.设置系统的各种服务.这是Red Hat公司遵循GPL规则所开发的程序,它可查询操作系统在每一个执行等级中会执行哪些系统服务,其中包括各类常驻服务 ...
- [NOI2008]假面舞会(DFS)
Description 一年一度的假面舞会又开始了,栋栋也兴致勃勃的参加了今年的舞会.今年的面具都是主办方特别定制的.每个参加舞会的人都可以在入场时选择一 个自己喜欢的面具.每个面具都有一个编号,主办 ...
- CF1009F Dominant Indices(树上DSU/长链剖分)
题目大意: 就是给你一棵以1为根的树,询问每一个节点的子树内节点数最多的深度(相对于这个子树根而言)若有多解,输出最小的. 解题思路: 这道题用树链剖分,两种思路: 1.树上DSU 首先想一下最暴力的 ...
- Appium_python3 抓取客户端toast
在客户端登录或者退出登录的时候会有吐司提示,因此需要抓取来验证用户登录成功或者注销成功: 在获取toast之前需要添加 desired_caps['automationName'] = 'Uiau ...
- uva 1456(dp)
题意:有n个数字u1,u2,u3-un,每一个数字出现的概率pi = ui/(u1 + u2 + - + un),分成w组.计算期望值. 第一组例子的五个数字例如以下 30 5 10 30 25 分成 ...
- 老调重弹:JDBC系列 之 <驱动载入原理全面解析>
前言 近期在研究Mybatis框架,因为该框架基于JDBC.想要非常好地理解和学习Mybatis,必需要对JDBC有较深入的了解.所以便把JDBC 这个东东翻出来.好好总结一番,作为自己的笔记,也是给 ...
- 用c实现的各种排序的方法
#include <stdio.h> void swap(int *a, int *b); void bubble_sort(int a[], int n); void select_so ...
- mIsFunui-判断Funui方法
1.有时候我们根据自己的需要,修改了frameword下的代码,但是,我们又不希望影响第三方,这时候我们就可以在修改处添加一个我们自己的标志位,如,mIsFunui 它是定义在我们自定义的theme里 ...
- C# 实现Ajax的方式总结
1JavaScript实现AJAX效果 2.AjaxPro实现AJAX应用 3.微软AJAX控件库开发AJAX 比如ScriptManager,updatePanel,timer等 4.jquery ...