Arcgisarcgis java 二次开发发中怎么用代码勾选TOCBean或者TOCControl中图层

&&&您需要以后才能回答,未注册用户请先。在vb中用 mo做GIS二次开发, 怎么选中一条线啊?_百度知道
在vb中用 mo做GIS二次开发, 怎么选中一条线啊?
提问者采纳
http、线图层等).qzone.qq,可以当做索引来用,面图层中则代表一个面),就可以理解为:获取图层中的第一条记录.qzone://user,它至少包含两个字段 FID 和 Shape,所以你要选择线图层中的一条线你要知道矢量图层其实是一张表.GetFeature(0)
为您推荐:
其他1条回答
用MAP加进线层的时候,一个是FID,用不重复的数字给他们标号.FIELD(“ID”),另一个是SHAPE,线层本身是有个属性表的,表里至少有两个字段的属性.VALUE来找到你所想要的线了,然后回到MO里就可以用过LAYER,你可以用ARCGIS给这个线层的属性表再添一个属性ID
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁hookActionsPan ArcGIS10.0二次开发中对图层平移的相关操作,可依 实现 的旋转等功能 GIS program 238万源代码下载-
&文件名称: hookActionsPan
& & & & &&]
&&所属分类:
&&开发工具: Visual Basic
&&文件大小: 2 KB
&&上传时间:
&&下载次数: 5
&&提 供 者:
&详细说明:ArcGIS10.0二次开发中对图层平移的相关操作,可依此可实现对图层的旋转等功能-ArcGIS10.0 secondary development in the translation of layer-related operation, so the rotation can be realized on the layer functions
文件列表(点击判断是否您需要的文件,如果是垃圾请在下面评价投诉):
&&hookActionsPan.vb
&输入关键字,在本站238万海量源码库中尽情搜索:ArcGIS Engine二次开发――提高篇_图文_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
ArcGIS Engine二次开发――提高篇
上传于||暂无简介
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
下载文档到电脑,查找使用更方便
还剩74页未读,继续阅读
你可能喜欢下次自动登录
现在的位置:
& 综合 & 正文
ArcGIS Engine开发-TOCControl中实现图层的拖动
TOCControl非常好,不用写一行就可以将整个地图的图层信息况显示出来;  TOCControl也非常坏,提供的接口非常少,我认为有用的只有三个:HitTest,SetBuddyControl,Update,而且Update方法一执行,整个TocControl就会重新装载一次,闪烁很厉害,实在是让人烦。要想在TOCControl中拖动图层,也并不容易,得动一动脑筋才行。  下面是我写的一个类,用于实现拖动图层,有需要的朋友,可以复制过去了,看一看。  需要说明的是,该类需要传入一个System.Windows.Forms.Control作为移动图层时显示要移到的位置,所以,在TOCControl上最好上一个Panel,然后传入到TocHelper中。另外,在计算同m_MovingLine显示的位置时,偶没找到什么好办法,只好设置了一个行高的参数。在正常字体时,据我的经验,行高是16,在Windows大字体显示时,行高是18,可以精确的显示。但这毕竟不是一个好办法。哪位高人要是看到了这个帖子,也请指点小弟一二,感激不尽!
public class TocHelper
private ESRI.ArcGIS.TOCControl.AxTOCControl m_
private ILayer m_layer = null;
private object m_other,m_
private LayerPopmenu m_LyM
private DataFramePopmenu m_FrameMenu = new DataFramePopmenu();
public event CurrentLayerChangedHandler CurrentLayerC
private bool m_Dragging = false;
private System.Windows.Forms.Control m_MovingL// = new System.Windows.Forms.Panel();
public TocHelper(ESRI.ArcGIS.TOCControl.AxTOCControl toc)
m_LyMenu = new LayerPopmenu(this);
m_LyMenu.TOCControl = m_
m_FrameMenu.TOCControl = m_
m_toc.LabelEdit = esriTOCControlEdit.esriTOCControlM
/**////处理事件
m_toc.OnMouseDown += new ITOCControlEvents_OnMouseDownEventHandler(m_toc_OnMouseDown);
m_toc.OnMouseMove += new ITOCControlEvents_OnMouseMoveEventHandler(m_toc_OnMouseMove);
m_toc.OnMouseUp += new ITOCControlEvents_OnMouseUpEventHandler(m_toc_OnMouseUp);
m_toc.OnBeginLabelEdit += new ITOCControlEvents_OnBeginLabelEditEventHandler(m_toc_OnBeginLabelEdit);
m_toc.OnEndLabelEdit += new ITOCControlEvents_OnEndLabelEditEventHandler(m_toc_OnEndLabelEdit);
public void SetMoveLine(System.Windows.Forms.Control line)
m_MovingLine =
m_MovingLine.Size = new System.Drawing.Size(<span style="color: #0,<span style="color: #);
m_MovingLine.BackColor = System.Drawing.Color.B
m_MovingLine.Visible = false;
private DevExpress.XtraBars.BarManager m_pBarM
public void SetBarManager(DevExpress.XtraBars.BarManager barMan)
m_pBarManager = barM
m_LyMenu.SetBarManager(barMan);
m_FrameMenu.SetBarManager(barMan);
/**//// &summary&
/// 获取当前图层
/// &/summary&
public ESRI.ArcGIS.Carto.ILayer CurrentLayer
/**//// &summary&
/// 刷新视图
/// &/summary&
/// &param name="layer"&&/param&
private void RefreshView(ILayer layer)
if (m_toc == null)
if (m_toc.Buddy == null)
IActiveView pView = null;
if (m_toc.Buddy is
ESRI.ArcGIS.MapControl.IMapControl2)
pView = (m_toc.Buddy as ESRI.ArcGIS.MapControl.IMapControl2).ActiveV
else if (m_toc.Buddy is ESRI.ArcGIS.SceneControl.ISceneControl)
IScene scene = (m_toc.Buddy as ESRI.ArcGIS.SceneControl.ISceneControl).S
if (scene is IActiveView)
pView = scene as IActiveV
if (pView != null)
if (layer != null)
pView.PartialRefresh(esriViewDrawPhase.esriViewGeography,layer,pView.Extent);
pView.Refresh();
private int m_DragStartY;
public int MouseX,MouseY;
private int m_TextHeight = <span style="color: #;
private void m_toc_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e)
/**////选中对象
ITOCControl m_TOCControl = (ITOCControl) m_toc.O
esriTOCControlItem item =esriTOCControlItem.esriTOCControlItemN
ILayer layer = null;
IBasicMap map = null;
m_TOCControl.HitTest(e.x,e.y,ref item,ref map,ref layer,ref m_other,ref m_index);
MouseX = e.x;MouseY =e.y;
m_DragStartY = e.y;
//设置当前图层//
if (item == esriTOCControlItem.esriTOCControlItemLayer)//
if (m_layer != layer)
if (CurrentLayerChanged != null)
CurrentLayerChanged();
if (m_layer != null)//
m_layer =//
if (CurrentLayerChanged != null)//
CurrentLayerChanged();//
m_LyMenu.CurrentLayer = m_
m_FrameMenu.CurrentLayer = m_
//如果点中的图例,则弹出符号设置窗口
if ((e.button == <span style="color: #) && (item == esriTOCControlItem.esriTOCControlItemLegendClass))
ILegendGroup legendG
ILegendClass legendC
legendGroup = m_other as ILegendG
Debug.Assert(legendGroup != null);
legendClass = legendGroup.get_Class(Convert.ToInt32(m_index.ToString()));
Debug.Assert(legendClass != null);
ISymbol pSymbol = legendClass.S
//选择符号窗口代码去掉了。
//如果是鼠标右键,则弹出右键菜单
if (e.button == <span style="color: #)
System.Diagnostics.Debug.Assert(m_pBarManager != null);
if ((item == esriTOCControlItem.esriTOCControlItemLayer) && (layer != null))
m_pBarManager.SetPopupContextMenu(m_toc,m_LyMenu.PopMenu);
else if (item == esriTOCControlItem.esriTOCControlItemMap)
m_pBarManager.SetPopupContextMenu(m_toc,m_FrameMenu.PopMenu);
m_pBarManager.SetPopupContextMenu(m_toc,null);
//如果鼠标左键选中了一个图层,则设为拖动状态
if ((e.button == <span style="color: #) && (layer != null))
m_Dragging = true;
m_DestLayer = null;
m_TextHeight = m_toc.Parent.Font.Height+<span style="color: #;
private int GetLayerIndex(IBasicMap map,ILayer layer,bool DragUp)
ILayer tmpL
for (int i=<span style="color: #;i&=map.LayerCount-<span style="color: #;i++)
tmpLayer = map.get_Layer(i);
if (tmpLayer == layer)
if (DragUp == true)
return i-<span style="color: #;
return <span style="color: #;
private int GetLayerIndex(ICompositeLayer groupLayer,ILayer layer,bool DragUp)
for (int i=<span style="color: #;i&=groupLayer.Count-<span style="color: #;i++)
<span style="color: #0000ff
&&&&推荐文章:
【上篇】【下篇】}

我要回帖

更多关于 基于arcgis的二次开发 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信