当前位置:网站首页>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";
}边栏推荐
猜你喜欢

Detailed explanation of cause and effect diagram of test case design method

Fortify白盒神器20.1.1下载及安装(非百度网盘)

酷雷曼上新6大功能,全景营销持续加码

数仓埋点体系与归因实践

Postman will return to results generated CSV file to the local interface

DSP Trick:向量长度估算

Qt5开发从入门到精通——第二篇(控件篇)

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

HCIP笔记整理 2022/7/20
随机推荐
mysql存生僻字奇怪问题,mysql为什么不能辨别mb4字符?
sqlserver2019安装失败
pt-online-schema-change工具使用的一次
【第1天】SQL快速入门-基础查询(SQL 小虚竹)
分布式数据库数据一致性的原理、与技术实现方案
postman将接口返回结果生成csv文件到本地
现货黄金分析的主要流派
华为设备配置BFD单跳检测二层链路
前缀和(区间和,子矩阵的和)
“碳中和”愿景下,什么样的数据中心才是我们需要的?
【OpenCV】 - 显示图像API之imshow()对不同位深度(数据类型)的图像的处理方法
pyspark---encode the suuid interval (based on the number of exposures and clicks)
9月考,如何选择靠谱正规的培训机构?
volta管理node版本
品牌方发行NFT时,应如何考量实用性?
华为设备配置BFD多跳检测
Oracle Rac 集群文件目录迁移
【图像去雾】基于matlab暗通道和非均值滤波图像去雾【含Matlab源码 2011期】
华为设备配置BFD与接口联动(触发与BFD联动的接口物理状态变为Down)
excel高级绘图技巧100讲(二十一)- Excel层叠柱形图