ArcGIS 要素闪烁
ArcGIS 要素闪烁
通过双击要素图例,闪烁定位到要素,并且闪烁一段时间:
IFeatureLayer featureLayer = layer as IFeatureLayer;
ITable table = featureLayer as ITable;
IRow row = table.GetRow((int)data);
IFeature feature = row as IFeature;
IEnvelope envelope = feature.Shape.Envelope;
switch(feature.Shape.GeometryType)
{
case esriGeometryType.esriGeometryPoint:
IPoint point = feature.Shape as IPoint;
envelope.Expand(2.7, 2.7, true);
axMapControl1.FlashShape(point, 1, 300, null);
axMapControl1.Extent = envelope;
Application.DoEvents();
axMapControl1.Refresh();
axMapControl1.FlashShape(point, 6, 300, null);
break;
case esriGeometryType.esriGeometryPolyline:
IPolyline polyline = feature.Shape as IPolyline;
envelope.Expand(1.7, 1.7, true);
axMapControl1.FlashShape(polyline, 1, 300, null);
axMapControl1.Extent = envelope;
Application.DoEvents();
axMapControl1.Refresh();
axMapControl1.FlashShape(polyline, 15, 300, null);
break;
case esriGeometryType.esriGeometryPolygon:
IPolygon polygon = feature.Shape as IPolygon;
envelope.Expand(1.7, 1.7, true);
axMapControl1.FlashShape(polygon, 1, 300, null);
axMapControl1.Extent = envelope;
Application.DoEvents();
axMapControl1.Refresh();
ITopologicalOperator topOperator = polygon as ITopologicalOperator;
IPolyline line = new PolylineClass();
line=topOperator.Boundary as IPolyline;
axMapControl1.FlashShape(line, 15, 300, null);
break;
}
第一种:通过FlashShape来实现闪烁功能
{
IGeometry pGeometry = pElement.Geometry;
ICartographicLineSymbol ipCartographicLineSymbol;
ISimpleFillSymbol ipSimpleFillSymbol;
ISimpleMarkerSymbol ipSimpleMarkersymbol;
ISymbol ipSymbol = null;
IRgbColor ipColor;
IPoint pPoint = new PointClass();
pPoint.X = pGeometry.Envelope.LowerLeft.X + pGeometry.Envelope.Width / 2;
pPoint.Y = pGeometry.Envelope.LowerLeft.Y + pGeometry.Envelope.Height / 2;
axMapControl.CenterAt(pPoint);
//pGeometry.Envelope.LowerLeft
int Size;
ipColor = new RgbColor();
ipColor.Red = 255;
Size = 10;
//esriGeometryType type = pGeometry.GeometryType;
if (type == esriGeometryType.esriGeometryPolyline)
{
ipCartographicLineSymbol = new CartographicLineSymbol();
ipSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
ipCartographicLineSymbol.Width = Size;
ipCartographicLineSymbol.Color = ipColor;
}
else if (type == esriGeometryType.esriGeometryPolygon)
{
ipSimpleFillSymbol = new SimpleFillSymbol();
ipSymbol = (ISymbol)ipSimpleFillSymbol;
ipSimpleFillSymbol.Color = ipColor;
}
else if (type == esriGeometryType.esriGeometryPoint || type == esriGeometryType.esriGeometryMultipoint)
{
ipSimpleMarkersymbol = new SimpleMarkerSymbol();
ipSymbol = (ISymbol)ipSimpleMarkersymbol;
ipSymbol.ROP2 = esriRasterOpCode.esriROPWhite;
ipSimpleMarkersymbol.Color = ipColor;
ipSimpleMarkersymbol.Size = 20;
}
axMapControl.FlashShape(pGeometry, 3, 300, ipSymbol);
}
|
Constant |
Value |
Description |
|
esriHookActionsFlash |
0 |
Flash the geometry. |
|
esriHookActionsPan |
1 |
Pan to the geometry. |
|
esriHookActionsZoom |
2 |
Zoom to the geometry. |
|
esriHookActionsGraphic |
3 |
Create a graphic for the geometry. |
|
esriHookActionsLabel |
4 |
Create a graphic and label for the geometry. |
|
esriHookActionsCallout |
5 |
Create a callout for the geometry. |
完成闪烁的代码如下:
IHookActions hookActions;
hookActions.DoAction(feature.Shape, esriHookActions.esriHookActionsPan);
Application.DoEvent();
hookActions.DoAction(feature.Shape,esriHookActions.esriHookActionsFlash);
第四种 接口IIdentify的返回对象IFeatureIdentifyObj也可以实现这个功能。特摘录代码如下:
Dim pEnvs As IEnvelope
pEnvs = AxMapControl1.TrackRectangle
Dim pLayer As IFeatureLayer
pLayer = pMainMap.Layer(0)
Dim pIdentify As IIdentify
pIdentify = pLayer
Dim pArr As IArray
pArr = pIdentify.Identify(pEnvs)
Dim pFtIdenObj As IFeatureIdentifyObj
Dim pIdenObj As IIdentifyObj
If Not pArr Is Nothing Then
Dim j As Integer
For j = 0 To pArr.Count - 1
pFtIdenObj = pArr.Element(j)
pIdenObj = pFtIdenObj
pIdenObj.Flash(pMainAV.ScreenDisplay)
pIdenObj = Nothing
pFtIdenObj = Nothing
Next
End If
ArcGIS 要素闪烁的更多相关文章
- ArcGIS 要素类平移工具-arcgis案例实习教程
ArcGIS 要素类平移工具-arcgis案例实习教程 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 目的:对整个要素类,按指定偏移距离,进行整体平移. 优点:使用 ...
- DWG 对象与ArcGIS 要素的强制对应关系
转自原文DWG 对象与ArcGIS 要素的强制对应关系 DWG 对象与ArcGIS 要素的强制对应关系如下: Feature type DWG object types Point Point, ...
- ArcGIS 要素类整体平移工具-arcgis/arcpy/模型构建器案例实习教程
ArcGIS 要素类整体平移工具-arcgis/arcpy/模型构建器案例实习教程 联系方式:谢老师,135-4855_4328,xiexiaokui#qq.com 目的:对整个要素类,按指定偏移距离 ...
- arcgis 要素服务增删改查
两种方式: 第一种 要素服务的增删改操作,在ArcGIS API for JS中给我们提供了三个类用于要素的增Add,删Delete,改Update 添加draw和要素服务 //用于操作的要素图层,注 ...
- ArcGIS 要素合并
1.选择工具 2.选择输入要素.输出要素.按照什么字段进行合并 3.查看融合结果 4.GP工具-创建GP模型 拖入“融合”工具,设置融合的参数,如下图: 右击左边椭圆,勾选 模型参数 右击右边椭圆,勾 ...
- Arcgis Javascript API 开发笔记
JS API3.4的要求 à(1) IE9或以上版本 否则dijit1.8.3不匹配 1.如何发布ArcgisJavascript API应用 0.准备工作: (1).有web应用: (2).有js ...
- AO Identify地图交互
转自supernever文章 Identify 1.框选要素高亮显示 private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS ...
- 2013Esri全球用户大会之互操作和标准
1:Esri在开源领域做过哪些工作? Esri一直以来就是开源技术的用户和支持者.我们相信,通过提供从上到下的开放平台可使我们的用户成为开发能力强大的解决方案的积极参与者.在现有技术形势下,我们正在将 ...
- QGIS练手 - 数据
又熬夜了... 这篇博客可能会将QGIS数据管理部分和ArcGIS数据管理进行对比学习. 1. 本地数据文件与数据库(矢量) 1.1 文件 QGIS用的是shp文件.kml文件.geojson文件较多 ...
随机推荐
- js文本框字数限制
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- mustache使用
mustache模板,用于构造html页面的内容, 前端html代码: <select name="itemtype" id="itemtype" cla ...
- Linux服务器---DansGuardian
DansGuardian DansGuardian可以限制客户端的访问,通过这个软件,我们可以限制哪些网站不可以访问.哪些内容不能下载. 1.下载DansGuardian,提供一个网址http://w ...
- LLVM/Clang编译相关研究
https://blog.csdn.net/guojin08/article/details/54310858 https://juejin.im/entry/5c64da44518825620b45 ...
- 什么是IO多路复用?Nginx的处理机制
先来说一下什么是IO复用? IO复用解决的就是并发行的问题,比如多个用户并发访问一个WEB网站,对于服务端后台而言就会产生多个请求,处理多个请求对于中间件就会产生多个IO流对于系统的读写.那么对于IO ...
- 07: python基础 零碎知识点
目录: 1.1 python异常处理 1.2 三元运算,filter和map与lambda表达式结合使用举例 1.3 内置方法 1.4 动态导入模块 1.1 python异常处理返回顶部 1.Pyth ...
- keil5配置stm32库函数开发
在将模板文件添加到工程中后, 1.点击魔术棒,选择C/C++,添加头文件的路径: 2.C/C++里面的define内填入:STM32F10X_MD,USE_STDPERIPH_DRIVER: 3.Ou ...
- CF 316E3 Summer Homework(斐波那契矩阵+线段树)
题目链接:http://codeforces.com/problemset/problem/316/E3 题意:一个数列A三种操作:(1)1 x y将x位置的数字修改为y:(2)2 x y求[x,y] ...
- ubuntu下git clone 提速
环境:ubuntu16.04 方法:通过socks5代理并且使用http链接 步骤: 1.设置全局使用socks5代理,并且使用http传输 git config --global http.prox ...
- 2017年人工智能相关会议论文阅读笔记 (已添加ISSCC17,慢慢补充中)
ISSCC 2017 Session14 Deep Learning Processors: 关于Deep Learning Processors的Slides笔记,主要参考了[1]中的笔记,自己根据 ...