同时闪烁多个要素代码(ArcEngine)
/// <summary>
/// 根据查询条件构造
/// </summary>
/// <param name="where">查询条件</param>
public void FilterLayer(string where)
{
IFeatureLayer flyr = (IFeatureLayer)axMapControl1.get_Layer(0);
IFeatureClass fcls = flyr.FeatureClass;
IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.WhereClause = where;
// 缩放到选择结果集,并高亮显示
ZoomToSelectedFeature(flyr, queryFilter);
//闪烁选中得图斑
IFeatureCursor featureCursor = fcls.Search(queryFilter, true);
FlashPolygons(featureCursor);
}
/// <summary>
/// 缩放到选择结果集,并高亮显示
/// </summary>
/// <param name="pFeatureLyr"></param>
/// <param name="pQueryFilter"></param>
private void ZoomToSelectedFeature(IFeatureLayer pFeatureLyr, IQueryFilter pQueryFilter)
{
#region 高亮显示查询到的要素集合
//符号边线颜色
IRgbColor pLineColor = new RgbColor();
pLineColor.Red = 255;
ILineSymbol ilSymbl = new SimpleLineSymbolClass();
ilSymbl.Color = pLineColor;
ilSymbl.Width = 5;
//定义选中要素的符号为红色
ISimpleFillSymbol ipSimpleFillSymbol = new SimpleFillSymbol();
ipSimpleFillSymbol.Outline = ilSymbl;
RgbColor pFillColor = new RgbColor();
pFillColor.Green = 60;
ipSimpleFillSymbol.Color = pFillColor;
ipSimpleFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal;
//选取要素集
IFeatureSelection pFtSelection = pFeatureLyr as IFeatureSelection;
pFtSelection.SetSelectionSymbol = true;
pFtSelection.SelectionSymbol = (ISymbol)ipSimpleFillSymbol;
pFtSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultNew, false);
#endregion
ISelectionSet pSelectionSet = pFtSelection.SelectionSet;
//居中显示选中要素
IEnumGeometry pEnumGeom = new EnumFeatureGeometry();
IEnumGeometryBind pEnumGeomBind = pEnumGeom as IEnumGeometryBind;
pEnumGeomBind.BindGeometrySource(null, pSelectionSet);
IGeometryFactory pGeomFactory = new GeometryEnvironmentClass();
IGeometry pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom);
axMapControl1.ActiveView.Extent = pGeom.Envelope;
axMapControl1.ActiveView.Refresh();
}
/// <summary>
/// 闪烁选中得图斑
/// </summary>
/// <param name="featureCursor"></param>
private void FlashPolygons(IFeatureCursor featureCursor)
{
IArray geoArray = new ArrayClass();
IFeature feature = null;
while ((feature = featureCursor.NextFeature()) != null)
{
//feature是循环外指针,所以必须用ShapeCopy
geoArray.Add(feature.ShapeCopy);
}
//通过IHookActions闪烁要素集合
HookHelperClass m_pHookHelper = new HookHelperClass();
m_pHookHelper.Hook = axMapControl1.Object;
IHookActions hookActions = (IHookActions)m_pHookHelper;
hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsPan);
//hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsGraphic);
//hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsZoom);
Application.DoEvents();
m_pHookHelper.ActiveView.ScreenDisplay.UpdateWindow();
hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsFlash);
}
}
from: http://www.cnblogs.com/feilong3540717/archive/2011/07/27/2118651.html
同时闪烁多个要素代码(ArcEngine)的更多相关文章
- ARM汇编程序闪烁灯与其反汇编代码比较
/* *LED闪烁 *led.s */ #define GPJ0CON 0xE0200240 #define GPJ0DAT 0xE0200244 .global _start //把 _start ...
- ArcGIS 要素闪烁
ArcGIS 要素闪烁 通过双击要素图例,闪烁定位到要素,并且闪烁一段时间: IFeatureLayer featureLayer = layer as IFeatureLayer; ...
- arcengine 开发经典帖
http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=25575&page=1&extra= 使用ArcGIS Engine 开发自定义 ...
- arcengine 开发经典帖 【强烈推荐仔细研读】
转自原文 arcengine 开发经典帖 使用ArcGIS Engine 开发自定义GIS应用: 第一部分:使用ArcGIS Engine 发布自定义GIS应用软件-全面了解ArcGIS Engine ...
- NodeMCU入门(2):在线构建、刷入固件,上传代码
准备工作 1.NodeMCU模块 2.ESP8266Flasher.exe 3.ESPlorer v0.2.0-rc6 构建固件 Building the firmware提供了三种构建你自己固件的方 ...
- arcgis 要素服务增删改查
两种方式: 第一种 要素服务的增删改操作,在ArcGIS API for JS中给我们提供了三个类用于要素的增Add,删Delete,改Update 添加draw和要素服务 //用于操作的要素图层,注 ...
- 关于印发利用DEM确定耕地坡度分级技术规定(试行)的通知
下载:http://files.cnblogs.com/files/gisoracle/%E5%88%A9%E7%94%A8DEM%E7%A1%AE%E5%AE%9A%E8%80%95%E5%9C%B ...
- JavaScript侧边悬浮框
<script> window.onscroll=function(){ var oDiv=document.getElementById('div1'); var scrollTop=d ...
- css兼容问题集合
css兼容问题 兼容问题 1.文字本身的大小不兼容.同样是font-size:14px的宋体文字,在不同浏览器下占的空间是不一样的,ie下实际占高16px,下留白3px,ff下实际占高17px,上留白 ...
随机推荐
- ftpget 从Windows FTP服务端获取文件
/********************************************************************************* * ftpget 从Windows ...
- 修改安卓串口蓝牙app问题记录
* 在网上下载的安卓的蓝牙串口app都是基于eclipse的,但往as里边导入时都存在问题. 迫不得已最后我使用的办法还是在as下面新建工程,然后把相关文件导入.不过还是遇到了其他的问题. * 某个蓝 ...
- C++的学习资源
本文总结了几个好的C++网站,以及C++方面的经典书籍.所列书籍或标准可以到这里找找电子版. wikipedia关于C++有关条目,注意看后面“参考文献”和“外部链接”: C++ programmin ...
- angular使用echarts折线图
echarts是开源的画图工具,在angular框架中引入echarts不能直接使用.需要新建一个directive //echarts基本参数 app.factory('$echartsConfig ...
- win7系统.LNK类型文件打开方式的修复办法
1.首先 win+r 2.打开运行程序 3.输入: regedit 4.找到: 计算机\HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\currentvers ...
- angular2 - content projection-
angular2中的内容映射: App.component: <my-day> <my-lucky> </my-lucky> </my-day> MyD ...
- Git服务器搭建及配置
一.部署环境 Server操作系统:CentOS release 6.7 (Final) 内核版本:2.6.32-358.el6.x86_64 git版本:1.9.0,源码下载地址如下 https:/ ...
- 关于python怎样编写登录接口
把今天的成果展示下,关于怎么用python编写登录接口, 要求是 1.输入用户名和密码 2.输错三次密码就锁定用户 3.认证成功后输出欢迎信息 账号文件内容如下: sanjiang sanjian ...
- eclipse svn插件地址
http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240
- sql server中批量插入与更新两种解决方案分享
若只是需要大批量插入数据使用bcp是最好的,若同时需要插入.删除.更新建议使用SqlDataAdapter我测试过有很高的效率,一般情况下这两种就满足需求了 bcp方式 复制代码 代码如下: /// ...