你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
朱新颖
赞同来自: 柚子
cannel
xiaosi9524 - GISER
赞同来自:
要回复问题请先登录或注册
ArcGIS/WebAPI
3 个回复
朱新颖
赞同来自: 柚子
cannel
赞同来自: 柚子
IGroupLayer groupLayer = new GroupLayerClass();
groupLayer.Name = "新组图层";
....FocusMap.AddLayer(groupLayer);
加载到组图层下面的:
IGroupLayer groupLayer = new GroupLayerClass();
groupLayer.Name = "新组图层";
IGroupLayer groupLayerCurrent = ....CurrentLayer as IGroupLayer;
groupLayerCurrent.Add(groupLayer);
其中CurrentLayer 的获取可以监听toccontrol的OnMouseDown事件获取
private void axTOCControl1_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e)
{
try
{
esriTOCControlItem tocControlItem = esriTOCControlItem.esriTOCControlItemNone;
ILayer layer = null;
object lengedGroup = null;
object index = null;
IBasicMap biscMap = null;
this.axTOCControl1.HitTest(e.x, e.y, ref tocControlItem, ref biscMap, ref layer, ref lengedGroup, ref index);
if (this.m_LayerCurrent != layer)
{
this.m_LayerCurrent = layer;
MapService mapService = MapService.GetInstance();
//触发当前图层改变事件
mapService.OnCurrentLayerChanged(layer, null);
}
以上代码均是部分截取,不能直接执行
xiaosi9524 - GISER
赞同来自:
要回复问题请先登录或注册
发起人
ArcGIS/WebAPI
相关问题
问题状态