ArcGIS Engine MapControl和GlobeControl同步
来源:互联网 发布:网络安全法第27条规定 编辑:程序博客网 时间:2024/04/30 18:15
在GIS开发过程中,难免会遇到各种各样的需求,而作为程序员的我们就必须要想方设法把这些需求转换为功能实现,遇到奇怪的要求只能一边郁闷一边着手。。。
抱怨到此为止,由此入正题。之前有遇到MapControl与PageLayoutControl的同步问题,这倒不是什么难题,ArcGISEngine的SDK中有实例介绍。但这次是MapControl与GlobeControl的同步。经过一段时间的研究,终是找到了解决办法,虽然有些笨拙,但为后来者提供学习还是可以的,望见谅!以下是实例代码:
IScene scene = GlobeControl.Globe.GlobeDisplay.Scene;
ISceneViewer sceneViewer = GlobeControl.Globe.GlobeDisplay.ActiveViewer;
IGlobeCamera pGlobeCamera = sceneViewer.Camera as IGlobeCamera;
IGlobeViewUtil pGlobeViewUtil = pGlobeCamera as IGlobeViewUtil;
IEnvelope pEnvelope = new EnvelopeClass();
pGlobeViewUtil.QueryVisibleGeographicExtent(pEnvelope);//得到GlobeControl的Extent
IPoint minPoint = new PointClass();
minPoint = GetProjectPoint(pEnvelope.XMin, pEnvelope.YMin);//获得从投影变换后的得到的平面坐标
(minPoint as IZAware).ZAware = true;
minPoint .Z = pEnvelope.ZMin;
IPoint maxPoint = new PointClass();
maxPoint = GetProjectPoint(pEnvelope.XMax, pEnvelope.YMax);
(maxPoint as IZAware).ZAware = true;
maxPoint.Z = pEnvelope.ZMax;
IEnvelope GeoEnvelope = new EnvelopeClass();
//设置平面Extent
GetEnvelope(minPoint,maxPoint,out GeoEnvelope);
//将得到的Envelope赋值给MapControl
MapControl.ActiveView.Extent = GeoEnvelope;
MapControl.ActiveView.Activate(MapControl.hWnd);
MapControl.ActiveView.Refresh();
简单介绍这段程序的使用,当在TapControl中从GlobeControl到MapControl的切换时,以上的代码就能实现位置同步。
而从MapControl到GlobeControl即可用IGlobeCamera.SetToZoomToExtents方法就能够实现。
到此,谢谢各位观赏!转载请注明出去!
下篇博文将讨论在ArcGISEngine开发中使用多线程技术!
- ArcGIS Engine MapControl和GlobeControl同步
- ArcGIS Engine MapControl和GlobeControl同步
- 实现MapControl与GlobeControl同步
- 在ArcGIS Engine的MapControl直接加载arcserver切片数据
- 关于MapControl和PageLayout地图同步的问题
- ArcGIS Engine 属性和方法
- "类型同时存在于ESRI.ArcGIS.AxMapControl.dll和ESRI.ArcGIS.MapControl.dll中"的错误
- MapControl与PageLayoutControl同步一
- MapControl与PageLayoutControl同步二
- ArcGlobe三维开发之十九——GlobeControl与MapControl的二三维联动
- Arcgis Engine和ArcObjects的区别
- ArcGIS10.1中的ArcGIS Engine和 ArcGIS Runtime的关系
- ArcGIS介绍:ArcObjects、 ArcGIS Desktop、ArcGIS Engine 和 ArcSDE、ArcIMS、ArcGIS Server
- ArcGIS 10.1 Engine Developer Kit 和 ArcGIS 10.1 Engine 快速入门指南
- GlobeControl轨道飞行工具和显示指北针
- arcgis desktop、arcgis engine和arcgis server三者之间有什么区别
- arcgis desktop、arcgis engine和arcgis server三者之间区别
- vista下安装VS2005和ArcGIS Engine的总结
- 相对路径与绝对路径
- Example4_10
- STL中的优先队列(堆)
- Codeforces Round #174 (Div. 2) Problem A
- ognl语言
- ArcGIS Engine MapControl和GlobeControl同步
- JS客户端RSA加密,Java服务端解密
- 一元多项式--链表实现
- android layout属性简介
- 乱七八糟
- ACM之单词匹配
- Oceanbase调试:用于调试的单机集群的搭建
- ActionContext和OGNL
- 一口一口吃掉Struts(二)——STRUTS基本工作流程