同时闪烁多个要素代码(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,上留白 ...
随机推荐
- 特殊的对象引用---$this
只要是对象中的成员,必须使用这个对象($this)来访问到这个对象内部的属性和方法 特殊对象的引用$this就是再对象内部的成员方法中,代表本对象的一个引用,但智能在对象的成员方法中使用,不管是在对象 ...
- 关于struts和Spring 结合到一起之后存在ACtion创建单实例还是多
struts 2的Action是多实例的并非单例,也就是每次请求产生一个Action的对象.原因是:struts 2的Action中包含数据,例如你在页面填写的数据就会包含在Action的成员变量里面 ...
- Centos 6.7 安装smokeping (最完整教程)
本教程需要的源码包一并上传了,届时可以直接上传到linux系统里面! 需要编译的fping.echoping.smokeping源码包,链接:http://pan.baidu.com/s/1pL4HL ...
- HTTP、FTP状态码 (share)
来源:http://www.cnblogs.com/setsail/archive/2012/03/23/2413577.html HTTP1xx - 信息提示(这些状态代码表示临时的响应.客户端在收 ...
- 关于ref的一点理解
先写一段代码 class Test { public int Count { get; set; } } static void Main(string[] args) { Test test = } ...
- C#编程语言与面向对象——继承
现实生活中的事物都归属于一定的类别,比如,狮子是一种(IS_A)动物,为了在计算机中模拟这种关系,面向对象的语言引入了继承(inherit)特性. 构成继承关系的两个类中,Animal称为父类(par ...
- WinForm DataGridView根据选中的复选框删除
注意:在DataGridView添加一列(name:delete),ColumnType属性为:DataGridViewCheckBoxColumn,FlaseValue属性为:Flase,TureV ...
- 413 Request Entity Too Large
做小视频上传,结果接口总是返回500,服务器端跟踪,根本就进不来,再次翻查,发下服务器返回的其实是413,只不过APP底层接口将所有不是200的回包都转成500了,问题定位. 有了错误码,有了描述,字 ...
- sublime 中文乱码
一.安装Package Control 使用Sublime Text2首先就要安装Package Control,这样就能使用丰富的插件包了 (1)访问Package Control站点按照提示复 ...
- flume 不报错但是不能正常使用
flume-ng agent --conf ./conf/ --conf-file ./conf/test1.conf --name a1 -Dflume.root.logger=INFO,conso ...