C#+ArcGIS Engine 使用获取的图层问题?(急,在线等)
首先使用下面的代码来获取到了所点击的图层。publicIFeatureLayerGetLayerByName(IScene_pGlobe,stringpGraphicLa...
首先使用下面的代码来获取到了所点击的图层。
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);这样吗?如果是括弧中应该填写什么,如果不是应如何使用?(新人求帮助) 展开
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);这样吗?如果是括弧中应该填写什么,如果不是应如何使用?(新人求帮助) 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询