当前位置:网站首页>ArcEngine(四)MapControl_OnMouseDown的使用
ArcEngine(四)MapControl_OnMouseDown的使用
2022-08-03 07:28:00 【稻田里展望者】
可以通过MapControl_OnMouseDown实现一些功能, 比如读取坐标, 放大, 选择等
static string function = string.Empty;
private void MapControl_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
IEnvelope envelope;
IGeometry geometry;
switch (function)
{
case "coordinate":
MessageBox.Show("当前坐标为:" + e.x + "," + e.y+" "+mapUnit);
function = string.Empty;//对function进行清空
break;
case "zoomIn"://track方法
envelope = MapControl.TrackRectangle();
MapControl.Extent = envelope;
MapControl.Refresh();
function = string.Empty;
break;
case "select":
geometry = MapControl.TrackRectangle();
MapControl.Map.SelectByShape(geometry, null, false);
MapControl.Refresh();
function = string.Empty;
break;
}
}
private void 读取坐标ToolStripMenuItem_Click(object sender, EventArgs e)
{
function = "coordinate";
}
private void 拉框放大ToolStripMenuItem_Click(object sender, EventArgs e)
{
function = "zoomIn";
}
private void 拉框选择ToolStripMenuItem_Click(object sender, EventArgs e)
{
function = "select";
}边栏推荐
猜你喜欢
随机推荐
boot - SSE
【云原生--Kubernetes】Pod容器与镜像拉取策略
【第1天】SQL快速入门-基础查询(SQL 小虚竹)
Roson的Qt之旅#104 QML Image控件
【C语言】函数栈帧的创建和销毁详解
Detailed explanation of cause and effect diagram of test case design method
@Async注解的坑,小心
标准输入流
加载properties文件,容器总结
请手撸5种常见限流算法!面试必备
Golang协程goroutine的调度与状态变迁分析
帆软11版本参数联动为null查询全部
解读 refresh 十二步骤
华为设备配置BFD与接口联动(触发与BFD联动的接口物理状态变为Down)
分治法求解中位数
【云原生--Kubernetes】kubectl命令详解
9月考,如何选择靠谱正规的培训机构?
LiveData 记录下 +
【图像边缘检测】基于matlab灰度图像的积累加权边缘检测【含Matlab源码 2010期】
计算机网络常见面试题总结






![[ 漏洞复现篇 ] yapi 代码执行 getshell 漏洞复现详解](/img/85/a4142689c22492cd898bd8275cd2c5.png)


