ArcEngine中使用上下左右键移动地图
来源:互联网 发布:淘宝客服新手教程视频 编辑:程序博客网 时间:2024/06/10 00:30
因项目需要,需对mapcontrol控件响应上下左右键,从网上找的方法都一样,都值提到了需要设置axMapControl1的KeyIntercept属性为1,但这样做的结果是,除了自己在onkeydown中设置的平移1/10个屏幕大小外,系统还会有一个默认的平移操作。经研究发现,设置axMapControl1的autokeyboardscrolling属性为false即可屏蔽系统默认的对上下左右键的相应方法。
axMapControl1.AutoKeyBoardScrolling=false;axMapControl1.KeyIntercept = 1;private void axMapControl1_OnKeyDown(object sender, ESRI.ArcGIS.MapControl.IMapControlEvents2_OnKeyDownEvent e) { switch (e.keyCode) { case (int)System.Windows.Forms.Keys.Up: PanMap(0d, 0.5d); break; case (int)System.Windows.Forms.Keys.Down: PanMap(0d, -0.5d); break; case (int)System.Windows.Forms.Keys.Left: PanMap(-0.5d, 0d); break; case (int)System.Windows.Forms.Keys.Right: PanMap(0.5d, 0d); break; } } private void PanMap(double ratioX, double ratioY) { //Pans map by amount specified given in a fraction of the extent e.g. rationX=0.5, pan right by half a screen IEnvelope envelope = axMapControl1.Extent; double h = envelope.Width; double w = envelope.Height; envelope.Offset(h * ratioX, w * ratioY); axMapControl1.Extent = envelope; }
- ArcEngine中使用上下左右键移动地图
- ArcEngine中使用上下左右键移动地图
- ArcEngine中使用上下左右键移动地图功能的实现
- JS上下左右键在GridView 中移动焦点
- java中image显示图片,随上下左右键移动
- ubuntu vi上下左右键无法使用?
- viso中无法使用左右键移动形状的解决方法
- 上下左右键控制光标在文本框内移动
- 上下左右键控制ultraGrid单元格数据的移动
- jQuery-利用上下左右键移动输入焦点
- EXCEL上下左右键
- ubuntu中vi上下左右键显示字母的解决方法
- SecureCRT中解决SQLPLUS上下左右键问题
- SecureCRT中解决SQLPLUS上下左右键问题
- ubuntu中vi上下左右键显示字母的解决方法
- ubuntu中vi上下左右键显示字母的解决方法
- ubuntu中vi上下左右键显示字母的解决办法
- linux下oralce插件,使用上下左右键
- 批量更改文件名称并且标号
- linux中命令别名的设定指令alias和unalias
- 在HTML5中如何提高网站前端性能
- 关于淘宝直通车的那些事
- linux各个目录的用途
- ArcEngine中使用上下左右键移动地图
- CSS最佳实践
- 句柄类的实现,robby 难道你还能忘记么?第几遍了已经!
- hdu2546
- 2013微软编程之美 资格赛C 树上的三角形
- Android开发当中Parcelable接口的使用
- WindowManager.LayoutParams(下)
- cloudera cdh4 hue 安装
- linux_shell编程学习笔记