当前位置:网站首页>ArcEngine (4) Use of MapControl_OnMouseDown
ArcEngine (4) Use of MapControl_OnMouseDown
2022-08-03 08:04:00 【Prospector in the rice field】
可以通过MapControl_OnMouseDown实现一些功能, Such as read coordinates, 放大, 选择等
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";
}
边栏推荐
猜你喜欢
随机推荐
Daily practice of PMP | Do not get lost in the exam-8.2 (including agility + multiple choice)
ArcEngine(三)通过MapControl控件实现放大缩小全图漫游
sqlserver2019安装失败
Evaluate:huggingface评价指标模块入门详细介绍
STL-vector容器
pyspark @udf loop using variable problem
前缀和(区间和,子矩阵的和)
数据仓库指标体系实践
ArcEngine(八)用IWorkspaceFactory加载矢量数据
ArcEngine(四)MapControl_OnMouseDown的使用
Nanny level explains Transformer
计算机网络常见面试题总结
HCIP笔记整理 2022/7/20
wordpress: 裁剪您的图片时发生错误
工控机防勒索病毒浅析
ArcEngine(五)用ICommand接口实现放大缩小
C语言实现树的底层遍历--超简代码
DSP Trick:向量长度估算
酷雷曼上新6大功能,全景营销持续加码
001-进程与线程