首先使用下面的代码来获取到了所点击的图层。
public IFeatureLayer GetLayerByName(IScene _pGlobe, string pGraphicLayerName)
{
UID pUid = new UIDClass();
pUid.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}";//要素图层
IEnumLayer pEnumLayer = _pGlobe.get_Layers(pUid, true);
ILayer pRetureLayer = null;
ILayer pLayer = pEnumLayer.Next();
while (pLayer != null)
{
if (pLayer.Name == pGraphicLayerName)
{
pRetureLayer = pLayer;
return pRetureLayer as IFeatureLayer;
}
pLayer = pEnumLayer.Next();
}
return pRetureLayer as IFeatureLayer;
}
当我使用 ILayer pLayer = 是怎么使用上面的代码?是ILayer pLayer = GetLayerByName(_pGlobe, pGraphicLayerName);这样吗?如果是括弧中应该填写什么,如果不是应如何使用?(新人求帮助)